body_hash stringlengths 64 64 | body stringlengths 23 109k | docstring stringlengths 1 57k | path stringlengths 4 198 | name stringlengths 1 115 | repository_name stringlengths 7 111 | repository_stars float64 0 191k | lang stringclasses 1
value | body_without_docstring stringlengths 14 108k | unified stringlengths 45 133k |
|---|---|---|---|---|---|---|---|---|---|
107335678ab6ba24ab3ad1e18690cd983ad3d465ccadd1bfcd428da2529a9a0b | def create(self, name, instance_dir=None, config=None, schema=None, data_dir=None):
'http://wiki.apache.org/solr/CoreAdmin#head-7ca1b98a9df8b8ca0dcfbfc49940ed5ac98c4a08'
params = {'action': 'CREATE', 'name': name}
if (instance_dir is None):
params.update(instanceDir=name)
else:
params.up... | http://wiki.apache.org/solr/CoreAdmin#head-7ca1b98a9df8b8ca0dcfbfc49940ed5ac98c4a08 | pysolr.py | create | sxalexander/pysolr | 0 | python | def create(self, name, instance_dir=None, config=None, schema=None, data_dir=None):
params = {'action': 'CREATE', 'name': name}
if (instance_dir is None):
params.update(instanceDir=name)
else:
params.update(instanceDir=instance_dir)
if data_dir:
params.update(dataDir=data_di... | def create(self, name, instance_dir=None, config=None, schema=None, data_dir=None):
params = {'action': 'CREATE', 'name': name}
if (instance_dir is None):
params.update(instanceDir=name)
else:
params.update(instanceDir=instance_dir)
if data_dir:
params.update(dataDir=data_di... |
8ce87056b6839575cb3f0fe2cf266b9979663c8e6f4060054a4e4db284ec68ef | def reload(self, core):
'http://wiki.apache.org/solr/CoreAdmin#head-3f125034c6a64611779442539812067b8b430930'
params = {'action': 'RELOAD', 'core': core}
return self._get_url(params=params) | http://wiki.apache.org/solr/CoreAdmin#head-3f125034c6a64611779442539812067b8b430930 | pysolr.py | reload | sxalexander/pysolr | 0 | python | def reload(self, core):
params = {'action': 'RELOAD', 'core': core}
return self._get_url(params=params) | def reload(self, core):
params = {'action': 'RELOAD', 'core': core}
return self._get_url(params=params)<|docstring|>http://wiki.apache.org/solr/CoreAdmin#head-3f125034c6a64611779442539812067b8b430930<|endoftext|> |
9a2e91e4c8f72db5c66fcba37a169a4b9930c9223b44ec33734c053cd7b4b357 | def rename(self, core, other):
'http://wiki.apache.org/solr/CoreAdmin#head-9473bee1abed39e8583ba45ef993bebb468e3afe'
params = {'action': 'RENAME', 'core': core, 'other': other}
return self._get_url(params=params) | http://wiki.apache.org/solr/CoreAdmin#head-9473bee1abed39e8583ba45ef993bebb468e3afe | pysolr.py | rename | sxalexander/pysolr | 0 | python | def rename(self, core, other):
params = {'action': 'RENAME', 'core': core, 'other': other}
return self._get_url(params=params) | def rename(self, core, other):
params = {'action': 'RENAME', 'core': core, 'other': other}
return self._get_url(params=params)<|docstring|>http://wiki.apache.org/solr/CoreAdmin#head-9473bee1abed39e8583ba45ef993bebb468e3afe<|endoftext|> |
24506070f8a9dca9f21fb521b80f83e267d7e819df96d96e31da5b7fb342943f | def swap(self, core, other):
'http://wiki.apache.org/solr/CoreAdmin#head-928b872300f1b66748c85cebb12a59bb574e501b'
params = {'action': 'SWAP', 'core': core, 'other': other}
return self._get_url(params=params) | http://wiki.apache.org/solr/CoreAdmin#head-928b872300f1b66748c85cebb12a59bb574e501b | pysolr.py | swap | sxalexander/pysolr | 0 | python | def swap(self, core, other):
params = {'action': 'SWAP', 'core': core, 'other': other}
return self._get_url(params=params) | def swap(self, core, other):
params = {'action': 'SWAP', 'core': core, 'other': other}
return self._get_url(params=params)<|docstring|>http://wiki.apache.org/solr/CoreAdmin#head-928b872300f1b66748c85cebb12a59bb574e501b<|endoftext|> |
f945e11b9ac8a7fc1c1bef82efb475ba8268fbe2bcea4a7d42be31160ffd1b5c | def unload(self, core, delete_instance_dir=False, delete_index=False, delete_data_dir=False):
'http://wiki.apache.org/solr/CoreAdmin#head-f5055a885932e2c25096a8856de840b06764d143'
params = {'action': 'UNLOAD', 'core': core, 'deleteDataDir': delete_data_dir, 'deleteInstanceDir': delete_instance_dir, 'deleteIndex... | http://wiki.apache.org/solr/CoreAdmin#head-f5055a885932e2c25096a8856de840b06764d143 | pysolr.py | unload | sxalexander/pysolr | 0 | python | def unload(self, core, delete_instance_dir=False, delete_index=False, delete_data_dir=False):
params = {'action': 'UNLOAD', 'core': core, 'deleteDataDir': delete_data_dir, 'deleteInstanceDir': delete_instance_dir, 'deleteIndex': delete_index}
return self._get_url(params=params) | def unload(self, core, delete_instance_dir=False, delete_index=False, delete_data_dir=False):
params = {'action': 'UNLOAD', 'core': core, 'deleteDataDir': delete_data_dir, 'deleteInstanceDir': delete_instance_dir, 'deleteIndex': delete_index}
return self._get_url(params=params)<|docstring|>http://wiki.apac... |
0420756c068706cf0b7daeca9060a24d50708cef62e21194b8984e04779cc267 | @api_view(['GET', 'POST', 'DELETE'])
def person(request):
'\n\n :param request:\n :return:\n '
if (request.method == 'GET'):
persons = Person.objects.all()
document_id = request.query_params.get('document_id', None)
document_type = request.query_params.get('document_type', None)... | :param request:
:return: | registration/views/person.py | person | Eddyjim/registrations-backend | 0 | python | @api_view(['GET', 'POST', 'DELETE'])
def person(request):
'\n\n :param request:\n :return:\n '
if (request.method == 'GET'):
persons = Person.objects.all()
document_id = request.query_params.get('document_id', None)
document_type = request.query_params.get('document_type', None)... | @api_view(['GET', 'POST', 'DELETE'])
def person(request):
'\n\n :param request:\n :return:\n '
if (request.method == 'GET'):
persons = Person.objects.all()
document_id = request.query_params.get('document_id', None)
document_type = request.query_params.get('document_type', None)... |
7ed7c98c57ab29d8f49bf4648b8f78363d965369cc96323c341c3f10e55dc004 | def get_controller_object(controller):
"\n Get the object associated with a controller, or None if there's no object,\n which is usually a group.\n "
controller_objects = controller.controllerObject.listConnections(s=True, d=False)
return (controller_objects[0] if controller_objects else None) | Get the object associated with a controller, or None if there's no object,
which is usually a group. | scripts/zMayaTools/controller_editor.py | get_controller_object | zewt/zMayaTools | 73 | python | def get_controller_object(controller):
"\n Get the object associated with a controller, or None if there's no object,\n which is usually a group.\n "
controller_objects = controller.controllerObject.listConnections(s=True, d=False)
return (controller_objects[0] if controller_objects else None) | def get_controller_object(controller):
"\n Get the object associated with a controller, or None if there's no object,\n which is usually a group.\n "
controller_objects = controller.controllerObject.listConnections(s=True, d=False)
return (controller_objects[0] if controller_objects else None)<|doc... |
74abedc74b5e377c81f7633ff1c8828a0504d5c9957dcc7bc0fa17725b47d797 | def get_controller_children(parent, disconnect_from_parent=False):
'\n Return a list of all children of the given controller.\n\n If disconnect_from_parent is true, disconnect the children list so edits can be\n made. Reassign the resulting list using assign_controller_children.\n '
all_children = ... | Return a list of all children of the given controller.
If disconnect_from_parent is true, disconnect the children list so edits can be
made. Reassign the resulting list using assign_controller_children. | scripts/zMayaTools/controller_editor.py | get_controller_children | zewt/zMayaTools | 73 | python | def get_controller_children(parent, disconnect_from_parent=False):
'\n Return a list of all children of the given controller.\n\n If disconnect_from_parent is true, disconnect the children list so edits can be\n made. Reassign the resulting list using assign_controller_children.\n '
all_children = ... | def get_controller_children(parent, disconnect_from_parent=False):
'\n Return a list of all children of the given controller.\n\n If disconnect_from_parent is true, disconnect the children list so edits can be\n made. Reassign the resulting list using assign_controller_children.\n '
all_children = ... |
1a9e42a199b880925c62797c5b0f1fa17d9e7463a75714b24fea99d910a40760 | def assign_controller_children(parent, children):
"\n Assign a controller's child list.\n\n This is always called after disconnecting the list using\n get_controller_children(disconnect_from_parent=True). This doesn't connect\n the prepopulate attribute.\n "
for (idx, child) in enumerate(childre... | Assign a controller's child list.
This is always called after disconnecting the list using
get_controller_children(disconnect_from_parent=True). This doesn't connect
the prepopulate attribute. | scripts/zMayaTools/controller_editor.py | assign_controller_children | zewt/zMayaTools | 73 | python | def assign_controller_children(parent, children):
"\n Assign a controller's child list.\n\n This is always called after disconnecting the list using\n get_controller_children(disconnect_from_parent=True). This doesn't connect\n the prepopulate attribute.\n "
for (idx, child) in enumerate(childre... | def assign_controller_children(parent, children):
"\n Assign a controller's child list.\n\n This is always called after disconnecting the list using\n get_controller_children(disconnect_from_parent=True). This doesn't connect\n the prepopulate attribute.\n "
for (idx, child) in enumerate(childre... |
371c4c47e31ecb2e0be9c4983bd40d79cac7b60bf1f95b74a15ded8eae0bd4d0 | def _remove_gaps_in_child_list(controller):
"\n If there are gaps in the children array of a controller, pick walking doesn't\n work. Remove any gaps in the given controller's child list, preserving the\n order of connections.\n "
connections = []
any_gaps_seen = False
for entry in controll... | If there are gaps in the children array of a controller, pick walking doesn't
work. Remove any gaps in the given controller's child list, preserving the
order of connections. | scripts/zMayaTools/controller_editor.py | _remove_gaps_in_child_list | zewt/zMayaTools | 73 | python | def _remove_gaps_in_child_list(controller):
"\n If there are gaps in the children array of a controller, pick walking doesn't\n work. Remove any gaps in the given controller's child list, preserving the\n order of connections.\n "
connections = []
any_gaps_seen = False
for entry in controll... | def _remove_gaps_in_child_list(controller):
"\n If there are gaps in the children array of a controller, pick walking doesn't\n work. Remove any gaps in the given controller's child list, preserving the\n order of connections.\n "
connections = []
any_gaps_seen = False
for entry in controll... |
299634820ce8cd7df517f8932e1668b76403a924451fb6ae842eb893d8f15723 | def remove_gaps_in_all_controllers():
'\n Call remove_gaps_in_child_list in all non-referenced controllers to correct\n any existing gaps.\n\n This is only needed to correct any bad controller connections created by earlier\n versions.\n '
for controller in pm.ls(type='controller'):
if pm... | Call remove_gaps_in_child_list in all non-referenced controllers to correct
any existing gaps.
This is only needed to correct any bad controller connections created by earlier
versions. | scripts/zMayaTools/controller_editor.py | remove_gaps_in_all_controllers | zewt/zMayaTools | 73 | python | def remove_gaps_in_all_controllers():
'\n Call remove_gaps_in_child_list in all non-referenced controllers to correct\n any existing gaps.\n\n This is only needed to correct any bad controller connections created by earlier\n versions.\n '
for controller in pm.ls(type='controller'):
if pm... | def remove_gaps_in_all_controllers():
'\n Call remove_gaps_in_child_list in all non-referenced controllers to correct\n any existing gaps.\n\n This is only needed to correct any bad controller connections created by earlier\n versions.\n '
for controller in pm.ls(type='controller'):
if pm... |
08f29c594b8417eb06ca608e78e4e3d5f9a73e679462dbd475429fb6466a2d62 | def set_controller_parent(controller, parent, after=None):
"\n Set controller's parent to parent.\n\n If after is None, the node becomes the first child. Otherwise, the node is placed\n after the given node. If after is at_end, the node is placed at the end.\n\n controller -p should do this, but the d... | Set controller's parent to parent.
If after is None, the node becomes the first child. Otherwise, the node is placed
after the given node. If after is at_end, the node is placed at the end.
controller -p should do this, but the docs don't really describe how it works and
there doesn't seem to be any way to change t... | scripts/zMayaTools/controller_editor.py | set_controller_parent | zewt/zMayaTools | 73 | python | def set_controller_parent(controller, parent, after=None):
"\n Set controller's parent to parent.\n\n If after is None, the node becomes the first child. Otherwise, the node is placed\n after the given node. If after is at_end, the node is placed at the end.\n\n controller -p should do this, but the d... | def set_controller_parent(controller, parent, after=None):
"\n Set controller's parent to parent.\n\n If after is None, the node becomes the first child. Otherwise, the node is placed\n after the given node. If after is at_end, the node is placed at the end.\n\n controller -p should do this, but the d... |
517a0745ad9c2411a76b91a64bf98f87bcdf5726ef40f8011853c65a01b06044 | def find_stale_controllers():
"\n Stale controller nodes often accumulate in scenes, since they aren't automatically deleted\n when their transforms are deleted, and they're a pain to clean up.\n \n Return all dead controller nodes: nodes which have no transform, and which don't have any\n children w... | Stale controller nodes often accumulate in scenes, since they aren't automatically deleted
when their transforms are deleted, and they're a pain to clean up.
Return all dead controller nodes: nodes which have no transform, and which don't have any
children with a transform (not a group). | scripts/zMayaTools/controller_editor.py | find_stale_controllers | zewt/zMayaTools | 73 | python | def find_stale_controllers():
"\n Stale controller nodes often accumulate in scenes, since they aren't automatically deleted\n when their transforms are deleted, and they're a pain to clean up.\n \n Return all dead controller nodes: nodes which have no transform, and which don't have any\n children w... | def find_stale_controllers():
"\n Stale controller nodes often accumulate in scenes, since they aren't automatically deleted\n when their transforms are deleted, and they're a pain to clean up.\n \n Return all dead controller nodes: nodes which have no transform, and which don't have any\n children w... |
7e7c637390fb329a66396bb03766a84bfd896805ca3667a886eff2846144adb8 | def delete_stale_controllers():
'\n Delete all stale controllers in the scene.\n '
stale_controllers = find_stale_controllers()
if (not stale_controllers):
log.info('No stale controllers')
return
pm.delete(stale_controllers)
log.info('Deleted %i stale %s', len(stale_controllers... | Delete all stale controllers in the scene. | scripts/zMayaTools/controller_editor.py | delete_stale_controllers | zewt/zMayaTools | 73 | python | def delete_stale_controllers():
'\n \n '
stale_controllers = find_stale_controllers()
if (not stale_controllers):
log.info('No stale controllers')
return
pm.delete(stale_controllers)
log.info('Deleted %i stale %s', len(stale_controllers), ('controller' if (len(stale_controllers... | def delete_stale_controllers():
'\n \n '
stale_controllers = find_stale_controllers()
if (not stale_controllers):
log.info('No stale controllers')
return
pm.delete(stale_controllers)
log.info('Deleted %i stale %s', len(stale_controllers), ('controller' if (len(stale_controllers... |
f4f5ce05477c56d4fedc59a59630eb2438424113a09a136a7c21727953068391 | @property
def current_selection(self):
'\n If a controller is selected in the UI, return its node.\n '
items = self.ui.controllerTree.selectedItems()
if (not items):
return None
return items[0].controller_node | If a controller is selected in the UI, return its node. | scripts/zMayaTools/controller_editor.py | current_selection | zewt/zMayaTools | 73 | python | @property
def current_selection(self):
'\n \n '
items = self.ui.controllerTree.selectedItems()
if (not items):
return None
return items[0].controller_node | @property
def current_selection(self):
'\n \n '
items = self.ui.controllerTree.selectedItems()
if (not items):
return None
return items[0].controller_node<|docstring|>If a controller is selected in the UI, return its node.<|endoftext|> |
9036b9d94f27c9783a0c02cb9f4a659e6fb10f9c340b1ef4808c41121b1e28ea | def create_controller_for_objects(self, nodes):
"\n Create controllers. nodes is a list of controller objects, which must be transforms.\n\n If an entry in nodes is None, create a controller without any object, which can be\n used as a group. This is what you get from pm.controller(g=True).\n... | Create controllers. nodes is a list of controller objects, which must be transforms.
If an entry in nodes is None, create a controller without any object, which can be
used as a group. This is what you get from pm.controller(g=True).
Note that we don't use pm.controller, since it doesn't return the new node like mo... | scripts/zMayaTools/controller_editor.py | create_controller_for_objects | zewt/zMayaTools | 73 | python | def create_controller_for_objects(self, nodes):
"\n Create controllers. nodes is a list of controller objects, which must be transforms.\n\n If an entry in nodes is None, create a controller without any object, which can be\n used as a group. This is what you get from pm.controller(g=True).\n... | def create_controller_for_objects(self, nodes):
"\n Create controllers. nodes is a list of controller objects, which must be transforms.\n\n If an entry in nodes is None, create a controller without any object, which can be\n used as a group. This is what you get from pm.controller(g=True).\n... |
6c56b76b6949ebd5158dcc2bbf41931c6f44e59c6182d05262b3748e150b8cf1 | def _async_refresh(self):
"\n Queue a refresh. If this is called multiple times before we do the refresh, we'll only\n refresh once.\n "
qt_helpers.run_async_once(self.refresh) | Queue a refresh. If this is called multiple times before we do the refresh, we'll only
refresh once. | scripts/zMayaTools/controller_editor.py | _async_refresh | zewt/zMayaTools | 73 | python | def _async_refresh(self):
"\n Queue a refresh. If this is called multiple times before we do the refresh, we'll only\n refresh once.\n "
qt_helpers.run_async_once(self.refresh) | def _async_refresh(self):
"\n Queue a refresh. If this is called multiple times before we do the refresh, we'll only\n refresh once.\n "
qt_helpers.run_async_once(self.refresh)<|docstring|>Queue a refresh. If this is called multiple times before we do the refresh, we'll only
refresh once.... |
3322062548dc4151f4362fbf39c2303202fe6180ce60e70bda8d260714417f41 | def get_workflows():
'\n :return: all registered workflows\n '
return get_flattened_subclasses(Workflow) | :return: all registered workflows | leapp/workflows/__init__.py | get_workflows | dhodovsk/leapp | 29 | python | def get_workflows():
'\n \n '
return get_flattened_subclasses(Workflow) | def get_workflows():
'\n \n '
return get_flattened_subclasses(Workflow)<|docstring|>:return: all registered workflows<|endoftext|> |
dd2d93099789c38ce31021a4026d526a7ccc26be9aa9833f223681be21020fb0 | @property
def errors(self):
'\n :return: All reported errors\n '
return self._errors | :return: All reported errors | leapp/workflows/__init__.py | errors | dhodovsk/leapp | 29 | python | @property
def errors(self):
'\n \n '
return self._errors | @property
def errors(self):
'\n \n '
return self._errors<|docstring|>:return: All reported errors<|endoftext|> |
75f5e5dedc14c68f4471c06fa1a112236cae586c77a73660830d5974430f1696 | @property
def answer_store(self):
'\n : return: AnswerStore instance used for messaging\n '
return self._answer_store | : return: AnswerStore instance used for messaging | leapp/workflows/__init__.py | answer_store | dhodovsk/leapp | 29 | python | @property
def answer_store(self):
'\n \n '
return self._answer_store | @property
def answer_store(self):
'\n \n '
return self._answer_store<|docstring|>: return: AnswerStore instance used for messaging<|endoftext|> |
47de5af6e9c14ab21fdb04ee4e4c8c3326ef7a59d3d0cf03d5575897fa693f08 | def save_answers(self, answerfile_path, userchoices_path):
'\n Generates an answer file for the dialogs of the workflow and saves it to `answerfile_path`.\n Updates a .userchoices file at `userchoices_path` with new answers encountered in answerfile.\n\n :param answerfile_path: The path where t... | Generates an answer file for the dialogs of the workflow and saves it to `answerfile_path`.
Updates a .userchoices file at `userchoices_path` with new answers encountered in answerfile.
:param answerfile_path: The path where to store the answer file.
:param userchoices_path: The path where to store the .userchoices fi... | leapp/workflows/__init__.py | save_answers | dhodovsk/leapp | 29 | python | def save_answers(self, answerfile_path, userchoices_path):
'\n Generates an answer file for the dialogs of the workflow and saves it to `answerfile_path`.\n Updates a .userchoices file at `userchoices_path` with new answers encountered in answerfile.\n\n :param answerfile_path: The path where t... | def save_answers(self, answerfile_path, userchoices_path):
'\n Generates an answer file for the dialogs of the workflow and saves it to `answerfile_path`.\n Updates a .userchoices file at `userchoices_path` with new answers encountered in answerfile.\n\n :param answerfile_path: The path where t... |
1281063758130c730878da9456994a5dc1970a4e04cb6eb443e815ee4a880630 | def __init__(self, logger=None, auto_reboot=False):
'\n :param logger: Optional logger to be used instead of leapp.workflow\n :type logger: Instance of :py:class:`logging.Logger`\n '
self.log = (logger or logging.getLogger('leapp')).getChild('workflow')
self._errors = []
self._all_c... | :param logger: Optional logger to be used instead of leapp.workflow
:type logger: Instance of :py:class:`logging.Logger` | leapp/workflows/__init__.py | __init__ | dhodovsk/leapp | 29 | python | def __init__(self, logger=None, auto_reboot=False):
'\n :param logger: Optional logger to be used instead of leapp.workflow\n :type logger: Instance of :py:class:`logging.Logger`\n '
self.log = (logger or logging.getLogger('leapp')).getChild('workflow')
self._errors = []
self._all_c... | def __init__(self, logger=None, auto_reboot=False):
'\n :param logger: Optional logger to be used instead of leapp.workflow\n :type logger: Instance of :py:class:`logging.Logger`\n '
self.log = (logger or logging.getLogger('leapp')).getChild('workflow')
self._errors = []
self._all_c... |
09b63743cf16811ebef62d82dc31a1d09e57afbd51390e489c671d64f14ed6c9 | @property
def experimental_whitelist(self):
' Whitelist of actors that may be executed even that they are marked experimental '
return self._experimental_whitelist | Whitelist of actors that may be executed even that they are marked experimental | leapp/workflows/__init__.py | experimental_whitelist | dhodovsk/leapp | 29 | python | @property
def experimental_whitelist(self):
' '
return self._experimental_whitelist | @property
def experimental_whitelist(self):
' '
return self._experimental_whitelist<|docstring|>Whitelist of actors that may be executed even that they are marked experimental<|endoftext|> |
c555953f5698fed83d4cff3fd0cf069196f4f28a2b0fc8c1329bad4359df61cb | def whitelist_experimental_actor(self, actor):
'\n Adds an actor to the experimental whitelist and allows them to be executed.\n\n :param actor: Actor to be whitelisted\n :type actor: class derived from py:class:`leapp.actors.Actor`\n :return: None\n '
if actor:
self._... | Adds an actor to the experimental whitelist and allows them to be executed.
:param actor: Actor to be whitelisted
:type actor: class derived from py:class:`leapp.actors.Actor`
:return: None | leapp/workflows/__init__.py | whitelist_experimental_actor | dhodovsk/leapp | 29 | python | def whitelist_experimental_actor(self, actor):
'\n Adds an actor to the experimental whitelist and allows them to be executed.\n\n :param actor: Actor to be whitelisted\n :type actor: class derived from py:class:`leapp.actors.Actor`\n :return: None\n '
if actor:
self._... | def whitelist_experimental_actor(self, actor):
'\n Adds an actor to the experimental whitelist and allows them to be executed.\n\n :param actor: Actor to be whitelisted\n :type actor: class derived from py:class:`leapp.actors.Actor`\n :return: None\n '
if actor:
self._... |
5f9863b204a771499aef75af4075139b74d6c4de50baceb6425abe45da8c135e | @property
def phase_actors(self):
' Return all actors for the phase '
return self._phase_actors | Return all actors for the phase | leapp/workflows/__init__.py | phase_actors | dhodovsk/leapp | 29 | python | @property
def phase_actors(self):
' '
return self._phase_actors | @property
def phase_actors(self):
' '
return self._phase_actors<|docstring|>Return all actors for the phase<|endoftext|> |
c1ade9f6f3782fa28863bc503be4ce3c7c55ae5a036a9ddfad5032190f534d95 | @property
def initial(self):
' Initial messages required '
return self._initial | Initial messages required | leapp/workflows/__init__.py | initial | dhodovsk/leapp | 29 | python | @property
def initial(self):
' '
return self._initial | @property
def initial(self):
' '
return self._initial<|docstring|>Initial messages required<|endoftext|> |
ca91c56e12430dbace882b35d965d88c047f760bd19ba9162d8e3803b1b0173e | @property
def consumes(self):
' All consumed messages '
return self._all_consumed | All consumed messages | leapp/workflows/__init__.py | consumes | dhodovsk/leapp | 29 | python | @property
def consumes(self):
' '
return self._all_consumed | @property
def consumes(self):
' '
return self._all_consumed<|docstring|>All consumed messages<|endoftext|> |
585c1a6fabfd895919d3101af0911dbe91ab0c622dd1295548fbd5d4ef3d70d1 | @property
def produces(self):
' All produced messages '
return self._all_produced | All produced messages | leapp/workflows/__init__.py | produces | dhodovsk/leapp | 29 | python | @property
def produces(self):
' '
return self._all_produced | @property
def produces(self):
' '
return self._all_produced<|docstring|>All produced messages<|endoftext|> |
7acdc7d49ceddc12846750e0060b3a19f4ba3c5fb06586b3e4888e8d957b71c3 | @property
def dialogs(self):
' All encountered dialogs '
return self._dialogs | All encountered dialogs | leapp/workflows/__init__.py | dialogs | dhodovsk/leapp | 29 | python | @property
def dialogs(self):
' '
return self._dialogs | @property
def dialogs(self):
' '
return self._dialogs<|docstring|>All encountered dialogs<|endoftext|> |
440645e8a05ec27cd125d13e978caeb326e706a4a8ef1c68885c0747406c59d5 | @classmethod
def serialize(cls):
'\n :return: Serialized form of the workflow\n '
return {'name': cls.name, 'short_name': cls.short_name, 'tag': cls.tag.__name__, 'description': cls.description, 'phases': [phase.serialize() for phase in cls.phases]} | :return: Serialized form of the workflow | leapp/workflows/__init__.py | serialize | dhodovsk/leapp | 29 | python | @classmethod
def serialize(cls):
'\n \n '
return {'name': cls.name, 'short_name': cls.short_name, 'tag': cls.tag.__name__, 'description': cls.description, 'phases': [phase.serialize() for phase in cls.phases]} | @classmethod
def serialize(cls):
'\n \n '
return {'name': cls.name, 'short_name': cls.short_name, 'tag': cls.tag.__name__, 'description': cls.description, 'phases': [phase.serialize() for phase in cls.phases]}<|docstring|>:return: Serialized form of the workflow<|endoftext|> |
6ced3092e52fee6add8f207f2f447d9d5cb67c392c7c08cc876037e362c83c00 | def run(self, context=None, until_phase=None, until_actor=None, skip_phases_until=None, skip_dialogs=False, only_with_tags=None):
"\n Executes the workflow\n\n :param context: Custom execution ID to be used instead of a randomly generated UUIDv4\n :type context: str\n :param until_phase:... | Executes the workflow
:param context: Custom execution ID to be used instead of a randomly generated UUIDv4
:type context: str
:param until_phase: Specify until including which phase the execution should run - phase.stage can be used to
control it even more granularly. `phase` is any phase name whe... | leapp/workflows/__init__.py | run | dhodovsk/leapp | 29 | python | def run(self, context=None, until_phase=None, until_actor=None, skip_phases_until=None, skip_dialogs=False, only_with_tags=None):
"\n Executes the workflow\n\n :param context: Custom execution ID to be used instead of a randomly generated UUIDv4\n :type context: str\n :param until_phase:... | def run(self, context=None, until_phase=None, until_actor=None, skip_phases_until=None, skip_dialogs=False, only_with_tags=None):
"\n Executes the workflow\n\n :param context: Custom execution ID to be used instead of a randomly generated UUIDv4\n :type context: str\n :param until_phase:... |
46640ae2ca4d427f48e8ceed212991615c2912433fd94ab72c9c45c15e8a297f | def build_time_range(from_str=None, to_str=None, ago=1):
' This function expect human-formatted user input with a combination of\n - end date, e.g.: 2018-09-21 (default is today)\n - start date, e.g.: 2018-09-01 (default is today - nb of days ago)\n - number of days ago, e.g.: 30 (default is ... | This function expect human-formatted user input with a combination of
- end date, e.g.: 2018-09-21 (default is today)
- start date, e.g.: 2018-09-01 (default is today - nb of days ago)
- number of days ago, e.g.: 30 (default is DEFAULT_NB_DAYS_AGO) | src/utils/dates.py | build_time_range | ebreton/pybootstrap | 2 | python | def build_time_range(from_str=None, to_str=None, ago=1):
' This function expect human-formatted user input with a combination of\n - end date, e.g.: 2018-09-21 (default is today)\n - start date, e.g.: 2018-09-01 (default is today - nb of days ago)\n - number of days ago, e.g.: 30 (default is ... | def build_time_range(from_str=None, to_str=None, ago=1):
' This function expect human-formatted user input with a combination of\n - end date, e.g.: 2018-09-21 (default is today)\n - start date, e.g.: 2018-09-01 (default is today - nb of days ago)\n - number of days ago, e.g.: 30 (default is ... |
05d9f669edade7ae94fbf431f273c7d3b46574d41521c540103d40418531a452 | def test_retry_doesnt_work_for_other_exceptions(self):
'\n db_retry() takes care only about OperationalError exception.\n Other exceptions re-raised immediately \n '
hit = [0]
@ddr.db_retry(tries=100, delay=1)
def decorated_func():
hit[0] += 1
(1 / 0)
with self.... | db_retry() takes care only about OperationalError exception.
Other exceptions re-raised immediately | django_dbconn_retry/tests/test_decorator.py | test_retry_doesnt_work_for_other_exceptions | baffolobill/django-dbconn-retry | 0 | python | def test_retry_doesnt_work_for_other_exceptions(self):
'\n db_retry() takes care only about OperationalError exception.\n Other exceptions re-raised immediately \n '
hit = [0]
@ddr.db_retry(tries=100, delay=1)
def decorated_func():
hit[0] += 1
(1 / 0)
with self.... | def test_retry_doesnt_work_for_other_exceptions(self):
'\n db_retry() takes care only about OperationalError exception.\n Other exceptions re-raised immediately \n '
hit = [0]
@ddr.db_retry(tries=100, delay=1)
def decorated_func():
hit[0] += 1
(1 / 0)
with self.... |
368190b2c922c939aceab4769b441c3e2235fe181a489c8765f2428281508be6 | def maxSubArray(self, nums):
' 动态规划问题。写出来状态转移方程。\n dp[i] = max(dp[i-1]+nums[i], dp[i])\n :type nums: List[int]\n :rtype: int\n '
if (not nums):
return 0
size = len(nums)
max_list = ([0] * size)
for i in range(size):
if (i == 0):
max_list[i] = n... | 动态规划问题。写出来状态转移方程。
dp[i] = max(dp[i-1]+nums[i], dp[i])
:type nums: List[int]
:rtype: int | 剑指offer/31_GreatestSumOfSubarrays(连续子数组最大和).py | maxSubArray | PegasusWang/python_data_structures_and_algorithms | 2,468 | python | def maxSubArray(self, nums):
' 动态规划问题。写出来状态转移方程。\n dp[i] = max(dp[i-1]+nums[i], dp[i])\n :type nums: List[int]\n :rtype: int\n '
if (not nums):
return 0
size = len(nums)
max_list = ([0] * size)
for i in range(size):
if (i == 0):
max_list[i] = n... | def maxSubArray(self, nums):
' 动态规划问题。写出来状态转移方程。\n dp[i] = max(dp[i-1]+nums[i], dp[i])\n :type nums: List[int]\n :rtype: int\n '
if (not nums):
return 0
size = len(nums)
max_list = ([0] * size)
for i in range(size):
if (i == 0):
max_list[i] = n... |
b8823b69d4556f51b59af3d25d8e40fd959f509b8cb0180168885a52a41db1a9 | def detectCycle(self, head: ListNode) -> ListNode:
"\n Given a linked list, return the node where the cycle begins. If there is no cycle, return null.\n\n There is a cycle in a linked list if there is some node in the list that can be reached again\n by continuously following the next pointer. ... | Given a linked list, return the node where the cycle begins. If there is no cycle, return null.
There is a cycle in a linked list if there is some node in the list that can be reached again
by continuously following the next pointer. Internally, pos is used to denote the index of the
node that tail's next pointer is c... | python/detectCycle.py | detectCycle | l0latgithub/codediary | 0 | python | def detectCycle(self, head: ListNode) -> ListNode:
"\n Given a linked list, return the node where the cycle begins. If there is no cycle, return null.\n\n There is a cycle in a linked list if there is some node in the list that can be reached again\n by continuously following the next pointer. ... | def detectCycle(self, head: ListNode) -> ListNode:
"\n Given a linked list, return the node where the cycle begins. If there is no cycle, return null.\n\n There is a cycle in a linked list if there is some node in the list that can be reached again\n by continuously following the next pointer. ... |
5491972d511e9b161fbd9743b52eece43fc4225b039907ef6f5714d9ada8a4b2 | def get_association(id, **kwargs):
'\n Fetch an association object by ID\n '
results = search_associations(id=id, **kwargs)
assoc = (results['associations'][0] if (len(results['associations']) > 0) else {})
return assoc | Fetch an association object by ID | ontobio/golr/golr_associations.py | get_association | alliance-genome/ontobio | 101 | python | def get_association(id, **kwargs):
'\n \n '
results = search_associations(id=id, **kwargs)
assoc = (results['associations'][0] if (len(results['associations']) > 0) else {})
return assoc | def get_association(id, **kwargs):
'\n \n '
results = search_associations(id=id, **kwargs)
assoc = (results['associations'][0] if (len(results['associations']) > 0) else {})
return assoc<|docstring|>Fetch an association object by ID<|endoftext|> |
ba6aa9f2470ddc7ab5202952c9410e473399d2a05aa4529ada619ffdfd15b97b | def search_associations(**kwargs):
'\n Fetch a set of association objects based on a query.\n :rtype:\n '
logger.info('CREATING_GOLR_QUERY {}'.format(kwargs))
q = GolrAssociationQuery(**kwargs)
return q.exec() | Fetch a set of association objects based on a query.
:rtype: | ontobio/golr/golr_associations.py | search_associations | alliance-genome/ontobio | 101 | python | def search_associations(**kwargs):
'\n Fetch a set of association objects based on a query.\n :rtype:\n '
logger.info('CREATING_GOLR_QUERY {}'.format(kwargs))
q = GolrAssociationQuery(**kwargs)
return q.exec() | def search_associations(**kwargs):
'\n Fetch a set of association objects based on a query.\n :rtype:\n '
logger.info('CREATING_GOLR_QUERY {}'.format(kwargs))
q = GolrAssociationQuery(**kwargs)
return q.exec()<|docstring|>Fetch a set of association objects based on a query.
:rtype:<|endoftext|> |
90c7e705078927e471b9514db875c9b6fb262e0891da49bc429e89dc13de745e | def get_objects_for_subject(subject=None, object_category=None, relation=None, **kwargs):
'\n Convenience method: Given a subject (e.g. gene, disease, variant), return all associated objects (phenotypes, functions, interacting genes, etc)\n '
searchresult = search_associations(subject=subject, fetch_objec... | Convenience method: Given a subject (e.g. gene, disease, variant), return all associated objects (phenotypes, functions, interacting genes, etc) | ontobio/golr/golr_associations.py | get_objects_for_subject | alliance-genome/ontobio | 101 | python | def get_objects_for_subject(subject=None, object_category=None, relation=None, **kwargs):
'\n \n '
searchresult = search_associations(subject=subject, fetch_objects=True, rows=0, object_category=object_category, relation=relation, **kwargs)
objs = searchresult['objects']
return objs | def get_objects_for_subject(subject=None, object_category=None, relation=None, **kwargs):
'\n \n '
searchresult = search_associations(subject=subject, fetch_objects=True, rows=0, object_category=object_category, relation=relation, **kwargs)
objs = searchresult['objects']
return objs<|docstring|>Co... |
010e1d61ecf67c4e76c32aff3e59f940d3f42028a9b0ceee5354968cb61fddad | def get_subjects_for_object(object=None, subject_category=None, subject_taxon=None, relation=None, **kwargs):
'\n Convenience method: Given a object (e.g. ontology term like phenotype or GO; interacting gene; disease; pathway etc), return all associated subjects (genes, variants, pubs, etc)\n '
searchresu... | Convenience method: Given a object (e.g. ontology term like phenotype or GO; interacting gene; disease; pathway etc), return all associated subjects (genes, variants, pubs, etc) | ontobio/golr/golr_associations.py | get_subjects_for_object | alliance-genome/ontobio | 101 | python | def get_subjects_for_object(object=None, subject_category=None, subject_taxon=None, relation=None, **kwargs):
'\n \n '
searchresult = search_associations(object=object, fetch_subjects=True, rows=0, subject_category=subject_category, subject_taxon=subject_taxon, relation=relation, **kwargs)
subjs = sea... | def get_subjects_for_object(object=None, subject_category=None, subject_taxon=None, relation=None, **kwargs):
'\n \n '
searchresult = search_associations(object=object, fetch_subjects=True, rows=0, subject_category=subject_category, subject_taxon=subject_taxon, relation=relation, **kwargs)
subjs = sea... |
14f023bcf8ed86c6a672309c32f03403d0dc6a64be5fb90d6006035f1d0c182c | def search_associations_compact(**kwargs):
'\n Convenience method: as for search associations, use compact\n '
searchresult = search_associations(use_compact_associations=True, facet_fields=[], **kwargs)
return searchresult['compact_associations'] | Convenience method: as for search associations, use compact | ontobio/golr/golr_associations.py | search_associations_compact | alliance-genome/ontobio | 101 | python | def search_associations_compact(**kwargs):
'\n \n '
searchresult = search_associations(use_compact_associations=True, facet_fields=[], **kwargs)
return searchresult['compact_associations'] | def search_associations_compact(**kwargs):
'\n \n '
searchresult = search_associations(use_compact_associations=True, facet_fields=[], **kwargs)
return searchresult['compact_associations']<|docstring|>Convenience method: as for search associations, use compact<|endoftext|> |
ff59ce6c0338876c2fdc72cf52461bf03ebdb516a7b3025e4a68910cd8be3422 | def map2slim(subjects, slim, **kwargs):
'\n Maps a set of subjects (e.g. genes) to a set of slims\n\n Result is a list of unique subject-class pairs, with\n a list of source assocations\n '
logger.info('SLIM SUBJECTS:{} SLIM:{} CAT:{}'.format(subjects, slim, kwargs.get('category')))
searchresult... | Maps a set of subjects (e.g. genes) to a set of slims
Result is a list of unique subject-class pairs, with
a list of source assocations | ontobio/golr/golr_associations.py | map2slim | alliance-genome/ontobio | 101 | python | def map2slim(subjects, slim, **kwargs):
'\n Maps a set of subjects (e.g. genes) to a set of slims\n\n Result is a list of unique subject-class pairs, with\n a list of source assocations\n '
logger.info('SLIM SUBJECTS:{} SLIM:{} CAT:{}'.format(subjects, slim, kwargs.get('category')))
searchresult... | def map2slim(subjects, slim, **kwargs):
'\n Maps a set of subjects (e.g. genes) to a set of slims\n\n Result is a list of unique subject-class pairs, with\n a list of source assocations\n '
logger.info('SLIM SUBJECTS:{} SLIM:{} CAT:{}'.format(subjects, slim, kwargs.get('category')))
searchresult... |
b0f5a3301c514217e4825a487312fd721b10ba3cbd8a0d76365dda3f39e6f3a6 | def bulk_fetch(subject_category, object_category, taxon, rows=MAX_ROWS, **kwargs):
'\n Fetch associations for a species and pair of categories in bulk.\n\n Arguments:\n\n - subject_category: String (not None)\n - object_category: String (not None)\n - taxon: String\n - rows: int\n\n Additio... | Fetch associations for a species and pair of categories in bulk.
Arguments:
- subject_category: String (not None)
- object_category: String (not None)
- taxon: String
- rows: int
Additionally, any argument for search_associations can be passed | ontobio/golr/golr_associations.py | bulk_fetch | alliance-genome/ontobio | 101 | python | def bulk_fetch(subject_category, object_category, taxon, rows=MAX_ROWS, **kwargs):
'\n Fetch associations for a species and pair of categories in bulk.\n\n Arguments:\n\n - subject_category: String (not None)\n - object_category: String (not None)\n - taxon: String\n - rows: int\n\n Additio... | def bulk_fetch(subject_category, object_category, taxon, rows=MAX_ROWS, **kwargs):
'\n Fetch associations for a species and pair of categories in bulk.\n\n Arguments:\n\n - subject_category: String (not None)\n - object_category: String (not None)\n - taxon: String\n - rows: int\n\n Additio... |
baa76c35e758059b002dbe226702d96b46dbdb990677baba616a5fd08957f2a2 | def pivot_query(facet=None, facet_pivot_fields=None, **kwargs):
'\n Pivot query\n '
if (facet_pivot_fields is None):
facet_pivot_fields = []
results = search_associations(rows=0, facet_fields=[facet], facet_pivot_fields=facet_pivot_fields, **kwargs)
return results | Pivot query | ontobio/golr/golr_associations.py | pivot_query | alliance-genome/ontobio | 101 | python | def pivot_query(facet=None, facet_pivot_fields=None, **kwargs):
'\n \n '
if (facet_pivot_fields is None):
facet_pivot_fields = []
results = search_associations(rows=0, facet_fields=[facet], facet_pivot_fields=facet_pivot_fields, **kwargs)
return results | def pivot_query(facet=None, facet_pivot_fields=None, **kwargs):
'\n \n '
if (facet_pivot_fields is None):
facet_pivot_fields = []
results = search_associations(rows=0, facet_fields=[facet], facet_pivot_fields=facet_pivot_fields, **kwargs)
return results<|docstring|>Pivot query<|endoftext|> |
b5851636e8214d1b16942bc1f8a35ba116ce956c440ee1b687ac121c4340933d | def pivot_query_as_matrix(facet=None, facet_pivot_fields=None, **kwargs):
'\n Pivot query\n '
if (facet_pivot_fields is None):
facet_pivot_fields = []
logger.info('Additional args: {}'.format(kwargs))
fp = search_associations(rows=0, facet_fields=[facet], facet_pivot_fields=facet_pivot_fie... | Pivot query | ontobio/golr/golr_associations.py | pivot_query_as_matrix | alliance-genome/ontobio | 101 | python | def pivot_query_as_matrix(facet=None, facet_pivot_fields=None, **kwargs):
'\n \n '
if (facet_pivot_fields is None):
facet_pivot_fields = []
logger.info('Additional args: {}'.format(kwargs))
fp = search_associations(rows=0, facet_fields=[facet], facet_pivot_fields=facet_pivot_fields, **kwar... | def pivot_query_as_matrix(facet=None, facet_pivot_fields=None, **kwargs):
'\n \n '
if (facet_pivot_fields is None):
facet_pivot_fields = []
logger.info('Additional args: {}'.format(kwargs))
fp = search_associations(rows=0, facet_fields=[facet], facet_pivot_fields=facet_pivot_fields, **kwar... |
bdd0a7da169c2d0fe2bba992111e2dc170f7539d97d86d1a07f783bc2f3e4e6e | def search_associations_go(subject_category=None, object_category=None, relation=None, subject=None, **kwargs):
'\n Perform association search using Monarch golr\n '
go_golr_url = 'http://golr.geneontology.org/solr/'
go_solr = pysolr.Solr(go_golr_url, timeout=5)
go_solr.get_session().headers['User... | Perform association search using Monarch golr | ontobio/golr/golr_associations.py | search_associations_go | alliance-genome/ontobio | 101 | python | def search_associations_go(subject_category=None, object_category=None, relation=None, subject=None, **kwargs):
'\n \n '
go_golr_url = 'http://golr.geneontology.org/solr/'
go_solr = pysolr.Solr(go_golr_url, timeout=5)
go_solr.get_session().headers['User-Agent'] = get_user_agent(caller_name=__name_... | def search_associations_go(subject_category=None, object_category=None, relation=None, subject=None, **kwargs):
'\n \n '
go_golr_url = 'http://golr.geneontology.org/solr/'
go_solr = pysolr.Solr(go_golr_url, timeout=5)
go_solr.get_session().headers['User-Agent'] = get_user_agent(caller_name=__name_... |
378d2f4efc939d9cfe56f0bff7a94bf6a35129b5ac2c5a6a3ce0eacf7265fc6f | def select_distinct(distinct_field=None, **kwargs):
'\n select distinct values for a given field for a given a query\n '
results = search_associations(rows=0, select_fields=[], facet_field_limits={distinct_field: (- 1)}, facet_fields=[distinct_field], **kwargs)
return list(results['facet_counts'][dist... | select distinct values for a given field for a given a query | ontobio/golr/golr_associations.py | select_distinct | alliance-genome/ontobio | 101 | python | def select_distinct(distinct_field=None, **kwargs):
'\n \n '
results = search_associations(rows=0, select_fields=[], facet_field_limits={distinct_field: (- 1)}, facet_fields=[distinct_field], **kwargs)
return list(results['facet_counts'][distinct_field].keys()) | def select_distinct(distinct_field=None, **kwargs):
'\n \n '
results = search_associations(rows=0, select_fields=[], facet_field_limits={distinct_field: (- 1)}, facet_fields=[distinct_field], **kwargs)
return list(results['facet_counts'][distinct_field].keys())<|docstring|>select distinct values for a... |
267ed07077dd8545d2968a2aaecf3273209cfa420066c41099ce78bb08c2bc9e | def select_distinct_subjects(**kwargs):
'\n select distinct subject IDs given a query\n '
return select_distinct(M.SUBJECT, **kwargs) | select distinct subject IDs given a query | ontobio/golr/golr_associations.py | select_distinct_subjects | alliance-genome/ontobio | 101 | python | def select_distinct_subjects(**kwargs):
'\n \n '
return select_distinct(M.SUBJECT, **kwargs) | def select_distinct_subjects(**kwargs):
'\n \n '
return select_distinct(M.SUBJECT, **kwargs)<|docstring|>select distinct subject IDs given a query<|endoftext|> |
dda62b40f65e6a562d5b581fc9ecf44e80a4422bed88671c0b943c947b458427 | def calculate_information_content(**kwargs):
'\n\n Arguments are as for search_associations, in particular:\n\n - subject_category\n - object_category\n - subject_taxon\n\n '
results = search_associations(rows=0, select_fields=[], facet_field_limits={M.OBJECT: (- 1)}, facet_fields=[M.OBJECT], ... | Arguments are as for search_associations, in particular:
- subject_category
- object_category
- subject_taxon | ontobio/golr/golr_associations.py | calculate_information_content | alliance-genome/ontobio | 101 | python | def calculate_information_content(**kwargs):
'\n\n Arguments are as for search_associations, in particular:\n\n - subject_category\n - object_category\n - subject_taxon\n\n '
results = search_associations(rows=0, select_fields=[], facet_field_limits={M.OBJECT: (- 1)}, facet_fields=[M.OBJECT], ... | def calculate_information_content(**kwargs):
'\n\n Arguments are as for search_associations, in particular:\n\n - subject_category\n - object_category\n - subject_taxon\n\n '
results = search_associations(rows=0, select_fields=[], facet_field_limits={M.OBJECT: (- 1)}, facet_fields=[M.OBJECT], ... |
545d25f7371cbe3f0f1a82c39dbf0200aafce6533cc9362af1d695f3e2a5f2d9 | def RoundCorner(image, radius):
'\n\n Generate the rounded corner image for orgimage.\n\n '
image = image.convert('RGBA')
mask = Image.new('RGBA', image.size, (0, 0, 0, 0))
draw = aggdraw.Draw(mask)
brush = aggdraw.Brush('black')
(width, height) = mask.size
draw.rectangle((0, 0, mask.s... | Generate the rounded corner image for orgimage. | py/jobs/tasks/graphs/textbox.py | RoundCorner | mabotech/mabo.task | 0 | python | def RoundCorner(image, radius):
'\n\n \n\n '
image = image.convert('RGBA')
mask = Image.new('RGBA', image.size, (0, 0, 0, 0))
draw = aggdraw.Draw(mask)
brush = aggdraw.Brush('black')
(width, height) = mask.size
draw.rectangle((0, 0, mask.size[0], mask.size[1]), aggdraw.Brush('white'))
... | def RoundCorner(image, radius):
'\n\n \n\n '
image = image.convert('RGBA')
mask = Image.new('RGBA', image.size, (0, 0, 0, 0))
draw = aggdraw.Draw(mask)
brush = aggdraw.Brush('black')
(width, height) = mask.size
draw.rectangle((0, 0, mask.size[0], mask.size[1]), aggdraw.Brush('white'))
... |
a07b239c35fe34b14f08f7f2b5205b9dedcf4cbdcd5d32298d00a9148031183e | def reduce_opacity(im, opacity):
'Returns an image with reduced opacity.'
assert ((opacity >= 0) and (opacity <= 1))
if (im.mode != 'RGBA'):
im = im.convert('RGBA')
else:
im = im.copy()
alpha = im.split()[3]
alpha = ImageEnhance.Brightness(alpha).enhance(opacity)
im.putalpha(... | Returns an image with reduced opacity. | py/jobs/tasks/graphs/textbox.py | reduce_opacity | mabotech/mabo.task | 0 | python | def reduce_opacity(im, opacity):
assert ((opacity >= 0) and (opacity <= 1))
if (im.mode != 'RGBA'):
im = im.convert('RGBA')
else:
im = im.copy()
alpha = im.split()[3]
alpha = ImageEnhance.Brightness(alpha).enhance(opacity)
im.putalpha(alpha)
return im | def reduce_opacity(im, opacity):
assert ((opacity >= 0) and (opacity <= 1))
if (im.mode != 'RGBA'):
im = im.convert('RGBA')
else:
im = im.copy()
alpha = im.split()[3]
alpha = ImageEnhance.Brightness(alpha).enhance(opacity)
im.putalpha(alpha)
return im<|docstring|>Returns... |
2c9cf914527e96dfe01ef4e7ff092e8e57b3edd3728b36142539a20c1afcad5d | def Watermark(image, markimage, position, opacity=1):
'Adds a watermark to an image.'
im = image
mark = markimage
if (opacity < 1):
mark = reduce_opacity(mark, opacity)
if (im.mode != 'RGBA'):
im = im.convert('RGBA')
layer = Image.new('RGBA', im.size, (0, 0, 0, 0))
if (positi... | Adds a watermark to an image. | py/jobs/tasks/graphs/textbox.py | Watermark | mabotech/mabo.task | 0 | python | def Watermark(image, markimage, position, opacity=1):
im = image
mark = markimage
if (opacity < 1):
mark = reduce_opacity(mark, opacity)
if (im.mode != 'RGBA'):
im = im.convert('RGBA')
layer = Image.new('RGBA', im.size, (0, 0, 0, 0))
if (position == 'tile'):
for y in... | def Watermark(image, markimage, position, opacity=1):
im = image
mark = markimage
if (opacity < 1):
mark = reduce_opacity(mark, opacity)
if (im.mode != 'RGBA'):
im = im.convert('RGBA')
layer = Image.new('RGBA', im.size, (0, 0, 0, 0))
if (position == 'tile'):
for y in... |
790c0b400abd906921cdb8cfcdd46097c848b017afd1da0296838b78d635afef | def Signature(image, type, text, position, font=None, color=(255, 0, 0)):
'\n\n imprints a PIL image with the indicated text in lower-right corner\n\n '
if (type not in ['c', 'v']):
raise
if (image.mode != 'RGBA'):
image = image.convert('RGBA')
textdraw = ImageDraw.Draw(image)
... | imprints a PIL image with the indicated text in lower-right corner | py/jobs/tasks/graphs/textbox.py | Signature | mabotech/mabo.task | 0 | python | def Signature(image, type, text, position, font=None, color=(255, 0, 0)):
'\n\n \n\n '
if (type not in ['c', 'v']):
raise
if (image.mode != 'RGBA'):
image = image.convert('RGBA')
textdraw = ImageDraw.Draw(image)
j = 1
lst = text.split('\n')
lst.reverse()
z = 0
n... | def Signature(image, type, text, position, font=None, color=(255, 0, 0)):
'\n\n \n\n '
if (type not in ['c', 'v']):
raise
if (image.mode != 'RGBA'):
image = image.convert('RGBA')
textdraw = ImageDraw.Draw(image)
j = 1
lst = text.split('\n')
lst.reverse()
z = 0
n... |
321620fc8b66cb014e824b4028191e72c8abc805978a2484cbdc1ba7f23de33d | @property
def dilute_initial(self):
'Initial atom density for nuclides with zero initial concentration'
return self._dilute_initial | Initial atom density for nuclides with zero initial concentration | openmc/deplete/abc.py | dilute_initial | xiashaopeng/openmc | 262 | python | @property
def dilute_initial(self):
return self._dilute_initial | @property
def dilute_initial(self):
return self._dilute_initial<|docstring|>Initial atom density for nuclides with zero initial concentration<|endoftext|> |
76e8736c3fbce5074cf08924601b8fdbc72ae887dad32e1010475ad682526a8d | @abstractmethod
def __call__(self, vec, source_rate):
'Runs a simulation.\n\n Parameters\n ----------\n vec : list of numpy.ndarray\n Total atoms to be used in function.\n source_rate : float\n Power in [W] or source rate in [neutron/sec]\n\n Returns\n ... | Runs a simulation.
Parameters
----------
vec : list of numpy.ndarray
Total atoms to be used in function.
source_rate : float
Power in [W] or source rate in [neutron/sec]
Returns
-------
openmc.deplete.OperatorResult
Eigenvalue and reaction rates resulting from transport operator | openmc/deplete/abc.py | __call__ | xiashaopeng/openmc | 262 | python | @abstractmethod
def __call__(self, vec, source_rate):
'Runs a simulation.\n\n Parameters\n ----------\n vec : list of numpy.ndarray\n Total atoms to be used in function.\n source_rate : float\n Power in [W] or source rate in [neutron/sec]\n\n Returns\n ... | @abstractmethod
def __call__(self, vec, source_rate):
'Runs a simulation.\n\n Parameters\n ----------\n vec : list of numpy.ndarray\n Total atoms to be used in function.\n source_rate : float\n Power in [W] or source rate in [neutron/sec]\n\n Returns\n ... |
a6f351c98a89c9fa946822616d7b669d7fe4afc061ddeadcff8636923bd8f842 | @abstractmethod
def initial_condition(self):
'Performs final setup and returns initial condition.\n\n Returns\n -------\n list of numpy.ndarray\n Total density for initial conditions.\n ' | Performs final setup and returns initial condition.
Returns
-------
list of numpy.ndarray
Total density for initial conditions. | openmc/deplete/abc.py | initial_condition | xiashaopeng/openmc | 262 | python | @abstractmethod
def initial_condition(self):
'Performs final setup and returns initial condition.\n\n Returns\n -------\n list of numpy.ndarray\n Total density for initial conditions.\n ' | @abstractmethod
def initial_condition(self):
'Performs final setup and returns initial condition.\n\n Returns\n -------\n list of numpy.ndarray\n Total density for initial conditions.\n '<|docstring|>Performs final setup and returns initial condition.
Returns
-------
list of ... |
b1f30bf1f37c8a619e119424b3ee6627581535cbcc9cec378087df7fc99e85b4 | @abstractmethod
def get_results_info(self):
'Returns volume list, cell lists, and nuc lists.\n\n Returns\n -------\n volume : dict of str to float\n Volumes corresponding to materials in burn_list\n nuc_list : list of str\n A list of all nuclide names. Used for sort... | Returns volume list, cell lists, and nuc lists.
Returns
-------
volume : dict of str to float
Volumes corresponding to materials in burn_list
nuc_list : list of str
A list of all nuclide names. Used for sorting the simulation.
burn_list : list of int
A list of all cell IDs to be burned. Used for sorting t... | openmc/deplete/abc.py | get_results_info | xiashaopeng/openmc | 262 | python | @abstractmethod
def get_results_info(self):
'Returns volume list, cell lists, and nuc lists.\n\n Returns\n -------\n volume : dict of str to float\n Volumes corresponding to materials in burn_list\n nuc_list : list of str\n A list of all nuclide names. Used for sort... | @abstractmethod
def get_results_info(self):
'Returns volume list, cell lists, and nuc lists.\n\n Returns\n -------\n volume : dict of str to float\n Volumes corresponding to materials in burn_list\n nuc_list : list of str\n A list of all nuclide names. Used for sort... |
64aa8205aa49511d7a6e875559076a0834ae0afdab7f028416d8580d0912ba54 | @abstractmethod
def write_bos_data(self, step):
'Document beginning of step data for a given step\n\n Called at the beginning of a depletion step and at\n the final point in the simulation.\n\n Parameters\n ----------\n step : int\n Current depletion step including rest... | Document beginning of step data for a given step
Called at the beginning of a depletion step and at
the final point in the simulation.
Parameters
----------
step : int
Current depletion step including restarts | openmc/deplete/abc.py | write_bos_data | xiashaopeng/openmc | 262 | python | @abstractmethod
def write_bos_data(self, step):
'Document beginning of step data for a given step\n\n Called at the beginning of a depletion step and at\n the final point in the simulation.\n\n Parameters\n ----------\n step : int\n Current depletion step including rest... | @abstractmethod
def write_bos_data(self, step):
'Document beginning of step data for a given step\n\n Called at the beginning of a depletion step and at\n the final point in the simulation.\n\n Parameters\n ----------\n step : int\n Current depletion step including rest... |
a60e097dec9577a2d53f7b0c3e8544b0c0ae4106778da0776b66d5db5b852dd0 | @abstractmethod
def generate_tallies(self, materials, scores):
'Use the C API to build tallies needed for reaction rates' | Use the C API to build tallies needed for reaction rates | openmc/deplete/abc.py | generate_tallies | xiashaopeng/openmc | 262 | python | @abstractmethod
def generate_tallies(self, materials, scores):
| @abstractmethod
def generate_tallies(self, materials, scores):
<|docstring|>Use the C API to build tallies needed for reaction rates<|endoftext|> |
14d377c2ecec9f80af576c8335a27d77f33add2ac8927824821c174b5e33e091 | @property
def nuclides(self):
'List of nuclides with requested reaction rates'
return self._nuclides | List of nuclides with requested reaction rates | openmc/deplete/abc.py | nuclides | xiashaopeng/openmc | 262 | python | @property
def nuclides(self):
return self._nuclides | @property
def nuclides(self):
return self._nuclides<|docstring|>List of nuclides with requested reaction rates<|endoftext|> |
645d97f1eea76b9618d7b30d46e5e2514d7048285e64f619decc28e9d1abd5ed | @abstractmethod
def get_material_rates(self, mat_id, nuc_index, react_index):
'Return 2D array of [nuclide, reaction] reaction rates\n\n Parameters\n ----------\n mat_id : int\n Unique ID for the requested material\n nuc_index : list of str\n Ordering of desired nuc... | Return 2D array of [nuclide, reaction] reaction rates
Parameters
----------
mat_id : int
Unique ID for the requested material
nuc_index : list of str
Ordering of desired nuclides
react_index : list of str
Ordering of reactions | openmc/deplete/abc.py | get_material_rates | xiashaopeng/openmc | 262 | python | @abstractmethod
def get_material_rates(self, mat_id, nuc_index, react_index):
'Return 2D array of [nuclide, reaction] reaction rates\n\n Parameters\n ----------\n mat_id : int\n Unique ID for the requested material\n nuc_index : list of str\n Ordering of desired nuc... | @abstractmethod
def get_material_rates(self, mat_id, nuc_index, react_index):
'Return 2D array of [nuclide, reaction] reaction rates\n\n Parameters\n ----------\n mat_id : int\n Unique ID for the requested material\n nuc_index : list of str\n Ordering of desired nuc... |
e5d0a86b511387bfff5403aabe2cd578beaedfec4d73de6eede4581c009b6be0 | def divide_by_adens(self, number):
'Normalize reaction rates by number of nuclides\n\n Acts on the current material examined by :meth:`get_material_rates`\n\n Parameters\n ----------\n number : iterable of float\n Number density [atoms/b-cm] of each nuclide tracked in the\n ... | Normalize reaction rates by number of nuclides
Acts on the current material examined by :meth:`get_material_rates`
Parameters
----------
number : iterable of float
Number density [atoms/b-cm] of each nuclide tracked in the
calculation.
Returns
-------
results : numpy.ndarray
Array of reactions rates of s... | openmc/deplete/abc.py | divide_by_adens | xiashaopeng/openmc | 262 | python | def divide_by_adens(self, number):
'Normalize reaction rates by number of nuclides\n\n Acts on the current material examined by :meth:`get_material_rates`\n\n Parameters\n ----------\n number : iterable of float\n Number density [atoms/b-cm] of each nuclide tracked in the\n ... | def divide_by_adens(self, number):
'Normalize reaction rates by number of nuclides\n\n Acts on the current material examined by :meth:`get_material_rates`\n\n Parameters\n ----------\n number : iterable of float\n Number density [atoms/b-cm] of each nuclide tracked in the\n ... |
db7c0fdb07a0e2b952db2b647ef8f7b06645e14b95a7a2f70bea520d6b0a8cf0 | def reset(self):
'Reset state for normalization' | Reset state for normalization | openmc/deplete/abc.py | reset | xiashaopeng/openmc | 262 | python | def reset(self):
| def reset(self):
<|docstring|>Reset state for normalization<|endoftext|> |
5ed49aa13bbd01c767b04610e3b0d086638af8cb9cdff470c890be90acdecf94 | @abstractmethod
def prepare(self, chain_nucs, rate_index):
'Perform work needed to obtain energy produced\n\n This method is called prior to the transport simulations\n in :meth:`openmc.deplete.Operator.initial_condition`. Only used for\n energy-based normalization.\n\n Parameters\n ... | Perform work needed to obtain energy produced
This method is called prior to the transport simulations
in :meth:`openmc.deplete.Operator.initial_condition`. Only used for
energy-based normalization.
Parameters
----------
chain_nucs : list of str
All nuclides to be tracked in this problem
rate_index : dict of str ... | openmc/deplete/abc.py | prepare | xiashaopeng/openmc | 262 | python | @abstractmethod
def prepare(self, chain_nucs, rate_index):
'Perform work needed to obtain energy produced\n\n This method is called prior to the transport simulations\n in :meth:`openmc.deplete.Operator.initial_condition`. Only used for\n energy-based normalization.\n\n Parameters\n ... | @abstractmethod
def prepare(self, chain_nucs, rate_index):
'Perform work needed to obtain energy produced\n\n This method is called prior to the transport simulations\n in :meth:`openmc.deplete.Operator.initial_condition`. Only used for\n energy-based normalization.\n\n Parameters\n ... |
0e887dd57e74b2c7daf336a7e8ea5794b000c6571fc478bb311cd5efd386aad3 | def update(self, fission_rates):
'Update the normalization based on fission rates (only used for\n energy-based normalization)\n\n Parameters\n ----------\n fission_rates : numpy.ndarray\n fission reaction rate for each isotope in the specified\n material. Should be... | Update the normalization based on fission rates (only used for
energy-based normalization)
Parameters
----------
fission_rates : numpy.ndarray
fission reaction rate for each isotope in the specified
material. Should be ordered corresponding to initial
``rate_index`` used in :meth:`prepare` | openmc/deplete/abc.py | update | xiashaopeng/openmc | 262 | python | def update(self, fission_rates):
'Update the normalization based on fission rates (only used for\n energy-based normalization)\n\n Parameters\n ----------\n fission_rates : numpy.ndarray\n fission reaction rate for each isotope in the specified\n material. Should be... | def update(self, fission_rates):
'Update the normalization based on fission rates (only used for\n energy-based normalization)\n\n Parameters\n ----------\n fission_rates : numpy.ndarray\n fission reaction rate for each isotope in the specified\n material. Should be... |
14d377c2ecec9f80af576c8335a27d77f33add2ac8927824821c174b5e33e091 | @property
def nuclides(self):
'List of nuclides with requested reaction rates'
return self._nuclides | List of nuclides with requested reaction rates | openmc/deplete/abc.py | nuclides | xiashaopeng/openmc | 262 | python | @property
def nuclides(self):
return self._nuclides | @property
def nuclides(self):
return self._nuclides<|docstring|>List of nuclides with requested reaction rates<|endoftext|> |
a5321694c0693a034e1c8715e8885309ce9fa4288b5cdf6b891bed4ee6632291 | @abstractmethod
def factor(self, source_rate):
'Return normalization factor\n\n Parameters\n ----------\n source_rate : float\n Power in [W] or source rate in [neutron/sec]\n\n Returns\n -------\n float\n Normalization factor for tallies\n\n ' | Return normalization factor
Parameters
----------
source_rate : float
Power in [W] or source rate in [neutron/sec]
Returns
-------
float
Normalization factor for tallies | openmc/deplete/abc.py | factor | xiashaopeng/openmc | 262 | python | @abstractmethod
def factor(self, source_rate):
'Return normalization factor\n\n Parameters\n ----------\n source_rate : float\n Power in [W] or source rate in [neutron/sec]\n\n Returns\n -------\n float\n Normalization factor for tallies\n\n ' | @abstractmethod
def factor(self, source_rate):
'Return normalization factor\n\n Parameters\n ----------\n source_rate : float\n Power in [W] or source rate in [neutron/sec]\n\n Returns\n -------\n float\n Normalization factor for tallies\n\n '<|... |
8b0c202449e47c680d4c5e0a52880a7ecf06b5aec127c2b7e99f861ff48a00c7 | @abstractmethod
def weighted_yields(self, local_mat_index):
'Return fission yields for a specific material\n\n Parameters\n ----------\n local_mat_index : int\n Index for the material with requested fission yields.\n Should correspond to the material represented in\n ... | Return fission yields for a specific material
Parameters
----------
local_mat_index : int
Index for the material with requested fission yields.
Should correspond to the material represented in
``mat_indexes[local_mat_index]`` during
:meth:`generate_tallies`.
Returns
-------
library : collections.abc.M... | openmc/deplete/abc.py | weighted_yields | xiashaopeng/openmc | 262 | python | @abstractmethod
def weighted_yields(self, local_mat_index):
'Return fission yields for a specific material\n\n Parameters\n ----------\n local_mat_index : int\n Index for the material with requested fission yields.\n Should correspond to the material represented in\n ... | @abstractmethod
def weighted_yields(self, local_mat_index):
'Return fission yields for a specific material\n\n Parameters\n ----------\n local_mat_index : int\n Index for the material with requested fission yields.\n Should correspond to the material represented in\n ... |
2096d3192e0b49de573770099750051139b4db3bc6e1e05b790cf889fdf393f9 | @staticmethod
def unpack():
'Unpack tally data prior to compute fission yields.\n\n Called after a :meth:`openmc.deplete.Operator.__call__`\n routine during the normalization of reaction rates.\n\n Not necessary for all subclasses to implement, unless tallies\n are used.\n ' | Unpack tally data prior to compute fission yields.
Called after a :meth:`openmc.deplete.Operator.__call__`
routine during the normalization of reaction rates.
Not necessary for all subclasses to implement, unless tallies
are used. | openmc/deplete/abc.py | unpack | xiashaopeng/openmc | 262 | python | @staticmethod
def unpack():
'Unpack tally data prior to compute fission yields.\n\n Called after a :meth:`openmc.deplete.Operator.__call__`\n routine during the normalization of reaction rates.\n\n Not necessary for all subclasses to implement, unless tallies\n are used.\n ' | @staticmethod
def unpack():
'Unpack tally data prior to compute fission yields.\n\n Called after a :meth:`openmc.deplete.Operator.__call__`\n routine during the normalization of reaction rates.\n\n Not necessary for all subclasses to implement, unless tallies\n are used.\n '<|docs... |
be589c43db4130e50c5dd844e64683cd0093e3e9daff0f0b00641496c159c644 | @staticmethod
def generate_tallies(materials, mat_indexes):
'Construct tallies necessary for computing fission yields\n\n Called during the operator set up phase prior to depleting.\n Not necessary for subclasses to implement\n\n Parameters\n ----------\n materials : iterable of C... | Construct tallies necessary for computing fission yields
Called during the operator set up phase prior to depleting.
Not necessary for subclasses to implement
Parameters
----------
materials : iterable of C-API materials
Materials to be used in :class:`openmc.lib.MaterialFilter`
mat_indexes : iterable of int
... | openmc/deplete/abc.py | generate_tallies | xiashaopeng/openmc | 262 | python | @staticmethod
def generate_tallies(materials, mat_indexes):
'Construct tallies necessary for computing fission yields\n\n Called during the operator set up phase prior to depleting.\n Not necessary for subclasses to implement\n\n Parameters\n ----------\n materials : iterable of C... | @staticmethod
def generate_tallies(materials, mat_indexes):
'Construct tallies necessary for computing fission yields\n\n Called during the operator set up phase prior to depleting.\n Not necessary for subclasses to implement\n\n Parameters\n ----------\n materials : iterable of C... |
4ad94b9ecbf78eb61ad3fe55995c371e736357ef6fdaf6113fbc3dea124fe72d | def update_tally_nuclides(self, nuclides):
'Return nuclides with non-zero densities and yield data\n\n Parameters\n ----------\n nuclides : iterable of str\n Nuclides with non-zero densities from the\n :class:`openmc.deplete.Operator`\n\n Returns\n -------\n ... | Return nuclides with non-zero densities and yield data
Parameters
----------
nuclides : iterable of str
Nuclides with non-zero densities from the
:class:`openmc.deplete.Operator`
Returns
-------
nuclides : list of str
Union of nuclides that the :class:`openmc.deplete.Operator`
says have non-zero densi... | openmc/deplete/abc.py | update_tally_nuclides | xiashaopeng/openmc | 262 | python | def update_tally_nuclides(self, nuclides):
'Return nuclides with non-zero densities and yield data\n\n Parameters\n ----------\n nuclides : iterable of str\n Nuclides with non-zero densities from the\n :class:`openmc.deplete.Operator`\n\n Returns\n -------\n ... | def update_tally_nuclides(self, nuclides):
'Return nuclides with non-zero densities and yield data\n\n Parameters\n ----------\n nuclides : iterable of str\n Nuclides with non-zero densities from the\n :class:`openmc.deplete.Operator`\n\n Returns\n -------\n ... |
8afcd46352de1a75ff0886f6093177a995202337d75953393a2eb89fd5cbabad | @classmethod
def from_operator(cls, operator, **kwargs):
'Create a new instance by pulling data from the operator\n\n All keyword arguments should be identical to their counterpart\n in the main ``__init__`` method\n\n Parameters\n ----------\n operator : openmc.deplete.TransportO... | Create a new instance by pulling data from the operator
All keyword arguments should be identical to their counterpart
in the main ``__init__`` method
Parameters
----------
operator : openmc.deplete.TransportOperator
Operator with a depletion chain
kwargs: optional
Additional keyword arguments to be used in c... | openmc/deplete/abc.py | from_operator | xiashaopeng/openmc | 262 | python | @classmethod
def from_operator(cls, operator, **kwargs):
'Create a new instance by pulling data from the operator\n\n All keyword arguments should be identical to their counterpart\n in the main ``__init__`` method\n\n Parameters\n ----------\n operator : openmc.deplete.TransportO... | @classmethod
def from_operator(cls, operator, **kwargs):
'Create a new instance by pulling data from the operator\n\n All keyword arguments should be identical to their counterpart\n in the main ``__init__`` method\n\n Parameters\n ----------\n operator : openmc.deplete.TransportO... |
3b82ab0450c7bf6e6fd5d90febf2e06b561318589f7efe62cec64dc911f97458 | def generate_tallies(self, materials, mat_indexes):
'Construct the fission rate tally\n\n Parameters\n ----------\n materials : iterable of :class:`openmc.lib.Material`\n Materials to be used in :class:`openmc.lib.MaterialFilter`\n mat_indexes : iterable of int\n In... | Construct the fission rate tally
Parameters
----------
materials : iterable of :class:`openmc.lib.Material`
Materials to be used in :class:`openmc.lib.MaterialFilter`
mat_indexes : iterable of int
Indices of tallied materials that will have their fission
yields computed by this helper. Necessary as the
... | openmc/deplete/abc.py | generate_tallies | xiashaopeng/openmc | 262 | python | def generate_tallies(self, materials, mat_indexes):
'Construct the fission rate tally\n\n Parameters\n ----------\n materials : iterable of :class:`openmc.lib.Material`\n Materials to be used in :class:`openmc.lib.MaterialFilter`\n mat_indexes : iterable of int\n In... | def generate_tallies(self, materials, mat_indexes):
'Construct the fission rate tally\n\n Parameters\n ----------\n materials : iterable of :class:`openmc.lib.Material`\n Materials to be used in :class:`openmc.lib.MaterialFilter`\n mat_indexes : iterable of int\n In... |
ea7650ed57800a18da3181e878b9b58b7c54e66068febd48af412a0fd45f9697 | def update_tally_nuclides(self, nuclides):
'Tally nuclides with non-zero density and multiple yields\n\n Must be run after :meth:`generate_tallies`.\n\n Parameters\n ----------\n nuclides : iterable of str\n Potential nuclides to be tallied, such as those with\n non... | Tally nuclides with non-zero density and multiple yields
Must be run after :meth:`generate_tallies`.
Parameters
----------
nuclides : iterable of str
Potential nuclides to be tallied, such as those with
non-zero density at this stage.
Returns
-------
nuclides : list of str
Union of input nuclides and tho... | openmc/deplete/abc.py | update_tally_nuclides | xiashaopeng/openmc | 262 | python | def update_tally_nuclides(self, nuclides):
'Tally nuclides with non-zero density and multiple yields\n\n Must be run after :meth:`generate_tallies`.\n\n Parameters\n ----------\n nuclides : iterable of str\n Potential nuclides to be tallied, such as those with\n non... | def update_tally_nuclides(self, nuclides):
'Tally nuclides with non-zero density and multiple yields\n\n Must be run after :meth:`generate_tallies`.\n\n Parameters\n ----------\n nuclides : iterable of str\n Potential nuclides to be tallied, such as those with\n non... |
6afd8466e19dd35c224e01ed65ac2a91c2edd631f3cd7ac78b059b4065cc47ea | @abstractmethod
def unpack(self):
'Unpack tallies after a transport run.\n\n Abstract because each subclass will need to arrange its\n tally data.\n ' | Unpack tallies after a transport run.
Abstract because each subclass will need to arrange its
tally data. | openmc/deplete/abc.py | unpack | xiashaopeng/openmc | 262 | python | @abstractmethod
def unpack(self):
'Unpack tallies after a transport run.\n\n Abstract because each subclass will need to arrange its\n tally data.\n ' | @abstractmethod
def unpack(self):
'Unpack tallies after a transport run.\n\n Abstract because each subclass will need to arrange its\n tally data.\n '<|docstring|>Unpack tallies after a transport run.
Abstract because each subclass will need to arrange its
tally data.<|endoftext|> |
c3b8d4da4ac1ea3d8df8a33c782a2252191e29e946834fe26c7cf22a23f22c6d | @abstractmethod
def __call__(self, conc, rates, dt, source_rate, i):
'Perform the integration across one time step\n\n Parameters\n ----------\n conc : numpy.ndarray\n Initial concentrations for all nuclides in [atom]\n rates : openmc.deplete.ReactionRates\n Reactio... | Perform the integration across one time step
Parameters
----------
conc : numpy.ndarray
Initial concentrations for all nuclides in [atom]
rates : openmc.deplete.ReactionRates
Reaction rates from operator
dt : float
Time in [s] for the entire depletion interval
source_rate : float
Power in [W] or source... | openmc/deplete/abc.py | __call__ | xiashaopeng/openmc | 262 | python | @abstractmethod
def __call__(self, conc, rates, dt, source_rate, i):
'Perform the integration across one time step\n\n Parameters\n ----------\n conc : numpy.ndarray\n Initial concentrations for all nuclides in [atom]\n rates : openmc.deplete.ReactionRates\n Reactio... | @abstractmethod
def __call__(self, conc, rates, dt, source_rate, i):
'Perform the integration across one time step\n\n Parameters\n ----------\n conc : numpy.ndarray\n Initial concentrations for all nuclides in [atom]\n rates : openmc.deplete.ReactionRates\n Reactio... |
41d5a579c72327888fcac9fad2b9f79c0795373f4c74121cea1bbb40b4af87f1 | @property
@abstractmethod
def _num_stages(self):
'Number of intermediate transport solutions\n\n Needed to ensure schemes are consistent with restarts\n ' | Number of intermediate transport solutions
Needed to ensure schemes are consistent with restarts | openmc/deplete/abc.py | _num_stages | xiashaopeng/openmc | 262 | python | @property
@abstractmethod
def _num_stages(self):
'Number of intermediate transport solutions\n\n Needed to ensure schemes are consistent with restarts\n ' | @property
@abstractmethod
def _num_stages(self):
'Number of intermediate transport solutions\n\n Needed to ensure schemes are consistent with restarts\n '<|docstring|>Number of intermediate transport solutions
Needed to ensure schemes are consistent with restarts<|endoftext|> |
cdd32e6261ed1956aaa09f997efc826974281c35b4fd9388bb1b769dbfe7c65f | def __iter__(self):
'Return pair of time step in [s] and source rate in [W] or [neutron/sec]'
return zip(self.timesteps, self.source_rates) | Return pair of time step in [s] and source rate in [W] or [neutron/sec] | openmc/deplete/abc.py | __iter__ | xiashaopeng/openmc | 262 | python | def __iter__(self):
return zip(self.timesteps, self.source_rates) | def __iter__(self):
return zip(self.timesteps, self.source_rates)<|docstring|>Return pair of time step in [s] and source rate in [W] or [neutron/sec]<|endoftext|> |
eabc84defb760079a69468062d2ebd1b2690d6a58867b1da8cd644983da84908 | def __len__(self):
'Return integer number of depletion intervals'
return len(self.timesteps) | Return integer number of depletion intervals | openmc/deplete/abc.py | __len__ | xiashaopeng/openmc | 262 | python | def __len__(self):
return len(self.timesteps) | def __len__(self):
return len(self.timesteps)<|docstring|>Return integer number of depletion intervals<|endoftext|> |
a843297f5d8c2a74f63028030b023247931ab269fc9936b7132e92c7665f5d30 | def _get_bos_data_from_operator(self, step_index, source_rate, bos_conc):
'Get beginning of step concentrations, reaction rates from Operator\n '
x = deepcopy(bos_conc)
res = self.operator(x, source_rate)
self.operator.write_bos_data((step_index + self._i_res))
return (x, res) | Get beginning of step concentrations, reaction rates from Operator | openmc/deplete/abc.py | _get_bos_data_from_operator | xiashaopeng/openmc | 262 | python | def _get_bos_data_from_operator(self, step_index, source_rate, bos_conc):
'\n '
x = deepcopy(bos_conc)
res = self.operator(x, source_rate)
self.operator.write_bos_data((step_index + self._i_res))
return (x, res) | def _get_bos_data_from_operator(self, step_index, source_rate, bos_conc):
'\n '
x = deepcopy(bos_conc)
res = self.operator(x, source_rate)
self.operator.write_bos_data((step_index + self._i_res))
return (x, res)<|docstring|>Get beginning of step concentrations, reaction rates from Operator<|e... |
dffc200c1368037a762517b09cdba61d9fe72939cba3fa7ca42f4a9cdd818e7e | def _get_bos_data_from_restart(self, step_index, source_rate, bos_conc):
'Get beginning of step concentrations, reaction rates from restart'
res = self.operator.prev_res[(- 1)]
bos_conc = list(res.data[0])
rates = res.rates[0]
k = ufloat(res.k[(0, 0)], res.k[(0, 1)])
rates *= (source_rate / res.... | Get beginning of step concentrations, reaction rates from restart | openmc/deplete/abc.py | _get_bos_data_from_restart | xiashaopeng/openmc | 262 | python | def _get_bos_data_from_restart(self, step_index, source_rate, bos_conc):
res = self.operator.prev_res[(- 1)]
bos_conc = list(res.data[0])
rates = res.rates[0]
k = ufloat(res.k[(0, 0)], res.k[(0, 1)])
rates *= (source_rate / res.source_rate[0])
return (bos_conc, OperatorResult(k, rates)) | def _get_bos_data_from_restart(self, step_index, source_rate, bos_conc):
res = self.operator.prev_res[(- 1)]
bos_conc = list(res.data[0])
rates = res.rates[0]
k = ufloat(res.k[(0, 0)], res.k[(0, 1)])
rates *= (source_rate / res.source_rate[0])
return (bos_conc, OperatorResult(k, rates))<|do... |
77b9f29d3e265724adecbe3b6a8c7848edc329611b7738d7739a5fd2250670bd | def integrate(self, final_step=True):
'Perform the entire depletion process across all steps\n\n Parameters\n ----------\n final_step : bool, optional\n Indicate whether or not a transport solve should be run at the end\n of the last timestep.\n\n .. versionadde... | Perform the entire depletion process across all steps
Parameters
----------
final_step : bool, optional
Indicate whether or not a transport solve should be run at the end
of the last timestep.
.. versionadded:: 0.12.1 | openmc/deplete/abc.py | integrate | xiashaopeng/openmc | 262 | python | def integrate(self, final_step=True):
'Perform the entire depletion process across all steps\n\n Parameters\n ----------\n final_step : bool, optional\n Indicate whether or not a transport solve should be run at the end\n of the last timestep.\n\n .. versionadde... | def integrate(self, final_step=True):
'Perform the entire depletion process across all steps\n\n Parameters\n ----------\n final_step : bool, optional\n Indicate whether or not a transport solve should be run at the end\n of the last timestep.\n\n .. versionadde... |
617bc4fb26c7f8126a636ccdb30c6d79544a6858d20510a0f61d240ff568a579 | def integrate(self):
'Perform the entire depletion process across all steps'
with self.operator as conc:
(t, self._i_res) = self._get_start_data()
for (i, (dt, p)) in enumerate(self):
if (i == 0):
if (self.operator.prev_res is None):
(conc, res) = ... | Perform the entire depletion process across all steps | openmc/deplete/abc.py | integrate | xiashaopeng/openmc | 262 | python | def integrate(self):
with self.operator as conc:
(t, self._i_res) = self._get_start_data()
for (i, (dt, p)) in enumerate(self):
if (i == 0):
if (self.operator.prev_res is None):
(conc, res) = self._get_bos_data_from_operator(i, p, conc)
... | def integrate(self):
with self.operator as conc:
(t, self._i_res) = self._get_start_data()
for (i, (dt, p)) in enumerate(self):
if (i == 0):
if (self.operator.prev_res is None):
(conc, res) = self._get_bos_data_from_operator(i, p, conc)
... |
e980591384adc922e7cf1fea3aad378c2453ec886f2cd184e1e48b39d860172b | @abstractmethod
def __call__(self, A, n0, dt):
'Solve the linear system of equations for depletion\n\n Parameters\n ----------\n A : scipy.sparse.csr_matrix\n Sparse transmutation matrix ``A[j, i]`` desribing rates at\n which isotope ``i`` transmutes to isotope ``j``\n ... | Solve the linear system of equations for depletion
Parameters
----------
A : scipy.sparse.csr_matrix
Sparse transmutation matrix ``A[j, i]`` desribing rates at
which isotope ``i`` transmutes to isotope ``j``
n0 : numpy.ndarray
Initial compositions, typically given in number of atoms in some
material or... | openmc/deplete/abc.py | __call__ | xiashaopeng/openmc | 262 | python | @abstractmethod
def __call__(self, A, n0, dt):
'Solve the linear system of equations for depletion\n\n Parameters\n ----------\n A : scipy.sparse.csr_matrix\n Sparse transmutation matrix ``A[j, i]`` desribing rates at\n which isotope ``i`` transmutes to isotope ``j``\n ... | @abstractmethod
def __call__(self, A, n0, dt):
'Solve the linear system of equations for depletion\n\n Parameters\n ----------\n A : scipy.sparse.csr_matrix\n Sparse transmutation matrix ``A[j, i]`` desribing rates at\n which isotope ``i`` transmutes to isotope ``j``\n ... |
8b143c10dfb072928e8c29dc8f9342f55b1c8e91d61e9fcef1398ffff7d64f85 | def test_get_instance_metrics_lt_92(check):
'\n check output when 9.2+\n '
check._is_9_2_or_above.return_value = False
res = check._get_instance_metrics(False, False)
assert (res['metrics'] == util.COMMON_METRICS) | check output when 9.2+ | postgres/tests/test_unit.py | test_get_instance_metrics_lt_92 | Nordstrom/integrations-core | 0 | python | def test_get_instance_metrics_lt_92(check):
'\n \n '
check._is_9_2_or_above.return_value = False
res = check._get_instance_metrics(False, False)
assert (res['metrics'] == util.COMMON_METRICS) | def test_get_instance_metrics_lt_92(check):
'\n \n '
check._is_9_2_or_above.return_value = False
res = check._get_instance_metrics(False, False)
assert (res['metrics'] == util.COMMON_METRICS)<|docstring|>check output when 9.2+<|endoftext|> |
be79761cdff9056014633054ba80fac536ba79c13346048ecf9e9bb4086d1581 | def test_get_instance_metrics_92(check):
'\n check output when <9.2\n '
check._is_9_2_or_above.return_value = True
res = check._get_instance_metrics(False, False)
assert (res['metrics'] == dict(util.COMMON_METRICS, **util.NEWER_92_METRICS)) | check output when <9.2 | postgres/tests/test_unit.py | test_get_instance_metrics_92 | Nordstrom/integrations-core | 0 | python | def test_get_instance_metrics_92(check):
'\n \n '
check._is_9_2_or_above.return_value = True
res = check._get_instance_metrics(False, False)
assert (res['metrics'] == dict(util.COMMON_METRICS, **util.NEWER_92_METRICS)) | def test_get_instance_metrics_92(check):
'\n \n '
check._is_9_2_or_above.return_value = True
res = check._get_instance_metrics(False, False)
assert (res['metrics'] == dict(util.COMMON_METRICS, **util.NEWER_92_METRICS))<|docstring|>check output when <9.2<|endoftext|> |
8a5a92ea1d2d72698a6b4c289811b7ab926c1abca9b4ebbbb646c788a18b2ade | def test_get_instance_metrics_state(check):
'\n Ensure data is consistent when the function is called more than once\n '
res = check._get_instance_metrics(False, False)
assert (res['metrics'] == dict(util.COMMON_METRICS, **util.NEWER_92_METRICS))
check._is_9_2_or_above.side_effect = Exception
... | Ensure data is consistent when the function is called more than once | postgres/tests/test_unit.py | test_get_instance_metrics_state | Nordstrom/integrations-core | 0 | python | def test_get_instance_metrics_state(check):
'\n \n '
res = check._get_instance_metrics(False, False)
assert (res['metrics'] == dict(util.COMMON_METRICS, **util.NEWER_92_METRICS))
check._is_9_2_or_above.side_effect = Exception
res = check._get_instance_metrics([], False)
assert (res['metric... | def test_get_instance_metrics_state(check):
'\n \n '
res = check._get_instance_metrics(False, False)
assert (res['metrics'] == dict(util.COMMON_METRICS, **util.NEWER_92_METRICS))
check._is_9_2_or_above.side_effect = Exception
res = check._get_instance_metrics([], False)
assert (res['metric... |
6bd8d4ab672ba496926538183ce8b30738fd8ccdc4c12e4f8ead68e113fd16a2 | def test_get_instance_metrics_database_size_metrics(check):
'\n Test the function behaves correctly when `database_size_metrics` is passed\n '
expected = util.COMMON_METRICS
expected.update(util.NEWER_92_METRICS)
expected.update(util.DATABASE_SIZE_METRICS)
res = check._get_instance_metrics(Tru... | Test the function behaves correctly when `database_size_metrics` is passed | postgres/tests/test_unit.py | test_get_instance_metrics_database_size_metrics | Nordstrom/integrations-core | 0 | python | def test_get_instance_metrics_database_size_metrics(check):
'\n \n '
expected = util.COMMON_METRICS
expected.update(util.NEWER_92_METRICS)
expected.update(util.DATABASE_SIZE_METRICS)
res = check._get_instance_metrics(True, False)
assert (res['metrics'] == expected) | def test_get_instance_metrics_database_size_metrics(check):
'\n \n '
expected = util.COMMON_METRICS
expected.update(util.NEWER_92_METRICS)
expected.update(util.DATABASE_SIZE_METRICS)
res = check._get_instance_metrics(True, False)
assert (res['metrics'] == expected)<|docstring|>Test the fun... |
114f1dc5f7773940280df663b87bf10216ebde843d322fb81256c14eb30f91c5 | def test_get_instance_with_default(check):
'\n Test the contents of the query string with different `collect_default_db` values\n '
collect_default_db = False
res = check._get_instance_metrics(False, collect_default_db)
assert (" AND psd.datname not ilike 'postgres'" in res['query'])
collect_... | Test the contents of the query string with different `collect_default_db` values | postgres/tests/test_unit.py | test_get_instance_with_default | Nordstrom/integrations-core | 0 | python | def test_get_instance_with_default(check):
'\n \n '
collect_default_db = False
res = check._get_instance_metrics(False, collect_default_db)
assert (" AND psd.datname not ilike 'postgres'" in res['query'])
collect_default_db = True
res = check._get_instance_metrics(False, collect_default_d... | def test_get_instance_with_default(check):
'\n \n '
collect_default_db = False
res = check._get_instance_metrics(False, collect_default_db)
assert (" AND psd.datname not ilike 'postgres'" in res['query'])
collect_default_db = True
res = check._get_instance_metrics(False, collect_default_d... |
c4812ff2b5220e7c3801b5137ecfb85f4bfd3393155ff20bd18df729ac65a7b2 | def test_get_version(check):
'\n Test _get_version() to make sure the check is properly parsing Postgres versions\n '
db = MagicMock()
check.db = db
db.cursor().fetchone.return_value = ['9.5.3']
assert (check._get_version() == [9, 5, 3])
db.cursor().fetchone.return_value = ['10.2']
che... | Test _get_version() to make sure the check is properly parsing Postgres versions | postgres/tests/test_unit.py | test_get_version | Nordstrom/integrations-core | 0 | python | def test_get_version(check):
'\n \n '
db = MagicMock()
check.db = db
db.cursor().fetchone.return_value = ['9.5.3']
assert (check._get_version() == [9, 5, 3])
db.cursor().fetchone.return_value = ['10.2']
check._clean_state()
assert (check._get_version() == [10, 2])
db.cursor().f... | def test_get_version(check):
'\n \n '
db = MagicMock()
check.db = db
db.cursor().fetchone.return_value = ['9.5.3']
assert (check._get_version() == [9, 5, 3])
db.cursor().fetchone.return_value = ['10.2']
check._clean_state()
assert (check._get_version() == [10, 2])
db.cursor().f... |
e7551c4b37db51e2f0b6e63f19b58e0044a8023c1412caad6b309a6d073cd3ce | def test_is_above(check):
'\n Test _is_above() to make sure the check is properly determining order of versions\n '
db = MagicMock()
check.db = db
db.cursor().fetchone.return_value = ['10.5.4']
assert check._is_above([9, 5, 4])
assert (check._is_above([11, 0, 0]) is False)
db.cursor().... | Test _is_above() to make sure the check is properly determining order of versions | postgres/tests/test_unit.py | test_is_above | Nordstrom/integrations-core | 0 | python | def test_is_above(check):
'\n \n '
db = MagicMock()
check.db = db
db.cursor().fetchone.return_value = ['10.5.4']
assert check._is_above([9, 5, 4])
assert (check._is_above([11, 0, 0]) is False)
db.cursor().fetchone.return_value = ['10.5.4']
assert check._is_above([10, 4, 4])
ass... | def test_is_above(check):
'\n \n '
db = MagicMock()
check.db = db
db.cursor().fetchone.return_value = ['10.5.4']
assert check._is_above([9, 5, 4])
assert (check._is_above([11, 0, 0]) is False)
db.cursor().fetchone.return_value = ['10.5.4']
assert check._is_above([10, 4, 4])
ass... |
e6f123f73845c48cc79181a4324373c8f95c4e82643b972879a4a6ddd0b71c4c | def test_malformed_get_custom_queries(check):
'\n Test early-exit conditions for _get_custom_queries()\n '
check.log = MagicMock()
db = MagicMock()
check.db = db
malformed_custom_query = {}
check._get_custom_queries([], [malformed_custom_query])
check.log.error.assert_called_once_with(... | Test early-exit conditions for _get_custom_queries() | postgres/tests/test_unit.py | test_malformed_get_custom_queries | Nordstrom/integrations-core | 0 | python | def test_malformed_get_custom_queries(check):
'\n \n '
check.log = MagicMock()
db = MagicMock()
check.db = db
malformed_custom_query = {}
check._get_custom_queries([], [malformed_custom_query])
check.log.error.assert_called_once_with('custom query field `metric_prefix` is required')
... | def test_malformed_get_custom_queries(check):
'\n \n '
check.log = MagicMock()
db = MagicMock()
check.db = db
malformed_custom_query = {}
check._get_custom_queries([], [malformed_custom_query])
check.log.error.assert_called_once_with('custom query field `metric_prefix` is required')
... |
ad747399eae06b631aec286d3008393c9898d0847cdada130c3a80ea9ce8ee62 | @patch('cloudcourseproject.src.model.User')
def test_create_token_should_get_user_model_and_return_token_with_username(user_mock):
' create_tocken should create tocken out of model '
user_mock.user_id = 1
token = create_token(user_mock)
decoded_token = jwt.decode(token, config['JWT_SECRET_KEY'], algorit... | create_tocken should create tocken out of model | tests/test_auth.py | test_create_token_should_get_user_model_and_return_token_with_username | dmitrijbozhkov/cloudcourseproject | 0 | python | @patch('cloudcourseproject.src.model.User')
def test_create_token_should_get_user_model_and_return_token_with_username(user_mock):
' '
user_mock.user_id = 1
token = create_token(user_mock)
decoded_token = jwt.decode(token, config['JWT_SECRET_KEY'], algorithms=[ALGORITHM])
assert (decoded_token['use... | @patch('cloudcourseproject.src.model.User')
def test_create_token_should_get_user_model_and_return_token_with_username(user_mock):
' '
user_mock.user_id = 1
token = create_token(user_mock)
decoded_token = jwt.decode(token, config['JWT_SECRET_KEY'], algorithms=[ALGORITHM])
assert (decoded_token['use... |
0ff6217fbe1202962ec9f084db1dc5cc8168c2256577af30e488843d905e7e7d | def test_identify_should_raise_error_if_token_has_no_user_id_in_payload():
" identify gets token and raises InvalidTokenError if it doesn't fave user_id field"
invalid_token = jwt.encode({'iat': datetime.utcnow(), 'exp': (datetime.utcnow() + timedelta(days=config['JWT_ACCESS_TOKEN_EXPIRES']))}, config['JWT_SECR... | identify gets token and raises InvalidTokenError if it doesn't fave user_id field | tests/test_auth.py | test_identify_should_raise_error_if_token_has_no_user_id_in_payload | dmitrijbozhkov/cloudcourseproject | 0 | python | def test_identify_should_raise_error_if_token_has_no_user_id_in_payload():
" "
invalid_token = jwt.encode({'iat': datetime.utcnow(), 'exp': (datetime.utcnow() + timedelta(days=config['JWT_ACCESS_TOKEN_EXPIRES']))}, config['JWT_SECRET_KEY'], algorithm=ALGORITHM)
with pytest.raises(InvalidTokenError) as error... | def test_identify_should_raise_error_if_token_has_no_user_id_in_payload():
" "
invalid_token = jwt.encode({'iat': datetime.utcnow(), 'exp': (datetime.utcnow() + timedelta(days=config['JWT_ACCESS_TOKEN_EXPIRES']))}, config['JWT_SECRET_KEY'], algorithm=ALGORITHM)
with pytest.raises(InvalidTokenError) as error... |
322be970f591bc47e73dfee9cb6f744a518be4ac71f17358dfb9bed7fbeb6713 | def test_identify_should_raise_tokenexpired_if_token_is_expired():
' identify should raise TokenExpired if exp is lower, than iat '
invalid_token = jwt.encode({'user_id': 123, 'iat': datetime.utcnow(), 'exp': (datetime.utcnow() - timedelta(days=config['JWT_ACCESS_TOKEN_EXPIRES']))}, config['JWT_SECRET_KEY'], al... | identify should raise TokenExpired if exp is lower, than iat | tests/test_auth.py | test_identify_should_raise_tokenexpired_if_token_is_expired | dmitrijbozhkov/cloudcourseproject | 0 | python | def test_identify_should_raise_tokenexpired_if_token_is_expired():
' '
invalid_token = jwt.encode({'user_id': 123, 'iat': datetime.utcnow(), 'exp': (datetime.utcnow() - timedelta(days=config['JWT_ACCESS_TOKEN_EXPIRES']))}, config['JWT_SECRET_KEY'], algorithm=ALGORITHM)
with pytest.raises(TokenExpired) as e... | def test_identify_should_raise_tokenexpired_if_token_is_expired():
' '
invalid_token = jwt.encode({'user_id': 123, 'iat': datetime.utcnow(), 'exp': (datetime.utcnow() - timedelta(days=config['JWT_ACCESS_TOKEN_EXPIRES']))}, config['JWT_SECRET_KEY'], algorithm=ALGORITHM)
with pytest.raises(TokenExpired) as e... |
7c7da42a58731a9bdcc2fd1e3a4fe874f57b5a33a6f67a38852aff765c6f3c7b | def users_userId_address_addressId_get(self, addressId, userId, headers=None, query_params=None, content_type='application/json'):
'\n get address id\n of address\n It is method for GET /users/{userId}/address/{addressId}\n '
if (query_params is None):
query_params = {}
u... | get address id
of address
It is method for GET /users/{userId}/address/{addressId} | codegen/python/fixtures/client/requests_client/users_service.py | users_userId_address_addressId_get | feeltheajf/go-raml | 0 | python | def users_userId_address_addressId_get(self, addressId, userId, headers=None, query_params=None, content_type='application/json'):
'\n get address id\n of address\n It is method for GET /users/{userId}/address/{addressId}\n '
if (query_params is None):
query_params = {}
u... | def users_userId_address_addressId_get(self, addressId, userId, headers=None, query_params=None, content_type='application/json'):
'\n get address id\n of address\n It is method for GET /users/{userId}/address/{addressId}\n '
if (query_params is None):
query_params = {}
u... |
298b7ecc19e7cc3cca05332c580334ee21234d205625669be6f117dfdc277702 | def users_userId_delete(self, userId, headers=None, query_params=None, content_type='application/json'):
'\n It is method for DELETE /users/{userId}\n '
if (query_params is None):
query_params = {}
uri = ((self.client.base_url + '/users/') + userId)
return self.client.delete(uri, N... | It is method for DELETE /users/{userId} | codegen/python/fixtures/client/requests_client/users_service.py | users_userId_delete | feeltheajf/go-raml | 0 | python | def users_userId_delete(self, userId, headers=None, query_params=None, content_type='application/json'):
'\n \n '
if (query_params is None):
query_params = {}
uri = ((self.client.base_url + '/users/') + userId)
return self.client.delete(uri, None, headers, query_params, content_typ... | def users_userId_delete(self, userId, headers=None, query_params=None, content_type='application/json'):
'\n \n '
if (query_params is None):
query_params = {}
uri = ((self.client.base_url + '/users/') + userId)
return self.client.delete(uri, None, headers, query_params, content_typ... |
ab026e9bf0bcd23349600dc80be203b56dcfd3b0d512df5886bae4dd74cc554a | def getuserid(self, userId, headers=None, query_params=None, content_type='application/json'):
'\n get id\n It is method for GET /users/{userId}\n '
if (query_params is None):
query_params = {}
uri = ((self.client.base_url + '/users/') + userId)
return self.client.get(uri, N... | get id
It is method for GET /users/{userId} | codegen/python/fixtures/client/requests_client/users_service.py | getuserid | feeltheajf/go-raml | 0 | python | def getuserid(self, userId, headers=None, query_params=None, content_type='application/json'):
'\n get id\n It is method for GET /users/{userId}\n '
if (query_params is None):
query_params = {}
uri = ((self.client.base_url + '/users/') + userId)
return self.client.get(uri, N... | def getuserid(self, userId, headers=None, query_params=None, content_type='application/json'):
'\n get id\n It is method for GET /users/{userId}\n '
if (query_params is None):
query_params = {}
uri = ((self.client.base_url + '/users/') + userId)
return self.client.get(uri, N... |
119a3d7a9edd574cd263998d99ca6fbf5776168c7f6bab457211e55b309333a3 | def users_userId_post(self, data, userId, headers=None, query_params=None, content_type='application/json'):
'\n post without request body\n It is method for POST /users/{userId}\n '
if (query_params is None):
query_params = {}
uri = ((self.client.base_url + '/users/') + userId)... | post without request body
It is method for POST /users/{userId} | codegen/python/fixtures/client/requests_client/users_service.py | users_userId_post | feeltheajf/go-raml | 0 | python | def users_userId_post(self, data, userId, headers=None, query_params=None, content_type='application/json'):
'\n post without request body\n It is method for POST /users/{userId}\n '
if (query_params is None):
query_params = {}
uri = ((self.client.base_url + '/users/') + userId)... | def users_userId_post(self, data, userId, headers=None, query_params=None, content_type='application/json'):
'\n post without request body\n It is method for POST /users/{userId}\n '
if (query_params is None):
query_params = {}
uri = ((self.client.base_url + '/users/') + userId)... |
e21919c49ac2ca3875cc5cea6fbf7d10e750aaf9fce34a747715d4b328492819 | def users_delete(self, data, headers=None, query_params=None, content_type='application/json'):
'\n delete with request body\n It is method for DELETE /users\n '
if (query_params is None):
query_params = {}
uri = (self.client.base_url + '/users')
return self.client.delete(ur... | delete with request body
It is method for DELETE /users | codegen/python/fixtures/client/requests_client/users_service.py | users_delete | feeltheajf/go-raml | 0 | python | def users_delete(self, data, headers=None, query_params=None, content_type='application/json'):
'\n delete with request body\n It is method for DELETE /users\n '
if (query_params is None):
query_params = {}
uri = (self.client.base_url + '/users')
return self.client.delete(ur... | def users_delete(self, data, headers=None, query_params=None, content_type='application/json'):
'\n delete with request body\n It is method for DELETE /users\n '
if (query_params is None):
query_params = {}
uri = (self.client.base_url + '/users')
return self.client.delete(ur... |
e7b1cf810cb8a767dd78a2b7e574cc760565301e4ddd56436a81cca6a6b857dd | def get_users(self, data, headers=None, query_params=None, content_type='application/json'):
'\n First line of comment.\n Second line of comment\n It is method for GET /users\n '
if (query_params is None):
query_params = {}
uri = (self.client.base_url + '/users')
retu... | First line of comment.
Second line of comment
It is method for GET /users | codegen/python/fixtures/client/requests_client/users_service.py | get_users | feeltheajf/go-raml | 0 | python | def get_users(self, data, headers=None, query_params=None, content_type='application/json'):
'\n First line of comment.\n Second line of comment\n It is method for GET /users\n '
if (query_params is None):
query_params = {}
uri = (self.client.base_url + '/users')
retu... | def get_users(self, data, headers=None, query_params=None, content_type='application/json'):
'\n First line of comment.\n Second line of comment\n It is method for GET /users\n '
if (query_params is None):
query_params = {}
uri = (self.client.base_url + '/users')
retu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.