body_hash
stringlengths
64
64
body
stringlengths
23
109k
docstring
stringlengths
1
57k
path
stringlengths
4
198
name
stringlengths
1
115
repository_name
stringlengths
7
111
repository_stars
float64
0
191k
lang
stringclasses
1 value
body_without_docstring
stringlengths
14
108k
unified
stringlengths
45
133k
77d550c579d9c9a016c054c589696781dc6267aab97aff437db02af312196ede
def take(self): 'Take a screenshot.\n @return: screenshot or None.\n ' if (not HAVE_PIL): return None return ImageGrab.grab()
Take a screenshot. @return: screenshot or None.
analyzer/windows/lib/api/screenshot.py
take
Yuanmessi/Bold-Falcon
41
python
def take(self): 'Take a screenshot.\n @return: screenshot or None.\n ' if (not HAVE_PIL): return None return ImageGrab.grab()
def take(self): 'Take a screenshot.\n @return: screenshot or None.\n ' if (not HAVE_PIL): return None return ImageGrab.grab()<|docstring|>Take a screenshot. @return: screenshot or None.<|endoftext|>
85adb5b87ded8406449526947f8dc22b4c6ba0fa764b66814ee99e046a0348e0
def Rain(datasets): '\n Computation of rainfall values; all datasets are necessary and a potential rain factor\n ' rain = [] for data in datasets: net_data = Dataset(data) rain_dataset = net_data.variables['rain'][:] if (len(rain) == 0): rain = rain_dataset ...
Computation of rainfall values; all datasets are necessary and a potential rain factor
amazon_rainforest/amazon_code/functions_amazon.py
Rain
lenas95/pycascades
0
python
def Rain(datasets): '\n \n ' rain = [] for data in datasets: net_data = Dataset(data) rain_dataset = net_data.variables['rain'][:] if (len(rain) == 0): rain = rain_dataset else: rain = np.add(rain, rain_dataset) rain = np.array(rain) ...
def Rain(datasets): '\n \n ' rain = [] for data in datasets: net_data = Dataset(data) rain_dataset = net_data.variables['rain'][:] if (len(rain) == 0): rain = rain_dataset else: rain = np.add(rain, rain_dataset) rain = np.array(rain) ...
3d4c3bfbb478d26cc31b8f41f9555256a6425a480d4c9bea99e55da03aa4996f
def Amazon_CUSPc(a, b, rain_current, rain_critical, rain_mean): '\n c = c(rainfall) where tipping occurs at sqrt((4*b**3)/(27*a))\n ' c = ((np.sqrt(((4 * (np.abs(b) ** 3)) / (27 * np.abs(a)))) / (rain_critical - rain_mean)) * (rain_current - rain_mean)) return c
c = c(rainfall) where tipping occurs at sqrt((4*b**3)/(27*a))
amazon_rainforest/amazon_code/functions_amazon.py
Amazon_CUSPc
lenas95/pycascades
0
python
def Amazon_CUSPc(a, b, rain_current, rain_critical, rain_mean): '\n \n ' c = ((np.sqrt(((4 * (np.abs(b) ** 3)) / (27 * np.abs(a)))) / (rain_critical - rain_mean)) * (rain_current - rain_mean)) return c
def Amazon_CUSPc(a, b, rain_current, rain_critical, rain_mean): '\n \n ' c = ((np.sqrt(((4 * (np.abs(b) ** 3)) / (27 * np.abs(a)))) / (rain_critical - rain_mean)) * (rain_current - rain_mean)) return c<|docstring|>c = c(rainfall) where tipping occurs at sqrt((4*b**3)/(27*a))<|endoftext|>
71745aab9dc65f1cb6b3e5783c97a7aa2136741f458d0a19bfd9be26ece048fc
def Amazon_cpl(a, b, rain_critical, rain_current, rain_mean, delta_rain): '\n Factor of (1/2) is necessary since delta(state)=2 from -1 to +1\n Factor (-1) is necessary since delta_rain < 0, but the coupling must be positive\n ' c = ((np.sqrt(((4 * (np.abs(b) ** 3)) / (27 * np.abs(a)))) / (...
Factor of (1/2) is necessary since delta(state)=2 from -1 to +1 Factor (-1) is necessary since delta_rain < 0, but the coupling must be positive
amazon_rainforest/amazon_code/functions_amazon.py
Amazon_cpl
lenas95/pycascades
0
python
def Amazon_cpl(a, b, rain_critical, rain_current, rain_mean, delta_rain): '\n Factor of (1/2) is necessary since delta(state)=2 from -1 to +1\n Factor (-1) is necessary since delta_rain < 0, but the coupling must be positive\n ' c = ((np.sqrt(((4 * (np.abs(b) ** 3)) / (27 * np.abs(a)))) / (...
def Amazon_cpl(a, b, rain_critical, rain_current, rain_mean, delta_rain): '\n Factor of (1/2) is necessary since delta(state)=2 from -1 to +1\n Factor (-1) is necessary since delta_rain < 0, but the coupling must be positive\n ' c = ((np.sqrt(((4 * (np.abs(b) ** 3)) / (27 * np.abs(a)))) / (...
080382ce15673c36320da3287e3967cf11e712d33887cfacc462eae5358cf30e
def Rain_moisture_delta_only(moist_rec_val): '\n Computation of moisture recycling value for a year\n ' rain_moist = (- np.sum(moist_rec_val)) return rain_moist
Computation of moisture recycling value for a year
amazon_rainforest/amazon_code/functions_amazon.py
Rain_moisture_delta_only
lenas95/pycascades
0
python
def Rain_moisture_delta_only(moist_rec_val): '\n \n ' rain_moist = (- np.sum(moist_rec_val)) return rain_moist
def Rain_moisture_delta_only(moist_rec_val): '\n \n ' rain_moist = (- np.sum(moist_rec_val)) return rain_moist<|docstring|>Computation of moisture recycling value for a year<|endoftext|>
e7437be89bb589c6ab9eca8dc4e3fd33045d68d1b0552ccf09c6eb0018d9bad5
def quotient_graph_with_merge(G, self_loops=False, merge_threshold=0, merge_attribute='chars_n'): '\n Generate the quotient graph, recursively merging nodes if the merge result\n does not exceed merge threshold.\n or merge threshold 0 this rolls up all node whose siblings are exclusively\n nodes with me...
Generate the quotient graph, recursively merging nodes if the merge result does not exceed merge threshold. or merge threshold 0 this rolls up all node whose siblings are exclusively nodes with merge attribute value 0.
legal_data_clustering/utils/nodes_merging.py
quotient_graph_with_merge
QuantLaw/legal-data-clustering
3
python
def quotient_graph_with_merge(G, self_loops=False, merge_threshold=0, merge_attribute='chars_n'): '\n Generate the quotient graph, recursively merging nodes if the merge result\n does not exceed merge threshold.\n or merge threshold 0 this rolls up all node whose siblings are exclusively\n nodes with me...
def quotient_graph_with_merge(G, self_loops=False, merge_threshold=0, merge_attribute='chars_n'): '\n Generate the quotient graph, recursively merging nodes if the merge result\n does not exceed merge threshold.\n or merge threshold 0 this rolls up all node whose siblings are exclusively\n nodes with me...
cb2d87d1967980e9f66a63cb8fca8b9ea40fe8831608ebb4003dcd3189f5a0df
def get_merge_parent(G, node, merge_threshold=0, merge_attribute='chars_n'): '\n Gets the first predecessor that is not contracted\n ' if (not is_node_contracted(G, node, merge_threshold, merge_attribute)): return node parents = list(G.predecessors(node)) assert (len(parents) == 1) ret...
Gets the first predecessor that is not contracted
legal_data_clustering/utils/nodes_merging.py
get_merge_parent
QuantLaw/legal-data-clustering
3
python
def get_merge_parent(G, node, merge_threshold=0, merge_attribute='chars_n'): '\n \n ' if (not is_node_contracted(G, node, merge_threshold, merge_attribute)): return node parents = list(G.predecessors(node)) assert (len(parents) == 1) return get_merge_parent(G, parents[0], merge_thresho...
def get_merge_parent(G, node, merge_threshold=0, merge_attribute='chars_n'): '\n \n ' if (not is_node_contracted(G, node, merge_threshold, merge_attribute)): return node parents = list(G.predecessors(node)) assert (len(parents) == 1) return get_merge_parent(G, parents[0], merge_thresho...
017c19a4d20719bb98079782543e8b546f540859d8184e93ec72da0f406e7ded
def is_root_node(G, node): '\n Helper for is_node_contracted\n ' return (G.in_degree(node) == 0)
Helper for is_node_contracted
legal_data_clustering/utils/nodes_merging.py
is_root_node
QuantLaw/legal-data-clustering
3
python
def is_root_node(G, node): '\n \n ' return (G.in_degree(node) == 0)
def is_root_node(G, node): '\n \n ' return (G.in_degree(node) == 0)<|docstring|>Helper for is_node_contracted<|endoftext|>
008707e72a6ac0c0c1c303c4ea9f02d178d31ef99ccc1f79af51ad543eba8a5e
def is_child_of_root_node(G, node): '\n Helper for is_node_contracted\n ' parent = list(G.predecessors(node))[0] return (G.in_degree(parent) == 0)
Helper for is_node_contracted
legal_data_clustering/utils/nodes_merging.py
is_child_of_root_node
QuantLaw/legal-data-clustering
3
python
def is_child_of_root_node(G, node): '\n \n ' parent = list(G.predecessors(node))[0] return (G.in_degree(parent) == 0)
def is_child_of_root_node(G, node): '\n \n ' parent = list(G.predecessors(node))[0] return (G.in_degree(parent) == 0)<|docstring|>Helper for is_node_contracted<|endoftext|>
bac33f1384fb5333b9f460d73de7a42ffbfbab5f3e97ee6af248ddaf7cecdc63
def is_parent_too_big(G, node, merge_attribute, merge_threshold): '\n Helper for is_node_contracted\n ' parent = list(G.predecessors(node))[0] return (G.nodes[parent][merge_attribute] > merge_threshold)
Helper for is_node_contracted
legal_data_clustering/utils/nodes_merging.py
is_parent_too_big
QuantLaw/legal-data-clustering
3
python
def is_parent_too_big(G, node, merge_attribute, merge_threshold): '\n \n ' parent = list(G.predecessors(node))[0] return (G.nodes[parent][merge_attribute] > merge_threshold)
def is_parent_too_big(G, node, merge_attribute, merge_threshold): '\n \n ' parent = list(G.predecessors(node))[0] return (G.nodes[parent][merge_attribute] > merge_threshold)<|docstring|>Helper for is_node_contracted<|endoftext|>
184717be4a9179b25d3120a68a7bb8504fe59bb388dee399ba1c5b0ec24d20a3
def get_parent_nodes(G, n): '\n get parents of a node ordered root first\n ' parents = list(G.predecessors(n)) if parents: assert (len(parents) == 1) return (get_parent_nodes(G, parents[0]) + parents) else: return []
get parents of a node ordered root first
legal_data_clustering/utils/nodes_merging.py
get_parent_nodes
QuantLaw/legal-data-clustering
3
python
def get_parent_nodes(G, n): '\n \n ' parents = list(G.predecessors(n)) if parents: assert (len(parents) == 1) return (get_parent_nodes(G, parents[0]) + parents) else: return []
def get_parent_nodes(G, n): '\n \n ' parents = list(G.predecessors(n)) if parents: assert (len(parents) == 1) return (get_parent_nodes(G, parents[0]) + parents) else: return []<|docstring|>get parents of a node ordered root first<|endoftext|>
4369cd3714b97923d480d631adf08aa1e8cad1366df1210ae52fdc87d45b9dc7
def is_node_contracted(G, node, merge_threshold=0, merge_attribute='chars_n'): '\n Determine whether a node should be in the quotient graph.\n In this implementation, nodes and their siblings are contracted\n if the parent they are contracted in is still below a certain threshold.\n It would also be pos...
Determine whether a node should be in the quotient graph. In this implementation, nodes and their siblings are contracted if the parent they are contracted in is still below a certain threshold. It would also be possible to contract a node and its siblings if one node is below a certain threshold but the parent would b...
legal_data_clustering/utils/nodes_merging.py
is_node_contracted
QuantLaw/legal-data-clustering
3
python
def is_node_contracted(G, node, merge_threshold=0, merge_attribute='chars_n'): '\n Determine whether a node should be in the quotient graph.\n In this implementation, nodes and their siblings are contracted\n if the parent they are contracted in is still below a certain threshold.\n It would also be pos...
def is_node_contracted(G, node, merge_threshold=0, merge_attribute='chars_n'): '\n Determine whether a node should be in the quotient graph.\n In this implementation, nodes and their siblings are contracted\n if the parent they are contracted in is still below a certain threshold.\n It would also be pos...
9b5057f8a91dd1561bcaf4fe3e4ae45cad40cc36a135711f84c6e1f7ef8a7130
@register.filter def symbol(value): '收支符号' if (int(value) > 0): return ('+' + str(value)) else: return str(value)
收支符号
apps/user/templatetags/custom_filters.py
symbol
banyanbbt/banyan_data
2
python
@register.filter def symbol(value): if (int(value) > 0): return ('+' + str(value)) else: return str(value)
@register.filter def symbol(value): if (int(value) > 0): return ('+' + str(value)) else: return str(value)<|docstring|>收支符号<|endoftext|>
d66394e4468c13534ac8d1e5d9795066fb5a2174f687004fafaecf359318628d
@register.filter def question_count(value): '题目总量' return Question.objects.filter(task_id=value).count()
题目总量
apps/user/templatetags/custom_filters.py
question_count
banyanbbt/banyan_data
2
python
@register.filter def question_count(value): return Question.objects.filter(task_id=value).count()
@register.filter def question_count(value): return Question.objects.filter(task_id=value).count()<|docstring|>题目总量<|endoftext|>
091c85ac21544dfcd2ce5448b0817510b50be436b24bb983d547e69fd8387ef6
@register.filter def remain_count(value): '剩余待解决题目数量' return Question.objects.filter(task_id=value, status=question_status[0][0]).count()
剩余待解决题目数量
apps/user/templatetags/custom_filters.py
remain_count
banyanbbt/banyan_data
2
python
@register.filter def remain_count(value): return Question.objects.filter(task_id=value, status=question_status[0][0]).count()
@register.filter def remain_count(value): return Question.objects.filter(task_id=value, status=question_status[0][0]).count()<|docstring|>剩余待解决题目数量<|endoftext|>
a119b0c171474bfff08b811cd77b536497008fb043caee22ebf1d4198e42ca8d
@register.filter def get_task_name_by_id(value): '根据任务id获取任务名称' return Task.objects.filter(pk=value).first().name
根据任务id获取任务名称
apps/user/templatetags/custom_filters.py
get_task_name_by_id
banyanbbt/banyan_data
2
python
@register.filter def get_task_name_by_id(value): return Task.objects.filter(pk=value).first().name
@register.filter def get_task_name_by_id(value): return Task.objects.filter(pk=value).first().name<|docstring|>根据任务id获取任务名称<|endoftext|>
ab4cb360e2184743cba6632d9e595fb11338c4fe7e78f0f5e5283ae3ca9c5af7
@register.filter def get_task_type_by_id(value): '根据任务id获取任务类型' return Task.objects.filter(pk=value).first().type
根据任务id获取任务类型
apps/user/templatetags/custom_filters.py
get_task_type_by_id
banyanbbt/banyan_data
2
python
@register.filter def get_task_type_by_id(value): return Task.objects.filter(pk=value).first().type
@register.filter def get_task_type_by_id(value): return Task.objects.filter(pk=value).first().type<|docstring|>根据任务id获取任务类型<|endoftext|>
0bbd0d7df6785348e6a775d7723513cdd14138a5222a1ec8af71b46a6a39f2d4
@register.filter def get_question_price_by_id(value): '根据任务id获取任务类型' return Task.objects.filter(pk=value).first().question_price
根据任务id获取任务类型
apps/user/templatetags/custom_filters.py
get_question_price_by_id
banyanbbt/banyan_data
2
python
@register.filter def get_question_price_by_id(value): return Task.objects.filter(pk=value).first().question_price
@register.filter def get_question_price_by_id(value): return Task.objects.filter(pk=value).first().question_price<|docstring|>根据任务id获取任务类型<|endoftext|>
605791b86b36d2e98feb2d8874c234609293d239e5fcd25319291a0c82298860
@register.filter def get_attachment_id_by_id(value): '根据任务id获取任务附件id' return Task.objects.filter(pk=value).first().attachment_id
根据任务id获取任务附件id
apps/user/templatetags/custom_filters.py
get_attachment_id_by_id
banyanbbt/banyan_data
2
python
@register.filter def get_attachment_id_by_id(value): return Task.objects.filter(pk=value).first().attachment_id
@register.filter def get_attachment_id_by_id(value): return Task.objects.filter(pk=value).first().attachment_id<|docstring|>根据任务id获取任务附件id<|endoftext|>
7b3c0082a8b14b83f63e608d61cbf4521a771abec5fafdc2b21b0e558d28abb4
@register.filter def get_answer_type_by_id(value): '根据任务id获取任务答案类型(是否需要上传文件)' return Task.objects.filter(pk=value).first().is_file_answer
根据任务id获取任务答案类型(是否需要上传文件)
apps/user/templatetags/custom_filters.py
get_answer_type_by_id
banyanbbt/banyan_data
2
python
@register.filter def get_answer_type_by_id(value): return Task.objects.filter(pk=value).first().is_file_answer
@register.filter def get_answer_type_by_id(value): return Task.objects.filter(pk=value).first().is_file_answer<|docstring|>根据任务id获取任务答案类型(是否需要上传文件)<|endoftext|>
c63e459f28a376022a98ed77325f46b27b5463e77545fb84c589e890af73a14e
@register.filter def get_transaction_question_code_by_id(value): '根据任务id获取题目id' return Question.objects.filter(task_id=value, question_type='文件翻译', status='unresolved').first().code
根据任务id获取题目id
apps/user/templatetags/custom_filters.py
get_transaction_question_code_by_id
banyanbbt/banyan_data
2
python
@register.filter def get_transaction_question_code_by_id(value): return Question.objects.filter(task_id=value, question_type='文件翻译', status='unresolved').first().code
@register.filter def get_transaction_question_code_by_id(value): return Question.objects.filter(task_id=value, question_type='文件翻译', status='unresolved').first().code<|docstring|>根据任务id获取题目id<|endoftext|>
8379a5426c727aa105d0a77a240128018fc09763291c8d101b0da2a505c1623d
@register.filter def get_cleaning_question_code_by_id(value, user_id): '根据任务id获取清洗题目id' answered_question_ids = Answer.objects.filter(user_id=user_id, task_id=value).exclude(status='审核未通过').values_list('question_id', flat=True) return Question.objects.get_random_question(task_id=value, answered_question_ids...
根据任务id获取清洗题目id
apps/user/templatetags/custom_filters.py
get_cleaning_question_code_by_id
banyanbbt/banyan_data
2
python
@register.filter def get_cleaning_question_code_by_id(value, user_id): answered_question_ids = Answer.objects.filter(user_id=user_id, task_id=value).exclude(status='审核未通过').values_list('question_id', flat=True) return Question.objects.get_random_question(task_id=value, answered_question_ids=answered_questi...
@register.filter def get_cleaning_question_code_by_id(value, user_id): answered_question_ids = Answer.objects.filter(user_id=user_id, task_id=value).exclude(status='审核未通过').values_list('question_id', flat=True) return Question.objects.get_random_question(task_id=value, answered_question_ids=answered_questi...
30eb49da4e85c70a173ad6c4662b333235251b7b3784df4225ddc130fb13a1bc
@register.filter def get_upload_img_question_code_by_id(value): '根据任务id获取图片上传题目id' return Question.objects.filter(task_id=value, question_type='图片上传', status='unresolved').first().code
根据任务id获取图片上传题目id
apps/user/templatetags/custom_filters.py
get_upload_img_question_code_by_id
banyanbbt/banyan_data
2
python
@register.filter def get_upload_img_question_code_by_id(value): return Question.objects.filter(task_id=value, question_type='图片上传', status='unresolved').first().code
@register.filter def get_upload_img_question_code_by_id(value): return Question.objects.filter(task_id=value, question_type='图片上传', status='unresolved').first().code<|docstring|>根据任务id获取图片上传题目id<|endoftext|>
55f4fe65e30ebfc864741e9d047948ba4d0013b63290970a1bf8d63322f6cdee
@register.filter def en_to_cn(value): '将英文字段转换为中文' if (value == 'car_brand'): return '车品牌' if (value == 'car_serie'): return '车系' if (value == 'car_type'): return '车型' if (value == 'car_version'): return '版本' if (value == 'car_gearbox'): return '变速箱' i...
将英文字段转换为中文
apps/user/templatetags/custom_filters.py
en_to_cn
banyanbbt/banyan_data
2
python
@register.filter def en_to_cn(value): if (value == 'car_brand'): return '车品牌' if (value == 'car_serie'): return '车系' if (value == 'car_type'): return '车型' if (value == 'car_version'): return '版本' if (value == 'car_gearbox'): return '变速箱' if (value == ...
@register.filter def en_to_cn(value): if (value == 'car_brand'): return '车品牌' if (value == 'car_serie'): return '车系' if (value == 'car_type'): return '车型' if (value == 'car_version'): return '版本' if (value == 'car_gearbox'): return '变速箱' if (value == ...
d377e39d35b21f5c7b7f98484588f3bed900f24386dc5bea0c15a05cfb4201ae
@register.filter def get_finish_count(value): '根据任务id获取图片上传任务的完成数量' question_ids = Attachment.objects.filter(task_id=value.task_id, created_by=value.user_id).values_list('question_id', flat=True) return len(set(question_ids))
根据任务id获取图片上传任务的完成数量
apps/user/templatetags/custom_filters.py
get_finish_count
banyanbbt/banyan_data
2
python
@register.filter def get_finish_count(value): question_ids = Attachment.objects.filter(task_id=value.task_id, created_by=value.user_id).values_list('question_id', flat=True) return len(set(question_ids))
@register.filter def get_finish_count(value): question_ids = Attachment.objects.filter(task_id=value.task_id, created_by=value.user_id).values_list('question_id', flat=True) return len(set(question_ids))<|docstring|>根据任务id获取图片上传任务的完成数量<|endoftext|>
8eea8605b36e7eede35a3a03061c93f144f8d02a5386019638167b3bf79a99de
@register.filter def has_remain_question(value): '判断该任务下的题目是否已经做完' answered_question_ids = Attachment.objects.get_current_user_answered_question_ids(value.task_id, value.user_id) return Question.objects.filter(status='unresolved', task_id=value.task_id).exclude(id__in=answered_question_ids)
判断该任务下的题目是否已经做完
apps/user/templatetags/custom_filters.py
has_remain_question
banyanbbt/banyan_data
2
python
@register.filter def has_remain_question(value): answered_question_ids = Attachment.objects.get_current_user_answered_question_ids(value.task_id, value.user_id) return Question.objects.filter(status='unresolved', task_id=value.task_id).exclude(id__in=answered_question_ids)
@register.filter def has_remain_question(value): answered_question_ids = Attachment.objects.get_current_user_answered_question_ids(value.task_id, value.user_id) return Question.objects.filter(status='unresolved', task_id=value.task_id).exclude(id__in=answered_question_ids)<|docstring|>判断该任务下的题目是否已经做完<|endo...
28f5c4688fbf9f9d5362f0b1ea066bc56bd329440f0fa49c14bc97d983cd4a0b
@register.filter def get_received_count(value): '任务已领取人数' if (value.start_time > now()): return 0 else: return (value.received_count + 50)
任务已领取人数
apps/user/templatetags/custom_filters.py
get_received_count
banyanbbt/banyan_data
2
python
@register.filter def get_received_count(value): if (value.start_time > now()): return 0 else: return (value.received_count + 50)
@register.filter def get_received_count(value): if (value.start_time > now()): return 0 else: return (value.received_count + 50)<|docstring|>任务已领取人数<|endoftext|>
a73a391e33f497cbf68560bc21825ecc04a04a62897dcacebd722cc14ebab236
def similar(self, other: 'TreeBST') -> bool: 'Whether two trees are similar based on the values. This will perform an\n inorder traversal on both trees to ensure that they contains the same values\n only.\n\n Args:\n other (TreeBST): Tree to compare to.\n\n Returns:\n ...
Whether two trees are similar based on the values. This will perform an inorder traversal on both trees to ensure that they contains the same values only. Args: other (TreeBST): Tree to compare to. Returns: bool: Result of whether both trees contain the same value
tree_bst.py
similar
Luca-Gazzola/python-library
0
python
def similar(self, other: 'TreeBST') -> bool: 'Whether two trees are similar based on the values. This will perform an\n inorder traversal on both trees to ensure that they contains the same values\n only.\n\n Args:\n other (TreeBST): Tree to compare to.\n\n Returns:\n ...
def similar(self, other: 'TreeBST') -> bool: 'Whether two trees are similar based on the values. This will perform an\n inorder traversal on both trees to ensure that they contains the same values\n only.\n\n Args:\n other (TreeBST): Tree to compare to.\n\n Returns:\n ...
3bbdd07ec34db00e94a2f7f9ea8b0628e4421cabf8958671ce25c61b785a067b
def insert(self, value: object) -> bool: 'Insert the given value into the tree. Will ignore duplicate and None type values.\n\n Args:\n value (object): Value to insert.\n\n Returns:\n bool: Returns True if insertion was successful.\n ' if (value == None): retur...
Insert the given value into the tree. Will ignore duplicate and None type values. Args: value (object): Value to insert. Returns: bool: Returns True if insertion was successful.
tree_bst.py
insert
Luca-Gazzola/python-library
0
python
def insert(self, value: object) -> bool: 'Insert the given value into the tree. Will ignore duplicate and None type values.\n\n Args:\n value (object): Value to insert.\n\n Returns:\n bool: Returns True if insertion was successful.\n ' if (value == None): retur...
def insert(self, value: object) -> bool: 'Insert the given value into the tree. Will ignore duplicate and None type values.\n\n Args:\n value (object): Value to insert.\n\n Returns:\n bool: Returns True if insertion was successful.\n ' if (value == None): retur...
6aa174d0116696d2bcdd8fef9d4d52726b135306e353f53a123cc9ff051b577d
def max(self) -> object: 'Find max value contained in the tree.\n\n Returns:\n object: Max value found.\n ' return self.__find_max__(self.__root__).value
Find max value contained in the tree. Returns: object: Max value found.
tree_bst.py
max
Luca-Gazzola/python-library
0
python
def max(self) -> object: 'Find max value contained in the tree.\n\n Returns:\n object: Max value found.\n ' return self.__find_max__(self.__root__).value
def max(self) -> object: 'Find max value contained in the tree.\n\n Returns:\n object: Max value found.\n ' return self.__find_max__(self.__root__).value<|docstring|>Find max value contained in the tree. Returns: object: Max value found.<|endoftext|>
4be5dd0b4ca35ecf87314984b691d4e575e4f6419253aace0e89ff3789fe4a9d
def min(self) -> object: 'Find min value contained in the tree.\n\n Returns:\n object: Min value found.\n ' return self.__find_min__(self.__root__).value
Find min value contained in the tree. Returns: object: Min value found.
tree_bst.py
min
Luca-Gazzola/python-library
0
python
def min(self) -> object: 'Find min value contained in the tree.\n\n Returns:\n object: Min value found.\n ' return self.__find_min__(self.__root__).value
def min(self) -> object: 'Find min value contained in the tree.\n\n Returns:\n object: Min value found.\n ' return self.__find_min__(self.__root__).value<|docstring|>Find min value contained in the tree. Returns: object: Min value found.<|endoftext|>
6c083e7c7a10770c2ef36ed7a0841e43f9c882abe7ba44e5b4a48a9976d3377d
def __insert__(self, value: object, node: Node) -> Node: "A recursive insert helper function to insert the node into the tree. This is\n purely a helper method and isn't meant to be called outside of the class.\n\n Args:\n value (object): The item to insert into the tree.\n node ...
A recursive insert helper function to insert the node into the tree. This is purely a helper method and isn't meant to be called outside of the class. Args: value (object): The item to insert into the tree. node (Node): The current node that we're at. Returns: Node: The newly inserted node.
tree_bst.py
__insert__
Luca-Gazzola/python-library
0
python
def __insert__(self, value: object, node: Node) -> Node: "A recursive insert helper function to insert the node into the tree. This is\n purely a helper method and isn't meant to be called outside of the class.\n\n Args:\n value (object): The item to insert into the tree.\n node ...
def __insert__(self, value: object, node: Node) -> Node: "A recursive insert helper function to insert the node into the tree. This is\n purely a helper method and isn't meant to be called outside of the class.\n\n Args:\n value (object): The item to insert into the tree.\n node ...
45ddb9d23aa36808b7211e10a350d7412a34135c6168ea5a903b7bbac27ce6c9
def __remove__(self, value: object, node: Node) -> Node: "A recursive remove helper function to remove a node from the tree. This is\n purely a helper method and isn't meant to be called outside of the class.\n\n Args:\n value (object): The item to be removed from the tree.\n nod...
A recursive remove helper function to remove a node from the tree. This is purely a helper method and isn't meant to be called outside of the class. Args: value (object): The item to be removed from the tree. node (Node): The current node that we're at. Returns: Node: The removed node.
tree_bst.py
__remove__
Luca-Gazzola/python-library
0
python
def __remove__(self, value: object, node: Node) -> Node: "A recursive remove helper function to remove a node from the tree. This is\n purely a helper method and isn't meant to be called outside of the class.\n\n Args:\n value (object): The item to be removed from the tree.\n nod...
def __remove__(self, value: object, node: Node) -> Node: "A recursive remove helper function to remove a node from the tree. This is\n purely a helper method and isn't meant to be called outside of the class.\n\n Args:\n value (object): The item to be removed from the tree.\n nod...
f9da40b42a6d576fd39cf563d68ed3bb1b06147ebdd7230d949178a7605cbae1
def __find_node__(self, value: object) -> Node: "Iterates through the tree to find the matching node that contains\n the given value. This is purely a helper method and isn't meant to be\n called outside of the class.\n\n Args:\n value (object): The value to match.\n\n Returns...
Iterates through the tree to find the matching node that contains the given value. This is purely a helper method and isn't meant to be called outside of the class. Args: value (object): The value to match. Returns: Node: The node found containing the matched value.
tree_bst.py
__find_node__
Luca-Gazzola/python-library
0
python
def __find_node__(self, value: object) -> Node: "Iterates through the tree to find the matching node that contains\n the given value. This is purely a helper method and isn't meant to be\n called outside of the class.\n\n Args:\n value (object): The value to match.\n\n Returns...
def __find_node__(self, value: object) -> Node: "Iterates through the tree to find the matching node that contains\n the given value. This is purely a helper method and isn't meant to be\n called outside of the class.\n\n Args:\n value (object): The value to match.\n\n Returns...
48d4532b68715cfb28507a581d4205c783b8e3a98c4a9ec929262a3526a09ef9
def __find_min__(self, node: Node) -> Node: "Iterates through the tree to find the node that contains the smallest value.\n This is purely a helper method and isn't meant to be called outside of the class.\n\n Args:\n node (Node): The current node.\n\n Returns:\n Node: The...
Iterates through the tree to find the node that contains the smallest value. This is purely a helper method and isn't meant to be called outside of the class. Args: node (Node): The current node. Returns: Node: The node that has the smallest value.
tree_bst.py
__find_min__
Luca-Gazzola/python-library
0
python
def __find_min__(self, node: Node) -> Node: "Iterates through the tree to find the node that contains the smallest value.\n This is purely a helper method and isn't meant to be called outside of the class.\n\n Args:\n node (Node): The current node.\n\n Returns:\n Node: The...
def __find_min__(self, node: Node) -> Node: "Iterates through the tree to find the node that contains the smallest value.\n This is purely a helper method and isn't meant to be called outside of the class.\n\n Args:\n node (Node): The current node.\n\n Returns:\n Node: The...
5904539510b7203945a29de4b80af072bc0f40aeaa4070ff3c78802bb306197a
def __find_max__(self, node: Node) -> Node: "Iterates through the tree to find the node that contains the largest value.\n This is purely a helper method and isn't meant to be called outside of the class.\n\n Args:\n node (Node): The current node.\n\n Returns:\n Node: The ...
Iterates through the tree to find the node that contains the largest value. This is purely a helper method and isn't meant to be called outside of the class. Args: node (Node): The current node. Returns: Node: The node that has the largest value.
tree_bst.py
__find_max__
Luca-Gazzola/python-library
0
python
def __find_max__(self, node: Node) -> Node: "Iterates through the tree to find the node that contains the largest value.\n This is purely a helper method and isn't meant to be called outside of the class.\n\n Args:\n node (Node): The current node.\n\n Returns:\n Node: The ...
def __find_max__(self, node: Node) -> Node: "Iterates through the tree to find the node that contains the largest value.\n This is purely a helper method and isn't meant to be called outside of the class.\n\n Args:\n node (Node): The current node.\n\n Returns:\n Node: The ...
07b681db58bf50b4d090c5b3f223cb2dd584d3d8d4f79321824d2034e8c9b81f
def ac(self, **params): 'Autocomplete API.\n\n ' field = params['field'] term = params['term'] colls = params['colls'].split(',') if (field == '*'): return jsonresp([]) (fieldname, fieldtype) = field.rsplit('_', 1) fieldconfigs = SearchCollection.config['types'].get('record', ...
Autocomplete API.
web/apps/search/views.py
ac
exploratour/exploratour
0
python
def ac(self, **params): '\n\n ' field = params['field'] term = params['term'] colls = params['colls'].split(',') if (field == '*'): return jsonresp([]) (fieldname, fieldtype) = field.rsplit('_', 1) fieldconfigs = SearchCollection.config['types'].get('record', {}).get('fields',...
def ac(self, **params): '\n\n ' field = params['field'] term = params['term'] colls = params['colls'].split(',') if (field == '*'): return jsonresp([]) (fieldname, fieldtype) = field.rsplit('_', 1) fieldconfigs = SearchCollection.config['types'].get('record', {}).get('fields',...
d050a1842552e1707a51f31c138de88cba9ad469c2a77ecfbf6b43f37facd6c5
def participant_pipeline(vhdr_file, log_file, ocular_correction='auto', bad_channels=None, auto_bad_channels=None, skip_log_rows=None, skip_log_conditions=None, downsample_sfreq=None, veog_channels='auto', heog_channels='auto', montage='easycap-M1', highpass_freq=0.1, lowpass_freq=40.0, triggers=None, triggers_column=N...
Processes EEG data for a single participant. The raw data is read and cleaned using standard steps (downsampling, bad channel interpolation, ocular correction, frequency domain filtering). Epochs are created around the `triggers`. Bad epochs are removed based on peak-to-peak amplitude. Single trial mean ERP amplitudes...
pipeline/participant.py
participant_pipeline
alexenge/mne-step
3
python
def participant_pipeline(vhdr_file, log_file, ocular_correction='auto', bad_channels=None, auto_bad_channels=None, skip_log_rows=None, skip_log_conditions=None, downsample_sfreq=None, veog_channels='auto', heog_channels='auto', montage='easycap-M1', highpass_freq=0.1, lowpass_freq=40.0, triggers=None, triggers_column=N...
def participant_pipeline(vhdr_file, log_file, ocular_correction='auto', bad_channels=None, auto_bad_channels=None, skip_log_rows=None, skip_log_conditions=None, downsample_sfreq=None, veog_channels='auto', heog_channels='auto', montage='easycap-M1', highpass_freq=0.1, lowpass_freq=40.0, triggers=None, triggers_column=N...
0364ae1f08fea773d745f663d5312514ac2e6d904786e919168a58868cb44e7e
def _on_apply(self, *args): "Call back called when the Apply button is pressed.\n\n The only reason this method exists is so the derived on_apply doesn't have to\n have any args.\n\n :param args: Callback args.\n " self.on_apply()
Call back called when the Apply button is pressed. The only reason this method exists is so the derived on_apply doesn't have to have any args. :param args: Callback args.
scripts/cmt/ui/optionbox.py
_on_apply
DouglasWilcox/cmt
199
python
def _on_apply(self, *args): "Call back called when the Apply button is pressed.\n\n The only reason this method exists is so the derived on_apply doesn't have to\n have any args.\n\n :param args: Callback args.\n " self.on_apply()
def _on_apply(self, *args): "Call back called when the Apply button is pressed.\n\n The only reason this method exists is so the derived on_apply doesn't have to\n have any args.\n\n :param args: Callback args.\n " self.on_apply()<|docstring|>Call back called when the Apply button is...
24e6da76090160ac478c53c60efcc5d6f417fe5f7ae692f6e6a167874b9366a8
def _on_reset(self, *args): "Call back called when the Reset settings menu item is pressed.\n\n The only reason this method exists is so the derived on_reset doesn't have to\n have any args.\n\n :param args: Callback args.\n " self.on_reset()
Call back called when the Reset settings menu item is pressed. The only reason this method exists is so the derived on_reset doesn't have to have any args. :param args: Callback args.
scripts/cmt/ui/optionbox.py
_on_reset
DouglasWilcox/cmt
199
python
def _on_reset(self, *args): "Call back called when the Reset settings menu item is pressed.\n\n The only reason this method exists is so the derived on_reset doesn't have to\n have any args.\n\n :param args: Callback args.\n " self.on_reset()
def _on_reset(self, *args): "Call back called when the Reset settings menu item is pressed.\n\n The only reason this method exists is so the derived on_reset doesn't have to\n have any args.\n\n :param args: Callback args.\n " self.on_reset()<|docstring|>Call back called when the Res...
56ce1496f597166a9cfa01835f32546c07eb5f4b089e3acbb3bf741d53c9f212
def _on_save(self, *args): "Call back called when the Save settings menu item is pressed.\n\n The only reason this method exists is so the derived on_save doesn't have to\n have any args.\n\n :param args: Callback args.\n " self.on_save()
Call back called when the Save settings menu item is pressed. The only reason this method exists is so the derived on_save doesn't have to have any args. :param args: Callback args.
scripts/cmt/ui/optionbox.py
_on_save
DouglasWilcox/cmt
199
python
def _on_save(self, *args): "Call back called when the Save settings menu item is pressed.\n\n The only reason this method exists is so the derived on_save doesn't have to\n have any args.\n\n :param args: Callback args.\n " self.on_save()
def _on_save(self, *args): "Call back called when the Save settings menu item is pressed.\n\n The only reason this method exists is so the derived on_save doesn't have to\n have any args.\n\n :param args: Callback args.\n " self.on_save()<|docstring|>Call back called when the Save se...
ea69fa31d84f0c326fc804fb2821848749b266e916e20fd97c5204052a94adae
def _apply_and_close(self, *args, **kwargs): 'Create the twist decomposition and close the option box.' self.on_apply() mel.eval('saveOptionBoxSize') self._close()
Create the twist decomposition and close the option box.
scripts/cmt/ui/optionbox.py
_apply_and_close
DouglasWilcox/cmt
199
python
def _apply_and_close(self, *args, **kwargs): self.on_apply() mel.eval('saveOptionBoxSize') self._close()
def _apply_and_close(self, *args, **kwargs): self.on_apply() mel.eval('saveOptionBoxSize') self._close()<|docstring|>Create the twist decomposition and close the option box.<|endoftext|>
832398b17f66d39efa468a7510692d495794527e0bbcb044a4d936c3ab18a8a6
def test_raise_exception_in_get_selection_nsel(self): 'Raise GwyfileErrorCMsg in GwySelection._get_selection_nsel\n\n Raise GwyfileErrorCMsg in GwySelection._get_selection_nsel\n if get_sel_func returns False\n ' falsep = ffi.new('bool*', False) self.get_sel_func.return_value = falsep[0...
Raise GwyfileErrorCMsg in GwySelection._get_selection_nsel Raise GwyfileErrorCMsg in GwySelection._get_selection_nsel if get_sel_func returns False
tests/test_gwyselection.py
test_raise_exception_in_get_selection_nsel
dmitry-streltsov/gwy-postgresql
1
python
def test_raise_exception_in_get_selection_nsel(self): 'Raise GwyfileErrorCMsg in GwySelection._get_selection_nsel\n\n Raise GwyfileErrorCMsg in GwySelection._get_selection_nsel\n if get_sel_func returns False\n ' falsep = ffi.new('bool*', False) self.get_sel_func.return_value = falsep[0...
def test_raise_exception_in_get_selection_nsel(self): 'Raise GwyfileErrorCMsg in GwySelection._get_selection_nsel\n\n Raise GwyfileErrorCMsg in GwySelection._get_selection_nsel\n if get_sel_func returns False\n ' falsep = ffi.new('bool*', False) self.get_sel_func.return_value = falsep[0...
f6c895482a47273522ce3e2a1b91b943b6488db39b9ef89cb902e892b0c16f1f
def test_pos_arguments(self): 'Test positional arguments in gwyfile_object_selectionpoint_get\n\n First argument must be GwySelectionPoint libgwyfile object\n Second argument must be GwyfileError** libgwyfile object\n Last argument must be NULL\n ' self.get_sel_func.side_effect = sel...
Test positional arguments in gwyfile_object_selectionpoint_get First argument must be GwySelectionPoint libgwyfile object Second argument must be GwyfileError** libgwyfile object Last argument must be NULL
tests/test_gwyselection.py
test_pos_arguments
dmitry-streltsov/gwy-postgresql
1
python
def test_pos_arguments(self): 'Test positional arguments in gwyfile_object_selectionpoint_get\n\n First argument must be GwySelectionPoint libgwyfile object\n Second argument must be GwyfileError** libgwyfile object\n Last argument must be NULL\n ' self.get_sel_func.side_effect = sel...
def test_pos_arguments(self): 'Test positional arguments in gwyfile_object_selectionpoint_get\n\n First argument must be GwySelectionPoint libgwyfile object\n Second argument must be GwyfileError** libgwyfile object\n Last argument must be NULL\n ' self.get_sel_func.side_effect = sel...
9bd2a0fd21b0b7952f0dbf320c668532ff58126903c8e4fa484b4a6b16b60efc
def test_returned_value(self): 'Test returned value of _get_selection_nsel method\n ' self.get_sel_func.side_effect = self._test_returned_value self.gwysel = Mock() returned_value = GwySelection._get_selection_nsel(self.gwysel) self.assertEqual(returned_value, self.nsel)
Test returned value of _get_selection_nsel method
tests/test_gwyselection.py
test_returned_value
dmitry-streltsov/gwy-postgresql
1
python
def test_returned_value(self): '\n ' self.get_sel_func.side_effect = self._test_returned_value self.gwysel = Mock() returned_value = GwySelection._get_selection_nsel(self.gwysel) self.assertEqual(returned_value, self.nsel)
def test_returned_value(self): '\n ' self.get_sel_func.side_effect = self._test_returned_value self.gwysel = Mock() returned_value = GwySelection._get_selection_nsel(self.gwysel) self.assertEqual(returned_value, self.nsel)<|docstring|>Test returned value of _get_selection_nsel method<|endofte...
4cb9d6affdf05ce4d323ef7bf0ce150dbb2813cf259ae80730fd4042d329cd50
def _test_returned_value(self, *args): "Write self.nsel in 'nsel' and return True\n " arg_keys = [ffi.string(key).decode('utf-8') for key in args[2:(- 1):2]] arg_pointers = [pointer for pointer in args[3:(- 1):2]] arg_dict = dict(zip(arg_keys, arg_pointers)) arg_dict['nsel'][0] = self.nsel ...
Write self.nsel in 'nsel' and return True
tests/test_gwyselection.py
_test_returned_value
dmitry-streltsov/gwy-postgresql
1
python
def _test_returned_value(self, *args): "\n " arg_keys = [ffi.string(key).decode('utf-8') for key in args[2:(- 1):2]] arg_pointers = [pointer for pointer in args[3:(- 1):2]] arg_dict = dict(zip(arg_keys, arg_pointers)) arg_dict['nsel'][0] = self.nsel truep = ffi.new('bool*', True) retu...
def _test_returned_value(self, *args): "\n " arg_keys = [ffi.string(key).decode('utf-8') for key in args[2:(- 1):2]] arg_pointers = [pointer for pointer in args[3:(- 1):2]] arg_dict = dict(zip(arg_keys, arg_pointers)) arg_dict['nsel'][0] = self.nsel truep = ffi.new('bool*', True) retu...
444fc3a837418d78b18782ae7b3b2b15180e821eaa4bd6f2c1dea8343ea14872
def test_raise_exception_in_get_selection_points(self): 'Raise GwyfileErrorCMsg in GwySelection._get_selection_points\n\n Raise GwyfileErrorCMsg in GwySelection._get_selection_points\n if get_sel_func returns False\n ' falsep = ffi.new('bool*', False) self.get_sel_func.return_value = fa...
Raise GwyfileErrorCMsg in GwySelection._get_selection_points Raise GwyfileErrorCMsg in GwySelection._get_selection_points if get_sel_func returns False
tests/test_gwyselection.py
test_raise_exception_in_get_selection_points
dmitry-streltsov/gwy-postgresql
1
python
def test_raise_exception_in_get_selection_points(self): 'Raise GwyfileErrorCMsg in GwySelection._get_selection_points\n\n Raise GwyfileErrorCMsg in GwySelection._get_selection_points\n if get_sel_func returns False\n ' falsep = ffi.new('bool*', False) self.get_sel_func.return_value = fa...
def test_raise_exception_in_get_selection_points(self): 'Raise GwyfileErrorCMsg in GwySelection._get_selection_points\n\n Raise GwyfileErrorCMsg in GwySelection._get_selection_points\n if get_sel_func returns False\n ' falsep = ffi.new('bool*', False) self.get_sel_func.return_value = fa...
0447052cf1a90404ec9f49ff6efa22d6f1b03f47c5bd8d925ddbb720fd9b8719
def test_return_None_if_nsel_is_zero(self): 'Return None if number of selections is zero\n ' nsel = 0 points = GwySelection._get_selection_points(self.gwysel, nsel) self.assertIsNone(points)
Return None if number of selections is zero
tests/test_gwyselection.py
test_return_None_if_nsel_is_zero
dmitry-streltsov/gwy-postgresql
1
python
def test_return_None_if_nsel_is_zero(self): '\n ' nsel = 0 points = GwySelection._get_selection_points(self.gwysel, nsel) self.assertIsNone(points)
def test_return_None_if_nsel_is_zero(self): '\n ' nsel = 0 points = GwySelection._get_selection_points(self.gwysel, nsel) self.assertIsNone(points)<|docstring|>Return None if number of selections is zero<|endoftext|>
864eb97ba3cdca53cb87581f88065f053c8437ead5f00fa89dd6a7aae04c3c99
def test_return_points_if_nsel_is_not_zero(self): 'Return list of points if number of selections is not zero\n ' self.get_sel_func.side_effect = self._get_points_side_effect points = GwySelection._get_selection_points(self.gwysel, self.nsel) self.assertListEqual(self.points, points)
Return list of points if number of selections is not zero
tests/test_gwyselection.py
test_return_points_if_nsel_is_not_zero
dmitry-streltsov/gwy-postgresql
1
python
def test_return_points_if_nsel_is_not_zero(self): '\n ' self.get_sel_func.side_effect = self._get_points_side_effect points = GwySelection._get_selection_points(self.gwysel, self.nsel) self.assertListEqual(self.points, points)
def test_return_points_if_nsel_is_not_zero(self): '\n ' self.get_sel_func.side_effect = self._get_points_side_effect points = GwySelection._get_selection_points(self.gwysel, self.nsel) self.assertListEqual(self.points, points)<|docstring|>Return list of points if number of selections is not zero<...
9fcf4285c78ee11d3e31c19445c91c6f9d3d07e53d88f8be3c41d30bb5da3e97
def _get_points_side_effect(self, *args): " Write self.cpoints in 'data' field and return True\n " arg_keys = [ffi.string(key).decode('utf-8') for key in args[2:(- 1):2]] arg_pointers = [pointer for pointer in args[3:(- 1):2]] arg_dict = dict(zip(arg_keys, arg_pointers)) arg_dict['data'][0] ...
Write self.cpoints in 'data' field and return True
tests/test_gwyselection.py
_get_points_side_effect
dmitry-streltsov/gwy-postgresql
1
python
def _get_points_side_effect(self, *args): " \n " arg_keys = [ffi.string(key).decode('utf-8') for key in args[2:(- 1):2]] arg_pointers = [pointer for pointer in args[3:(- 1):2]] arg_dict = dict(zip(arg_keys, arg_pointers)) arg_dict['data'][0] = self.cpoints truep = ffi.new('bool*', True) ...
def _get_points_side_effect(self, *args): " \n " arg_keys = [ffi.string(key).decode('utf-8') for key in args[2:(- 1):2]] arg_pointers = [pointer for pointer in args[3:(- 1):2]] arg_dict = dict(zip(arg_keys, arg_pointers)) arg_dict['data'][0] = self.cpoints truep = ffi.new('bool*', True) ...
3a922fd724ac2d3961b293a32a1777f1274686c3332a6c3616b742c2710935cb
def test__combine_ponts_in_pairs_non_empty_arg(self): 'Combine points in pairs if points list is not empty\n ' points = [(0.0, 0.0), (1.0, 1.0), (2.0, 2.0), (3.0, 3.0)] pairs = GwySelection._combine_points_in_pair(points) self.assertListEqual(pairs, [((0.0, 0.0), (1.0, 1.0)), ((2.0, 2.0), (3.0, 3...
Combine points in pairs if points list is not empty
tests/test_gwyselection.py
test__combine_ponts_in_pairs_non_empty_arg
dmitry-streltsov/gwy-postgresql
1
python
def test__combine_ponts_in_pairs_non_empty_arg(self): '\n ' points = [(0.0, 0.0), (1.0, 1.0), (2.0, 2.0), (3.0, 3.0)] pairs = GwySelection._combine_points_in_pair(points) self.assertListEqual(pairs, [((0.0, 0.0), (1.0, 1.0)), ((2.0, 2.0), (3.0, 3.0))])
def test__combine_ponts_in_pairs_non_empty_arg(self): '\n ' points = [(0.0, 0.0), (1.0, 1.0), (2.0, 2.0), (3.0, 3.0)] pairs = GwySelection._combine_points_in_pair(points) self.assertListEqual(pairs, [((0.0, 0.0), (1.0, 1.0)), ((2.0, 2.0), (3.0, 3.0))])<|docstring|>Combine points in pairs if point...
4114a857e5b0d5fa946cf8b31a878fbec83ce2c2eb5de63f27b5cb9cc7bc9c47
def test__combine_ponts_in_pairs_empty_arg(self): 'Return empty list if points list is empty\n ' points = [] pairs = GwySelection._combine_points_in_pair(points) self.assertListEqual(pairs, [])
Return empty list if points list is empty
tests/test_gwyselection.py
test__combine_ponts_in_pairs_empty_arg
dmitry-streltsov/gwy-postgresql
1
python
def test__combine_ponts_in_pairs_empty_arg(self): '\n ' points = [] pairs = GwySelection._combine_points_in_pair(points) self.assertListEqual(pairs, [])
def test__combine_ponts_in_pairs_empty_arg(self): '\n ' points = [] pairs = GwySelection._combine_points_in_pair(points) self.assertListEqual(pairs, [])<|docstring|>Return empty list if points list is empty<|endoftext|>
8acf094935c6bc2d5bb035f41bbf2554cda8d5894c65371320115b8c98a4d9c5
def test_arg_is_list_of_points(self): 'GwyPointSelection.__init__ arg is a list\n ' points = [(1, 2), (3, 4)] point_sel = GwyPointSelection(points) self.assertListEqual(point_sel.data, points)
GwyPointSelection.__init__ arg is a list
tests/test_gwyselection.py
test_arg_is_list_of_points
dmitry-streltsov/gwy-postgresql
1
python
def test_arg_is_list_of_points(self): '\n ' points = [(1, 2), (3, 4)] point_sel = GwyPointSelection(points) self.assertListEqual(point_sel.data, points)
def test_arg_is_list_of_points(self): '\n ' points = [(1, 2), (3, 4)] point_sel = GwyPointSelection(points) self.assertListEqual(point_sel.data, points)<|docstring|>GwyPointSelection.__init__ arg is a list<|endoftext|>
9849e23eeb4fd7a30b1c20c58a2990d341447d687eaa45e673dbc3a584b6e0df
def test_arg_is_tuple_of_points(self): 'GwyPointSelection.__init__ arg is a tuple\n ' points = ((1, 2), (3, 4)) point_sel = GwyPointSelection(points) self.assertListEqual(point_sel.data, [(1, 2), (3, 4)])
GwyPointSelection.__init__ arg is a tuple
tests/test_gwyselection.py
test_arg_is_tuple_of_points
dmitry-streltsov/gwy-postgresql
1
python
def test_arg_is_tuple_of_points(self): '\n ' points = ((1, 2), (3, 4)) point_sel = GwyPointSelection(points) self.assertListEqual(point_sel.data, [(1, 2), (3, 4)])
def test_arg_is_tuple_of_points(self): '\n ' points = ((1, 2), (3, 4)) point_sel = GwyPointSelection(points) self.assertListEqual(point_sel.data, [(1, 2), (3, 4)])<|docstring|>GwyPointSelection.__init__ arg is a tuple<|endoftext|>
4c2582fc9a846938d899ba9c8385e982eaddc0fef73e016d8dc8c2c13baa3a05
def test_arg_is_an_empty_list(self): 'Raise ValueError if GwyPointSelection.__init__ arg is empty\n ' points = [] self.assertRaises(ValueError, GwyPointSelection, points)
Raise ValueError if GwyPointSelection.__init__ arg is empty
tests/test_gwyselection.py
test_arg_is_an_empty_list
dmitry-streltsov/gwy-postgresql
1
python
def test_arg_is_an_empty_list(self): '\n ' points = [] self.assertRaises(ValueError, GwyPointSelection, points)
def test_arg_is_an_empty_list(self): '\n ' points = [] self.assertRaises(ValueError, GwyPointSelection, points)<|docstring|>Raise ValueError if GwyPointSelection.__init__ arg is empty<|endoftext|>
091f318750c566a48f04a4e9134f1afe7b90b6ad52d163085adf03f6c6ea4b7d
def test_getting_number_of_selections(self): 'Get number of selections from gwysel\n ' GwyPointSelection.from_gwy(self.gwysel) self.get_nsel.assert_has_calls([call(self.gwysel)])
Get number of selections from gwysel
tests/test_gwyselection.py
test_getting_number_of_selections
dmitry-streltsov/gwy-postgresql
1
python
def test_getting_number_of_selections(self): '\n ' GwyPointSelection.from_gwy(self.gwysel) self.get_nsel.assert_has_calls([call(self.gwysel)])
def test_getting_number_of_selections(self): '\n ' GwyPointSelection.from_gwy(self.gwysel) self.get_nsel.assert_has_calls([call(self.gwysel)])<|docstring|>Get number of selections from gwysel<|endoftext|>
5bfc86f6356938b3d6e6e961b05da4c85a3e471794bace8019788b7a57185241
def test_getting_points_of_selections(self): 'Get points of selections from gwysel\n ' self.get_nsel.return_value = self.nsel GwyPointSelection.from_gwy(self.gwysel) self.get_points.assert_has_calls([call(self.gwysel, self.nsel)])
Get points of selections from gwysel
tests/test_gwyselection.py
test_getting_points_of_selections
dmitry-streltsov/gwy-postgresql
1
python
def test_getting_points_of_selections(self): '\n ' self.get_nsel.return_value = self.nsel GwyPointSelection.from_gwy(self.gwysel) self.get_points.assert_has_calls([call(self.gwysel, self.nsel)])
def test_getting_points_of_selections(self): '\n ' self.get_nsel.return_value = self.nsel GwyPointSelection.from_gwy(self.gwysel) self.get_points.assert_has_calls([call(self.gwysel, self.nsel)])<|docstring|>Get points of selections from gwysel<|endoftext|>
21bf491bc3eaea138ad3031966352c9109508f5d98d8b6b6874f5edfee5ec7d5
def test_returned_value(self): 'Return GwyPointSelections initiated by points from gwysel\n ' self.get_points.return_value = self.points point_sel = GwyPointSelection.from_gwy(self.gwysel) self.assertListEqual(point_sel.data, self.points)
Return GwyPointSelections initiated by points from gwysel
tests/test_gwyselection.py
test_returned_value
dmitry-streltsov/gwy-postgresql
1
python
def test_returned_value(self): '\n ' self.get_points.return_value = self.points point_sel = GwyPointSelection.from_gwy(self.gwysel) self.assertListEqual(point_sel.data, self.points)
def test_returned_value(self): '\n ' self.get_points.return_value = self.points point_sel = GwyPointSelection.from_gwy(self.gwysel) self.assertListEqual(point_sel.data, self.points)<|docstring|>Return GwyPointSelections initiated by points from gwysel<|endoftext|>
eb25e63c9f841bad74fb8ee4313a5a08d865672d6846a1a97b8aed4c19b4ba96
def test_return_None_if_data_list_is_empty(self): 'Return None if point selection data list is empty' self.pointsel.data = [] cdata = self.pointsel._cdata self.assertIsNone(cdata)
Return None if point selection data list is empty
tests/test_gwyselection.py
test_return_None_if_data_list_is_empty
dmitry-streltsov/gwy-postgresql
1
python
def test_return_None_if_data_list_is_empty(self): self.pointsel.data = [] cdata = self.pointsel._cdata self.assertIsNone(cdata)
def test_return_None_if_data_list_is_empty(self): self.pointsel.data = [] cdata = self.pointsel._cdata self.assertIsNone(cdata)<|docstring|>Return None if point selection data list is empty<|endoftext|>
2e2897cbdc96a8da75f4f7056a3f741b9c484cae56385ee56ed46731ec879f8b
def test_return_value_if_data_list_is_not_empty(self): 'Return C array if selection data list is not empty' cdata = self.pointsel._cdata self.assertAlmostEqual(cdata, self.cdata)
Return C array if selection data list is not empty
tests/test_gwyselection.py
test_return_value_if_data_list_is_not_empty
dmitry-streltsov/gwy-postgresql
1
python
def test_return_value_if_data_list_is_not_empty(self): cdata = self.pointsel._cdata self.assertAlmostEqual(cdata, self.cdata)
def test_return_value_if_data_list_is_not_empty(self): cdata = self.pointsel._cdata self.assertAlmostEqual(cdata, self.cdata)<|docstring|>Return C array if selection data list is not empty<|endoftext|>
c1b6302a8ddb147383eb50f4ff79adcf4e0d2b0121a870f08a7cf0235c1164b7
def test_return_None_if_selection_list_is_empty(self): ' Return None if point selection list is empty' self.pointsel.data = [] gwysel = self.pointsel.to_gwy() self.assertIsNone(gwysel)
Return None if point selection list is empty
tests/test_gwyselection.py
test_return_None_if_selection_list_is_empty
dmitry-streltsov/gwy-postgresql
1
python
def test_return_None_if_selection_list_is_empty(self): ' ' self.pointsel.data = [] gwysel = self.pointsel.to_gwy() self.assertIsNone(gwysel)
def test_return_None_if_selection_list_is_empty(self): ' ' self.pointsel.data = [] gwysel = self.pointsel.to_gwy() self.assertIsNone(gwysel)<|docstring|>Return None if point selection list is empty<|endoftext|>
5325bc0fdcf05be935a2ad442cb06eeaca4281081bba6051d555aee1e775c010
@patch.object(GwyPointSelection, '_new_sel_func') def test_call_of_libgwyfile_new_selection_func(self, mock_new_sel_func): 'Test call of _new_sel_func of GwyPointSelection class' expected_return = mock_new_sel_func.return_value actual_return = self.pointsel.to_gwy() self.assertEqual(actual_return, expec...
Test call of _new_sel_func of GwyPointSelection class
tests/test_gwyselection.py
test_call_of_libgwyfile_new_selection_func
dmitry-streltsov/gwy-postgresql
1
python
@patch.object(GwyPointSelection, '_new_sel_func') def test_call_of_libgwyfile_new_selection_func(self, mock_new_sel_func): expected_return = mock_new_sel_func.return_value actual_return = self.pointsel.to_gwy() self.assertEqual(actual_return, expected_return)
@patch.object(GwyPointSelection, '_new_sel_func') def test_call_of_libgwyfile_new_selection_func(self, mock_new_sel_func): expected_return = mock_new_sel_func.return_value actual_return = self.pointsel.to_gwy() self.assertEqual(actual_return, expected_return)<|docstring|>Test call of _new_sel_func of G...
615b51d63b4f08fb1266853e6d0dd9ccb67ff5fbdb8ac8d73e5a11c4652a5d86
def test_arg_is_list_of_points(self): 'GwyPointerSelection.__init__ arg is a list\n ' points = [(1, 2), (3, 4)] pointer_sel = GwyPointerSelection(points) self.assertListEqual(pointer_sel.data, points)
GwyPointerSelection.__init__ arg is a list
tests/test_gwyselection.py
test_arg_is_list_of_points
dmitry-streltsov/gwy-postgresql
1
python
def test_arg_is_list_of_points(self): '\n ' points = [(1, 2), (3, 4)] pointer_sel = GwyPointerSelection(points) self.assertListEqual(pointer_sel.data, points)
def test_arg_is_list_of_points(self): '\n ' points = [(1, 2), (3, 4)] pointer_sel = GwyPointerSelection(points) self.assertListEqual(pointer_sel.data, points)<|docstring|>GwyPointerSelection.__init__ arg is a list<|endoftext|>
3095eb4c62915f04936cffc3cca0f43852db9cd1b0146be0b23725f579163916
def test_arg_is_tuple_of_points(self): 'GwyPointerSelection.__init__ arg is a tuple\n ' points = ((1, 2), (3, 4)) pointer_sel = GwyPointSelection(points) self.assertListEqual(pointer_sel.data, [(1, 2), (3, 4)])
GwyPointerSelection.__init__ arg is a tuple
tests/test_gwyselection.py
test_arg_is_tuple_of_points
dmitry-streltsov/gwy-postgresql
1
python
def test_arg_is_tuple_of_points(self): '\n ' points = ((1, 2), (3, 4)) pointer_sel = GwyPointSelection(points) self.assertListEqual(pointer_sel.data, [(1, 2), (3, 4)])
def test_arg_is_tuple_of_points(self): '\n ' points = ((1, 2), (3, 4)) pointer_sel = GwyPointSelection(points) self.assertListEqual(pointer_sel.data, [(1, 2), (3, 4)])<|docstring|>GwyPointerSelection.__init__ arg is a tuple<|endoftext|>
fd7010668a1bb162832a3f5ac3ccd5448458eea6ce2e65c03224ca941a8a949d
def test_arg_is_an_empty_list(self): 'Raise ValueError if GwyPointerSelection.__init__ arg is empty\n ' points = [] self.assertRaises(ValueError, GwyPointerSelection, points)
Raise ValueError if GwyPointerSelection.__init__ arg is empty
tests/test_gwyselection.py
test_arg_is_an_empty_list
dmitry-streltsov/gwy-postgresql
1
python
def test_arg_is_an_empty_list(self): '\n ' points = [] self.assertRaises(ValueError, GwyPointerSelection, points)
def test_arg_is_an_empty_list(self): '\n ' points = [] self.assertRaises(ValueError, GwyPointerSelection, points)<|docstring|>Raise ValueError if GwyPointerSelection.__init__ arg is empty<|endoftext|>
8cb9712d75df6d779b56fd87e7744e5cbb74022811a7f0e43bb788b8c15e53c3
def test_arg_of_parent_from_gwy_method(self): 'Get selection points\n ' GwyPointerSelection.from_gwy(self.gwysel) self.from_gwy_parent.assert_has_calls([call(self.gwysel)])
Get selection points
tests/test_gwyselection.py
test_arg_of_parent_from_gwy_method
dmitry-streltsov/gwy-postgresql
1
python
def test_arg_of_parent_from_gwy_method(self): '\n ' GwyPointerSelection.from_gwy(self.gwysel) self.from_gwy_parent.assert_has_calls([call(self.gwysel)])
def test_arg_of_parent_from_gwy_method(self): '\n ' GwyPointerSelection.from_gwy(self.gwysel) self.from_gwy_parent.assert_has_calls([call(self.gwysel)])<|docstring|>Get selection points<|endoftext|>
96b3619fb0ca2f509a9172c40b3f49be021506a9e9649afabc2086f3f1a16d09
def test_returned_value(self): 'Return GwyPointSelection initiated by points from gwysel\n ' self.from_gwy_parent.return_value = self.points pointer_sel = GwyPointerSelection.from_gwy(self.gwysel) self.assertListEqual(pointer_sel.data, self.points)
Return GwyPointSelection initiated by points from gwysel
tests/test_gwyselection.py
test_returned_value
dmitry-streltsov/gwy-postgresql
1
python
def test_returned_value(self): '\n ' self.from_gwy_parent.return_value = self.points pointer_sel = GwyPointerSelection.from_gwy(self.gwysel) self.assertListEqual(pointer_sel.data, self.points)
def test_returned_value(self): '\n ' self.from_gwy_parent.return_value = self.points pointer_sel = GwyPointerSelection.from_gwy(self.gwysel) self.assertListEqual(pointer_sel.data, self.points)<|docstring|>Return GwyPointSelection initiated by points from gwysel<|endoftext|>
a09c8c966811d4c06a85cfcd2f71af5db3baa0d5858372b2f098310080545ad5
def test_return_None_if_there_are_no_points_in_sel(self): 'Return None if there are no points in the selection\n ' self.from_gwy_parent.return_value = None pointer_sel = GwyPointerSelection.from_gwy(self.gwysel) self.assertIsNone(pointer_sel)
Return None if there are no points in the selection
tests/test_gwyselection.py
test_return_None_if_there_are_no_points_in_sel
dmitry-streltsov/gwy-postgresql
1
python
def test_return_None_if_there_are_no_points_in_sel(self): '\n ' self.from_gwy_parent.return_value = None pointer_sel = GwyPointerSelection.from_gwy(self.gwysel) self.assertIsNone(pointer_sel)
def test_return_None_if_there_are_no_points_in_sel(self): '\n ' self.from_gwy_parent.return_value = None pointer_sel = GwyPointerSelection.from_gwy(self.gwysel) self.assertIsNone(pointer_sel)<|docstring|>Return None if there are no points in the selection<|endoftext|>
df7b2dfb8aef5dc345303dc1c66b93427612867a3cb464c29a6ba8671ec5f07a
def test_return_None_if_data_list_is_empty(self): 'Return None if point selection data list is empty' self.pointersel.data = [] cdata = self.pointersel._cdata self.assertIsNone(cdata)
Return None if point selection data list is empty
tests/test_gwyselection.py
test_return_None_if_data_list_is_empty
dmitry-streltsov/gwy-postgresql
1
python
def test_return_None_if_data_list_is_empty(self): self.pointersel.data = [] cdata = self.pointersel._cdata self.assertIsNone(cdata)
def test_return_None_if_data_list_is_empty(self): self.pointersel.data = [] cdata = self.pointersel._cdata self.assertIsNone(cdata)<|docstring|>Return None if point selection data list is empty<|endoftext|>
4fc08107dd0b292e8f5f1bf7441025c8e333058572afc32d9b30902adb63d61e
def test_return_value_if_data_list_is_not_empty(self): 'Return C array if selection data list is not empty' cdata = self.pointersel._cdata self.assertAlmostEqual(cdata, self.cdata)
Return C array if selection data list is not empty
tests/test_gwyselection.py
test_return_value_if_data_list_is_not_empty
dmitry-streltsov/gwy-postgresql
1
python
def test_return_value_if_data_list_is_not_empty(self): cdata = self.pointersel._cdata self.assertAlmostEqual(cdata, self.cdata)
def test_return_value_if_data_list_is_not_empty(self): cdata = self.pointersel._cdata self.assertAlmostEqual(cdata, self.cdata)<|docstring|>Return C array if selection data list is not empty<|endoftext|>
d17c1f11142b334790cd4c2c11cdee1e9e934a6e1c517726ce8f75ae9653c4e7
def test_arg_is_list_of_point_pairs(self): 'GwyLineSelection.__init__ arg is a list\n ' point_pairs = [((0, 0), (1, 1)), ((2, 2), (3, 3))] line_sel = GwyLineSelection(point_pairs) self.assertListEqual(line_sel.data, point_pairs)
GwyLineSelection.__init__ arg is a list
tests/test_gwyselection.py
test_arg_is_list_of_point_pairs
dmitry-streltsov/gwy-postgresql
1
python
def test_arg_is_list_of_point_pairs(self): '\n ' point_pairs = [((0, 0), (1, 1)), ((2, 2), (3, 3))] line_sel = GwyLineSelection(point_pairs) self.assertListEqual(line_sel.data, point_pairs)
def test_arg_is_list_of_point_pairs(self): '\n ' point_pairs = [((0, 0), (1, 1)), ((2, 2), (3, 3))] line_sel = GwyLineSelection(point_pairs) self.assertListEqual(line_sel.data, point_pairs)<|docstring|>GwyLineSelection.__init__ arg is a list<|endoftext|>
6fd41af945bd549a089ce262f5da244df6b7e0d9e041c05982ac7dc5151d9632
def test_arg_is_tuple_of_points(self): 'GwyLineSelection.__init__ arg is a tuple\n ' point_pairs = (((0, 0), (1, 1)), ((2, 2), (3, 3))) line_sel = GwyLineSelection(point_pairs) self.assertListEqual(line_sel.data, [((0, 0), (1, 1)), ((2, 2), (3, 3))])
GwyLineSelection.__init__ arg is a tuple
tests/test_gwyselection.py
test_arg_is_tuple_of_points
dmitry-streltsov/gwy-postgresql
1
python
def test_arg_is_tuple_of_points(self): '\n ' point_pairs = (((0, 0), (1, 1)), ((2, 2), (3, 3))) line_sel = GwyLineSelection(point_pairs) self.assertListEqual(line_sel.data, [((0, 0), (1, 1)), ((2, 2), (3, 3))])
def test_arg_is_tuple_of_points(self): '\n ' point_pairs = (((0, 0), (1, 1)), ((2, 2), (3, 3))) line_sel = GwyLineSelection(point_pairs) self.assertListEqual(line_sel.data, [((0, 0), (1, 1)), ((2, 2), (3, 3))])<|docstring|>GwyLineSelection.__init__ arg is a tuple<|endoftext|>
b58dcbefa0f5d6544616ebd1d101e979f4cf7722324d9dc69cbcce4bdd249130
def test_arg_is_an_empty_list(self): 'Raise ValueError if GwyLineSelection.__init__ arg is empty\n ' points = [] self.assertRaises(ValueError, GwyLineSelection, points)
Raise ValueError if GwyLineSelection.__init__ arg is empty
tests/test_gwyselection.py
test_arg_is_an_empty_list
dmitry-streltsov/gwy-postgresql
1
python
def test_arg_is_an_empty_list(self): '\n ' points = [] self.assertRaises(ValueError, GwyLineSelection, points)
def test_arg_is_an_empty_list(self): '\n ' points = [] self.assertRaises(ValueError, GwyLineSelection, points)<|docstring|>Raise ValueError if GwyLineSelection.__init__ arg is empty<|endoftext|>
a1e6c3921128236ed36c7d3ce03f3c6531fa5739c830a6c77a455018792a81ae
def test_arg_of_parent_from_gwy_method(self): 'Get selection points\n ' self.from_gwy_parent.return_value = self.points GwyLineSelection.from_gwy(self.gwysel) self.from_gwy_parent.assert_has_calls([call(self.gwysel)])
Get selection points
tests/test_gwyselection.py
test_arg_of_parent_from_gwy_method
dmitry-streltsov/gwy-postgresql
1
python
def test_arg_of_parent_from_gwy_method(self): '\n ' self.from_gwy_parent.return_value = self.points GwyLineSelection.from_gwy(self.gwysel) self.from_gwy_parent.assert_has_calls([call(self.gwysel)])
def test_arg_of_parent_from_gwy_method(self): '\n ' self.from_gwy_parent.return_value = self.points GwyLineSelection.from_gwy(self.gwysel) self.from_gwy_parent.assert_has_calls([call(self.gwysel)])<|docstring|>Get selection points<|endoftext|>
7b84f02b56e98c56b06e26ca73bc5c1cf86fefe8594eec3e82915f84fd3da597
def test_returned_value(self): 'Return GwyLineSelection initiated by point pairs from gwysel\n ' self.from_gwy_parent.return_value = self.points line_sel = GwyLineSelection.from_gwy(self.gwysel) self.assertListEqual(line_sel.data, self.point_pairs)
Return GwyLineSelection initiated by point pairs from gwysel
tests/test_gwyselection.py
test_returned_value
dmitry-streltsov/gwy-postgresql
1
python
def test_returned_value(self): '\n ' self.from_gwy_parent.return_value = self.points line_sel = GwyLineSelection.from_gwy(self.gwysel) self.assertListEqual(line_sel.data, self.point_pairs)
def test_returned_value(self): '\n ' self.from_gwy_parent.return_value = self.points line_sel = GwyLineSelection.from_gwy(self.gwysel) self.assertListEqual(line_sel.data, self.point_pairs)<|docstring|>Return GwyLineSelection initiated by point pairs from gwysel<|endoftext|>
2962418e6725f3b9d8d09a8e5d73535460d9d94efc645de5e334aacd7db59b3e
def test_return_None_if_there_are_no_points_in_sel(self): 'Return None if there are no points in the selection\n ' self.from_gwy_parent.return_value = None line_sel = GwyLineSelection.from_gwy(self.gwysel) self.assertIsNone(line_sel)
Return None if there are no points in the selection
tests/test_gwyselection.py
test_return_None_if_there_are_no_points_in_sel
dmitry-streltsov/gwy-postgresql
1
python
def test_return_None_if_there_are_no_points_in_sel(self): '\n ' self.from_gwy_parent.return_value = None line_sel = GwyLineSelection.from_gwy(self.gwysel) self.assertIsNone(line_sel)
def test_return_None_if_there_are_no_points_in_sel(self): '\n ' self.from_gwy_parent.return_value = None line_sel = GwyLineSelection.from_gwy(self.gwysel) self.assertIsNone(line_sel)<|docstring|>Return None if there are no points in the selection<|endoftext|>
2145c530f521832570708d0621e6247aaaf74330598eab90ad4ada8db3dc4473
def test_return_None_if_data_list_is_empty(self): 'Return None if line selection data list is empty' self.linesel.data = [] cdata = self.linesel._cdata self.assertIsNone(cdata)
Return None if line selection data list is empty
tests/test_gwyselection.py
test_return_None_if_data_list_is_empty
dmitry-streltsov/gwy-postgresql
1
python
def test_return_None_if_data_list_is_empty(self): self.linesel.data = [] cdata = self.linesel._cdata self.assertIsNone(cdata)
def test_return_None_if_data_list_is_empty(self): self.linesel.data = [] cdata = self.linesel._cdata self.assertIsNone(cdata)<|docstring|>Return None if line selection data list is empty<|endoftext|>
a72b8e3d975b7dd16577a6bb548f32b4817afefa5d9b2bd8408cbbcaa455b806
def test_return_value_if_data_list_is_not_empty(self): 'Return C array if selection data list is not empty' cdata = self.linesel._cdata self.assertAlmostEqual(cdata, self.cdata)
Return C array if selection data list is not empty
tests/test_gwyselection.py
test_return_value_if_data_list_is_not_empty
dmitry-streltsov/gwy-postgresql
1
python
def test_return_value_if_data_list_is_not_empty(self): cdata = self.linesel._cdata self.assertAlmostEqual(cdata, self.cdata)
def test_return_value_if_data_list_is_not_empty(self): cdata = self.linesel._cdata self.assertAlmostEqual(cdata, self.cdata)<|docstring|>Return C array if selection data list is not empty<|endoftext|>
cc71aa81b7e3ad0c62459ea30626185aa02c9bcb4fd15a2bd4a6bfe2732a4ab3
def test_arg_is_list_of_point_pairs(self): 'GwyRectangleSelections.__init__ arg is a list\n ' point_pairs = [((0, 0), (1, 1)), ((2, 2), (3, 3))] rectangle_sel = GwyRectangleSelection(point_pairs) self.assertListEqual(rectangle_sel.data, point_pairs)
GwyRectangleSelections.__init__ arg is a list
tests/test_gwyselection.py
test_arg_is_list_of_point_pairs
dmitry-streltsov/gwy-postgresql
1
python
def test_arg_is_list_of_point_pairs(self): '\n ' point_pairs = [((0, 0), (1, 1)), ((2, 2), (3, 3))] rectangle_sel = GwyRectangleSelection(point_pairs) self.assertListEqual(rectangle_sel.data, point_pairs)
def test_arg_is_list_of_point_pairs(self): '\n ' point_pairs = [((0, 0), (1, 1)), ((2, 2), (3, 3))] rectangle_sel = GwyRectangleSelection(point_pairs) self.assertListEqual(rectangle_sel.data, point_pairs)<|docstring|>GwyRectangleSelections.__init__ arg is a list<|endoftext|>
b80424f4be86cd6d1d888942d074ed5f799078b26bdbdff55db0f7831a823c67
def test_arg_is_tuple_of_points(self): 'GwyRectangleSelection.__init__ arg is a tuple\n ' point_pairs = (((0, 0), (1, 1)), ((2, 2), (3, 3))) rectangle_sel = GwyRectangleSelection(point_pairs) self.assertListEqual(rectangle_sel.data, [((0, 0), (1, 1)), ((2, 2), (3, 3))])
GwyRectangleSelection.__init__ arg is a tuple
tests/test_gwyselection.py
test_arg_is_tuple_of_points
dmitry-streltsov/gwy-postgresql
1
python
def test_arg_is_tuple_of_points(self): '\n ' point_pairs = (((0, 0), (1, 1)), ((2, 2), (3, 3))) rectangle_sel = GwyRectangleSelection(point_pairs) self.assertListEqual(rectangle_sel.data, [((0, 0), (1, 1)), ((2, 2), (3, 3))])
def test_arg_is_tuple_of_points(self): '\n ' point_pairs = (((0, 0), (1, 1)), ((2, 2), (3, 3))) rectangle_sel = GwyRectangleSelection(point_pairs) self.assertListEqual(rectangle_sel.data, [((0, 0), (1, 1)), ((2, 2), (3, 3))])<|docstring|>GwyRectangleSelection.__init__ arg is a tuple<|endoftext|>
350da571712bf9d925a2565fee8a8813f8c7df4b85312fcd5517a1f932287b4a
def test_arg_is_an_empty_list(self): 'Raise ValueError if GwyRectangleSelection.__init__ arg is empty\n ' points = [] self.assertRaises(ValueError, GwyRectangleSelection, points)
Raise ValueError if GwyRectangleSelection.__init__ arg is empty
tests/test_gwyselection.py
test_arg_is_an_empty_list
dmitry-streltsov/gwy-postgresql
1
python
def test_arg_is_an_empty_list(self): '\n ' points = [] self.assertRaises(ValueError, GwyRectangleSelection, points)
def test_arg_is_an_empty_list(self): '\n ' points = [] self.assertRaises(ValueError, GwyRectangleSelection, points)<|docstring|>Raise ValueError if GwyRectangleSelection.__init__ arg is empty<|endoftext|>
795e240447e30c51de151ef7cd79cb5a28bbeda0acd78c1de02079b29620cbd0
def test_arg_of_parent_from_gwy_method(self): 'Get selection points\n ' self.from_gwy_parent.return_value = self.points GwyRectangleSelection.from_gwy(self.gwysel) self.from_gwy_parent.assert_has_calls([call(self.gwysel)])
Get selection points
tests/test_gwyselection.py
test_arg_of_parent_from_gwy_method
dmitry-streltsov/gwy-postgresql
1
python
def test_arg_of_parent_from_gwy_method(self): '\n ' self.from_gwy_parent.return_value = self.points GwyRectangleSelection.from_gwy(self.gwysel) self.from_gwy_parent.assert_has_calls([call(self.gwysel)])
def test_arg_of_parent_from_gwy_method(self): '\n ' self.from_gwy_parent.return_value = self.points GwyRectangleSelection.from_gwy(self.gwysel) self.from_gwy_parent.assert_has_calls([call(self.gwysel)])<|docstring|>Get selection points<|endoftext|>
0aed2448c1569ae1473c5144ffcf4226542ae1ae0a916f593d969e99608f3a18
def test_returned_value(self): 'Return GwyRectangleSelection initiated by point pairs from gwysel\n ' self.from_gwy_parent.return_value = self.points rectangle_sel = GwyRectangleSelection.from_gwy(self.gwysel) self.assertListEqual(rectangle_sel.data, self.point_pairs)
Return GwyRectangleSelection initiated by point pairs from gwysel
tests/test_gwyselection.py
test_returned_value
dmitry-streltsov/gwy-postgresql
1
python
def test_returned_value(self): '\n ' self.from_gwy_parent.return_value = self.points rectangle_sel = GwyRectangleSelection.from_gwy(self.gwysel) self.assertListEqual(rectangle_sel.data, self.point_pairs)
def test_returned_value(self): '\n ' self.from_gwy_parent.return_value = self.points rectangle_sel = GwyRectangleSelection.from_gwy(self.gwysel) self.assertListEqual(rectangle_sel.data, self.point_pairs)<|docstring|>Return GwyRectangleSelection initiated by point pairs from gwysel<|endoftext|>
35bfc811e825b9793306493bd2eb04f85a698d465a1d06a3d8d76e291ae95a5c
def test_return_None_if_there_are_no_points_in_sel(self): 'Return None if there are no points in the selection\n ' self.from_gwy_parent.return_value = None rectangle_sel = GwyRectangleSelection.from_gwy(self.gwysel) self.assertIsNone(rectangle_sel)
Return None if there are no points in the selection
tests/test_gwyselection.py
test_return_None_if_there_are_no_points_in_sel
dmitry-streltsov/gwy-postgresql
1
python
def test_return_None_if_there_are_no_points_in_sel(self): '\n ' self.from_gwy_parent.return_value = None rectangle_sel = GwyRectangleSelection.from_gwy(self.gwysel) self.assertIsNone(rectangle_sel)
def test_return_None_if_there_are_no_points_in_sel(self): '\n ' self.from_gwy_parent.return_value = None rectangle_sel = GwyRectangleSelection.from_gwy(self.gwysel) self.assertIsNone(rectangle_sel)<|docstring|>Return None if there are no points in the selection<|endoftext|>
2eae6488889ce823e417016f9b3d2a6bbd4d65755303c599234606f65f044d5e
def test_return_None_if_data_list_is_empty(self): 'Return None if rectangle selection data list is empty' self.rectanglesel.data = [] cdata = self.rectanglesel._cdata self.assertIsNone(cdata)
Return None if rectangle selection data list is empty
tests/test_gwyselection.py
test_return_None_if_data_list_is_empty
dmitry-streltsov/gwy-postgresql
1
python
def test_return_None_if_data_list_is_empty(self): self.rectanglesel.data = [] cdata = self.rectanglesel._cdata self.assertIsNone(cdata)
def test_return_None_if_data_list_is_empty(self): self.rectanglesel.data = [] cdata = self.rectanglesel._cdata self.assertIsNone(cdata)<|docstring|>Return None if rectangle selection data list is empty<|endoftext|>
d45264650ec938d904dd413aa9da288c3cdc8d4e537cf56c9bd7490e8b842c0d
def test_return_value_if_data_list_is_not_empty(self): 'Return C array if selection data list is not empty' cdata = self.rectanglesel._cdata self.assertAlmostEqual(cdata, self.cdata)
Return C array if selection data list is not empty
tests/test_gwyselection.py
test_return_value_if_data_list_is_not_empty
dmitry-streltsov/gwy-postgresql
1
python
def test_return_value_if_data_list_is_not_empty(self): cdata = self.rectanglesel._cdata self.assertAlmostEqual(cdata, self.cdata)
def test_return_value_if_data_list_is_not_empty(self): cdata = self.rectanglesel._cdata self.assertAlmostEqual(cdata, self.cdata)<|docstring|>Return C array if selection data list is not empty<|endoftext|>
2af6f78ff754b86e3cda949c8faa74b085b47e3ffc75692a5db67537ce1322f0
def test_arg_is_list_of_point_pairs(self): 'GwyEllipseSelections.__init__ arg is a list\n ' point_pairs = [((0, 0), (1, 1)), ((2, 2), (3, 3))] ellipse_sel = GwyEllipseSelection(point_pairs) self.assertListEqual(ellipse_sel.data, point_pairs)
GwyEllipseSelections.__init__ arg is a list
tests/test_gwyselection.py
test_arg_is_list_of_point_pairs
dmitry-streltsov/gwy-postgresql
1
python
def test_arg_is_list_of_point_pairs(self): '\n ' point_pairs = [((0, 0), (1, 1)), ((2, 2), (3, 3))] ellipse_sel = GwyEllipseSelection(point_pairs) self.assertListEqual(ellipse_sel.data, point_pairs)
def test_arg_is_list_of_point_pairs(self): '\n ' point_pairs = [((0, 0), (1, 1)), ((2, 2), (3, 3))] ellipse_sel = GwyEllipseSelection(point_pairs) self.assertListEqual(ellipse_sel.data, point_pairs)<|docstring|>GwyEllipseSelections.__init__ arg is a list<|endoftext|>
9cc3ff759f57e60b3c30cd8299d16419c252cb2b7e07eb895ad0fa2ca4d47cd9
def test_arg_is_tuple_of_points(self): 'GwyEllipseSelections.__init__ arg is a tuple\n ' point_pairs = (((0, 0), (1, 1)), ((2, 2), (3, 3))) ellipse_sel = GwyEllipseSelection(point_pairs) self.assertListEqual(ellipse_sel.data, [((0, 0), (1, 1)), ((2, 2), (3, 3))])
GwyEllipseSelections.__init__ arg is a tuple
tests/test_gwyselection.py
test_arg_is_tuple_of_points
dmitry-streltsov/gwy-postgresql
1
python
def test_arg_is_tuple_of_points(self): '\n ' point_pairs = (((0, 0), (1, 1)), ((2, 2), (3, 3))) ellipse_sel = GwyEllipseSelection(point_pairs) self.assertListEqual(ellipse_sel.data, [((0, 0), (1, 1)), ((2, 2), (3, 3))])
def test_arg_is_tuple_of_points(self): '\n ' point_pairs = (((0, 0), (1, 1)), ((2, 2), (3, 3))) ellipse_sel = GwyEllipseSelection(point_pairs) self.assertListEqual(ellipse_sel.data, [((0, 0), (1, 1)), ((2, 2), (3, 3))])<|docstring|>GwyEllipseSelections.__init__ arg is a tuple<|endoftext|>
75071974a3040f274a97c157f5926c4d96944fc4e3d6bd0ee463404d6d53ecbb
def test_arg_is_an_empty_list(self): 'Raise ValueError if GwyEllipseSelection.__init__ arg is empty\n ' points = [] self.assertRaises(ValueError, GwyEllipseSelection, points)
Raise ValueError if GwyEllipseSelection.__init__ arg is empty
tests/test_gwyselection.py
test_arg_is_an_empty_list
dmitry-streltsov/gwy-postgresql
1
python
def test_arg_is_an_empty_list(self): '\n ' points = [] self.assertRaises(ValueError, GwyEllipseSelection, points)
def test_arg_is_an_empty_list(self): '\n ' points = [] self.assertRaises(ValueError, GwyEllipseSelection, points)<|docstring|>Raise ValueError if GwyEllipseSelection.__init__ arg is empty<|endoftext|>
e420e4219e16ee56c27788fe36bc39530783e8b7959fdf31bd3266475ad77513
def test_arg_of_parent_from_gwy_method(self): 'Get selection points\n ' self.from_gwy_parent.return_value = self.points GwyEllipseSelection.from_gwy(self.gwysel) self.from_gwy_parent.assert_has_calls([call(self.gwysel)])
Get selection points
tests/test_gwyselection.py
test_arg_of_parent_from_gwy_method
dmitry-streltsov/gwy-postgresql
1
python
def test_arg_of_parent_from_gwy_method(self): '\n ' self.from_gwy_parent.return_value = self.points GwyEllipseSelection.from_gwy(self.gwysel) self.from_gwy_parent.assert_has_calls([call(self.gwysel)])
def test_arg_of_parent_from_gwy_method(self): '\n ' self.from_gwy_parent.return_value = self.points GwyEllipseSelection.from_gwy(self.gwysel) self.from_gwy_parent.assert_has_calls([call(self.gwysel)])<|docstring|>Get selection points<|endoftext|>
9a38d9d24a3ec95f18c8f894a113d15637f4c90ed9dfb4847d70efaa3d76f05c
def test_returned_value(self): 'Return GwyEllipseSelections initiated by point pairs from gwysel\n ' self.from_gwy_parent.return_value = self.points ellipse_sel = GwyEllipseSelection.from_gwy(self.gwysel) self.assertListEqual(ellipse_sel.data, self.point_pairs)
Return GwyEllipseSelections initiated by point pairs from gwysel
tests/test_gwyselection.py
test_returned_value
dmitry-streltsov/gwy-postgresql
1
python
def test_returned_value(self): '\n ' self.from_gwy_parent.return_value = self.points ellipse_sel = GwyEllipseSelection.from_gwy(self.gwysel) self.assertListEqual(ellipse_sel.data, self.point_pairs)
def test_returned_value(self): '\n ' self.from_gwy_parent.return_value = self.points ellipse_sel = GwyEllipseSelection.from_gwy(self.gwysel) self.assertListEqual(ellipse_sel.data, self.point_pairs)<|docstring|>Return GwyEllipseSelections initiated by point pairs from gwysel<|endoftext|>
6b011a521666dde3badcbcea7fceb06ced9c34f0c308682a0966beeb610c9ecc
def test_return_None_if_there_are_no_points_in_sel(self): 'Return None if there are no points in the selection\n ' self.from_gwy_parent.return_value = None ellipse_sel = GwyEllipseSelection.from_gwy(self.gwysel) self.assertIsNone(ellipse_sel)
Return None if there are no points in the selection
tests/test_gwyselection.py
test_return_None_if_there_are_no_points_in_sel
dmitry-streltsov/gwy-postgresql
1
python
def test_return_None_if_there_are_no_points_in_sel(self): '\n ' self.from_gwy_parent.return_value = None ellipse_sel = GwyEllipseSelection.from_gwy(self.gwysel) self.assertIsNone(ellipse_sel)
def test_return_None_if_there_are_no_points_in_sel(self): '\n ' self.from_gwy_parent.return_value = None ellipse_sel = GwyEllipseSelection.from_gwy(self.gwysel) self.assertIsNone(ellipse_sel)<|docstring|>Return None if there are no points in the selection<|endoftext|>
523d5ac72486e035d5fea875f2e5716df7c61f6a8f76cefc28742685379e6b37
def test_return_None_if_data_list_is_empty(self): 'Return None if ellipse selection data list is empty' self.ellipsesel.data = [] cdata = self.ellipsesel._cdata self.assertIsNone(cdata)
Return None if ellipse selection data list is empty
tests/test_gwyselection.py
test_return_None_if_data_list_is_empty
dmitry-streltsov/gwy-postgresql
1
python
def test_return_None_if_data_list_is_empty(self): self.ellipsesel.data = [] cdata = self.ellipsesel._cdata self.assertIsNone(cdata)
def test_return_None_if_data_list_is_empty(self): self.ellipsesel.data = [] cdata = self.ellipsesel._cdata self.assertIsNone(cdata)<|docstring|>Return None if ellipse selection data list is empty<|endoftext|>
93556d7d4f34f86a2b0922bd425473ec5844b44c4d4e172738ac52ee25e07198
def test_return_value_if_data_list_is_not_empty(self): 'Return C array if selection data list is not empty' cdata = self.ellipsesel._cdata self.assertAlmostEqual(cdata, self.cdata)
Return C array if selection data list is not empty
tests/test_gwyselection.py
test_return_value_if_data_list_is_not_empty
dmitry-streltsov/gwy-postgresql
1
python
def test_return_value_if_data_list_is_not_empty(self): cdata = self.ellipsesel._cdata self.assertAlmostEqual(cdata, self.cdata)
def test_return_value_if_data_list_is_not_empty(self): cdata = self.ellipsesel._cdata self.assertAlmostEqual(cdata, self.cdata)<|docstring|>Return C array if selection data list is not empty<|endoftext|>
f74f1d6ceacc554aad94d2d5331b4948af76a1840235657aa7ebae82a94349c7
@commands.Cog.listener() async def on_ready(self) -> None: ' Tells when the cog is ready to go. ' print('Duolingo cog is online!')
Tells when the cog is ready to go.
cogs/duolingo.py
on_ready
yagomichalak/sloth-bot
21
python
@commands.Cog.listener() async def on_ready(self) -> None: ' ' print('Duolingo cog is online!')
@commands.Cog.listener() async def on_ready(self) -> None: ' ' print('Duolingo cog is online!')<|docstring|>Tells when the cog is ready to go.<|endoftext|>
bd046735b287125b6cb94c253b21281b6c17232d92daa188d0d6d1b3d81eb7a8
@commands.command(aliases=['set_duolingo', 'set_owl', 'setduo', 'setduolingo']) @Player.poisoned() @commands.cooldown(1, 10, commands.BucketType.user) async def set_duo(self, ctx, *, duo_name: str=None) -> None: " Sets a Duolingo account to your Discord account.\n :param duo_name: Your Duolingo's username. "...
Sets a Duolingo account to your Discord account. :param duo_name: Your Duolingo's username.
cogs/duolingo.py
set_duo
yagomichalak/sloth-bot
21
python
@commands.command(aliases=['set_duolingo', 'set_owl', 'setduo', 'setduolingo']) @Player.poisoned() @commands.cooldown(1, 10, commands.BucketType.user) async def set_duo(self, ctx, *, duo_name: str=None) -> None: " Sets a Duolingo account to your Discord account.\n :param duo_name: Your Duolingo's username. "...
@commands.command(aliases=['set_duolingo', 'set_owl', 'setduo', 'setduolingo']) @Player.poisoned() @commands.cooldown(1, 10, commands.BucketType.user) async def set_duo(self, ctx, *, duo_name: str=None) -> None: " Sets a Duolingo account to your Discord account.\n :param duo_name: Your Duolingo's username. "...
2c4428990fcd37cfccde445c23f19b8751ec996e31208c9f513cd0cd4f9f8645
@commands.command(aliases=['update_duolingo', 'update_owl', 'updateduo', 'updateduolingo']) @Player.poisoned() @commands.cooldown(1, 10, commands.BucketType.user) async def update_duo(self, ctx, *, duo_name: str=None) -> None: " Updates a Duolingo account to your Discord account.\n :param duo_name: Your new ...
Updates a Duolingo account to your Discord account. :param duo_name: Your new Duolingo's username.
cogs/duolingo.py
update_duo
yagomichalak/sloth-bot
21
python
@commands.command(aliases=['update_duolingo', 'update_owl', 'updateduo', 'updateduolingo']) @Player.poisoned() @commands.cooldown(1, 10, commands.BucketType.user) async def update_duo(self, ctx, *, duo_name: str=None) -> None: " Updates a Duolingo account to your Discord account.\n :param duo_name: Your new ...
@commands.command(aliases=['update_duolingo', 'update_owl', 'updateduo', 'updateduolingo']) @Player.poisoned() @commands.cooldown(1, 10, commands.BucketType.user) async def update_duo(self, ctx, *, duo_name: str=None) -> None: " Updates a Duolingo account to your Discord account.\n :param duo_name: Your new ...
eb80acb048112d9cd19ee75bf579129dd2636fb2d821ad54838d7d1628c6adba
@commands.command(aliases=['delete_duolingo', 'delete_owl', 'deleteduo', 'deleteduolingo']) @Player.poisoned() @commands.cooldown(1, 10, commands.BucketType.user) async def delete_duo(self, ctx) -> None: ' Deletes a Duolingo account from your Discord account. ' member = ctx.author if (not (duo_profile := (a...
Deletes a Duolingo account from your Discord account.
cogs/duolingo.py
delete_duo
yagomichalak/sloth-bot
21
python
@commands.command(aliases=['delete_duolingo', 'delete_owl', 'deleteduo', 'deleteduolingo']) @Player.poisoned() @commands.cooldown(1, 10, commands.BucketType.user) async def delete_duo(self, ctx) -> None: ' ' member = ctx.author if (not (duo_profile := (await self.get_duo_profile(member.id)))): retu...
@commands.command(aliases=['delete_duolingo', 'delete_owl', 'deleteduo', 'deleteduolingo']) @Player.poisoned() @commands.cooldown(1, 10, commands.BucketType.user) async def delete_duo(self, ctx) -> None: ' ' member = ctx.author if (not (duo_profile := (await self.get_duo_profile(member.id)))): retu...
01f8a39821dea6355b70555c38910fa921158f67290071a7badb313b65f6e559
@commands.command(aliases=['duo', 'duo_me']) @Player.poisoned() @commands.cooldown(1, 10, commands.BucketType.user) async def duome(self, ctx, *, member: Optional[discord.Member]=None) -> None: " Gets the user's Duolingo profile.\n :param member: The member to look for. [Optional]\n\n PS: If member no...
Gets the user's Duolingo profile. :param member: The member to look for. [Optional] PS: If member not informed, it'll look for your profile.
cogs/duolingo.py
duome
yagomichalak/sloth-bot
21
python
@commands.command(aliases=['duo', 'duo_me']) @Player.poisoned() @commands.cooldown(1, 10, commands.BucketType.user) async def duome(self, ctx, *, member: Optional[discord.Member]=None) -> None: " Gets the user's Duolingo profile.\n :param member: The member to look for. [Optional]\n\n PS: If member no...
@commands.command(aliases=['duo', 'duo_me']) @Player.poisoned() @commands.cooldown(1, 10, commands.BucketType.user) async def duome(self, ctx, *, member: Optional[discord.Member]=None) -> None: " Gets the user's Duolingo profile.\n :param member: The member to look for. [Optional]\n\n PS: If member no...
d5c0cd57f8d783779658deffa00f5908cda70dda2e4082ff453e621bd916b38a
async def get_flag(self, language: str) -> str: ' Gets a language flag emoji.\n :param language: The language to get a flag for. ' flags = {} with open('./extra/random/json/flag_emojis.json', 'r', encoding='utf-8') as f: flags = json.loads(f.read()) if (emoji := flags.get(language.lower()...
Gets a language flag emoji. :param language: The language to get a flag for.
cogs/duolingo.py
get_flag
yagomichalak/sloth-bot
21
python
async def get_flag(self, language: str) -> str: ' Gets a language flag emoji.\n :param language: The language to get a flag for. ' flags = {} with open('./extra/random/json/flag_emojis.json', 'r', encoding='utf-8') as f: flags = json.loads(f.read()) if (emoji := flags.get(language.lower()...
async def get_flag(self, language: str) -> str: ' Gets a language flag emoji.\n :param language: The language to get a flag for. ' flags = {} with open('./extra/random/json/flag_emojis.json', 'r', encoding='utf-8') as f: flags = json.loads(f.read()) if (emoji := flags.get(language.lower()...