This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def validate_argument_dict(dict_arg, dict_expected): | |
| for key, value in dict_arg.items(): | |
| if key not in dict_expected: | |
| raise ValueError(f'Wrong key {key}') | |
| type_expected = type(dict_expected[key]) | |
| if not isinstance(value, type_expected): | |
| raise ValueError(f'Wrong value type for the {key}. {type_expected} is expected.') | |
| return dict_arg | |
| PD_EXPECTED = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def create_user_other_parcels(self, parcel_dashboard: ParcelDashboard, user: PortalUser): | |
| # expression is needed to normalize phones for all parcels and fine parcels with the same phone | |
| expression = """ | |
| function () { | |
| const userPhone = '<user_phone>'; | |
| let phone = this.receiver_phone; | |
| if (phone === undefined || phone === null) { | |
| return false; | |
| }; | |
| phone = phone.replace(/[+() -]/, ''); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for (let ion in FORMULAS[this.recipeSelected].ions) { | |
| this.$watch(`solute.${ion}`, function (newValue, oldValue) { | |
| console.log(newValue, oldValue) | |
| }, { deep: true }) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <div> | |
| <div v-for="(color, colorName, index) in colorThemes" | |
| > | |
| <input | |
| type="radio" | |
| name="theme" | |
| :id="'color' + index" | |
| :value="colorName" | |
| v-model="colorTheme" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| d = datetime.now(tz=pytz.timezone('Asia/Seoul')) | |
| d.astimezone(pytz.timezone('Europe/Samara')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| title = title_el.text or '' | |
| for part in title_el: | |
| title += part.text | |
| title += part.tail or '' | |
| title2 = etree.tostring(title_el, method='text', encoding='utf-8').decode('utf-8') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def get_word_idx(word_id): | |
| return WordsChart.objects.aggregate( | |
| { | |
| "$project": { | |
| "matchedIndex": { | |
| "$indexOfArray": [ | |
| "$list", word_id | |
| ] | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| return send_file(BytesIO(open(z.filename, 'rb').read()), | |
| attachment_filename=curdir_basename + '.zip', | |
| as_attachment=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <title>jQuery UI Draggable - Handles</title> | |
| <style> | |
| ul { | |
| width: 300px; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| switchFromParToInput: function(id) { | |
| var p_element = $('#' + id).find('.count'); | |
| var input_element = $('<input>', { | |
| type: 'text', | |
| class: $(p_element).attr('class'), | |
| value: $(p_element).text() | |
| } | |
| ); | |
| p_element.replaceWith($(input_element)); | |
| var value = input_element.val(); |
NewerOlder