repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
mitsei/dlkit
dlkit/services/assessment.py
Bank.save_assessment_offered
def save_assessment_offered(self, assessment_offered_form, *args, **kwargs): """Pass through to provider AssessmentOfferedAdminSession.update_assessment_offered""" # Implemented from kitosid template for - # osid.resource.ResourceAdminSession.update_resource if assessment_offered_form.is...
python
def save_assessment_offered(self, assessment_offered_form, *args, **kwargs): """Pass through to provider AssessmentOfferedAdminSession.update_assessment_offered""" # Implemented from kitosid template for - # osid.resource.ResourceAdminSession.update_resource if assessment_offered_form.is...
[ "def", "save_assessment_offered", "(", "self", ",", "assessment_offered_form", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# Implemented from kitosid template for -", "# osid.resource.ResourceAdminSession.update_resource", "if", "assessment_offered_form", ".", "is_f...
Pass through to provider AssessmentOfferedAdminSession.update_assessment_offered
[ "Pass", "through", "to", "provider", "AssessmentOfferedAdminSession", ".", "update_assessment_offered" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/assessment.py#L3188-L3195
mitsei/dlkit
dlkit/services/assessment.py
Bank.use_comparative_assessment_taken_view
def use_comparative_assessment_taken_view(self): """Pass through to provider AssessmentTakenLookupSession.use_comparative_assessment_taken_view""" self._object_views['assessment_taken'] = COMPARATIVE # self._get_provider_session('assessment_taken_lookup_session') # To make sure the session is tr...
python
def use_comparative_assessment_taken_view(self): """Pass through to provider AssessmentTakenLookupSession.use_comparative_assessment_taken_view""" self._object_views['assessment_taken'] = COMPARATIVE # self._get_provider_session('assessment_taken_lookup_session') # To make sure the session is tr...
[ "def", "use_comparative_assessment_taken_view", "(", "self", ")", ":", "self", ".", "_object_views", "[", "'assessment_taken'", "]", "=", "COMPARATIVE", "# self._get_provider_session('assessment_taken_lookup_session') # To make sure the session is tracked", "for", "session", "in", ...
Pass through to provider AssessmentTakenLookupSession.use_comparative_assessment_taken_view
[ "Pass", "through", "to", "provider", "AssessmentTakenLookupSession", ".", "use_comparative_assessment_taken_view" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/assessment.py#L3229-L3237
mitsei/dlkit
dlkit/services/assessment.py
Bank.use_plenary_assessment_taken_view
def use_plenary_assessment_taken_view(self): """Pass through to provider AssessmentTakenLookupSession.use_plenary_assessment_taken_view""" self._object_views['assessment_taken'] = PLENARY # self._get_provider_session('assessment_taken_lookup_session') # To make sure the session is tracked ...
python
def use_plenary_assessment_taken_view(self): """Pass through to provider AssessmentTakenLookupSession.use_plenary_assessment_taken_view""" self._object_views['assessment_taken'] = PLENARY # self._get_provider_session('assessment_taken_lookup_session') # To make sure the session is tracked ...
[ "def", "use_plenary_assessment_taken_view", "(", "self", ")", ":", "self", ".", "_object_views", "[", "'assessment_taken'", "]", "=", "PLENARY", "# self._get_provider_session('assessment_taken_lookup_session') # To make sure the session is tracked", "for", "session", "in", "self"...
Pass through to provider AssessmentTakenLookupSession.use_plenary_assessment_taken_view
[ "Pass", "through", "to", "provider", "AssessmentTakenLookupSession", ".", "use_plenary_assessment_taken_view" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/assessment.py#L3239-L3247
mitsei/dlkit
dlkit/services/assessment.py
Bank.get_assessment_taken_form
def get_assessment_taken_form(self, *args, **kwargs): """Pass through to provider AssessmentTakenAdminSession.get_assessment_taken_form_for_update""" # Implemented from kitosid template for - # osid.resource.ResourceAdminSession.get_resource_form_for_update # This method might be a bit s...
python
def get_assessment_taken_form(self, *args, **kwargs): """Pass through to provider AssessmentTakenAdminSession.get_assessment_taken_form_for_update""" # Implemented from kitosid template for - # osid.resource.ResourceAdminSession.get_resource_form_for_update # This method might be a bit s...
[ "def", "get_assessment_taken_form", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# Implemented from kitosid template for -", "# osid.resource.ResourceAdminSession.get_resource_form_for_update", "# This method might be a bit sketchy. Time will tell.", "if", "is...
Pass through to provider AssessmentTakenAdminSession.get_assessment_taken_form_for_update
[ "Pass", "through", "to", "provider", "AssessmentTakenAdminSession", ".", "get_assessment_taken_form_for_update" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/assessment.py#L3395-L3403
mitsei/dlkit
dlkit/services/assessment.py
Bank.save_assessment_taken
def save_assessment_taken(self, assessment_taken_form, *args, **kwargs): """Pass through to provider AssessmentTakenAdminSession.update_assessment_taken""" # Implemented from kitosid template for - # osid.resource.ResourceAdminSession.update_resource if assessment_taken_form.is_for_updat...
python
def save_assessment_taken(self, assessment_taken_form, *args, **kwargs): """Pass through to provider AssessmentTakenAdminSession.update_assessment_taken""" # Implemented from kitosid template for - # osid.resource.ResourceAdminSession.update_resource if assessment_taken_form.is_for_updat...
[ "def", "save_assessment_taken", "(", "self", ",", "assessment_taken_form", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# Implemented from kitosid template for -", "# osid.resource.ResourceAdminSession.update_resource", "if", "assessment_taken_form", ".", "is_for_upd...
Pass through to provider AssessmentTakenAdminSession.update_assessment_taken
[ "Pass", "through", "to", "provider", "AssessmentTakenAdminSession", ".", "update_assessment_taken" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/assessment.py#L3417-L3424
mitsei/dlkit
dlkit/services/assessment.py
Bank.use_comparative_assessment_part_view
def use_comparative_assessment_part_view(self): """Pass through to provider AssessmentPartLookupSession.use_comparative_assessment_part_view""" self._object_views['assessment_part'] = COMPARATIVE # self._get_provider_session('assessment_part_lookup_session') # To make sure the session is tracked...
python
def use_comparative_assessment_part_view(self): """Pass through to provider AssessmentPartLookupSession.use_comparative_assessment_part_view""" self._object_views['assessment_part'] = COMPARATIVE # self._get_provider_session('assessment_part_lookup_session') # To make sure the session is tracked...
[ "def", "use_comparative_assessment_part_view", "(", "self", ")", ":", "self", ".", "_object_views", "[", "'assessment_part'", "]", "=", "COMPARATIVE", "# self._get_provider_session('assessment_part_lookup_session') # To make sure the session is tracked", "for", "session", "in", "...
Pass through to provider AssessmentPartLookupSession.use_comparative_assessment_part_view
[ "Pass", "through", "to", "provider", "AssessmentPartLookupSession", ".", "use_comparative_assessment_part_view" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/assessment.py#L3457-L3465
mitsei/dlkit
dlkit/services/assessment.py
Bank.use_plenary_assessment_part_view
def use_plenary_assessment_part_view(self): """Pass through to provider AssessmentPartLookupSession.use_plenary_assessment_part_view""" self._object_views['assessment_part'] = PLENARY # self._get_provider_session('assessment_part_lookup_session') # To make sure the session is tracked for...
python
def use_plenary_assessment_part_view(self): """Pass through to provider AssessmentPartLookupSession.use_plenary_assessment_part_view""" self._object_views['assessment_part'] = PLENARY # self._get_provider_session('assessment_part_lookup_session') # To make sure the session is tracked for...
[ "def", "use_plenary_assessment_part_view", "(", "self", ")", ":", "self", ".", "_object_views", "[", "'assessment_part'", "]", "=", "PLENARY", "# self._get_provider_session('assessment_part_lookup_session') # To make sure the session is tracked", "for", "session", "in", "self", ...
Pass through to provider AssessmentPartLookupSession.use_plenary_assessment_part_view
[ "Pass", "through", "to", "provider", "AssessmentPartLookupSession", ".", "use_plenary_assessment_part_view" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/assessment.py#L3467-L3475
mitsei/dlkit
dlkit/services/assessment.py
Bank.use_active_assessment_part_view
def use_active_assessment_part_view(self): """Pass through to provider AssessmentPartLookupSession.use_active_assessment_part_view""" self._operable_views['assessment_part'] = ACTIVE # self._get_provider_session('assessment_part_lookup_session') # To make sure the session is tracked for...
python
def use_active_assessment_part_view(self): """Pass through to provider AssessmentPartLookupSession.use_active_assessment_part_view""" self._operable_views['assessment_part'] = ACTIVE # self._get_provider_session('assessment_part_lookup_session') # To make sure the session is tracked for...
[ "def", "use_active_assessment_part_view", "(", "self", ")", ":", "self", ".", "_operable_views", "[", "'assessment_part'", "]", "=", "ACTIVE", "# self._get_provider_session('assessment_part_lookup_session') # To make sure the session is tracked", "for", "session", "in", "self", ...
Pass through to provider AssessmentPartLookupSession.use_active_assessment_part_view
[ "Pass", "through", "to", "provider", "AssessmentPartLookupSession", ".", "use_active_assessment_part_view" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/assessment.py#L3477-L3485
mitsei/dlkit
dlkit/services/assessment.py
Bank.use_any_status_assessment_part_view
def use_any_status_assessment_part_view(self): """Pass through to provider AssessmentPartLookupSession.use_any_status_assessment_part_view""" self._operable_views['assessment_part'] = ANY_STATUS # self._get_provider_session('assessment_part_lookup_session') # To make sure the session is tracked...
python
def use_any_status_assessment_part_view(self): """Pass through to provider AssessmentPartLookupSession.use_any_status_assessment_part_view""" self._operable_views['assessment_part'] = ANY_STATUS # self._get_provider_session('assessment_part_lookup_session') # To make sure the session is tracked...
[ "def", "use_any_status_assessment_part_view", "(", "self", ")", ":", "self", ".", "_operable_views", "[", "'assessment_part'", "]", "=", "ANY_STATUS", "# self._get_provider_session('assessment_part_lookup_session') # To make sure the session is tracked", "for", "session", "in", ...
Pass through to provider AssessmentPartLookupSession.use_any_status_assessment_part_view
[ "Pass", "through", "to", "provider", "AssessmentPartLookupSession", ".", "use_any_status_assessment_part_view" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/assessment.py#L3487-L3495
mitsei/dlkit
dlkit/services/assessment.py
Bank.use_sequestered_assessment_part_view
def use_sequestered_assessment_part_view(self): """Pass through to provider AssessmentPartLookupSession.use_sequestered_assessment_part_view""" # Does this need to be re-implemented to match the other non-sub-package view setters? self._containable_views['assessment_part'] = SEQUESTERED ...
python
def use_sequestered_assessment_part_view(self): """Pass through to provider AssessmentPartLookupSession.use_sequestered_assessment_part_view""" # Does this need to be re-implemented to match the other non-sub-package view setters? self._containable_views['assessment_part'] = SEQUESTERED ...
[ "def", "use_sequestered_assessment_part_view", "(", "self", ")", ":", "# Does this need to be re-implemented to match the other non-sub-package view setters?", "self", ".", "_containable_views", "[", "'assessment_part'", "]", "=", "SEQUESTERED", "self", ".", "_get_sub_package_provi...
Pass through to provider AssessmentPartLookupSession.use_sequestered_assessment_part_view
[ "Pass", "through", "to", "provider", "AssessmentPartLookupSession", ".", "use_sequestered_assessment_part_view" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/assessment.py#L3497-L3508
mitsei/dlkit
dlkit/services/assessment.py
Bank.use_unsequestered_assessment_part_view
def use_unsequestered_assessment_part_view(self): """Pass through to provider AssessmentPartLookupSession.use_unsequestered_assessment_part_view""" # Does this need to be re-implemented to match the other non-sub-package view setters? self._containable_views['assessment_part'] = UNSEQUESTERED ...
python
def use_unsequestered_assessment_part_view(self): """Pass through to provider AssessmentPartLookupSession.use_unsequestered_assessment_part_view""" # Does this need to be re-implemented to match the other non-sub-package view setters? self._containable_views['assessment_part'] = UNSEQUESTERED ...
[ "def", "use_unsequestered_assessment_part_view", "(", "self", ")", ":", "# Does this need to be re-implemented to match the other non-sub-package view setters?", "self", ".", "_containable_views", "[", "'assessment_part'", "]", "=", "UNSEQUESTERED", "self", ".", "_get_sub_package_p...
Pass through to provider AssessmentPartLookupSession.use_unsequestered_assessment_part_view
[ "Pass", "through", "to", "provider", "AssessmentPartLookupSession", ".", "use_unsequestered_assessment_part_view" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/assessment.py#L3510-L3521
mitsei/dlkit
dlkit/services/assessment.py
Bank.get_assessment_part_form
def get_assessment_part_form(self, *args, **kwargs): """Pass through to provider AssessmentPartAdminSession.get_assessment_part_form_for_update""" # This method might be a bit sketchy. Time will tell. if isinstance(args[-1], list) or 'assessment_part_record_types' in kwargs: return s...
python
def get_assessment_part_form(self, *args, **kwargs): """Pass through to provider AssessmentPartAdminSession.get_assessment_part_form_for_update""" # This method might be a bit sketchy. Time will tell. if isinstance(args[-1], list) or 'assessment_part_record_types' in kwargs: return s...
[ "def", "get_assessment_part_form", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# This method might be a bit sketchy. Time will tell.", "if", "isinstance", "(", "args", "[", "-", "1", "]", ",", "list", ")", "or", "'assessment_part_record_type...
Pass through to provider AssessmentPartAdminSession.get_assessment_part_form_for_update
[ "Pass", "through", "to", "provider", "AssessmentPartAdminSession", ".", "get_assessment_part_form_for_update" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/assessment.py#L3624-L3630
mitsei/dlkit
dlkit/services/assessment.py
Bank.save_assessment_part
def save_assessment_part(self, assessment_part_form, *args, **kwargs): """Pass through to provider AssessmentPartAdminSession.update_assessment_part""" # Implemented from kitosid template for - # osid.resource.ResourceAdminSession.update_resource if assessment_part_form.is_for_update(): ...
python
def save_assessment_part(self, assessment_part_form, *args, **kwargs): """Pass through to provider AssessmentPartAdminSession.update_assessment_part""" # Implemented from kitosid template for - # osid.resource.ResourceAdminSession.update_resource if assessment_part_form.is_for_update(): ...
[ "def", "save_assessment_part", "(", "self", ",", "assessment_part_form", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# Implemented from kitosid template for -", "# osid.resource.ResourceAdminSession.update_resource", "if", "assessment_part_form", ".", "is_for_update...
Pass through to provider AssessmentPartAdminSession.update_assessment_part
[ "Pass", "through", "to", "provider", "AssessmentPartAdminSession", ".", "update_assessment_part" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/assessment.py#L3643-L3650
mitsei/dlkit
dlkit/services/assessment.py
Bank.use_comparative_asseessment_part_item_view
def use_comparative_asseessment_part_item_view(self): """Pass through to provider AssessmentPartItemSession.use_comparative_asseessment_part_item_view""" self._object_views['asseessment_part_item'] = COMPARATIVE # self._get_provider_session('assessment_part_item_session') # To make sure the sess...
python
def use_comparative_asseessment_part_item_view(self): """Pass through to provider AssessmentPartItemSession.use_comparative_asseessment_part_item_view""" self._object_views['asseessment_part_item'] = COMPARATIVE # self._get_provider_session('assessment_part_item_session') # To make sure the sess...
[ "def", "use_comparative_asseessment_part_item_view", "(", "self", ")", ":", "self", ".", "_object_views", "[", "'asseessment_part_item'", "]", "=", "COMPARATIVE", "# self._get_provider_session('assessment_part_item_session') # To make sure the session is tracked", "for", "session", ...
Pass through to provider AssessmentPartItemSession.use_comparative_asseessment_part_item_view
[ "Pass", "through", "to", "provider", "AssessmentPartItemSession", ".", "use_comparative_asseessment_part_item_view" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/assessment.py#L3750-L3758
mitsei/dlkit
dlkit/services/assessment.py
Bank.use_plenary_assessment_part_item_view
def use_plenary_assessment_part_item_view(self): """Pass through to provider AssessmentPartItemSession.use_plenary_assessment_part_item_view""" self._object_views['assessment_part_item'] = PLENARY # self._get_provider_session('assessment_part_item_session') # To make sure the session is tracked ...
python
def use_plenary_assessment_part_item_view(self): """Pass through to provider AssessmentPartItemSession.use_plenary_assessment_part_item_view""" self._object_views['assessment_part_item'] = PLENARY # self._get_provider_session('assessment_part_item_session') # To make sure the session is tracked ...
[ "def", "use_plenary_assessment_part_item_view", "(", "self", ")", ":", "self", ".", "_object_views", "[", "'assessment_part_item'", "]", "=", "PLENARY", "# self._get_provider_session('assessment_part_item_session') # To make sure the session is tracked", "for", "session", "in", "...
Pass through to provider AssessmentPartItemSession.use_plenary_assessment_part_item_view
[ "Pass", "through", "to", "provider", "AssessmentPartItemSession", ".", "use_plenary_assessment_part_item_view" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/assessment.py#L3760-L3768
mitsei/dlkit
dlkit/services/assessment.py
Bank.use_comparative_sequence_rule_view
def use_comparative_sequence_rule_view(self): """Pass through to provider SequenceRuleLookupSession.use_comparative_sequence_rule_view""" self._object_views['sequence_rule'] = COMPARATIVE # self._get_provider_session('sequence_rule_lookup_session') # To make sure the session is tracked f...
python
def use_comparative_sequence_rule_view(self): """Pass through to provider SequenceRuleLookupSession.use_comparative_sequence_rule_view""" self._object_views['sequence_rule'] = COMPARATIVE # self._get_provider_session('sequence_rule_lookup_session') # To make sure the session is tracked f...
[ "def", "use_comparative_sequence_rule_view", "(", "self", ")", ":", "self", ".", "_object_views", "[", "'sequence_rule'", "]", "=", "COMPARATIVE", "# self._get_provider_session('sequence_rule_lookup_session') # To make sure the session is tracked", "for", "session", "in", "self",...
Pass through to provider SequenceRuleLookupSession.use_comparative_sequence_rule_view
[ "Pass", "through", "to", "provider", "SequenceRuleLookupSession", ".", "use_comparative_sequence_rule_view" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/assessment.py#L3806-L3814
mitsei/dlkit
dlkit/services/assessment.py
Bank.use_plenary_sequence_rule_view
def use_plenary_sequence_rule_view(self): """Pass through to provider SequenceRuleLookupSession.use_plenary_sequence_rule_view""" self._object_views['sequence_rule'] = PLENARY # self._get_provider_session('sequence_rule_lookup_session') # To make sure the session is tracked for session i...
python
def use_plenary_sequence_rule_view(self): """Pass through to provider SequenceRuleLookupSession.use_plenary_sequence_rule_view""" self._object_views['sequence_rule'] = PLENARY # self._get_provider_session('sequence_rule_lookup_session') # To make sure the session is tracked for session i...
[ "def", "use_plenary_sequence_rule_view", "(", "self", ")", ":", "self", ".", "_object_views", "[", "'sequence_rule'", "]", "=", "PLENARY", "# self._get_provider_session('sequence_rule_lookup_session') # To make sure the session is tracked", "for", "session", "in", "self", ".", ...
Pass through to provider SequenceRuleLookupSession.use_plenary_sequence_rule_view
[ "Pass", "through", "to", "provider", "SequenceRuleLookupSession", ".", "use_plenary_sequence_rule_view" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/assessment.py#L3816-L3824
mitsei/dlkit
dlkit/services/assessment.py
Bank.use_active_sequence_rule_view
def use_active_sequence_rule_view(self): """Pass through to provider SequenceRuleLookupSession.use_active_sequence_rule_view""" self._operable_views['sequence_rule'] = ACTIVE # self._get_provider_session('sequence_rule_lookup_session') # To make sure the session is tracked for session i...
python
def use_active_sequence_rule_view(self): """Pass through to provider SequenceRuleLookupSession.use_active_sequence_rule_view""" self._operable_views['sequence_rule'] = ACTIVE # self._get_provider_session('sequence_rule_lookup_session') # To make sure the session is tracked for session i...
[ "def", "use_active_sequence_rule_view", "(", "self", ")", ":", "self", ".", "_operable_views", "[", "'sequence_rule'", "]", "=", "ACTIVE", "# self._get_provider_session('sequence_rule_lookup_session') # To make sure the session is tracked", "for", "session", "in", "self", ".",...
Pass through to provider SequenceRuleLookupSession.use_active_sequence_rule_view
[ "Pass", "through", "to", "provider", "SequenceRuleLookupSession", ".", "use_active_sequence_rule_view" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/assessment.py#L3826-L3834
mitsei/dlkit
dlkit/services/assessment.py
Bank.use_any_status_sequence_rule_view
def use_any_status_sequence_rule_view(self): """Pass through to provider SequenceRuleLookupSession.use_any_status_sequence_rule_view""" self._operable_views['sequence_rule'] = ANY_STATUS # self._get_provider_session('sequence_rule_lookup_session') # To make sure the session is tracked f...
python
def use_any_status_sequence_rule_view(self): """Pass through to provider SequenceRuleLookupSession.use_any_status_sequence_rule_view""" self._operable_views['sequence_rule'] = ANY_STATUS # self._get_provider_session('sequence_rule_lookup_session') # To make sure the session is tracked f...
[ "def", "use_any_status_sequence_rule_view", "(", "self", ")", ":", "self", ".", "_operable_views", "[", "'sequence_rule'", "]", "=", "ANY_STATUS", "# self._get_provider_session('sequence_rule_lookup_session') # To make sure the session is tracked", "for", "session", "in", "self"...
Pass through to provider SequenceRuleLookupSession.use_any_status_sequence_rule_view
[ "Pass", "through", "to", "provider", "SequenceRuleLookupSession", ".", "use_any_status_sequence_rule_view" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/assessment.py#L3836-L3844
mitsei/dlkit
dlkit/services/assessment.py
Bank.save_sequence_rule
def save_sequence_rule(self, sequence_rule_form, *args, **kwargs): """Pass through to provider SequenceRuleAdminSession.update_sequence_rule""" # Implemented from kitosid template for - # osid.resource.ResourceAdminSession.update_resource if sequence_rule_form.is_for_update(): ...
python
def save_sequence_rule(self, sequence_rule_form, *args, **kwargs): """Pass through to provider SequenceRuleAdminSession.update_sequence_rule""" # Implemented from kitosid template for - # osid.resource.ResourceAdminSession.update_resource if sequence_rule_form.is_for_update(): ...
[ "def", "save_sequence_rule", "(", "self", ",", "sequence_rule_form", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# Implemented from kitosid template for -", "# osid.resource.ResourceAdminSession.update_resource", "if", "sequence_rule_form", ".", "is_for_update", "...
Pass through to provider SequenceRuleAdminSession.update_sequence_rule
[ "Pass", "through", "to", "provider", "SequenceRuleAdminSession", ".", "update_sequence_rule" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/assessment.py#L3965-L3972
mitsei/dlkit
dlkit/services/assessment.py
Bank.use_comparative_sequence_rule_enabler_view
def use_comparative_sequence_rule_enabler_view(self): """Pass through to provider SequenceRuleEnablerLookupSession.use_comparative_sequence_rule_enabler_view""" self._object_views['sequence_rule_enabler'] = COMPARATIVE # self._get_provider_session('sequence_rule_enabler_lookup_session') # To mak...
python
def use_comparative_sequence_rule_enabler_view(self): """Pass through to provider SequenceRuleEnablerLookupSession.use_comparative_sequence_rule_enabler_view""" self._object_views['sequence_rule_enabler'] = COMPARATIVE # self._get_provider_session('sequence_rule_enabler_lookup_session') # To mak...
[ "def", "use_comparative_sequence_rule_enabler_view", "(", "self", ")", ":", "self", ".", "_object_views", "[", "'sequence_rule_enabler'", "]", "=", "COMPARATIVE", "# self._get_provider_session('sequence_rule_enabler_lookup_session') # To make sure the session is tracked", "for", "ses...
Pass through to provider SequenceRuleEnablerLookupSession.use_comparative_sequence_rule_enabler_view
[ "Pass", "through", "to", "provider", "SequenceRuleEnablerLookupSession", ".", "use_comparative_sequence_rule_enabler_view" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/assessment.py#L4108-L4116
mitsei/dlkit
dlkit/services/assessment.py
Bank.use_plenary_sequence_rule_enabler_view
def use_plenary_sequence_rule_enabler_view(self): """Pass through to provider SequenceRuleEnablerLookupSession.use_plenary_sequence_rule_enabler_view""" self._object_views['sequence_rule_enabler'] = PLENARY # self._get_provider_session('sequence_rule_enabler_lookup_session') # To make sure the s...
python
def use_plenary_sequence_rule_enabler_view(self): """Pass through to provider SequenceRuleEnablerLookupSession.use_plenary_sequence_rule_enabler_view""" self._object_views['sequence_rule_enabler'] = PLENARY # self._get_provider_session('sequence_rule_enabler_lookup_session') # To make sure the s...
[ "def", "use_plenary_sequence_rule_enabler_view", "(", "self", ")", ":", "self", ".", "_object_views", "[", "'sequence_rule_enabler'", "]", "=", "PLENARY", "# self._get_provider_session('sequence_rule_enabler_lookup_session') # To make sure the session is tracked", "for", "session", ...
Pass through to provider SequenceRuleEnablerLookupSession.use_plenary_sequence_rule_enabler_view
[ "Pass", "through", "to", "provider", "SequenceRuleEnablerLookupSession", ".", "use_plenary_sequence_rule_enabler_view" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/assessment.py#L4118-L4126
mitsei/dlkit
dlkit/services/assessment.py
Bank.use_active_sequence_rule_enabler_view
def use_active_sequence_rule_enabler_view(self): """Pass through to provider SequenceRuleEnablerLookupSession.use_active_sequence_rule_enabler_view""" self._operable_views['sequence_rule_enabler'] = ACTIVE # self._get_provider_session('sequence_rule_enabler_lookup_session') # To make sure the s...
python
def use_active_sequence_rule_enabler_view(self): """Pass through to provider SequenceRuleEnablerLookupSession.use_active_sequence_rule_enabler_view""" self._operable_views['sequence_rule_enabler'] = ACTIVE # self._get_provider_session('sequence_rule_enabler_lookup_session') # To make sure the s...
[ "def", "use_active_sequence_rule_enabler_view", "(", "self", ")", ":", "self", ".", "_operable_views", "[", "'sequence_rule_enabler'", "]", "=", "ACTIVE", "# self._get_provider_session('sequence_rule_enabler_lookup_session') # To make sure the session is tracked", "for", "session", ...
Pass through to provider SequenceRuleEnablerLookupSession.use_active_sequence_rule_enabler_view
[ "Pass", "through", "to", "provider", "SequenceRuleEnablerLookupSession", ".", "use_active_sequence_rule_enabler_view" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/assessment.py#L4128-L4136
mitsei/dlkit
dlkit/services/assessment.py
Bank.use_any_status_sequence_rule_enabler_view
def use_any_status_sequence_rule_enabler_view(self): """Pass through to provider SequenceRuleEnablerLookupSession.use_any_status_sequence_rule_enabler_view""" self._operable_views['sequence_rule_enabler'] = ANY_STATUS # self._get_provider_session('sequence_rule_enabler_lookup_session') # To mak...
python
def use_any_status_sequence_rule_enabler_view(self): """Pass through to provider SequenceRuleEnablerLookupSession.use_any_status_sequence_rule_enabler_view""" self._operable_views['sequence_rule_enabler'] = ANY_STATUS # self._get_provider_session('sequence_rule_enabler_lookup_session') # To mak...
[ "def", "use_any_status_sequence_rule_enabler_view", "(", "self", ")", ":", "self", ".", "_operable_views", "[", "'sequence_rule_enabler'", "]", "=", "ANY_STATUS", "# self._get_provider_session('sequence_rule_enabler_lookup_session') # To make sure the session is tracked", "for", "se...
Pass through to provider SequenceRuleEnablerLookupSession.use_any_status_sequence_rule_enabler_view
[ "Pass", "through", "to", "provider", "SequenceRuleEnablerLookupSession", ".", "use_any_status_sequence_rule_enabler_view" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/assessment.py#L4138-L4146
mitsei/dlkit
dlkit/services/assessment.py
Bank.get_sequence_rule_enabler_form
def get_sequence_rule_enabler_form(self, *args, **kwargs): """Pass through to provider SequenceRuleEnablerAdminSession.get_sequence_rule_enabler_form_for_update""" # Implemented from kitosid template for - # osid.resource.ResourceAdminSession.get_resource_form_for_update # This method mi...
python
def get_sequence_rule_enabler_form(self, *args, **kwargs): """Pass through to provider SequenceRuleEnablerAdminSession.get_sequence_rule_enabler_form_for_update""" # Implemented from kitosid template for - # osid.resource.ResourceAdminSession.get_resource_form_for_update # This method mi...
[ "def", "get_sequence_rule_enabler_form", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# Implemented from kitosid template for -", "# osid.resource.ResourceAdminSession.get_resource_form_for_update", "# This method might be a bit sketchy. Time will tell.", "if", ...
Pass through to provider SequenceRuleEnablerAdminSession.get_sequence_rule_enabler_form_for_update
[ "Pass", "through", "to", "provider", "SequenceRuleEnablerAdminSession", ".", "get_sequence_rule_enabler_form_for_update" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/assessment.py#L4254-L4262
mitsei/dlkit
dlkit/services/assessment.py
Bank.save_sequence_rule_enabler
def save_sequence_rule_enabler(self, sequence_rule_enabler_form, *args, **kwargs): """Pass through to provider SequenceRuleEnablerAdminSession.update_sequence_rule_enabler""" # Implemented from kitosid template for - # osid.resource.ResourceAdminSession.update_resource if sequence_rule_e...
python
def save_sequence_rule_enabler(self, sequence_rule_enabler_form, *args, **kwargs): """Pass through to provider SequenceRuleEnablerAdminSession.update_sequence_rule_enabler""" # Implemented from kitosid template for - # osid.resource.ResourceAdminSession.update_resource if sequence_rule_e...
[ "def", "save_sequence_rule_enabler", "(", "self", ",", "sequence_rule_enabler_form", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# Implemented from kitosid template for -", "# osid.resource.ResourceAdminSession.update_resource", "if", "sequence_rule_enabler_form", "."...
Pass through to provider SequenceRuleEnablerAdminSession.update_sequence_rule_enabler
[ "Pass", "through", "to", "provider", "SequenceRuleEnablerAdminSession", ".", "update_sequence_rule_enabler" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/assessment.py#L4276-L4283
mitsei/dlkit
dlkit/services/assessment.py
Bank.use_comparative_sequence_rule_enabler_rule_view
def use_comparative_sequence_rule_enabler_rule_view(self): """Pass through to provider SequenceRuleEnablerRuleLookupSession.use_comparative_sequence_rule_enabler_rule_view""" self._object_views['sequence_rule_enabler_rule'] = COMPARATIVE # self._get_provider_session('sequence_rule_enabler_rule_l...
python
def use_comparative_sequence_rule_enabler_rule_view(self): """Pass through to provider SequenceRuleEnablerRuleLookupSession.use_comparative_sequence_rule_enabler_rule_view""" self._object_views['sequence_rule_enabler_rule'] = COMPARATIVE # self._get_provider_session('sequence_rule_enabler_rule_l...
[ "def", "use_comparative_sequence_rule_enabler_rule_view", "(", "self", ")", ":", "self", ".", "_object_views", "[", "'sequence_rule_enabler_rule'", "]", "=", "COMPARATIVE", "# self._get_provider_session('sequence_rule_enabler_rule_lookup_session') # To make sure the session is tracked", ...
Pass through to provider SequenceRuleEnablerRuleLookupSession.use_comparative_sequence_rule_enabler_rule_view
[ "Pass", "through", "to", "provider", "SequenceRuleEnablerRuleLookupSession", ".", "use_comparative_sequence_rule_enabler_rule_view" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/assessment.py#L4381-L4389
mitsei/dlkit
dlkit/services/assessment.py
Bank.use_plenary_sequence_rule_enabler_rule_view
def use_plenary_sequence_rule_enabler_rule_view(self): """Pass through to provider SequenceRuleEnablerRuleLookupSession.use_plenary_sequence_rule_enabler_rule_view""" self._object_views['sequence_rule_enabler_rule'] = PLENARY # self._get_provider_session('sequence_rule_enabler_rule_lookup_sessio...
python
def use_plenary_sequence_rule_enabler_rule_view(self): """Pass through to provider SequenceRuleEnablerRuleLookupSession.use_plenary_sequence_rule_enabler_rule_view""" self._object_views['sequence_rule_enabler_rule'] = PLENARY # self._get_provider_session('sequence_rule_enabler_rule_lookup_sessio...
[ "def", "use_plenary_sequence_rule_enabler_rule_view", "(", "self", ")", ":", "self", ".", "_object_views", "[", "'sequence_rule_enabler_rule'", "]", "=", "PLENARY", "# self._get_provider_session('sequence_rule_enabler_rule_lookup_session') # To make sure the session is tracked", "for",...
Pass through to provider SequenceRuleEnablerRuleLookupSession.use_plenary_sequence_rule_enabler_rule_view
[ "Pass", "through", "to", "provider", "SequenceRuleEnablerRuleLookupSession", ".", "use_plenary_sequence_rule_enabler_rule_view" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/assessment.py#L4391-L4399
mitsei/dlkit
dlkit/records/assessment/basic/feedback_answer_records.py
FeedbackAnswerFormRecord._init_map
def _init_map(self): """stub""" self.my_osid_object_form._my_map['confusedLearningObjectiveIds'] = \ self._confused_learning_objectives_metadata['default_list_values'][0] self.my_osid_object_form._my_map['feedback'] = \ self._feedback_metadata['default_string_values'][0]
python
def _init_map(self): """stub""" self.my_osid_object_form._my_map['confusedLearningObjectiveIds'] = \ self._confused_learning_objectives_metadata['default_list_values'][0] self.my_osid_object_form._my_map['feedback'] = \ self._feedback_metadata['default_string_values'][0]
[ "def", "_init_map", "(", "self", ")", ":", "self", ".", "my_osid_object_form", ".", "_my_map", "[", "'confusedLearningObjectiveIds'", "]", "=", "self", ".", "_confused_learning_objectives_metadata", "[", "'default_list_values'", "]", "[", "0", "]", "self", ".", "m...
stub
[ "stub" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/feedback_answer_records.py#L77-L82
mitsei/dlkit
dlkit/records/assessment/basic/feedback_answer_records.py
FeedbackAnswerFormRecord._init_metadata
def _init_metadata(self): """stub""" self._min_string_length = None self._max_string_length = None self._confused_learning_objectives_metadata = { 'element_id': Id(self.my_osid_object_form._authority, self.my_osid_object_form._namespace, ...
python
def _init_metadata(self): """stub""" self._min_string_length = None self._max_string_length = None self._confused_learning_objectives_metadata = { 'element_id': Id(self.my_osid_object_form._authority, self.my_osid_object_form._namespace, ...
[ "def", "_init_metadata", "(", "self", ")", ":", "self", ".", "_min_string_length", "=", "None", "self", ".", "_max_string_length", "=", "None", "self", ".", "_confused_learning_objectives_metadata", "=", "{", "'element_id'", ":", "Id", "(", "self", ".", "my_osid...
stub
[ "stub" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/feedback_answer_records.py#L85-L122
mitsei/dlkit
dlkit/records/assessment/basic/feedback_answer_records.py
MultiLanguageFeedbacksAnswerFormRecord._init_metadata
def _init_metadata(self): """stub""" self._confused_learning_objectives_metadata = { 'element_id': Id(self.my_osid_object_form._authority, self.my_osid_object_form._namespace, 'confusedLearningObjectiveIds'), 'element_labe...
python
def _init_metadata(self): """stub""" self._confused_learning_objectives_metadata = { 'element_id': Id(self.my_osid_object_form._authority, self.my_osid_object_form._namespace, 'confusedLearningObjectiveIds'), 'element_labe...
[ "def", "_init_metadata", "(", "self", ")", ":", "self", ".", "_confused_learning_objectives_metadata", "=", "{", "'element_id'", ":", "Id", "(", "self", ".", "my_osid_object_form", ".", "_authority", ",", "self", ".", "my_osid_object_form", ".", "_namespace", ",",...
stub
[ "stub" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/feedback_answer_records.py#L199-L227
mitsei/dlkit
dlkit/records/assessment/basic/feedback_answer_records.py
MultiLanguageFeedbacksAnswerFormRecord.clear_feedbacks
def clear_feedbacks(self): """stub""" if self.get_feedbacks_metadata().is_read_only(): raise NoAccess() self.my_osid_object_form._my_map['feedbacks'] = \ self._feedbacks_metadata['default_object_values'][0]
python
def clear_feedbacks(self): """stub""" if self.get_feedbacks_metadata().is_read_only(): raise NoAccess() self.my_osid_object_form._my_map['feedbacks'] = \ self._feedbacks_metadata['default_object_values'][0]
[ "def", "clear_feedbacks", "(", "self", ")", ":", "if", "self", ".", "get_feedbacks_metadata", "(", ")", ".", "is_read_only", "(", ")", ":", "raise", "NoAccess", "(", ")", "self", ".", "my_osid_object_form", ".", "_my_map", "[", "'feedbacks'", "]", "=", "se...
stub
[ "stub" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/feedback_answer_records.py#L238-L243
theosysbio/means
src/means/inference/inference.py
_extract_params_from_i0
def _extract_params_from_i0(only_variable_parameters, parameters_with_variability, initial_conditions_with_variability): """ Used within the distance/cost function to create the current kinetic parameter and initial condition vectors to be used during that interaction, using current values in i0. This ...
python
def _extract_params_from_i0(only_variable_parameters, parameters_with_variability, initial_conditions_with_variability): """ Used within the distance/cost function to create the current kinetic parameter and initial condition vectors to be used during that interaction, using current values in i0. This ...
[ "def", "_extract_params_from_i0", "(", "only_variable_parameters", ",", "parameters_with_variability", ",", "initial_conditions_with_variability", ")", ":", "complete_params", "=", "[", "]", "counter", "=", "0", "for", "param", ",", "is_variable", "in", "parameters_with_v...
Used within the distance/cost function to create the current kinetic parameter and initial condition vectors to be used during that interaction, using current values in i0. This function takes i0 and complements it with additional information from variables that we do not want to vary so the simulation fun...
[ "Used", "within", "the", "distance", "/", "cost", "function", "to", "create", "the", "current", "kinetic", "parameter", "and", "initial", "condition", "vectors", "to", "be", "used", "during", "that", "interaction", "using", "current", "values", "in", "i0", "."...
train
https://github.com/theosysbio/means/blob/fe164916a1d84ab2a4fa039871d38ccdf638b1db/src/means/inference/inference.py#L47-L82
theosysbio/means
src/means/inference/inference.py
InferenceWithRestarts.infer
def infer(self, number_of_processes=1, *args, **kwargs): """ :param number_of_processes: If set to more than 1, the inference routines will be paralellised using ``multiprocessing`` module :param args: arguments to pass to :meth:`Inference.infer` :para...
python
def infer(self, number_of_processes=1, *args, **kwargs): """ :param number_of_processes: If set to more than 1, the inference routines will be paralellised using ``multiprocessing`` module :param args: arguments to pass to :meth:`Inference.infer` :para...
[ "def", "infer", "(", "self", ",", "number_of_processes", "=", "1", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "number_of_processes", "==", "1", ":", "results", "=", "map", "(", "lambda", "x", ":", "x", ".", "infer", "(", "*", "args"...
:param number_of_processes: If set to more than 1, the inference routines will be paralellised using ``multiprocessing`` module :param args: arguments to pass to :meth:`Inference.infer` :param kwargs: keyword arguments to pass to :meth:`Inference.infer` :retur...
[ ":", "param", "number_of_processes", ":", "If", "set", "to", "more", "than", "1", "the", "inference", "routines", "will", "be", "paralellised", "using", "multiprocessing", "module", ":", "param", "args", ":", "arguments", "to", "pass", "to", ":", "meth", ":"...
train
https://github.com/theosysbio/means/blob/fe164916a1d84ab2a4fa039871d38ccdf638b1db/src/means/inference/inference.py#L221-L241
theosysbio/means
src/means/inference/inference.py
Inference._generate_values_with_variability_and_constraints
def _generate_values_with_variability_and_constraints(self, symbols, starting_values, variable_parameters): """ Generates the `values_with_variability` formatted list from the provided symbols, starting values and variable parameters :param symbols: The symbols defining each of the valu...
python
def _generate_values_with_variability_and_constraints(self, symbols, starting_values, variable_parameters): """ Generates the `values_with_variability` formatted list from the provided symbols, starting values and variable parameters :param symbols: The symbols defining each of the valu...
[ "def", "_generate_values_with_variability_and_constraints", "(", "self", ",", "symbols", ",", "starting_values", ",", "variable_parameters", ")", ":", "values_with_variability", "=", "[", "]", "constraints", "=", "[", "]", "if", "not", "isinstance", "(", "variable_par...
Generates the `values_with_variability` formatted list from the provided symbols, starting values and variable parameters :param symbols: The symbols defining each of the values in the starting values list :param starting_values: the actual starting values :param variable_parameters: a ...
[ "Generates", "the", "values_with_variability", "formatted", "list", "from", "the", "provided", "symbols", "starting", "values", "and", "variable", "parameters" ]
train
https://github.com/theosysbio/means/blob/fe164916a1d84ab2a4fa039871d38ccdf638b1db/src/means/inference/inference.py#L371-L409
nrcharles/caelum
caelum/tmy3.py
tmybasename
def tmybasename(usaf): """Basename for USAF base. Args: usaf (str): USAF code Returns: (str) """ url_file = open(env.SRC_PATH + '/tmy3.csv') for line in url_file.readlines(): if line.find(usaf) is not -1: return line.rstrip().partition(',')[0]
python
def tmybasename(usaf): """Basename for USAF base. Args: usaf (str): USAF code Returns: (str) """ url_file = open(env.SRC_PATH + '/tmy3.csv') for line in url_file.readlines(): if line.find(usaf) is not -1: return line.rstrip().partition(',')[0]
[ "def", "tmybasename", "(", "usaf", ")", ":", "url_file", "=", "open", "(", "env", ".", "SRC_PATH", "+", "'/tmy3.csv'", ")", "for", "line", "in", "url_file", ".", "readlines", "(", ")", ":", "if", "line", ".", "find", "(", "usaf", ")", "is", "not", ...
Basename for USAF base. Args: usaf (str): USAF code Returns: (str)
[ "Basename", "for", "USAF", "base", "." ]
train
https://github.com/nrcharles/caelum/blob/9a8e65806385978556d7bb2e6870f003ff82023e/caelum/tmy3.py#L35-L47
nrcharles/caelum
caelum/tmy3.py
normalize_date
def normalize_date(tmy_date, year): """change TMY3 date to an arbitrary year. Args: tmy_date (datetime): date to mangle. year (int): desired year. Returns: (None) """ month = tmy_date.month day = tmy_date.day - 1 hour = tmy_date.hour # hack to get around 24:00 n...
python
def normalize_date(tmy_date, year): """change TMY3 date to an arbitrary year. Args: tmy_date (datetime): date to mangle. year (int): desired year. Returns: (None) """ month = tmy_date.month day = tmy_date.day - 1 hour = tmy_date.hour # hack to get around 24:00 n...
[ "def", "normalize_date", "(", "tmy_date", ",", "year", ")", ":", "month", "=", "tmy_date", ".", "month", "day", "=", "tmy_date", ".", "day", "-", "1", "hour", "=", "tmy_date", ".", "hour", "# hack to get around 24:00 notation", "if", "month", "is", "1", "a...
change TMY3 date to an arbitrary year. Args: tmy_date (datetime): date to mangle. year (int): desired year. Returns: (None)
[ "change", "TMY3", "date", "to", "an", "arbitrary", "year", "." ]
train
https://github.com/nrcharles/caelum/blob/9a8e65806385978556d7bb2e6870f003ff82023e/caelum/tmy3.py#L70-L87
nrcharles/caelum
caelum/tmy3.py
total
def total(usaf, field='GHI (W/m^2)'): """total annual insolation, defaults to GHI.""" running_total = 0 usafdata = data(usaf) for record in usafdata: running_total += float(record[field]) return running_total/1000.
python
def total(usaf, field='GHI (W/m^2)'): """total annual insolation, defaults to GHI.""" running_total = 0 usafdata = data(usaf) for record in usafdata: running_total += float(record[field]) return running_total/1000.
[ "def", "total", "(", "usaf", ",", "field", "=", "'GHI (W/m^2)'", ")", ":", "running_total", "=", "0", "usafdata", "=", "data", "(", "usaf", ")", "for", "record", "in", "usafdata", ":", "running_total", "+=", "float", "(", "record", "[", "field", "]", "...
total annual insolation, defaults to GHI.
[ "total", "annual", "insolation", "defaults", "to", "GHI", "." ]
train
https://github.com/nrcharles/caelum/blob/9a8e65806385978556d7bb2e6870f003ff82023e/caelum/tmy3.py#L141-L147
nrcharles/caelum
caelum/tmy3.py
data.next
def next(self): """iterate.""" record = self.tmy_data.next() _sd = record['Date (MM/DD/YYYY)'] + ' ' + record['Time (HH:MM)'] record['utc_datetime'] = strptime(_sd, self.tz) record['datetime'] = strptime(_sd) return record
python
def next(self): """iterate.""" record = self.tmy_data.next() _sd = record['Date (MM/DD/YYYY)'] + ' ' + record['Time (HH:MM)'] record['utc_datetime'] = strptime(_sd, self.tz) record['datetime'] = strptime(_sd) return record
[ "def", "next", "(", "self", ")", ":", "record", "=", "self", ".", "tmy_data", ".", "next", "(", ")", "_sd", "=", "record", "[", "'Date (MM/DD/YYYY)'", "]", "+", "' '", "+", "record", "[", "'Time (HH:MM)'", "]", "record", "[", "'utc_datetime'", "]", "="...
iterate.
[ "iterate", "." ]
train
https://github.com/nrcharles/caelum/blob/9a8e65806385978556d7bb2e6870f003ff82023e/caelum/tmy3.py#L128-L134
mitsei/dlkit
dlkit/json_/proxy/managers.py
ProxyManager.get_proxy_session
def get_proxy_session(self): """Gets a ``ProxySession`` which is responsible for acquiring authentication credentials on behalf of a service client. return: (osid.proxy.ProxySession) - a proxy session for this service raise: OperationFailed - unable to complete request ...
python
def get_proxy_session(self): """Gets a ``ProxySession`` which is responsible for acquiring authentication credentials on behalf of a service client. return: (osid.proxy.ProxySession) - a proxy session for this service raise: OperationFailed - unable to complete request ...
[ "def", "get_proxy_session", "(", "self", ")", ":", "if", "not", "self", ".", "supports_proxy", "(", ")", ":", "raise", "errors", ".", "Unimplemented", "(", ")", "# pylint: disable=no-member", "return", "sessions", ".", "ProxySession", "(", "runtime", "=", "sel...
Gets a ``ProxySession`` which is responsible for acquiring authentication credentials on behalf of a service client. return: (osid.proxy.ProxySession) - a proxy session for this service raise: OperationFailed - unable to complete request raise: Unimplemented - ``supports_proxy...
[ "Gets", "a", "ProxySession", "which", "is", "responsible", "for", "acquiring", "authentication", "credentials", "on", "behalf", "of", "a", "service", "client", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/proxy/managers.py#L88-L102
mitsei/dlkit
dlkit/handcar/osid/managers.py
OsidManager.initialize
def initialize(self, runtime=None): """Initializes this manager. A manager is initialized once at the time of creation. arg: runtime (osid.OsidRuntimeManager): the runtime environment raise: CONFIGURATION_ERROR - an error with implementation configurat...
python
def initialize(self, runtime=None): """Initializes this manager. A manager is initialized once at the time of creation. arg: runtime (osid.OsidRuntimeManager): the runtime environment raise: CONFIGURATION_ERROR - an error with implementation configurat...
[ "def", "initialize", "(", "self", ",", "runtime", "=", "None", ")", ":", "if", "self", ".", "_runtime", "is", "not", "None", ":", "raise", "IllegalState", "(", ")", "self", ".", "_runtime", "=", "runtime", "config", "=", "runtime", ".", "get_configuratio...
Initializes this manager. A manager is initialized once at the time of creation. arg: runtime (osid.OsidRuntimeManager): the runtime environment raise: CONFIGURATION_ERROR - an error with implementation configuration raise: ILLEGAL_STATE - this manage...
[ "Initializes", "this", "manager", ".", "A", "manager", "is", "initialized", "once", "at", "the", "time", "of", "creation", ".", "arg", ":", "runtime", "(", "osid", ".", "OsidRuntimeManager", ")", ":", "the", "runtime", "environment", "raise", ":", "CONFIGURA...
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/osid/managers.py#L210-L242
ND-CSE-30151/tock
tock/grammars.py
Grammar.is_contextfree
def is_contextfree(self): """Returns True iff the grammar is context-free.""" for lhs, rhs in self.rules: if len(lhs) != 1: return False if lhs[0] not in self.nonterminals: return False return True
python
def is_contextfree(self): """Returns True iff the grammar is context-free.""" for lhs, rhs in self.rules: if len(lhs) != 1: return False if lhs[0] not in self.nonterminals: return False return True
[ "def", "is_contextfree", "(", "self", ")", ":", "for", "lhs", ",", "rhs", "in", "self", ".", "rules", ":", "if", "len", "(", "lhs", ")", "!=", "1", ":", "return", "False", "if", "lhs", "[", "0", "]", "not", "in", "self", ".", "nonterminals", ":",...
Returns True iff the grammar is context-free.
[ "Returns", "True", "iff", "the", "grammar", "is", "context", "-", "free", "." ]
train
https://github.com/ND-CSE-30151/tock/blob/b8d21901aaf0e6ac913c2afa855f5b5a882a16c6/tock/grammars.py#L67-L74
ND-CSE-30151/tock
tock/grammars.py
Grammar.remove_useless
def remove_useless(self): """Returns a new grammar containing just useful rules.""" if not self.is_contextfree(): raise ValueError("grammar must be context-free") by_lhs = collections.defaultdict(list) by_rhs = collections.defaultdict(list) for [lhs], rhs in self.rule...
python
def remove_useless(self): """Returns a new grammar containing just useful rules.""" if not self.is_contextfree(): raise ValueError("grammar must be context-free") by_lhs = collections.defaultdict(list) by_rhs = collections.defaultdict(list) for [lhs], rhs in self.rule...
[ "def", "remove_useless", "(", "self", ")", ":", "if", "not", "self", ".", "is_contextfree", "(", ")", ":", "raise", "ValueError", "(", "\"grammar must be context-free\"", ")", "by_lhs", "=", "collections", ".", "defaultdict", "(", "list", ")", "by_rhs", "=", ...
Returns a new grammar containing just useful rules.
[ "Returns", "a", "new", "grammar", "containing", "just", "useful", "rules", "." ]
train
https://github.com/ND-CSE-30151/tock/blob/b8d21901aaf0e6ac913c2afa855f5b5a882a16c6/tock/grammars.py#L76-L119
theosysbio/means
src/means/approximation/mea/moment_expansion_approximation.py
mea_approximation
def mea_approximation(model, max_order, closure='scalar', *closure_args, **closure_kwargs): r""" A wrapper around :class:`~means.approximation.mea.moment_expansion_approximation.MomentExpansionApproximation`. It performs moment expansion approximation (MEA) up to a given order of moment. See :class:...
python
def mea_approximation(model, max_order, closure='scalar', *closure_args, **closure_kwargs): r""" A wrapper around :class:`~means.approximation.mea.moment_expansion_approximation.MomentExpansionApproximation`. It performs moment expansion approximation (MEA) up to a given order of moment. See :class:...
[ "def", "mea_approximation", "(", "model", ",", "max_order", ",", "closure", "=", "'scalar'", ",", "*", "closure_args", ",", "*", "*", "closure_kwargs", ")", ":", "mea", "=", "MomentExpansionApproximation", "(", "model", ",", "max_order", ",", "closure", "=", ...
r""" A wrapper around :class:`~means.approximation.mea.moment_expansion_approximation.MomentExpansionApproximation`. It performs moment expansion approximation (MEA) up to a given order of moment. See :class:`~means.approximation.mea.moment_expansion_approximation.MomentExpansionApproximation` for detail...
[ "r", "A", "wrapper", "around", ":", "class", ":", "~means", ".", "approximation", ".", "mea", ".", "moment_expansion_approximation", ".", "MomentExpansionApproximation", ".", "It", "performs", "moment", "expansion", "approximation", "(", "MEA", ")", "up", "to", ...
train
https://github.com/theosysbio/means/blob/fe164916a1d84ab2a4fa039871d38ccdf638b1db/src/means/approximation/mea/moment_expansion_approximation.py#L22-L34
theosysbio/means
src/means/approximation/mea/moment_expansion_approximation.py
MomentExpansionApproximation.run
def run(self): r""" Overrides the default run() method. Performs the complete analysis on the model specified during initialisation. :return: an ODE problem which can be further used in inference and simulation. :rtype: :class:`~means.core.problems.ODEProblem` """...
python
def run(self): r""" Overrides the default run() method. Performs the complete analysis on the model specified during initialisation. :return: an ODE problem which can be further used in inference and simulation. :rtype: :class:`~means.core.problems.ODEProblem` """...
[ "def", "run", "(", "self", ")", ":", "max_order", "=", "self", ".", "__max_order", "stoichiometry_matrix", "=", "self", ".", "model", ".", "stoichiometry_matrix", "propensities", "=", "self", ".", "model", ".", "propensities", "species", "=", "self", ".", "m...
r""" Overrides the default run() method. Performs the complete analysis on the model specified during initialisation. :return: an ODE problem which can be further used in inference and simulation. :rtype: :class:`~means.core.problems.ODEProblem`
[ "r", "Overrides", "the", "default", "run", "()", "method", ".", "Performs", "the", "complete", "analysis", "on", "the", "model", "specified", "during", "initialisation", ".", ":", "return", ":", "an", "ODE", "problem", "which", "can", "be", "further", "used"...
train
https://github.com/theosysbio/means/blob/fe164916a1d84ab2a4fa039871d38ccdf638b1db/src/means/approximation/mea/moment_expansion_approximation.py#L101-L131
theosysbio/means
src/means/approximation/mea/moment_expansion_approximation.py
MomentExpansionApproximation._generate_problem_left_hand_side
def _generate_problem_left_hand_side(self, n_counter, k_counter): """ Generate the left hand side of the ODEs. This is simply the symbols for the corresponding moments. Note that, in principle, they are in of course fact the time derivative of the moments. :param ...
python
def _generate_problem_left_hand_side(self, n_counter, k_counter): """ Generate the left hand side of the ODEs. This is simply the symbols for the corresponding moments. Note that, in principle, they are in of course fact the time derivative of the moments. :param ...
[ "def", "_generate_problem_left_hand_side", "(", "self", ",", "n_counter", ",", "k_counter", ")", ":", "# concatenate the symbols for first order raw moments (means)\r", "prob_moments_over_dt", "=", "[", "k", "for", "k", "in", "k_counter", "if", "k", ".", "order", "==", ...
Generate the left hand side of the ODEs. This is simply the symbols for the corresponding moments. Note that, in principle, they are in of course fact the time derivative of the moments. :param n_counter: a list of :class:`~means.core.descriptors.Moment`\s representing central mome...
[ "Generate", "the", "left", "hand", "side", "of", "the", "ODEs", ".", "This", "is", "simply", "the", "symbols", "for", "the", "corresponding", "moments", ".", "Note", "that", "in", "principle", "they", "are", "in", "of", "course", "fact", "the", "time", "...
train
https://github.com/theosysbio/means/blob/fe164916a1d84ab2a4fa039871d38ccdf638b1db/src/means/approximation/mea/moment_expansion_approximation.py#L133-L154
theosysbio/means
src/means/approximation/mea/moment_expansion_approximation.py
MomentExpansionApproximation._generate_mass_fluctuation_kinetics
def _generate_mass_fluctuation_kinetics(self, central_moments, dmu_over_dt, n_counter): """ Generate the Mass Fluctuation Kinetics (i.e. the right hand side of the ODEs) :param central_moments: The matrix of central moment expressions :param dmu_over_dt: :param n_counter: ...
python
def _generate_mass_fluctuation_kinetics(self, central_moments, dmu_over_dt, n_counter): """ Generate the Mass Fluctuation Kinetics (i.e. the right hand side of the ODEs) :param central_moments: The matrix of central moment expressions :param dmu_over_dt: :param n_counter: ...
[ "def", "_generate_mass_fluctuation_kinetics", "(", "self", ",", "central_moments", ",", "dmu_over_dt", ",", "n_counter", ")", ":", "# symbols for central moments\r", "central_moments_symbols", "=", "sp", ".", "Matrix", "(", "[", "n", ".", "symbol", "for", "n", "in",...
Generate the Mass Fluctuation Kinetics (i.e. the right hand side of the ODEs) :param central_moments: The matrix of central moment expressions :param dmu_over_dt: :param n_counter: a list of :class:`~means.core.descriptors.Moment`\s representing central moments :type n_counter: lis...
[ "Generate", "the", "Mass", "Fluctuation", "Kinetics", "(", "i", ".", "e", ".", "the", "right", "hand", "side", "of", "the", "ODEs", ")", ":", "param", "central_moments", ":", "The", "matrix", "of", "central", "moment", "expressions", ":", "param", "dmu_ove...
train
https://github.com/theosysbio/means/blob/fe164916a1d84ab2a4fa039871d38ccdf638b1db/src/means/approximation/mea/moment_expansion_approximation.py#L156-L178
theosysbio/means
src/means/approximation/mea/moment_expansion_approximation.py
MomentExpansionApproximation._substitute_raw_with_central
def _substitute_raw_with_central(self, central_moments_exprs, central_from_raw_exprs, n_counter, k_counter): r""" Takes the expressions for central moments, and substitute the symbols representing raw moments, by equivalent expressions in terms of central moment :param central_mome...
python
def _substitute_raw_with_central(self, central_moments_exprs, central_from_raw_exprs, n_counter, k_counter): r""" Takes the expressions for central moments, and substitute the symbols representing raw moments, by equivalent expressions in terms of central moment :param central_mome...
[ "def", "_substitute_raw_with_central", "(", "self", ",", "central_moments_exprs", ",", "central_from_raw_exprs", ",", "n_counter", ",", "k_counter", ")", ":", "positiv_raw_moms_symbs", "=", "[", "raw", ".", "symbol", "for", "raw", "in", "k_counter", "if", "raw", "...
r""" Takes the expressions for central moments, and substitute the symbols representing raw moments, by equivalent expressions in terms of central moment :param central_moments_exprs: a matrix of expressions for central moments. :param central_from_raw_exprs: central moment express...
[ "r", "Takes", "the", "expressions", "for", "central", "moments", "and", "substitute", "the", "symbols", "representing", "raw", "moments", "by", "equivalent", "expressions", "in", "terms", "of", "central", "moment", ":", "param", "central_moments_exprs", ":", "a", ...
train
https://github.com/theosysbio/means/blob/fe164916a1d84ab2a4fa039871d38ccdf638b1db/src/means/approximation/mea/moment_expansion_approximation.py#L180-L220
theosysbio/means
src/means/approximation/mea/raw_to_central.py
raw_to_central
def raw_to_central(n_counter, species, k_counter): """ Expresses central moments in terms of raw moments (and other central moments). Based on equation 8 in the paper: .. math:: \mathbf{M_{x^n}} = \sum_{k_1=0}^{n_1} ... \sum_{k_d=0}^{n_d} \mathbf{{n \choose k}} (-1)^{\mathbf{n-k}} \mu^{\mathbf...
python
def raw_to_central(n_counter, species, k_counter): """ Expresses central moments in terms of raw moments (and other central moments). Based on equation 8 in the paper: .. math:: \mathbf{M_{x^n}} = \sum_{k_1=0}^{n_1} ... \sum_{k_d=0}^{n_d} \mathbf{{n \choose k}} (-1)^{\mathbf{n-k}} \mu^{\mathbf...
[ "def", "raw_to_central", "(", "n_counter", ",", "species", ",", "k_counter", ")", ":", "# create empty output", "central_in_terms_of_raw", "=", "[", "]", "# This loop loops through the ::math::`[n_1, ..., n_d]` vectors of the sums in the beginning of the equation", "# i.e. :math:`\\s...
Expresses central moments in terms of raw moments (and other central moments). Based on equation 8 in the paper: .. math:: \mathbf{M_{x^n}} = \sum_{k_1=0}^{n_1} ... \sum_{k_d=0}^{n_d} \mathbf{{n \choose k}} (-1)^{\mathbf{n-k}} \mu^{\mathbf{n-k}} \langle \mathbf{x^k} \\rangle The term :math:`\mu^...
[ "Expresses", "central", "moments", "in", "terms", "of", "raw", "moments", "(", "and", "other", "central", "moments", ")", ".", "Based", "on", "equation", "8", "in", "the", "paper", ":" ]
train
https://github.com/theosysbio/means/blob/fe164916a1d84ab2a4fa039871d38ccdf638b1db/src/means/approximation/mea/raw_to_central.py#L12-L65
delfick/harpoon
harpoon/formatter.py
MergedOptionStringFormatter.get_string
def get_string(self, key): """Get a string from all_options""" if key not in self.all_options: kwargs = {} if len(self.chain) > 1: kwargs['source'] = Meta(self.all_options, self.chain[-2]).source raise BadOptionFormat("Can't find key in options", key=k...
python
def get_string(self, key): """Get a string from all_options""" if key not in self.all_options: kwargs = {} if len(self.chain) > 1: kwargs['source'] = Meta(self.all_options, self.chain[-2]).source raise BadOptionFormat("Can't find key in options", key=k...
[ "def", "get_string", "(", "self", ",", "key", ")", ":", "if", "key", "not", "in", "self", ".", "all_options", ":", "kwargs", "=", "{", "}", "if", "len", "(", "self", ".", "chain", ")", ">", "1", ":", "kwargs", "[", "'source'", "]", "=", "Meta", ...
Get a string from all_options
[ "Get", "a", "string", "from", "all_options" ]
train
https://github.com/delfick/harpoon/blob/a2d39311d6127b7da2e15f40468bf320d598e461/harpoon/formatter.py#L51-L65
delfick/harpoon
harpoon/formatter.py
MergedOptionStringFormatter.special_format_field
def special_format_field(self, obj, format_spec): """Know about any special formats""" if format_spec == "env": return "${{{0}}}".format(obj) elif format_spec == "from_env": if obj not in os.environ: raise NoSuchEnvironmentVariable(wanted=obj) ...
python
def special_format_field(self, obj, format_spec): """Know about any special formats""" if format_spec == "env": return "${{{0}}}".format(obj) elif format_spec == "from_env": if obj not in os.environ: raise NoSuchEnvironmentVariable(wanted=obj) ...
[ "def", "special_format_field", "(", "self", ",", "obj", ",", "format_spec", ")", ":", "if", "format_spec", "==", "\"env\"", ":", "return", "\"${{{0}}}\"", ".", "format", "(", "obj", ")", "elif", "format_spec", "==", "\"from_env\"", ":", "if", "obj", "not", ...
Know about any special formats
[ "Know", "about", "any", "special", "formats" ]
train
https://github.com/delfick/harpoon/blob/a2d39311d6127b7da2e15f40468bf320d598e461/harpoon/formatter.py#L75-L82
Vagrants/blackbird
blackbird/sr71.py
main
def main(): """ main """ try: sr71 = BlackBird() sr71.start() except BlackbirdError as error: sys.stderr.write(error.__str__() + '\n') return(1)
python
def main(): """ main """ try: sr71 = BlackBird() sr71.start() except BlackbirdError as error: sys.stderr.write(error.__str__() + '\n') return(1)
[ "def", "main", "(", ")", ":", "try", ":", "sr71", "=", "BlackBird", "(", ")", "sr71", ".", "start", "(", ")", "except", "BlackbirdError", "as", "error", ":", "sys", ".", "stderr", ".", "write", "(", "error", ".", "__str__", "(", ")", "+", "'\\n'", ...
main
[ "main" ]
train
https://github.com/Vagrants/blackbird/blob/3b38cd5650caae362e0668dbd38bf8f88233e079/blackbird/sr71.py#L325-L334
Vagrants/blackbird
blackbird/sr71.py
BlackBird._add_arguments
def _add_arguments(self, args): """ Add command line arguments to each section in config. e.x: before: [global] hoge = hoge after: { 'global': { 'hoge': 'hoge', 'arguments': { ...
python
def _add_arguments(self, args): """ Add command line arguments to each section in config. e.x: before: [global] hoge = hoge after: { 'global': { 'hoge': 'hoge', 'arguments': { ...
[ "def", "_add_arguments", "(", "self", ",", "args", ")", ":", "update_dict", "=", "{", "'arguments'", ":", "vars", "(", "args", ")", "}", "for", "section", "in", "self", ".", "config", ".", "keys", "(", ")", ":", "self", ".", "config", "[", "section",...
Add command line arguments to each section in config. e.x: before: [global] hoge = hoge after: { 'global': { 'hoge': 'hoge', 'arguments': { 'debug_mode': True, ...
[ "Add", "command", "line", "arguments", "to", "each", "section", "in", "config", ".", "e", ".", "x", ":", "before", ":", "[", "global", "]", "hoge", "=", "hoge" ]
train
https://github.com/Vagrants/blackbird/blob/3b38cd5650caae362e0668dbd38bf8f88233e079/blackbird/sr71.py#L85-L108
Vagrants/blackbird
blackbird/sr71.py
BlackBird._create_threads
def _create_threads(self): """ This method creates job instances. """ creator = JobCreator( self.config, self.observers.jobs, self.logger ) self.jobs = creator.job_factory()
python
def _create_threads(self): """ This method creates job instances. """ creator = JobCreator( self.config, self.observers.jobs, self.logger ) self.jobs = creator.job_factory()
[ "def", "_create_threads", "(", "self", ")", ":", "creator", "=", "JobCreator", "(", "self", ".", "config", ",", "self", ".", "observers", ".", "jobs", ",", "self", ".", "logger", ")", "self", ".", "jobs", "=", "creator", ".", "job_factory", "(", ")" ]
This method creates job instances.
[ "This", "method", "creates", "job", "instances", "." ]
train
https://github.com/Vagrants/blackbird/blob/3b38cd5650caae362e0668dbd38bf8f88233e079/blackbird/sr71.py#L110-L120
Vagrants/blackbird
blackbird/sr71.py
BlackBird.start
def start(self): """ main loop. """ def main_loop(): while True: threadnames = [thread.name for thread in threading.enumerate()] for job_name, concrete_job in self.jobs.items(): if job_name not in threadnames: ...
python
def start(self): """ main loop. """ def main_loop(): while True: threadnames = [thread.name for thread in threading.enumerate()] for job_name, concrete_job in self.jobs.items(): if job_name not in threadnames: ...
[ "def", "start", "(", "self", ")", ":", "def", "main_loop", "(", ")", ":", "while", "True", ":", "threadnames", "=", "[", "thread", ".", "name", "for", "thread", "in", "threading", ".", "enumerate", "(", ")", "]", "for", "job_name", ",", "concrete_job",...
main loop.
[ "main", "loop", "." ]
train
https://github.com/Vagrants/blackbird/blob/3b38cd5650caae362e0668dbd38bf8f88233e079/blackbird/sr71.py#L122-L167
Vagrants/blackbird
blackbird/sr71.py
JobCreator.job_factory
def job_factory(self): """ Create concrete jobs. The concrete jobs is following dictionary. jobs = { 'PLUGINNAME-build_items': { 'method': FUNCTION_OBJECT, 'interval': INTERVAL_TIME , } ... } If ConcreteJob insta...
python
def job_factory(self): """ Create concrete jobs. The concrete jobs is following dictionary. jobs = { 'PLUGINNAME-build_items': { 'method': FUNCTION_OBJECT, 'interval': INTERVAL_TIME , } ... } If ConcreteJob insta...
[ "def", "job_factory", "(", "self", ")", ":", "jobs", "=", "dict", "(", ")", "for", "section", ",", "options", "in", "self", ".", "config", ".", "items", "(", ")", ":", "if", "section", "==", "'global'", ":", "continue", "# Since validate in utils/configrea...
Create concrete jobs. The concrete jobs is following dictionary. jobs = { 'PLUGINNAME-build_items': { 'method': FUNCTION_OBJECT, 'interval': INTERVAL_TIME , } ... } If ConcreteJob instance has "build_discovery_items", "b...
[ "Create", "concrete", "jobs", ".", "The", "concrete", "jobs", "is", "following", "dictionary", ".", "jobs", "=", "{", "PLUGINNAME", "-", "build_items", ":", "{", "method", ":", "FUNCTION_OBJECT", "interval", ":", "INTERVAL_TIME", "}", "...", "}", "If", "Conc...
train
https://github.com/Vagrants/blackbird/blob/3b38cd5650caae362e0668dbd38bf8f88233e079/blackbird/sr71.py#L187-L291
mitsei/dlkit
dlkit/runtime/impls/proxy/managers.py
ProxyManager.get_proxy_session
def get_proxy_session(self): """Gets a ``ProxySession`` which is responsible for acquiring authentication credentials on behalf of a service client. :return: a proxy session for this service :rtype: ``osid.proxy.ProxySession`` :raise: ``OperationFailed`` -- unable to complete request ...
python
def get_proxy_session(self): """Gets a ``ProxySession`` which is responsible for acquiring authentication credentials on behalf of a service client. :return: a proxy session for this service :rtype: ``osid.proxy.ProxySession`` :raise: ``OperationFailed`` -- unable to complete request ...
[ "def", "get_proxy_session", "(", "self", ")", ":", "if", "not", "self", ".", "supports_proxy", "(", ")", ":", "raise", "Unimplemented", "(", ")", "try", ":", "from", ".", "import", "sessions", "except", "ImportError", ":", "raise", "# OperationFailed()", "tr...
Gets a ``ProxySession`` which is responsible for acquiring authentication credentials on behalf of a service client. :return: a proxy session for this service :rtype: ``osid.proxy.ProxySession`` :raise: ``OperationFailed`` -- unable to complete request :raise: ``Unimplemented`` -- ``sup...
[ "Gets", "a", "ProxySession", "which", "is", "responsible", "for", "acquiring", "authentication", "credentials", "on", "behalf", "of", "a", "service", "client", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/runtime/impls/proxy/managers.py#L93-L114
mitsei/dlkit
dlkit/authz_adapter/grading/sessions.py
GradeSystemSearchSession.get_grade_systems_by_search
def get_grade_systems_by_search(self, grade_system_query, grade_system_search): """Pass through to provider GradeSystemSearchSession.get_grade_systems_by_search""" # Implemented from azosid template for - # osid.resource.ResourceSearchSession.get_resources_by_search_template if not self....
python
def get_grade_systems_by_search(self, grade_system_query, grade_system_search): """Pass through to provider GradeSystemSearchSession.get_grade_systems_by_search""" # Implemented from azosid template for - # osid.resource.ResourceSearchSession.get_resources_by_search_template if not self....
[ "def", "get_grade_systems_by_search", "(", "self", ",", "grade_system_query", ",", "grade_system_search", ")", ":", "# Implemented from azosid template for -", "# osid.resource.ResourceSearchSession.get_resources_by_search_template", "if", "not", "self", ".", "_can", "(", "'searc...
Pass through to provider GradeSystemSearchSession.get_grade_systems_by_search
[ "Pass", "through", "to", "provider", "GradeSystemSearchSession", ".", "get_grade_systems_by_search" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/authz_adapter/grading/sessions.py#L331-L337
mitsei/dlkit
dlkit/authz_adapter/grading/sessions.py
GradeEntrySearchSession.get_grade_entries_by_search
def get_grade_entries_by_search(self, grade_entry_query, grade_entry_search): """Pass through to provider GradeEntrySearchSession.get_grade_entries_by_search""" # Implemented from azosid template for - # osid.resource.ResourceSearchSession.get_resources_by_search_template if not self._ca...
python
def get_grade_entries_by_search(self, grade_entry_query, grade_entry_search): """Pass through to provider GradeEntrySearchSession.get_grade_entries_by_search""" # Implemented from azosid template for - # osid.resource.ResourceSearchSession.get_resources_by_search_template if not self._ca...
[ "def", "get_grade_entries_by_search", "(", "self", ",", "grade_entry_query", ",", "grade_entry_search", ")", ":", "# Implemented from azosid template for -", "# osid.resource.ResourceSearchSession.get_resources_by_search_template", "if", "not", "self", ".", "_can", "(", "'search'...
Pass through to provider GradeEntrySearchSession.get_grade_entries_by_search
[ "Pass", "through", "to", "provider", "GradeEntrySearchSession", ".", "get_grade_entries_by_search" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/authz_adapter/grading/sessions.py#L1179-L1185
mitsei/dlkit
dlkit/authz_adapter/grading/sessions.py
GradebookColumnSearchSession.get_gradebook_columns_by_search
def get_gradebook_columns_by_search(self, gradebook_column_query, gradebook_column_search): """Pass through to provider GradebookColumnSearchSession.get_gradebook_columns_by_search""" # Implemented from azosid template for - # osid.resource.ResourceSearchSession.get_resources_by_search_template ...
python
def get_gradebook_columns_by_search(self, gradebook_column_query, gradebook_column_search): """Pass through to provider GradebookColumnSearchSession.get_gradebook_columns_by_search""" # Implemented from azosid template for - # osid.resource.ResourceSearchSession.get_resources_by_search_template ...
[ "def", "get_gradebook_columns_by_search", "(", "self", ",", "gradebook_column_query", ",", "gradebook_column_search", ")", ":", "# Implemented from azosid template for -", "# osid.resource.ResourceSearchSession.get_resources_by_search_template", "if", "not", "self", ".", "_can", "(...
Pass through to provider GradebookColumnSearchSession.get_gradebook_columns_by_search
[ "Pass", "through", "to", "provider", "GradebookColumnSearchSession", ".", "get_gradebook_columns_by_search" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/authz_adapter/grading/sessions.py#L1823-L1829
jason-weirather/py-seq-tools
seqtools/align.py
Alignment.set_query_sequence
def set_query_sequence(self,seq): """Assign the query sequence. :param seq: sequence of the query :type seq: string """ self._options = self._options.replace(query_sequence = seq)
python
def set_query_sequence(self,seq): """Assign the query sequence. :param seq: sequence of the query :type seq: string """ self._options = self._options.replace(query_sequence = seq)
[ "def", "set_query_sequence", "(", "self", ",", "seq", ")", ":", "self", ".", "_options", "=", "self", ".", "_options", ".", "replace", "(", "query_sequence", "=", "seq", ")" ]
Assign the query sequence. :param seq: sequence of the query :type seq: string
[ "Assign", "the", "query", "sequence", ".", ":", "param", "seq", ":", "sequence", "of", "the", "query", ":", "type", "seq", ":", "string" ]
train
https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/align.py#L93-L100
jason-weirather/py-seq-tools
seqtools/align.py
Alignment.target_range
def target_range(self): """Get the range covered on the target/reference strand :returns: Genomic range of the target strand :rtype: GenomicRange """ a = self.alignment_ranges return GenomicRange(a[0][0].chr,a[0][0].start,a[-1][0].end)
python
def target_range(self): """Get the range covered on the target/reference strand :returns: Genomic range of the target strand :rtype: GenomicRange """ a = self.alignment_ranges return GenomicRange(a[0][0].chr,a[0][0].start,a[-1][0].end)
[ "def", "target_range", "(", "self", ")", ":", "a", "=", "self", ".", "alignment_ranges", "return", "GenomicRange", "(", "a", "[", "0", "]", "[", "0", "]", ".", "chr", ",", "a", "[", "0", "]", "[", "0", "]", ".", "start", ",", "a", "[", "-", "...
Get the range covered on the target/reference strand :returns: Genomic range of the target strand :rtype: GenomicRange
[ "Get", "the", "range", "covered", "on", "the", "target", "/", "reference", "strand" ]
train
https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/align.py#L148-L156
jason-weirather/py-seq-tools
seqtools/align.py
Alignment.actual_query_range
def actual_query_range(self): """This is the actual query range for the positive strand :returns: Range of query positive strand covered :rtype: GenomicRange """ a = self.alignment_ranges #return GenomicRange(a[0][1].chr,a[0][1].start,a[-1][1].end,self.get_strand()) if self.get_strand() ==...
python
def actual_query_range(self): """This is the actual query range for the positive strand :returns: Range of query positive strand covered :rtype: GenomicRange """ a = self.alignment_ranges #return GenomicRange(a[0][1].chr,a[0][1].start,a[-1][1].end,self.get_strand()) if self.get_strand() ==...
[ "def", "actual_query_range", "(", "self", ")", ":", "a", "=", "self", ".", "alignment_ranges", "#return GenomicRange(a[0][1].chr,a[0][1].start,a[-1][1].end,self.get_strand())", "if", "self", ".", "get_strand", "(", ")", "==", "'+'", ":", "return", "GenomicRange", "(", ...
This is the actual query range for the positive strand :returns: Range of query positive strand covered :rtype: GenomicRange
[ "This", "is", "the", "actual", "query", "range", "for", "the", "positive", "strand" ]
train
https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/align.py#L164-L176
jason-weirather/py-seq-tools
seqtools/align.py
Alignment.set_reference
def set_reference(self,ref): """Set the reference sequence :param ref: reference sequence :type ref: string """ self._options = self._options._replace(reference = ref)
python
def set_reference(self,ref): """Set the reference sequence :param ref: reference sequence :type ref: string """ self._options = self._options._replace(reference = ref)
[ "def", "set_reference", "(", "self", ",", "ref", ")", ":", "self", ".", "_options", "=", "self", ".", "_options", ".", "_replace", "(", "reference", "=", "ref", ")" ]
Set the reference sequence :param ref: reference sequence :type ref: string
[ "Set", "the", "reference", "sequence" ]
train
https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/align.py#L187-L194
jason-weirather/py-seq-tools
seqtools/align.py
Alignment.get_alignment_strings
def get_alignment_strings(self,min_intron_size=68): """Process the alignment to get information like the alignment strings for each exon. These strings are used by the pretty print. :returns: String representation of the alignment in an easy to read format :rtype: string """ qseq = self.quer...
python
def get_alignment_strings(self,min_intron_size=68): """Process the alignment to get information like the alignment strings for each exon. These strings are used by the pretty print. :returns: String representation of the alignment in an easy to read format :rtype: string """ qseq = self.quer...
[ "def", "get_alignment_strings", "(", "self", ",", "min_intron_size", "=", "68", ")", ":", "qseq", "=", "self", ".", "query_sequence", "if", "not", "qseq", ":", "sys", ".", "exit", "(", "\"ERROR: Query sequence must be accessable to get alignment strings\\n\"", ")", ...
Process the alignment to get information like the alignment strings for each exon. These strings are used by the pretty print. :returns: String representation of the alignment in an easy to read format :rtype: string
[ "Process", "the", "alignment", "to", "get", "information", "like", "the", "alignment", "strings", "for", "each", "exon", ".", "These", "strings", "are", "used", "by", "the", "pretty", "print", "." ]
train
https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/align.py#L201-L258
jason-weirather/py-seq-tools
seqtools/align.py
Alignment.print_alignment
def print_alignment(self,chunk_size=40,min_intron_size=68): """print the nice looking alignment. Must have data accessable from get_query_sequence() and get_refernece_sequencec() :returns: Pretty print string. :rtype: string """ has_qual = True if not self.query_quality: has_qual = False ...
python
def print_alignment(self,chunk_size=40,min_intron_size=68): """print the nice looking alignment. Must have data accessable from get_query_sequence() and get_refernece_sequencec() :returns: Pretty print string. :rtype: string """ has_qual = True if not self.query_quality: has_qual = False ...
[ "def", "print_alignment", "(", "self", ",", "chunk_size", "=", "40", ",", "min_intron_size", "=", "68", ")", ":", "has_qual", "=", "True", "if", "not", "self", ".", "query_quality", ":", "has_qual", "=", "False", "trantab", "=", "maketrans", "(", "'01'", ...
print the nice looking alignment. Must have data accessable from get_query_sequence() and get_refernece_sequencec() :returns: Pretty print string. :rtype: string
[ "print", "the", "nice", "looking", "alignment", ".", "Must", "have", "data", "accessable", "from", "get_query_sequence", "()", "and", "get_refernece_sequencec", "()" ]
train
https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/align.py#L285-L309
jason-weirather/py-seq-tools
seqtools/align.py
Alignment.get_PSL
def get_PSL(self,min_intron_size=68): """Get a PSL object representation of the alignment. :returns: PSL representation :rtype: PSL """ from seqtools.format.psl import PSL matches = sum([x[0].length for x in self.alignment_ranges]) # 1. Matches - Number of matching bases that aren't repeats ...
python
def get_PSL(self,min_intron_size=68): """Get a PSL object representation of the alignment. :returns: PSL representation :rtype: PSL """ from seqtools.format.psl import PSL matches = sum([x[0].length for x in self.alignment_ranges]) # 1. Matches - Number of matching bases that aren't repeats ...
[ "def", "get_PSL", "(", "self", ",", "min_intron_size", "=", "68", ")", ":", "from", "seqtools", ".", "format", ".", "psl", "import", "PSL", "matches", "=", "sum", "(", "[", "x", "[", "0", "]", ".", "length", "for", "x", "in", "self", ".", "alignmen...
Get a PSL object representation of the alignment. :returns: PSL representation :rtype: PSL
[ "Get", "a", "PSL", "object", "representation", "of", "the", "alignment", "." ]
train
https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/align.py#L311-L360
jason-weirather/py-seq-tools
seqtools/align.py
Alignment.get_SAM
def get_SAM(self,min_intron_size=68): """Get a SAM object representation of the alignment. :returns: SAM representation :rtype: SAM """ from seqtools.format.sam import SAM #ar is target then query qname = self.alignment_ranges[0][1].chr flag = 0 if self.strand == '-': flag = 16 ...
python
def get_SAM(self,min_intron_size=68): """Get a SAM object representation of the alignment. :returns: SAM representation :rtype: SAM """ from seqtools.format.sam import SAM #ar is target then query qname = self.alignment_ranges[0][1].chr flag = 0 if self.strand == '-': flag = 16 ...
[ "def", "get_SAM", "(", "self", ",", "min_intron_size", "=", "68", ")", ":", "from", "seqtools", ".", "format", ".", "sam", "import", "SAM", "#ar is target then query", "qname", "=", "self", ".", "alignment_ranges", "[", "0", "]", "[", "1", "]", ".", "chr...
Get a SAM object representation of the alignment. :returns: SAM representation :rtype: SAM
[ "Get", "a", "SAM", "object", "representation", "of", "the", "alignment", "." ]
train
https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/align.py#L363-L398
jason-weirather/py-seq-tools
seqtools/align.py
Alignment.construct_cigar
def construct_cigar(self,min_intron_size=68): """Create a CIGAR string from the alignment :returns: CIGAR string :rtype: string """ # goes target query ar = self.alignment_ranges cig = '' if ar[0][1].start > 1: # soft clipped cig += str(ar[0][1].start-1)+'S' for i in range(l...
python
def construct_cigar(self,min_intron_size=68): """Create a CIGAR string from the alignment :returns: CIGAR string :rtype: string """ # goes target query ar = self.alignment_ranges cig = '' if ar[0][1].start > 1: # soft clipped cig += str(ar[0][1].start-1)+'S' for i in range(l...
[ "def", "construct_cigar", "(", "self", ",", "min_intron_size", "=", "68", ")", ":", "# goes target query", "ar", "=", "self", ".", "alignment_ranges", "cig", "=", "''", "if", "ar", "[", "0", "]", "[", "1", "]", ".", "start", ">", "1", ":", "# soft clip...
Create a CIGAR string from the alignment :returns: CIGAR string :rtype: string
[ "Create", "a", "CIGAR", "string", "from", "the", "alignment" ]
train
https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/align.py#L400-L430
jason-weirather/py-seq-tools
seqtools/align.py
Alignment.get_target_transcript
def get_target_transcript(self,min_intron=1): """Get the mapping of to the target strand :returns: Transcript mapped to target :rtype: Transcript """ if min_intron < 1: sys.stderr.write("ERROR minimum intron should be 1 base or longer\n") sys.exit() #tx = Transcript() rngs = [...
python
def get_target_transcript(self,min_intron=1): """Get the mapping of to the target strand :returns: Transcript mapped to target :rtype: Transcript """ if min_intron < 1: sys.stderr.write("ERROR minimum intron should be 1 base or longer\n") sys.exit() #tx = Transcript() rngs = [...
[ "def", "get_target_transcript", "(", "self", ",", "min_intron", "=", "1", ")", ":", "if", "min_intron", "<", "1", ":", "sys", ".", "stderr", ".", "write", "(", "\"ERROR minimum intron should be 1 base or longer\\n\"", ")", "sys", ".", "exit", "(", ")", "#tx = ...
Get the mapping of to the target strand :returns: Transcript mapped to target :rtype: Transcript
[ "Get", "the", "mapping", "of", "to", "the", "target", "strand" ]
train
https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/align.py#L432-L463
mitsei/dlkit
dlkit/json_/learning/queries.py
ProficiencyQuery.match_resource_id
def match_resource_id(self, resource_id, match): """Sets the resource ``Id`` for this query. arg: resource_id (osid.id.Id): a resource ``Id`` arg: match (boolean): ``true`` if a positive match, ``false`` for a negative match raise: NullArgument - ``resource_id`` i...
python
def match_resource_id(self, resource_id, match): """Sets the resource ``Id`` for this query. arg: resource_id (osid.id.Id): a resource ``Id`` arg: match (boolean): ``true`` if a positive match, ``false`` for a negative match raise: NullArgument - ``resource_id`` i...
[ "def", "match_resource_id", "(", "self", ",", "resource_id", ",", "match", ")", ":", "if", "not", "isinstance", "(", "resource_id", ",", "Id", ")", ":", "raise", "errors", ".", "InvalidArgument", "(", ")", "self", ".", "_add_match", "(", "'resourceId'", ",...
Sets the resource ``Id`` for this query. arg: resource_id (osid.id.Id): a resource ``Id`` arg: match (boolean): ``true`` if a positive match, ``false`` for a negative match raise: NullArgument - ``resource_id`` is ``null`` *compliance: mandatory -- This method mus...
[ "Sets", "the", "resource", "Id", "for", "this", "query", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/queries.py#L1177-L1189
mitsei/dlkit
dlkit/json_/learning/queries.py
ProficiencyQuery.match_objective_id
def match_objective_id(self, objective_id, match): """Sets the objective ``Id`` for this query. arg: objective_id (osid.id.Id): an objective ``Id`` arg: match (boolean): ``true`` for a positive match, ``false`` for a negative match raise: NullArgument - ``objectiv...
python
def match_objective_id(self, objective_id, match): """Sets the objective ``Id`` for this query. arg: objective_id (osid.id.Id): an objective ``Id`` arg: match (boolean): ``true`` for a positive match, ``false`` for a negative match raise: NullArgument - ``objectiv...
[ "def", "match_objective_id", "(", "self", ",", "objective_id", ",", "match", ")", ":", "if", "not", "isinstance", "(", "objective_id", ",", "Id", ")", ":", "raise", "errors", ".", "InvalidArgument", "(", ")", "self", ".", "_add_match", "(", "'objectiveId'", ...
Sets the objective ``Id`` for this query. arg: objective_id (osid.id.Id): an objective ``Id`` arg: match (boolean): ``true`` for a positive match, ``false`` for a negative match raise: NullArgument - ``objective_id`` is ``null`` *compliance: mandatory -- This meth...
[ "Sets", "the", "objective", "Id", "for", "this", "query", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/queries.py#L1240-L1252
mitsei/dlkit
dlkit/json_/learning/queries.py
ProficiencyQuery.match_completion
def match_completion(self, start, end, match): """Sets the completion for this query to match completion percentages between the given range inclusive. arg: start (decimal): start of range arg: end (decimal): end of range arg: match (boolean): ``true`` for a positive match, ...
python
def match_completion(self, start, end, match): """Sets the completion for this query to match completion percentages between the given range inclusive. arg: start (decimal): start of range arg: end (decimal): end of range arg: match (boolean): ``true`` for a positive match, ...
[ "def", "match_completion", "(", "self", ",", "start", ",", "end", ",", "match", ")", ":", "try", ":", "start", "=", "float", "(", "start", ")", "except", "ValueError", ":", "raise", "errors", ".", "InvalidArgument", "(", "'Invalid start value'", ")", "try"...
Sets the completion for this query to match completion percentages between the given range inclusive. arg: start (decimal): start of range arg: end (decimal): end of range arg: match (boolean): ``true`` for a positive match, ``false`` for a negative match raise:...
[ "Sets", "the", "completion", "for", "this", "query", "to", "match", "completion", "percentages", "between", "the", "given", "range", "inclusive", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/queries.py#L1315-L1342
mitsei/dlkit
dlkit/json_/learning/queries.py
ProficiencyQuery.match_level_id
def match_level_id(self, grade_id, match): """Sets the level grade ``Id`` for this query. arg: grade_id (osid.id.Id): a grade ``Id`` arg: match (boolean): ``true`` for a positive match, ``false`` for a negative match raise: NullArgument - ``grade_id`` is ``null`` ...
python
def match_level_id(self, grade_id, match): """Sets the level grade ``Id`` for this query. arg: grade_id (osid.id.Id): a grade ``Id`` arg: match (boolean): ``true`` for a positive match, ``false`` for a negative match raise: NullArgument - ``grade_id`` is ``null`` ...
[ "def", "match_level_id", "(", "self", ",", "grade_id", ",", "match", ")", ":", "if", "not", "isinstance", "(", "grade_id", ",", "Id", ")", ":", "raise", "errors", ".", "InvalidArgument", "(", ")", "self", ".", "_add_match", "(", "'levelId'", ",", "str", ...
Sets the level grade ``Id`` for this query. arg: grade_id (osid.id.Id): a grade ``Id`` arg: match (boolean): ``true`` for a positive match, ``false`` for a negative match raise: NullArgument - ``grade_id`` is ``null`` *compliance: mandatory -- This method must be ...
[ "Sets", "the", "level", "grade", "Id", "for", "this", "query", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/queries.py#L1378-L1390
jason-weirather/py-seq-tools
seqtools/range/__init__.py
GenomicRangeFromString
def GenomicRangeFromString(range_string,payload=None,dir=None): """Constructor for a GenomicRange object that takes a string""" m = re.match('^(.+):(\d+)-(\d+)$',range_string) if not m: sys.stderr.write("ERROR bad genomic range string\n"+range_string+"\n") sys.exit() chr = m.group(1) start = int(m.g...
python
def GenomicRangeFromString(range_string,payload=None,dir=None): """Constructor for a GenomicRange object that takes a string""" m = re.match('^(.+):(\d+)-(\d+)$',range_string) if not m: sys.stderr.write("ERROR bad genomic range string\n"+range_string+"\n") sys.exit() chr = m.group(1) start = int(m.g...
[ "def", "GenomicRangeFromString", "(", "range_string", ",", "payload", "=", "None", ",", "dir", "=", "None", ")", ":", "m", "=", "re", ".", "match", "(", "'^(.+):(\\d+)-(\\d+)$'", ",", "range_string", ")", "if", "not", "m", ":", "sys", ".", "stderr", ".",...
Constructor for a GenomicRange object that takes a string
[ "Constructor", "for", "a", "GenomicRange", "object", "that", "takes", "a", "string" ]
train
https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/range/__init__.py#L381-L390
jason-weirather/py-seq-tools
seqtools/range/__init__.py
GenomicRange.copy
def copy(self): """Create a new copy of selfe. does not do a deep copy for payload :return: copied range :rtype: GenomicRange """ return type(self)(self.chr, self.start+self._start_offset, self.end, self.payload, ...
python
def copy(self): """Create a new copy of selfe. does not do a deep copy for payload :return: copied range :rtype: GenomicRange """ return type(self)(self.chr, self.start+self._start_offset, self.end, self.payload, ...
[ "def", "copy", "(", "self", ")", ":", "return", "type", "(", "self", ")", "(", "self", ".", "chr", ",", "self", ".", "start", "+", "self", ".", "_start_offset", ",", "self", ".", "end", ",", "self", ".", "payload", ",", "self", ".", "dir", ")" ]
Create a new copy of selfe. does not do a deep copy for payload :return: copied range :rtype: GenomicRange
[ "Create", "a", "new", "copy", "of", "selfe", ".", "does", "not", "do", "a", "deep", "copy", "for", "payload" ]
train
https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/range/__init__.py#L102-L113
jason-weirather/py-seq-tools
seqtools/range/__init__.py
GenomicRange.get_bed_array
def get_bed_array(self): """Return a basic three meber bed array representation of this range :return: list of [chr,start (0-indexed), end (1-indexed] :rtype: list """ arr = [self.chr,self.start-1,self.end] if self.dir: arr.append(self.dir) return arr
python
def get_bed_array(self): """Return a basic three meber bed array representation of this range :return: list of [chr,start (0-indexed), end (1-indexed] :rtype: list """ arr = [self.chr,self.start-1,self.end] if self.dir: arr.append(self.dir) return arr
[ "def", "get_bed_array", "(", "self", ")", ":", "arr", "=", "[", "self", ".", "chr", ",", "self", ".", "start", "-", "1", ",", "self", ".", "end", "]", "if", "self", ".", "dir", ":", "arr", ".", "append", "(", "self", ".", "dir", ")", "return", ...
Return a basic three meber bed array representation of this range :return: list of [chr,start (0-indexed), end (1-indexed] :rtype: list
[ "Return", "a", "basic", "three", "meber", "bed", "array", "representation", "of", "this", "range" ]
train
https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/range/__init__.py#L128-L137
jason-weirather/py-seq-tools
seqtools/range/__init__.py
GenomicRange.equals
def equals(self,gr): """ check for equality. does not consider direction :param gr: another genomic range :type gr: GenomicRange :return: true if they are the same, false if they are not :rtype: bool """ if self.chr == gr.chr and self.start == gr.start and self.end == gr.end: return T...
python
def equals(self,gr): """ check for equality. does not consider direction :param gr: another genomic range :type gr: GenomicRange :return: true if they are the same, false if they are not :rtype: bool """ if self.chr == gr.chr and self.start == gr.start and self.end == gr.end: return T...
[ "def", "equals", "(", "self", ",", "gr", ")", ":", "if", "self", ".", "chr", "==", "gr", ".", "chr", "and", "self", ".", "start", "==", "gr", ".", "start", "and", "self", ".", "end", "==", "gr", ".", "end", ":", "return", "True", "return", "Fal...
check for equality. does not consider direction :param gr: another genomic range :type gr: GenomicRange :return: true if they are the same, false if they are not :rtype: bool
[ "check", "for", "equality", ".", "does", "not", "consider", "direction" ]
train
https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/range/__init__.py#L157-L167
jason-weirather/py-seq-tools
seqtools/range/__init__.py
GenomicRange.get_range_string
def get_range_string(self): """ get the range string represetation. similar to the default input for UCSC genome browser :return: representation by string like chr2:801-900 :rtype: string """ return self.chr+":"+str(self.start)+"-"+str(self.end)
python
def get_range_string(self): """ get the range string represetation. similar to the default input for UCSC genome browser :return: representation by string like chr2:801-900 :rtype: string """ return self.chr+":"+str(self.start)+"-"+str(self.end)
[ "def", "get_range_string", "(", "self", ")", ":", "return", "self", ".", "chr", "+", "\":\"", "+", "str", "(", "self", ".", "start", ")", "+", "\"-\"", "+", "str", "(", "self", ".", "end", ")" ]
get the range string represetation. similar to the default input for UCSC genome browser :return: representation by string like chr2:801-900 :rtype: string
[ "get", "the", "range", "string", "represetation", ".", "similar", "to", "the", "default", "input", "for", "UCSC", "genome", "browser" ]
train
https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/range/__init__.py#L169-L175
jason-weirather/py-seq-tools
seqtools/range/__init__.py
GenomicRange.adjacent
def adjacent(self,rng2): """ Test for adjacency. :param rng2: :param use_direction: false by default :param type: GenomicRange :param type: use_direction """ if self.chr != rng2.chr: return False if self.direction != rng2.direction and use_direction: return False if self.end == rn...
python
def adjacent(self,rng2): """ Test for adjacency. :param rng2: :param use_direction: false by default :param type: GenomicRange :param type: use_direction """ if self.chr != rng2.chr: return False if self.direction != rng2.direction and use_direction: return False if self.end == rn...
[ "def", "adjacent", "(", "self", ",", "rng2", ")", ":", "if", "self", ".", "chr", "!=", "rng2", ".", "chr", ":", "return", "False", "if", "self", ".", "direction", "!=", "rng2", ".", "direction", "and", "use_direction", ":", "return", "False", "if", "...
Test for adjacency. :param rng2: :param use_direction: false by default :param type: GenomicRange :param type: use_direction
[ "Test", "for", "adjacency", "." ]
train
https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/range/__init__.py#L194-L206
jason-weirather/py-seq-tools
seqtools/range/__init__.py
GenomicRange.overlaps
def overlaps(self,in_genomic_range,padding=0): """do the ranges overlap? :param in_genomic_range: range to compare to :param padding: add to the ends this many (default 0) :type in_genomic_range: GenomicRange :type padding: int :return: True if they overlap :rtype: bool """ if pad...
python
def overlaps(self,in_genomic_range,padding=0): """do the ranges overlap? :param in_genomic_range: range to compare to :param padding: add to the ends this many (default 0) :type in_genomic_range: GenomicRange :type padding: int :return: True if they overlap :rtype: bool """ if pad...
[ "def", "overlaps", "(", "self", ",", "in_genomic_range", ",", "padding", "=", "0", ")", ":", "if", "padding", ">", "0", ":", "in_genomic_range", "=", "GenomicRange", "(", "in_genomic_range", ".", "chr", ",", "max", "(", "[", "1", ",", "in_genomic_range", ...
do the ranges overlap? :param in_genomic_range: range to compare to :param padding: add to the ends this many (default 0) :type in_genomic_range: GenomicRange :type padding: int :return: True if they overlap :rtype: bool
[ "do", "the", "ranges", "overlap?" ]
train
https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/range/__init__.py#L208-L245
jason-weirather/py-seq-tools
seqtools/range/__init__.py
GenomicRange.overlap_size
def overlap_size(self,in_genomic_range): """ The size of the overlap :param in_genomic_range: the range to intersect :type in_genomic_range: GenomicRange :return: count of overlapping bases :rtype: int """ if self.chr != in_genomic_range.chr: return 0 if self.end < in_genomic_ran...
python
def overlap_size(self,in_genomic_range): """ The size of the overlap :param in_genomic_range: the range to intersect :type in_genomic_range: GenomicRange :return: count of overlapping bases :rtype: int """ if self.chr != in_genomic_range.chr: return 0 if self.end < in_genomic_ran...
[ "def", "overlap_size", "(", "self", ",", "in_genomic_range", ")", ":", "if", "self", ".", "chr", "!=", "in_genomic_range", ".", "chr", ":", "return", "0", "if", "self", ".", "end", "<", "in_genomic_range", ".", "start", ":", "return", "0", "if", "in_geno...
The size of the overlap :param in_genomic_range: the range to intersect :type in_genomic_range: GenomicRange :return: count of overlapping bases :rtype: int
[ "The", "size", "of", "the", "overlap" ]
train
https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/range/__init__.py#L247-L277
jason-weirather/py-seq-tools
seqtools/range/__init__.py
GenomicRange.merge
def merge(self,range2): """merge this bed with another bed to make a longer bed. Returns None if on different chromosomes. keeps the options of this class (not range2) :param range2: :type range2: GenomicRange :return: bigger range with both :rtype: GenomicRange """ if self.chr != ...
python
def merge(self,range2): """merge this bed with another bed to make a longer bed. Returns None if on different chromosomes. keeps the options of this class (not range2) :param range2: :type range2: GenomicRange :return: bigger range with both :rtype: GenomicRange """ if self.chr != ...
[ "def", "merge", "(", "self", ",", "range2", ")", ":", "if", "self", ".", "chr", "!=", "range2", ".", "chr", ":", "return", "None", "o", "=", "type", "(", "self", ")", "(", "self", ".", "chr", ",", "min", "(", "self", ".", "start", ",", "range2"...
merge this bed with another bed to make a longer bed. Returns None if on different chromosomes. keeps the options of this class (not range2) :param range2: :type range2: GenomicRange :return: bigger range with both :rtype: GenomicRange
[ "merge", "this", "bed", "with", "another", "bed", "to", "make", "a", "longer", "bed", ".", "Returns", "None", "if", "on", "different", "chromosomes", "." ]
train
https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/range/__init__.py#L279-L294
jason-weirather/py-seq-tools
seqtools/range/__init__.py
GenomicRange.intersect
def intersect(self,range2): """Return the chunk they overlap as a range. options is passed to result from this object :param range2: :type range2: GenomicRange :return: Range with the intersecting segement, or None if not overlapping :rtype: GenomicRange """ if not self.overlaps(rang...
python
def intersect(self,range2): """Return the chunk they overlap as a range. options is passed to result from this object :param range2: :type range2: GenomicRange :return: Range with the intersecting segement, or None if not overlapping :rtype: GenomicRange """ if not self.overlaps(rang...
[ "def", "intersect", "(", "self", ",", "range2", ")", ":", "if", "not", "self", ".", "overlaps", "(", "range2", ")", ":", "return", "None", "return", "type", "(", "self", ")", "(", "self", ".", "chr", ",", "max", "(", "self", ".", "start", ",", "r...
Return the chunk they overlap as a range. options is passed to result from this object :param range2: :type range2: GenomicRange :return: Range with the intersecting segement, or None if not overlapping :rtype: GenomicRange
[ "Return", "the", "chunk", "they", "overlap", "as", "a", "range", "." ]
train
https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/range/__init__.py#L296-L309
jason-weirather/py-seq-tools
seqtools/range/__init__.py
GenomicRange.cmp
def cmp(self,range2,overlap_size=0): """the comparitor for ranges * return 1 if greater than range2 * return -1 if less than range2 * return 0 if overlapped :param range2: :param overlap_size: allow some padding for an 'equal' comparison (default 0) :type range2: GenomicRange :type ...
python
def cmp(self,range2,overlap_size=0): """the comparitor for ranges * return 1 if greater than range2 * return -1 if less than range2 * return 0 if overlapped :param range2: :param overlap_size: allow some padding for an 'equal' comparison (default 0) :type range2: GenomicRange :type ...
[ "def", "cmp", "(", "self", ",", "range2", ",", "overlap_size", "=", "0", ")", ":", "if", "self", ".", "overlaps", "(", "range2", ",", "padding", "=", "overlap_size", ")", ":", "return", "0", "if", "self", ".", "chr", "<", "range2", ".", "chr", ":",...
the comparitor for ranges * return 1 if greater than range2 * return -1 if less than range2 * return 0 if overlapped :param range2: :param overlap_size: allow some padding for an 'equal' comparison (default 0) :type range2: GenomicRange :type overlap_size: int
[ "the", "comparitor", "for", "ranges" ]
train
https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/range/__init__.py#L311-L331
jason-weirather/py-seq-tools
seqtools/range/__init__.py
GenomicRange.subtract
def subtract(self,range2): """Take another range, and list of ranges after removing range2, keep options from self :param range2: :type range2: GenomicRange :return: List of Genomic Ranges :rtype: GenomicRange[] """ outranges = [] if self.chr != range2.chr: outranges.append(self....
python
def subtract(self,range2): """Take another range, and list of ranges after removing range2, keep options from self :param range2: :type range2: GenomicRange :return: List of Genomic Ranges :rtype: GenomicRange[] """ outranges = [] if self.chr != range2.chr: outranges.append(self....
[ "def", "subtract", "(", "self", ",", "range2", ")", ":", "outranges", "=", "[", "]", "if", "self", ".", "chr", "!=", "range2", ".", "chr", ":", "outranges", ".", "append", "(", "self", ".", "copy", "(", ")", ")", "return", "outranges", "if", "not",...
Take another range, and list of ranges after removing range2, keep options from self :param range2: :type range2: GenomicRange :return: List of Genomic Ranges :rtype: GenomicRange[]
[ "Take", "another", "range", "and", "list", "of", "ranges", "after", "removing", "range2", "keep", "options", "from", "self" ]
train
https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/range/__init__.py#L333-L358
jason-weirather/py-seq-tools
seqtools/range/__init__.py
GenomicRange.distance
def distance(self,rng): """The distance between two ranges. :param rng: another range :type rng: GenomicRange :returns: bases separting, 0 if overlapped or adjacent, -1 if on different chromsomes :rtype: int """ if self.chr != rng.chr: return -1 c = self.cmp(rng) if c == 0: return 0...
python
def distance(self,rng): """The distance between two ranges. :param rng: another range :type rng: GenomicRange :returns: bases separting, 0 if overlapped or adjacent, -1 if on different chromsomes :rtype: int """ if self.chr != rng.chr: return -1 c = self.cmp(rng) if c == 0: return 0...
[ "def", "distance", "(", "self", ",", "rng", ")", ":", "if", "self", ".", "chr", "!=", "rng", ".", "chr", ":", "return", "-", "1", "c", "=", "self", ".", "cmp", "(", "rng", ")", "if", "c", "==", "0", ":", "return", "0", "if", "c", "<", "0", ...
The distance between two ranges. :param rng: another range :type rng: GenomicRange :returns: bases separting, 0 if overlapped or adjacent, -1 if on different chromsomes :rtype: int
[ "The", "distance", "between", "two", "ranges", "." ]
train
https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/range/__init__.py#L366-L379
mitsei/dlkit
dlkit/json_/relationship/searches.py
RelationshipSearchResults.get_relationships
def get_relationships(self): """Gets the relationship list resulting from a search. return: (osid.relationship.RelationshipList) - the relationship list raise: IllegalState - list already retrieved *compliance: mandatory -- This method must be implemented.* """...
python
def get_relationships(self): """Gets the relationship list resulting from a search. return: (osid.relationship.RelationshipList) - the relationship list raise: IllegalState - list already retrieved *compliance: mandatory -- This method must be implemented.* """...
[ "def", "get_relationships", "(", "self", ")", ":", "if", "self", ".", "retrieved", ":", "raise", "errors", ".", "IllegalState", "(", "'List has already been retrieved.'", ")", "self", ".", "retrieved", "=", "True", "return", "objects", ".", "RelationshipList", "...
Gets the relationship list resulting from a search. return: (osid.relationship.RelationshipList) - the relationship list raise: IllegalState - list already retrieved *compliance: mandatory -- This method must be implemented.*
[ "Gets", "the", "relationship", "list", "resulting", "from", "a", "search", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/relationship/searches.py#L98-L110
mitsei/dlkit
dlkit/json_/relationship/searches.py
FamilySearchResults.get_families
def get_families(self): """Gets the family list resulting from a search. return: (osid.relationship.FamilyList) - the family list raise: IllegalState - list already retrieved *compliance: mandatory -- This method must be implemented.* """ if self.retrieved: ...
python
def get_families(self): """Gets the family list resulting from a search. return: (osid.relationship.FamilyList) - the family list raise: IllegalState - list already retrieved *compliance: mandatory -- This method must be implemented.* """ if self.retrieved: ...
[ "def", "get_families", "(", "self", ")", ":", "if", "self", ".", "retrieved", ":", "raise", "errors", ".", "IllegalState", "(", "'List has already been retrieved.'", ")", "self", ".", "retrieved", "=", "True", "return", "objects", ".", "FamilyList", "(", "self...
Gets the family list resulting from a search. return: (osid.relationship.FamilyList) - the family list raise: IllegalState - list already retrieved *compliance: mandatory -- This method must be implemented.*
[ "Gets", "the", "family", "list", "resulting", "from", "a", "search", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/relationship/searches.py#L226-L237
svetlyak40wt/python-cl-conditions
example/example.py
parse_log_entry
def parse_log_entry(text): """This function does all real job on log line parsing. it setup two cases for restart parsing if a line with wrong format was found. Restarts: - use_value: just retuns an object it was passed. This can be any value. - reparse: calls `parse_log_entry` again with...
python
def parse_log_entry(text): """This function does all real job on log line parsing. it setup two cases for restart parsing if a line with wrong format was found. Restarts: - use_value: just retuns an object it was passed. This can be any value. - reparse: calls `parse_log_entry` again with...
[ "def", "parse_log_entry", "(", "text", ")", ":", "text", "=", "text", ".", "strip", "(", ")", "if", "well_formed_log_entry_p", "(", "text", ")", ":", "return", "LogEntry", "(", "text", ")", "else", ":", "def", "use_value", "(", "obj", ")", ":", "return...
This function does all real job on log line parsing. it setup two cases for restart parsing if a line with wrong format was found. Restarts: - use_value: just retuns an object it was passed. This can be any value. - reparse: calls `parse_log_entry` again with other text value. Beware, t...
[ "This", "function", "does", "all", "real", "job", "on", "log", "line", "parsing", ".", "it", "setup", "two", "cases", "for", "restart", "parsing", "if", "a", "line", "with", "wrong", "format", "was", "found", "." ]
train
https://github.com/svetlyak40wt/python-cl-conditions/blob/709dfd55f2b8cf7eb9b7d86a6b70c8a3feed4b10/example/example.py#L67-L90
svetlyak40wt/python-cl-conditions
example/example.py
log_analyzer
def log_analyzer(path): """This procedure replaces every line which can't be parsed with special object MalformedLogEntry. """ with handle(MalformedLogEntryError, lambda (c): invoke_restart('use_value', MalformedLogEntry(c.text...
python
def log_analyzer(path): """This procedure replaces every line which can't be parsed with special object MalformedLogEntry. """ with handle(MalformedLogEntryError, lambda (c): invoke_restart('use_value', MalformedLogEntry(c.text...
[ "def", "log_analyzer", "(", "path", ")", ":", "with", "handle", "(", "MalformedLogEntryError", ",", "lambda", "(", "c", ")", ":", "invoke_restart", "(", "'use_value'", ",", "MalformedLogEntry", "(", "c", ".", "text", ")", ")", ")", ":", "for", "filename", ...
This procedure replaces every line which can't be parsed with special object MalformedLogEntry.
[ "This", "procedure", "replaces", "every", "line", "which", "can", "t", "be", "parsed", "with", "special", "object", "MalformedLogEntry", "." ]
train
https://github.com/svetlyak40wt/python-cl-conditions/blob/709dfd55f2b8cf7eb9b7d86a6b70c8a3feed4b10/example/example.py#L93-L102
svetlyak40wt/python-cl-conditions
example/example.py
log_analyzer2
def log_analyzer2(path): """This procedure considers every line which can't be parsed as a line with ERROR level. """ with handle(MalformedLogEntryError, lambda (c): invoke_restart('reparse', 'ERROR: ' + c.text)): for f...
python
def log_analyzer2(path): """This procedure considers every line which can't be parsed as a line with ERROR level. """ with handle(MalformedLogEntryError, lambda (c): invoke_restart('reparse', 'ERROR: ' + c.text)): for f...
[ "def", "log_analyzer2", "(", "path", ")", ":", "with", "handle", "(", "MalformedLogEntryError", ",", "lambda", "(", "c", ")", ":", "invoke_restart", "(", "'reparse'", ",", "'ERROR: '", "+", "c", ".", "text", ")", ")", ":", "for", "filename", "in", "find_...
This procedure considers every line which can't be parsed as a line with ERROR level.
[ "This", "procedure", "considers", "every", "line", "which", "can", "t", "be", "parsed", "as", "a", "line", "with", "ERROR", "level", "." ]
train
https://github.com/svetlyak40wt/python-cl-conditions/blob/709dfd55f2b8cf7eb9b7d86a6b70c8a3feed4b10/example/example.py#L105-L114
OpenAgInitiative/openag_python
openag/cli/db/__init__.py
init
def init(db_url, api_url): """ Initialize the database server. Sets some configuration parameters on the server, creates the necessary databases for this project, pushes design documents into those databases, and sets up replication with the cloud server if one has already been selected. """ ...
python
def init(db_url, api_url): """ Initialize the database server. Sets some configuration parameters on the server, creates the necessary databases for this project, pushes design documents into those databases, and sets up replication with the cloud server if one has already been selected. """ ...
[ "def", "init", "(", "db_url", ",", "api_url", ")", ":", "old_db_url", "=", "config", "[", "\"local_server\"", "]", "[", "\"url\"", "]", "if", "old_db_url", "and", "old_db_url", "!=", "db_url", ":", "raise", "click", ".", "ClickException", "(", "\"Local datab...
Initialize the database server. Sets some configuration parameters on the server, creates the necessary databases for this project, pushes design documents into those databases, and sets up replication with the cloud server if one has already been selected.
[ "Initialize", "the", "database", "server", ".", "Sets", "some", "configuration", "parameters", "on", "the", "server", "creates", "the", "necessary", "databases", "for", "this", "project", "pushes", "design", "documents", "into", "those", "databases", "and", "sets"...
train
https://github.com/OpenAgInitiative/openag_python/blob/f6202340292bbf7185e1a7d4290188c0dacbb8d0/openag/cli/db/__init__.py#L27-L95
OpenAgInitiative/openag_python
openag/cli/db/__init__.py
clear
def clear(): """ Clear all data on the local server. Useful for debugging purposed. """ utils.check_for_local_server() click.confirm( "Are you sure you want to do this? It will delete all of your data", abort=True ) server = Server(config["local_server"]["url"]) for db_na...
python
def clear(): """ Clear all data on the local server. Useful for debugging purposed. """ utils.check_for_local_server() click.confirm( "Are you sure you want to do this? It will delete all of your data", abort=True ) server = Server(config["local_server"]["url"]) for db_na...
[ "def", "clear", "(", ")", ":", "utils", ".", "check_for_local_server", "(", ")", "click", ".", "confirm", "(", "\"Are you sure you want to do this? It will delete all of your data\"", ",", "abort", "=", "True", ")", "server", "=", "Server", "(", "config", "[", "\"...
Clear all data on the local server. Useful for debugging purposed.
[ "Clear", "all", "data", "on", "the", "local", "server", ".", "Useful", "for", "debugging", "purposed", "." ]
train
https://github.com/OpenAgInitiative/openag_python/blob/f6202340292bbf7185e1a7d4290188c0dacbb8d0/openag/cli/db/__init__.py#L117-L128
OpenAgInitiative/openag_python
openag/cli/db/__init__.py
load_fixture
def load_fixture(fixture_file): """ Populate the database from a JSON file. Reads the JSON file FIXTURE_FILE and uses it to populate the database. Fuxture files should consist of a dictionary mapping database names to arrays of objects to store in those databases. """ utils.check_for_local_s...
python
def load_fixture(fixture_file): """ Populate the database from a JSON file. Reads the JSON file FIXTURE_FILE and uses it to populate the database. Fuxture files should consist of a dictionary mapping database names to arrays of objects to store in those databases. """ utils.check_for_local_s...
[ "def", "load_fixture", "(", "fixture_file", ")", ":", "utils", ".", "check_for_local_server", "(", ")", "local_url", "=", "config", "[", "\"local_server\"", "]", "[", "\"url\"", "]", "server", "=", "Server", "(", "local_url", ")", "fixture", "=", "json", "."...
Populate the database from a JSON file. Reads the JSON file FIXTURE_FILE and uses it to populate the database. Fuxture files should consist of a dictionary mapping database names to arrays of objects to store in those databases.
[ "Populate", "the", "database", "from", "a", "JSON", "file", ".", "Reads", "the", "JSON", "file", "FIXTURE_FILE", "and", "uses", "it", "to", "populate", "the", "database", ".", "Fuxture", "files", "should", "consist", "of", "a", "dictionary", "mapping", "data...
train
https://github.com/OpenAgInitiative/openag_python/blob/f6202340292bbf7185e1a7d4290188c0dacbb8d0/openag/cli/db/__init__.py#L132-L155
OpenAgInitiative/openag_python
openag/cli/db/__init__.py
update_module_types
def update_module_types(): """ Download the repositories for all of the firmware_module_type records and update them using the `module.json` files from the repositories themselves. Currently only works for git repositories. """ local_url = config["local_server"]["url"] server = Server(local_...
python
def update_module_types(): """ Download the repositories for all of the firmware_module_type records and update them using the `module.json` files from the repositories themselves. Currently only works for git repositories. """ local_url = config["local_server"]["url"] server = Server(local_...
[ "def", "update_module_types", "(", ")", ":", "local_url", "=", "config", "[", "\"local_server\"", "]", "[", "\"url\"", "]", "server", "=", "Server", "(", "local_url", ")", "db", "=", "server", "[", "FIRMWARE_MODULE_TYPE", "]", "temp_folder", "=", "mkdtemp", ...
Download the repositories for all of the firmware_module_type records and update them using the `module.json` files from the repositories themselves. Currently only works for git repositories.
[ "Download", "the", "repositories", "for", "all", "of", "the", "firmware_module_type", "records", "and", "update", "them", "using", "the", "module", ".", "json", "files", "from", "the", "repositories", "themselves", ".", "Currently", "only", "works", "for", "git"...
train
https://github.com/OpenAgInitiative/openag_python/blob/f6202340292bbf7185e1a7d4290188c0dacbb8d0/openag/cli/db/__init__.py#L177-L195
matham/pyflycap2
pyflycap2/utils.py
strip_comments
def strip_comments(code): '''Returns the headers with comments removed. ''' single_comment = compile('//.*') # single line comment multi_comment = compile('/\\*\\*.*?\\*/', re.DOTALL) # multiline comment code = sub(single_comment, '', code) code = sub(multi_comment, '', code) return...
python
def strip_comments(code): '''Returns the headers with comments removed. ''' single_comment = compile('//.*') # single line comment multi_comment = compile('/\\*\\*.*?\\*/', re.DOTALL) # multiline comment code = sub(single_comment, '', code) code = sub(multi_comment, '', code) return...
[ "def", "strip_comments", "(", "code", ")", ":", "single_comment", "=", "compile", "(", "'//.*'", ")", "# single line comment\r", "multi_comment", "=", "compile", "(", "'/\\\\*\\\\*.*?\\\\*/'", ",", "re", ".", "DOTALL", ")", "# multiline comment\r", "code", "=", "s...
Returns the headers with comments removed.
[ "Returns", "the", "headers", "with", "comments", "removed", "." ]
train
https://github.com/matham/pyflycap2/blob/ce84f8f7553ccee7a7a3bbbc152574a68683862f/pyflycap2/utils.py#L67-L74
matham/pyflycap2
pyflycap2/utils.py
parse_prototype
def parse_prototype(prototype): '''Returns a :attr:`FunctionSpec` instance from the input. ''' val = ' '.join(prototype.splitlines()) f = match(func_pat, val) # match the whole function if f is None: raise Exception('Cannot parse function prototype "{}"'.format(val)) ftp, pointer...
python
def parse_prototype(prototype): '''Returns a :attr:`FunctionSpec` instance from the input. ''' val = ' '.join(prototype.splitlines()) f = match(func_pat, val) # match the whole function if f is None: raise Exception('Cannot parse function prototype "{}"'.format(val)) ftp, pointer...
[ "def", "parse_prototype", "(", "prototype", ")", ":", "val", "=", "' '", ".", "join", "(", "prototype", ".", "splitlines", "(", ")", ")", "f", "=", "match", "(", "func_pat", ",", "val", ")", "# match the whole function\r", "if", "f", "is", "None", ":", ...
Returns a :attr:`FunctionSpec` instance from the input.
[ "Returns", "a", ":", "attr", ":", "FunctionSpec", "instance", "from", "the", "input", "." ]
train
https://github.com/matham/pyflycap2/blob/ce84f8f7553ccee7a7a3bbbc152574a68683862f/pyflycap2/utils.py#L77-L96
matham/pyflycap2
pyflycap2/utils.py
parse_struct
def parse_struct(type_name, body, name): '''Returns a :attr:`StructSpec` instance from the input. ''' type_name, name = type_name.strip(), name.strip() lines = [l.strip() for l in body.splitlines() if l.strip()] members = [] for line in lines: m = match(variable_pat, line) ...
python
def parse_struct(type_name, body, name): '''Returns a :attr:`StructSpec` instance from the input. ''' type_name, name = type_name.strip(), name.strip() lines = [l.strip() for l in body.splitlines() if l.strip()] members = [] for line in lines: m = match(variable_pat, line) ...
[ "def", "parse_struct", "(", "type_name", ",", "body", ",", "name", ")", ":", "type_name", ",", "name", "=", "type_name", ".", "strip", "(", ")", ",", "name", ".", "strip", "(", ")", "lines", "=", "[", "l", ".", "strip", "(", ")", "for", "l", "in"...
Returns a :attr:`StructSpec` instance from the input.
[ "Returns", "a", ":", "attr", ":", "StructSpec", "instance", "from", "the", "input", "." ]
train
https://github.com/matham/pyflycap2/blob/ce84f8f7553ccee7a7a3bbbc152574a68683862f/pyflycap2/utils.py#L99-L113
matham/pyflycap2
pyflycap2/utils.py
parse_enum
def parse_enum(type_name, body, name): '''Returns a :attr:`EnumSpec` instance from the input. ''' type_name, name = type_name.strip(), name.strip() lines = [l.strip(' ,') for l in body.splitlines() if l.strip(', ')] members = [] for line in lines: vals = [v.strip() for v in line...
python
def parse_enum(type_name, body, name): '''Returns a :attr:`EnumSpec` instance from the input. ''' type_name, name = type_name.strip(), name.strip() lines = [l.strip(' ,') for l in body.splitlines() if l.strip(', ')] members = [] for line in lines: vals = [v.strip() for v in line...
[ "def", "parse_enum", "(", "type_name", ",", "body", ",", "name", ")", ":", "type_name", ",", "name", "=", "type_name", ".", "strip", "(", ")", ",", "name", ".", "strip", "(", ")", "lines", "=", "[", "l", ".", "strip", "(", "' ,'", ")", "for", "l"...
Returns a :attr:`EnumSpec` instance from the input.
[ "Returns", "a", ":", "attr", ":", "EnumSpec", "instance", "from", "the", "input", "." ]
train
https://github.com/matham/pyflycap2/blob/ce84f8f7553ccee7a7a3bbbc152574a68683862f/pyflycap2/utils.py#L116-L130