repository_name
stringlengths
7
55
func_path_in_repository
stringlengths
4
223
func_name
stringlengths
1
134
whole_func_string
stringlengths
75
104k
language
stringclasses
1 value
func_code_string
stringlengths
75
104k
func_code_tokens
listlengths
19
28.4k
func_documentation_string
stringlengths
1
46.9k
func_documentation_tokens
listlengths
1
1.97k
split_name
stringclasses
1 value
func_code_url
stringlengths
87
315
fudge-py/fudge
fudge/__init__.py
Fake.without_args
def without_args(self, *args, **kwargs): """Set the last call to expect that certain arguments will not exist. This is the opposite of :func:`fudge.Fake.with_matching_args`. It will fail if any of the arguments are passed. .. doctest:: >>> import fudge >>> que...
python
def without_args(self, *args, **kwargs): """Set the last call to expect that certain arguments will not exist. This is the opposite of :func:`fudge.Fake.with_matching_args`. It will fail if any of the arguments are passed. .. doctest:: >>> import fudge >>> que...
[ "def", "without_args", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "exp", "=", "self", ".", "_get_current_call", "(", ")", "if", "args", ":", "exp", ".", "unexpected_args", "=", "args", "if", "kwargs", ":", "exp", ".", "unexpect...
Set the last call to expect that certain arguments will not exist. This is the opposite of :func:`fudge.Fake.with_matching_args`. It will fail if any of the arguments are passed. .. doctest:: >>> import fudge >>> query = fudge.Fake('query').expects_call().without_args...
[ "Set", "the", "last", "call", "to", "expect", "that", "certain", "arguments", "will", "not", "exist", "." ]
train
https://github.com/fudge-py/fudge/blob/b283fbc1a41900f3f5845b10b8c2ef9136a67ebc/fudge/__init__.py#L1285-L1357
fudge-py/fudge
fudge/__init__.py
Fake.with_arg_count
def with_arg_count(self, count): """Set the last call to expect an exact argument count. I.E.:: >>> auth = Fake('auth').provides('login').with_arg_count(2) >>> auth.login('joe_user') # forgot password Traceback (most recent call last): ... As...
python
def with_arg_count(self, count): """Set the last call to expect an exact argument count. I.E.:: >>> auth = Fake('auth').provides('login').with_arg_count(2) >>> auth.login('joe_user') # forgot password Traceback (most recent call last): ... As...
[ "def", "with_arg_count", "(", "self", ",", "count", ")", ":", "exp", "=", "self", ".", "_get_current_call", "(", ")", "exp", ".", "expected_arg_count", "=", "count", "return", "self" ]
Set the last call to expect an exact argument count. I.E.:: >>> auth = Fake('auth').provides('login').with_arg_count(2) >>> auth.login('joe_user') # forgot password Traceback (most recent call last): ... AssertionError: fake:auth.login() was called w...
[ "Set", "the", "last", "call", "to", "expect", "an", "exact", "argument", "count", "." ]
train
https://github.com/fudge-py/fudge/blob/b283fbc1a41900f3f5845b10b8c2ef9136a67ebc/fudge/__init__.py#L1359-L1373
fudge-py/fudge
fudge/__init__.py
Fake.with_kwarg_count
def with_kwarg_count(self, count): """Set the last call to expect an exact count of keyword arguments. I.E.:: >>> auth = Fake('auth').provides('login').with_kwarg_count(2) >>> auth.login(username='joe') # forgot password= Traceback (most recent call last): ...
python
def with_kwarg_count(self, count): """Set the last call to expect an exact count of keyword arguments. I.E.:: >>> auth = Fake('auth').provides('login').with_kwarg_count(2) >>> auth.login(username='joe') # forgot password= Traceback (most recent call last): ...
[ "def", "with_kwarg_count", "(", "self", ",", "count", ")", ":", "exp", "=", "self", ".", "_get_current_call", "(", ")", "exp", ".", "expected_kwarg_count", "=", "count", "return", "self" ]
Set the last call to expect an exact count of keyword arguments. I.E.:: >>> auth = Fake('auth').provides('login').with_kwarg_count(2) >>> auth.login(username='joe') # forgot password= Traceback (most recent call last): ... AssertionError: fake:auth.l...
[ "Set", "the", "last", "call", "to", "expect", "an", "exact", "count", "of", "keyword", "arguments", "." ]
train
https://github.com/fudge-py/fudge/blob/b283fbc1a41900f3f5845b10b8c2ef9136a67ebc/fudge/__init__.py#L1375-L1389
thespacedoctor/sherlock
sherlock/database.py
database.connect
def connect(self): """connect to the various databases, the credientals and settings of which are found in the sherlock settings file **Return:** - ``transientsDbConn`` -- the database hosting the transient source data - ``cataloguesDbConn`` -- connection to the database hosting...
python
def connect(self): """connect to the various databases, the credientals and settings of which are found in the sherlock settings file **Return:** - ``transientsDbConn`` -- the database hosting the transient source data - ``cataloguesDbConn`` -- connection to the database hosting...
[ "def", "connect", "(", "self", ")", ":", "self", ".", "log", ".", "debug", "(", "'starting the ``get`` method'", ")", "transientSettings", "=", "self", ".", "settings", "[", "\"database settings\"", "]", "[", "\"transients\"", "]", "catalogueSettings", "=", "sel...
connect to the various databases, the credientals and settings of which are found in the sherlock settings file **Return:** - ``transientsDbConn`` -- the database hosting the transient source data - ``cataloguesDbConn`` -- connection to the database hosting the contextual catalogues the...
[ "connect", "to", "the", "various", "databases", "the", "credientals", "and", "settings", "of", "which", "are", "found", "in", "the", "sherlock", "settings", "file" ]
train
https://github.com/thespacedoctor/sherlock/blob/2c80fb6fa31b04e7820e6928e3d437a21e692dd3/sherlock/database.py#L83-L171
thespacedoctor/sherlock
sherlock/database.py
database._setup_tunnel
def _setup_tunnel( self, tunnelParameters): """ *setup a ssh tunnel for a database connection to port through* **Key Arguments:** - ``tunnelParameters`` -- the tunnel parameters found associated with the database settings **Return:** - ``...
python
def _setup_tunnel( self, tunnelParameters): """ *setup a ssh tunnel for a database connection to port through* **Key Arguments:** - ``tunnelParameters`` -- the tunnel parameters found associated with the database settings **Return:** - ``...
[ "def", "_setup_tunnel", "(", "self", ",", "tunnelParameters", ")", ":", "self", ".", "log", ".", "debug", "(", "'starting the ``_setup_tunnel`` method'", ")", "# TEST TUNNEL DOES NOT ALREADY EXIST", "sshPort", "=", "tunnelParameters", "[", "\"port\"", "]", "connected", ...
*setup a ssh tunnel for a database connection to port through* **Key Arguments:** - ``tunnelParameters`` -- the tunnel parameters found associated with the database settings **Return:** - ``sshPort`` -- the port the ssh tunnel is connected via .. todo :: -...
[ "*", "setup", "a", "ssh", "tunnel", "for", "a", "database", "connection", "to", "port", "through", "*" ]
train
https://github.com/thespacedoctor/sherlock/blob/2c80fb6fa31b04e7820e6928e3d437a21e692dd3/sherlock/database.py#L173-L226
thespacedoctor/sherlock
sherlock/database.py
database._checkServer
def _checkServer(self, address, port): """Check that the TCP Port we've decided to use for tunnelling is available .. todo :: - update key arguments values and definitions with defaults - update return values and definitions - update usage examples and text ...
python
def _checkServer(self, address, port): """Check that the TCP Port we've decided to use for tunnelling is available .. todo :: - update key arguments values and definitions with defaults - update return values and definitions - update usage examples and text ...
[ "def", "_checkServer", "(", "self", ",", "address", ",", "port", ")", ":", "self", ".", "log", ".", "debug", "(", "'starting the ``_checkServer`` method'", ")", "# CREATE A TCP SOCKET", "import", "socket", "s", "=", "socket", ".", "socket", "(", ")", "self", ...
Check that the TCP Port we've decided to use for tunnelling is available .. todo :: - update key arguments values and definitions with defaults - update return values and definitions - update usage examples and text - update docstring text - check su...
[ "Check", "that", "the", "TCP", "Port", "we", "ve", "decided", "to", "use", "for", "tunnelling", "is", "available" ]
train
https://github.com/thespacedoctor/sherlock/blob/2c80fb6fa31b04e7820e6928e3d437a21e692dd3/sherlock/database.py#L228-L258
ozgurgunes/django-manifest
manifest/accounts/decorators.py
secure_required
def secure_required(view_func): """ Decorator to switch an url from http to https. If a view is accessed through http and this decorator is applied to that view, than it will return a permanent redirect to the secure (https) version of the same view. The decorator also must check that ``ACCO...
python
def secure_required(view_func): """ Decorator to switch an url from http to https. If a view is accessed through http and this decorator is applied to that view, than it will return a permanent redirect to the secure (https) version of the same view. The decorator also must check that ``ACCO...
[ "def", "secure_required", "(", "view_func", ")", ":", "def", "_wrapped_view", "(", "request", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "not", "request", ".", "is_secure", "(", ")", ":", "if", "defaults", ".", "ACCOUNTS_USE_HTTPS", ":", ...
Decorator to switch an url from http to https. If a view is accessed through http and this decorator is applied to that view, than it will return a permanent redirect to the secure (https) version of the same view. The decorator also must check that ``ACCOUNTS_USE_HTTPS`` is enabled. If disable...
[ "Decorator", "to", "switch", "an", "url", "from", "http", "to", "https", "." ]
train
https://github.com/ozgurgunes/django-manifest/blob/9873bbf2a475b76284ad7e36b2b26c92131e72dd/manifest/accounts/decorators.py#L10-L32
ozgurgunes/django-manifest
manifest/accounts/forms.py
identification_field_factory
def identification_field_factory(label, error_required): """ A simple identification field factory which enable you to set the label. :param label: String containing the label for this field. :param error_required: String containing the error message if the field is left empty. ""...
python
def identification_field_factory(label, error_required): """ A simple identification field factory which enable you to set the label. :param label: String containing the label for this field. :param error_required: String containing the error message if the field is left empty. ""...
[ "def", "identification_field_factory", "(", "label", ",", "error_required", ")", ":", "return", "forms", ".", "CharField", "(", "label", "=", "_", "(", "u\"%(label)s\"", ")", "%", "{", "'label'", ":", "label", "}", ",", "widget", "=", "forms", ".", "TextIn...
A simple identification field factory which enable you to set the label. :param label: String containing the label for this field. :param error_required: String containing the error message if the field is left empty.
[ "A", "simple", "identification", "field", "factory", "which", "enable", "you", "to", "set", "the", "label", "." ]
train
https://github.com/ozgurgunes/django-manifest/blob/9873bbf2a475b76284ad7e36b2b26c92131e72dd/manifest/accounts/forms.py#L133-L148
ozgurgunes/django-manifest
manifest/accounts/forms.py
RegistrationForm.clean_username
def clean_username(self): """ Validate that the username is unique and not listed in ``defaults.ACCOUNTS_FORBIDDEN_USERNAMES`` list. """ try: user = get_user_model().objects.get(username=self.cleaned_data["username"]) except get_user_model().DoesNot...
python
def clean_username(self): """ Validate that the username is unique and not listed in ``defaults.ACCOUNTS_FORBIDDEN_USERNAMES`` list. """ try: user = get_user_model().objects.get(username=self.cleaned_data["username"]) except get_user_model().DoesNot...
[ "def", "clean_username", "(", "self", ")", ":", "try", ":", "user", "=", "get_user_model", "(", ")", ".", "objects", ".", "get", "(", "username", "=", "self", ".", "cleaned_data", "[", "\"username\"", "]", ")", "except", "get_user_model", "(", ")", ".", ...
Validate that the username is unique and not listed in ``defaults.ACCOUNTS_FORBIDDEN_USERNAMES`` list.
[ "Validate", "that", "the", "username", "is", "unique", "and", "not", "listed", "in", "defaults", ".", "ACCOUNTS_FORBIDDEN_USERNAMES", "list", "." ]
train
https://github.com/ozgurgunes/django-manifest/blob/9873bbf2a475b76284ad7e36b2b26c92131e72dd/manifest/accounts/forms.py#L48-L65
ozgurgunes/django-manifest
manifest/accounts/forms.py
RegistrationForm.clean_email
def clean_email(self): """ Validate that the email address is unique. """ if get_user_model().objects.filter( Q(email__iexact=self.cleaned_data['email']) | Q(email_unconfirmed__iexact=self.cleaned_data['email'])): raise forms.ValidationError...
python
def clean_email(self): """ Validate that the email address is unique. """ if get_user_model().objects.filter( Q(email__iexact=self.cleaned_data['email']) | Q(email_unconfirmed__iexact=self.cleaned_data['email'])): raise forms.ValidationError...
[ "def", "clean_email", "(", "self", ")", ":", "if", "get_user_model", "(", ")", ".", "objects", ".", "filter", "(", "Q", "(", "email__iexact", "=", "self", ".", "cleaned_data", "[", "'email'", "]", ")", "|", "Q", "(", "email_unconfirmed__iexact", "=", "se...
Validate that the email address is unique.
[ "Validate", "that", "the", "email", "address", "is", "unique", "." ]
train
https://github.com/ozgurgunes/django-manifest/blob/9873bbf2a475b76284ad7e36b2b26c92131e72dd/manifest/accounts/forms.py#L67-L77
ozgurgunes/django-manifest
manifest/accounts/forms.py
RegistrationForm.save
def save(self): """ Creates a new user and account. Returns the newly created user. """ username, email, password = (self.cleaned_data['username'], self.cleaned_data['email'], self.cleaned_data['password...
python
def save(self): """ Creates a new user and account. Returns the newly created user. """ username, email, password = (self.cleaned_data['username'], self.cleaned_data['email'], self.cleaned_data['password...
[ "def", "save", "(", "self", ")", ":", "username", ",", "email", ",", "password", "=", "(", "self", ".", "cleaned_data", "[", "'username'", "]", ",", "self", ".", "cleaned_data", "[", "'email'", "]", ",", "self", ".", "cleaned_data", "[", "'password1'", ...
Creates a new user and account. Returns the newly created user.
[ "Creates", "a", "new", "user", "and", "account", ".", "Returns", "the", "newly", "created", "user", "." ]
train
https://github.com/ozgurgunes/django-manifest/blob/9873bbf2a475b76284ad7e36b2b26c92131e72dd/manifest/accounts/forms.py#L79-L91
ozgurgunes/django-manifest
manifest/accounts/forms.py
AuthenticationForm.clean
def clean(self): """ Checks for the identification and password. If the combination can't be found will raise an invalid sign in error. """ identification = self.cleaned_data.get('identification') password = self.cleaned_data.get('password') if identification a...
python
def clean(self): """ Checks for the identification and password. If the combination can't be found will raise an invalid sign in error. """ identification = self.cleaned_data.get('identification') password = self.cleaned_data.get('password') if identification a...
[ "def", "clean", "(", "self", ")", ":", "identification", "=", "self", ".", "cleaned_data", ".", "get", "(", "'identification'", ")", "password", "=", "self", ".", "cleaned_data", ".", "get", "(", "'password'", ")", "if", "identification", "and", "password", ...
Checks for the identification and password. If the combination can't be found will raise an invalid sign in error.
[ "Checks", "for", "the", "identification", "and", "password", "." ]
train
https://github.com/ozgurgunes/django-manifest/blob/9873bbf2a475b76284ad7e36b2b26c92131e72dd/manifest/accounts/forms.py#L181-L198
ozgurgunes/django-manifest
manifest/accounts/forms.py
EmailForm.clean_email
def clean_email(self): """ Validate that the email is not already registered with another user. """ if self.cleaned_data['email'].lower() == self.user.email: raise forms.ValidationError(_(u"You're already known under " ...
python
def clean_email(self): """ Validate that the email is not already registered with another user. """ if self.cleaned_data['email'].lower() == self.user.email: raise forms.ValidationError(_(u"You're already known under " ...
[ "def", "clean_email", "(", "self", ")", ":", "if", "self", ".", "cleaned_data", "[", "'email'", "]", ".", "lower", "(", ")", "==", "self", ".", "user", ".", "email", ":", "raise", "forms", ".", "ValidationError", "(", "_", "(", "u\"You're already known u...
Validate that the email is not already registered with another user.
[ "Validate", "that", "the", "email", "is", "not", "already", "registered", "with", "another", "user", "." ]
train
https://github.com/ozgurgunes/django-manifest/blob/9873bbf2a475b76284ad7e36b2b26c92131e72dd/manifest/accounts/forms.py#L221-L234
ozgurgunes/django-manifest
manifest/accounts/forms.py
ProfileForm.clean_picture
def clean_picture(self): """ Validates format and file size of uploaded profile picture. """ if self.cleaned_data.get('picture'): picture_data = self.cleaned_data['picture'] if 'error' in picture_data: raise forms.ValidationError(_(u'Uploa...
python
def clean_picture(self): """ Validates format and file size of uploaded profile picture. """ if self.cleaned_data.get('picture'): picture_data = self.cleaned_data['picture'] if 'error' in picture_data: raise forms.ValidationError(_(u'Uploa...
[ "def", "clean_picture", "(", "self", ")", ":", "if", "self", ".", "cleaned_data", ".", "get", "(", "'picture'", ")", ":", "picture_data", "=", "self", ".", "cleaned_data", "[", "'picture'", "]", "if", "'error'", "in", "picture_data", ":", "raise", "forms",...
Validates format and file size of uploaded profile picture.
[ "Validates", "format", "and", "file", "size", "of", "uploaded", "profile", "picture", "." ]
train
https://github.com/ozgurgunes/django-manifest/blob/9873bbf2a475b76284ad7e36b2b26c92131e72dd/manifest/accounts/forms.py#L280-L302
OpenEnergyPlatform/oedialect
oedialect/compiler.py
OECompiler.visit_grouping
def visit_grouping(self, grouping, asfrom=False, **kwargs): """" TODO: """ return { 'type': 'grouping', 'grouping': grouping.element._compiler_dispatch(self, **kwargs) }
python
def visit_grouping(self, grouping, asfrom=False, **kwargs): """" TODO: """ return { 'type': 'grouping', 'grouping': grouping.element._compiler_dispatch(self, **kwargs) }
[ "def", "visit_grouping", "(", "self", ",", "grouping", ",", "asfrom", "=", "False", ",", "*", "*", "kwargs", ")", ":", "return", "{", "'type'", ":", "'grouping'", ",", "'grouping'", ":", "grouping", ".", "element", ".", "_compiler_dispatch", "(", "self", ...
TODO:
[ "TODO", ":" ]
train
https://github.com/OpenEnergyPlatform/oedialect/blob/40a8d9e9b272ea4674d2c40dd6b3e6cc15f91c1e/oedialect/compiler.py#L275-L282
OpenEnergyPlatform/oedialect
oedialect/compiler.py
OECompiler.visit_select
def visit_select(self, select, asfrom=False, parens=True, fromhints=None, compound_index=0, nested_join_translation=False, select_wraps_for=None, **kwargs): jsn = {'command': 'advanced/search', 'type': 'sele...
python
def visit_select(self, select, asfrom=False, parens=True, fromhints=None, compound_index=0, nested_join_translation=False, select_wraps_for=None, **kwargs): jsn = {'command': 'advanced/search', 'type': 'sele...
[ "def", "visit_select", "(", "self", ",", "select", ",", "asfrom", "=", "False", ",", "parens", "=", "True", ",", "fromhints", "=", "None", ",", "compound_index", "=", "0", ",", "nested_join_translation", "=", "False", ",", "select_wraps_for", "=", "None", ...
if select._prefixes: text += self._generate_prefixes( select, select._prefixes, **kwargs)
[ "if", "select", ".", "_prefixes", ":", "text", "+", "=", "self", ".", "_generate_prefixes", "(", "select", "select", ".", "_prefixes", "**", "kwargs", ")" ]
train
https://github.com/OpenEnergyPlatform/oedialect/blob/40a8d9e9b272ea4674d2c40dd6b3e6cc15f91c1e/oedialect/compiler.py#L517-L641
OpenEnergyPlatform/oedialect
oedialect/compiler.py
OECompiler._label_select_column
def _label_select_column(self, select, column, populate_result_map, asfrom, column_clause_args, name=None, within_columns_clause=True): """produce labeled columns present in a select().""" ...
python
def _label_select_column(self, select, column, populate_result_map, asfrom, column_clause_args, name=None, within_columns_clause=True): """produce labeled columns present in a select().""" ...
[ "def", "_label_select_column", "(", "self", ",", "select", ",", "column", ",", "populate_result_map", ",", "asfrom", ",", "column_clause_args", ",", "name", "=", "None", ",", "within_columns_clause", "=", "True", ")", ":", "if", "column", ".", "type", ".", "...
produce labeled columns present in a select().
[ "produce", "labeled", "columns", "present", "in", "a", "select", "()", "." ]
train
https://github.com/OpenEnergyPlatform/oedialect/blob/40a8d9e9b272ea4674d2c40dd6b3e6cc15f91c1e/oedialect/compiler.py#L891-L972
pytroll/posttroll
posttroll/logger.py
run
def run(): """Main function """ import argparse global LOGGER parser = argparse.ArgumentParser() parser.add_argument("-r", "--rotated", help="Time rotated log file") parser.add_argument("-v", "--verbose", help="print debug messages too", action="store_true") par...
python
def run(): """Main function """ import argparse global LOGGER parser = argparse.ArgumentParser() parser.add_argument("-r", "--rotated", help="Time rotated log file") parser.add_argument("-v", "--verbose", help="print debug messages too", action="store_true") par...
[ "def", "run", "(", ")", ":", "import", "argparse", "global", "LOGGER", "parser", "=", "argparse", ".", "ArgumentParser", "(", ")", "parser", ".", "add_argument", "(", "\"-r\"", ",", "\"--rotated\"", ",", "help", "=", "\"Time rotated log file\"", ")", "parser",...
Main function
[ "Main", "function" ]
train
https://github.com/pytroll/posttroll/blob/8e811a0544b5182c4a72aed074b2ff8c4324e94d/posttroll/logger.py#L164-L213
pytroll/posttroll
posttroll/logger.py
Logger.log
def log(self): """Log stuff. """ with Subscribe(services=[""], addr_listener=True) as sub: for msg in sub.recv(1): if msg: if msg.type in ["log.debug", "log.info", "log.warning", "log.error", ...
python
def log(self): """Log stuff. """ with Subscribe(services=[""], addr_listener=True) as sub: for msg in sub.recv(1): if msg: if msg.type in ["log.debug", "log.info", "log.warning", "log.error", ...
[ "def", "log", "(", "self", ")", ":", "with", "Subscribe", "(", "services", "=", "[", "\"\"", "]", ",", "addr_listener", "=", "True", ")", "as", "sub", ":", "for", "msg", "in", "sub", ".", "recv", "(", "1", ")", ":", "if", "msg", ":", "if", "msg...
Log stuff.
[ "Log", "stuff", "." ]
train
https://github.com/pytroll/posttroll/blob/8e811a0544b5182c4a72aed074b2ff8c4324e94d/posttroll/logger.py#L129-L156
emichael/PyREM
pyrem/task.py
cleanup
def cleanup(): """Stop all started tasks on system exit. Note: This only handles signals caught by the atexit module by default. SIGKILL, for instance, will not be caught, so cleanup is not guaranteed in all cases. """ to_stop = STARTED_TASKS.copy() if to_stop: print "Cleaning up......
python
def cleanup(): """Stop all started tasks on system exit. Note: This only handles signals caught by the atexit module by default. SIGKILL, for instance, will not be caught, so cleanup is not guaranteed in all cases. """ to_stop = STARTED_TASKS.copy() if to_stop: print "Cleaning up......
[ "def", "cleanup", "(", ")", ":", "to_stop", "=", "STARTED_TASKS", ".", "copy", "(", ")", "if", "to_stop", ":", "print", "\"Cleaning up...\"", "for", "task", "in", "to_stop", ":", "try", ":", "task", ".", "stop", "(", ")", "except", ":", "# pylint: disabl...
Stop all started tasks on system exit. Note: This only handles signals caught by the atexit module by default. SIGKILL, for instance, will not be caught, so cleanup is not guaranteed in all cases.
[ "Stop", "all", "started", "tasks", "on", "system", "exit", "." ]
train
https://github.com/emichael/PyREM/blob/2609249ead197cd9496d164f4998ca9985503579/pyrem/task.py#L30-L48
emichael/PyREM
pyrem/task.py
Task.start
def start(self, wait=False): """Start a task. This function depends on the underlying implementation of _start, which any subclass of ``Task`` should implement. Args: wait (bool): Whether or not to wait on the task to finish before returning from this functi...
python
def start(self, wait=False): """Start a task. This function depends on the underlying implementation of _start, which any subclass of ``Task`` should implement. Args: wait (bool): Whether or not to wait on the task to finish before returning from this functi...
[ "def", "start", "(", "self", ",", "wait", "=", "False", ")", ":", "if", "self", ".", "_status", "is", "not", "TaskStatus", ".", "IDLE", ":", "raise", "RuntimeError", "(", "\"Cannot start %s in state %s\"", "%", "(", "self", ",", "self", ".", "_status", "...
Start a task. This function depends on the underlying implementation of _start, which any subclass of ``Task`` should implement. Args: wait (bool): Whether or not to wait on the task to finish before returning from this function. Default `False`. Raises: ...
[ "Start", "a", "task", "." ]
train
https://github.com/emichael/PyREM/blob/2609249ead197cd9496d164f4998ca9985503579/pyrem/task.py#L82-L106
emichael/PyREM
pyrem/task.py
Task.wait
def wait(self): """Wait on a task to finish and stop it when it has finished. Raises: RuntimeError: If the task hasn't been started or has already been stopped. Returns: The ``return_values`` of the task. """ if self._status is not TaskSt...
python
def wait(self): """Wait on a task to finish and stop it when it has finished. Raises: RuntimeError: If the task hasn't been started or has already been stopped. Returns: The ``return_values`` of the task. """ if self._status is not TaskSt...
[ "def", "wait", "(", "self", ")", ":", "if", "self", ".", "_status", "is", "not", "TaskStatus", ".", "STARTED", ":", "raise", "RuntimeError", "(", "\"Cannot wait on %s in state %s\"", "%", "(", "self", ",", "self", ".", "_status", ")", ")", "self", ".", "...
Wait on a task to finish and stop it when it has finished. Raises: RuntimeError: If the task hasn't been started or has already been stopped. Returns: The ``return_values`` of the task.
[ "Wait", "on", "a", "task", "to", "finish", "and", "stop", "it", "when", "it", "has", "finished", "." ]
train
https://github.com/emichael/PyREM/blob/2609249ead197cd9496d164f4998ca9985503579/pyrem/task.py#L112-L127
emichael/PyREM
pyrem/task.py
Task.stop
def stop(self): """Stop a task immediately. Raises: RuntimeError: If the task hasn't been started or has already been stopped. """ if self._status is TaskStatus.STOPPED: return if self._status is not TaskStatus.STARTED: raise ...
python
def stop(self): """Stop a task immediately. Raises: RuntimeError: If the task hasn't been started or has already been stopped. """ if self._status is TaskStatus.STOPPED: return if self._status is not TaskStatus.STARTED: raise ...
[ "def", "stop", "(", "self", ")", ":", "if", "self", ".", "_status", "is", "TaskStatus", ".", "STOPPED", ":", "return", "if", "self", ".", "_status", "is", "not", "TaskStatus", ".", "STARTED", ":", "raise", "RuntimeError", "(", "\"Cannot stop %s in state %s\"...
Stop a task immediately. Raises: RuntimeError: If the task hasn't been started or has already been stopped.
[ "Stop", "a", "task", "immediately", "." ]
train
https://github.com/emichael/PyREM/blob/2609249ead197cd9496d164f4998ca9985503579/pyrem/task.py#L133-L149
emichael/PyREM
pyrem/task.py
Task.reset
def reset(self): """Reset a task. Allows a task to be started again, clears the ``return_values``. Raises: RuntimeError: If the task has not been stopped. """ if self._status is not TaskStatus.STOPPED: raise RuntimeError("Cannot reset %s in state %s" % ...
python
def reset(self): """Reset a task. Allows a task to be started again, clears the ``return_values``. Raises: RuntimeError: If the task has not been stopped. """ if self._status is not TaskStatus.STOPPED: raise RuntimeError("Cannot reset %s in state %s" % ...
[ "def", "reset", "(", "self", ")", ":", "if", "self", ".", "_status", "is", "not", "TaskStatus", ".", "STOPPED", ":", "raise", "RuntimeError", "(", "\"Cannot reset %s in state %s\"", "%", "(", "self", ",", "self", ".", "_status", ")", ")", "self", ".", "_...
Reset a task. Allows a task to be started again, clears the ``return_values``. Raises: RuntimeError: If the task has not been stopped.
[ "Reset", "a", "task", "." ]
train
https://github.com/emichael/PyREM/blob/2609249ead197cd9496d164f4998ca9985503579/pyrem/task.py#L155-L168
emichael/PyREM
pyrem/task.py
Parallel._aggregate
def _aggregate(self): """Helper method to aggregate RemoteTasks into single ssh session.""" # pylint: disable=W0212 nonremote = [t for t in self._tasks if not isinstance(t, RemoteTask)] remote = [t for t in self._tasks if isinstance(t, RemoteTask)] host_dict = defaultdict(list) ...
python
def _aggregate(self): """Helper method to aggregate RemoteTasks into single ssh session.""" # pylint: disable=W0212 nonremote = [t for t in self._tasks if not isinstance(t, RemoteTask)] remote = [t for t in self._tasks if isinstance(t, RemoteTask)] host_dict = defaultdict(list) ...
[ "def", "_aggregate", "(", "self", ")", ":", "# pylint: disable=W0212", "nonremote", "=", "[", "t", "for", "t", "in", "self", ".", "_tasks", "if", "not", "isinstance", "(", "t", ",", "RemoteTask", ")", "]", "remote", "=", "[", "t", "for", "t", "in", "...
Helper method to aggregate RemoteTasks into single ssh session.
[ "Helper", "method", "to", "aggregate", "RemoteTasks", "into", "single", "ssh", "session", "." ]
train
https://github.com/emichael/PyREM/blob/2609249ead197cd9496d164f4998ca9985503579/pyrem/task.py#L385-L412
ozgurgunes/django-manifest
manifest/accounts/models.py
upload_to_picture
def upload_to_picture(instance, filename): """ Uploads a picture for a user to the ``ACCOUNTS_PICTURE_PATH`` and saving it under unique hash for the image. This is for privacy reasons so others can't just browse through the picture directory. """ extension = filename.split('.')[-1].lower() ...
python
def upload_to_picture(instance, filename): """ Uploads a picture for a user to the ``ACCOUNTS_PICTURE_PATH`` and saving it under unique hash for the image. This is for privacy reasons so others can't just browse through the picture directory. """ extension = filename.split('.')[-1].lower() ...
[ "def", "upload_to_picture", "(", "instance", ",", "filename", ")", ":", "extension", "=", "filename", ".", "split", "(", "'.'", ")", "[", "-", "1", "]", ".", "lower", "(", ")", "salt", ",", "hash", "=", "generate_sha1", "(", "instance", ".", "id", ")...
Uploads a picture for a user to the ``ACCOUNTS_PICTURE_PATH`` and saving it under unique hash for the image. This is for privacy reasons so others can't just browse through the picture directory.
[ "Uploads", "a", "picture", "for", "a", "user", "to", "the", "ACCOUNTS_PICTURE_PATH", "and", "saving", "it", "under", "unique", "hash", "for", "the", "image", ".", "This", "is", "for", "privacy", "reasons", "so", "others", "can", "t", "just", "browse", "thr...
train
https://github.com/ozgurgunes/django-manifest/blob/9873bbf2a475b76284ad7e36b2b26c92131e72dd/manifest/accounts/models.py#L173-L188
ozgurgunes/django-manifest
manifest/accounts/models.py
AccountActivationMixin.activation_key_expired
def activation_key_expired(self): """ Checks if activation key is expired. Returns ``True`` when the ``activation_key`` of the user is expired and ``False`` if the key is still valid. The key is expired when it's set to the value defined in ``ACCOUNTS_ACTIVATED`` or ``...
python
def activation_key_expired(self): """ Checks if activation key is expired. Returns ``True`` when the ``activation_key`` of the user is expired and ``False`` if the key is still valid. The key is expired when it's set to the value defined in ``ACCOUNTS_ACTIVATED`` or ``...
[ "def", "activation_key_expired", "(", "self", ")", ":", "expiration_days", "=", "datetime", ".", "timedelta", "(", "days", "=", "defaults", ".", "ACCOUNTS_ACTIVATION_DAYS", ")", "expiration_date", "=", "self", ".", "date_joined", "+", "expiration_days", "if", "sel...
Checks if activation key is expired. Returns ``True`` when the ``activation_key`` of the user is expired and ``False`` if the key is still valid. The key is expired when it's set to the value defined in ``ACCOUNTS_ACTIVATED`` or ``activation_key_created`` is beyond the amount ...
[ "Checks", "if", "activation", "key", "is", "expired", "." ]
train
https://github.com/ozgurgunes/django-manifest/blob/9873bbf2a475b76284ad7e36b2b26c92131e72dd/manifest/accounts/models.py#L31-L50
ozgurgunes/django-manifest
manifest/accounts/models.py
AccountActivationMixin.send_activation_email
def send_activation_email(self): """ Sends a activation email to the user. This email is send when the user wants to activate their newly created user. """ context= {'user': self, 'protocol': get_protocol(), 'activation_days': defaul...
python
def send_activation_email(self): """ Sends a activation email to the user. This email is send when the user wants to activate their newly created user. """ context= {'user': self, 'protocol': get_protocol(), 'activation_days': defaul...
[ "def", "send_activation_email", "(", "self", ")", ":", "context", "=", "{", "'user'", ":", "self", ",", "'protocol'", ":", "get_protocol", "(", ")", ",", "'activation_days'", ":", "defaults", ".", "ACCOUNTS_ACTIVATION_DAYS", ",", "'activation_key'", ":", "self",...
Sends a activation email to the user. This email is send when the user wants to activate their newly created user.
[ "Sends", "a", "activation", "email", "to", "the", "user", "." ]
train
https://github.com/ozgurgunes/django-manifest/blob/9873bbf2a475b76284ad7e36b2b26c92131e72dd/manifest/accounts/models.py#L52-L76
ozgurgunes/django-manifest
manifest/accounts/models.py
EmailConfirmationMixin.change_email
def change_email(self, email): """ Changes the email address for a user. A user needs to verify this new email address before it becomes active. By storing the new email address in a temporary field -- ``temporary_email`` -- we are able to set this email address after ...
python
def change_email(self, email): """ Changes the email address for a user. A user needs to verify this new email address before it becomes active. By storing the new email address in a temporary field -- ``temporary_email`` -- we are able to set this email address after ...
[ "def", "change_email", "(", "self", ",", "email", ")", ":", "self", ".", "email_unconfirmed", "=", "email", "salt", ",", "hash", "=", "generate_sha1", "(", "self", ".", "username", ")", "self", ".", "email_confirmation_key", "=", "hash", "self", ".", "emai...
Changes the email address for a user. A user needs to verify this new email address before it becomes active. By storing the new email address in a temporary field -- ``temporary_email`` -- we are able to set this email address after the user has verified it by clicking on the verific...
[ "Changes", "the", "email", "address", "for", "a", "user", "." ]
train
https://github.com/ozgurgunes/django-manifest/blob/9873bbf2a475b76284ad7e36b2b26c92131e72dd/manifest/accounts/models.py#L99-L123
ozgurgunes/django-manifest
manifest/accounts/models.py
EmailConfirmationMixin.send_confirmation_email
def send_confirmation_email(self): """ Sends an email to confirm the new email address. This method sends out two emails. One to the new email address that contains the ``email_confirmation_key`` which is used to verify this this email address with :func:`User.objects.confirm_em...
python
def send_confirmation_email(self): """ Sends an email to confirm the new email address. This method sends out two emails. One to the new email address that contains the ``email_confirmation_key`` which is used to verify this this email address with :func:`User.objects.confirm_em...
[ "def", "send_confirmation_email", "(", "self", ")", ":", "context", "=", "{", "'user'", ":", "self", ",", "'new_email'", ":", "self", ".", "email_unconfirmed", ",", "'protocol'", ":", "get_protocol", "(", ")", ",", "'confirmation_key'", ":", "self", ".", "em...
Sends an email to confirm the new email address. This method sends out two emails. One to the new email address that contains the ``email_confirmation_key`` which is used to verify this this email address with :func:`User.objects.confirm_email`. The other email is to the old email addr...
[ "Sends", "an", "email", "to", "confirm", "the", "new", "email", "address", "." ]
train
https://github.com/ozgurgunes/django-manifest/blob/9873bbf2a475b76284ad7e36b2b26c92131e72dd/manifest/accounts/models.py#L125-L170
ozgurgunes/django-manifest
manifest/accounts/models.py
UserProfileMixin.get_picture_url
def get_picture_url(self): """ Returns the image containing the picture for the user. The picture can be a uploaded image or a Gravatar. Gravatar functionality will only be used when ``ACCOUNTS_GRAVATAR_PICTURE`` is set to ``True``. :return: ``None`` when G...
python
def get_picture_url(self): """ Returns the image containing the picture for the user. The picture can be a uploaded image or a Gravatar. Gravatar functionality will only be used when ``ACCOUNTS_GRAVATAR_PICTURE`` is set to ``True``. :return: ``None`` when G...
[ "def", "get_picture_url", "(", "self", ")", ":", "# First check for a picture and if any return that.", "if", "self", ".", "picture", ":", "return", "self", ".", "picture", ".", "url", "# Use Gravatar if the user wants to.", "if", "defaults", ".", "ACCOUNTS_GRAVATAR_PICTU...
Returns the image containing the picture for the user. The picture can be a uploaded image or a Gravatar. Gravatar functionality will only be used when ``ACCOUNTS_GRAVATAR_PICTURE`` is set to ``True``. :return: ``None`` when Gravatar is not used and no default image is ...
[ "Returns", "the", "image", "containing", "the", "picture", "for", "the", "user", "." ]
train
https://github.com/ozgurgunes/django-manifest/blob/9873bbf2a475b76284ad7e36b2b26c92131e72dd/manifest/accounts/models.py#L240-L271
ozgurgunes/django-manifest
manifest/accounts/models.py
UserProfileMixin.get_full_name_or_username
def get_full_name_or_username(self): """ Returns the full name of the user, or if none is supplied will return the username. Also looks at ``ACCOUNTS_WITHOUT_USERNAMES`` settings to define if it should return the username or email address when the full name is not suppli...
python
def get_full_name_or_username(self): """ Returns the full name of the user, or if none is supplied will return the username. Also looks at ``ACCOUNTS_WITHOUT_USERNAMES`` settings to define if it should return the username or email address when the full name is not suppli...
[ "def", "get_full_name_or_username", "(", "self", ")", ":", "if", "self", ".", "first_name", "or", "self", ".", "last_name", ":", "# We will return this as translated string. Maybe there are some", "# countries that first display the last name.", "name", "=", "_", "(", "u\"%...
Returns the full name of the user, or if none is supplied will return the username. Also looks at ``ACCOUNTS_WITHOUT_USERNAMES`` settings to define if it should return the username or email address when the full name is not supplied. :return: ``String`` containing t...
[ "Returns", "the", "full", "name", "of", "the", "user", "or", "if", "none", "is", "supplied", "will", "return", "the", "username", "." ]
train
https://github.com/ozgurgunes/django-manifest/blob/9873bbf2a475b76284ad7e36b2b26c92131e72dd/manifest/accounts/models.py#L273-L300
contentful-labs/contentful.py
contentful/cda/client.py
Client.validate_config
def validate_config(config): """Verify sanity for a :class:`.Config` instance. This will raise an exception in case conditions are not met, otherwise will complete silently. :param config: (:class:`.Config`) Configuration container. """ non_null_params = ['space_id', 'a...
python
def validate_config(config): """Verify sanity for a :class:`.Config` instance. This will raise an exception in case conditions are not met, otherwise will complete silently. :param config: (:class:`.Config`) Configuration container. """ non_null_params = ['space_id', 'a...
[ "def", "validate_config", "(", "config", ")", ":", "non_null_params", "=", "[", "'space_id'", ",", "'access_token'", "]", "for", "param", "in", "non_null_params", ":", "if", "getattr", "(", "config", ",", "param", ")", "is", "None", ":", "raise", "Exception"...
Verify sanity for a :class:`.Config` instance. This will raise an exception in case conditions are not met, otherwise will complete silently. :param config: (:class:`.Config`) Configuration container.
[ "Verify", "sanity", "for", "a", ":", "class", ":", ".", "Config", "instance", "." ]
train
https://github.com/contentful-labs/contentful.py/blob/d9eb4a68abcad33e4766e2be8c7b35e605210b5a/contentful/cda/client.py#L52-L70
contentful-labs/contentful.py
contentful/cda/client.py
Client.fetch
def fetch(self, resource_class): """Construct a :class:`.Request` for the given resource type. Provided an :class:`.Entry` subclass, the Content Type ID will be inferred and requested explicitly. Examples:: client.fetch(Asset) client.fetch(Entry) client.fet...
python
def fetch(self, resource_class): """Construct a :class:`.Request` for the given resource type. Provided an :class:`.Entry` subclass, the Content Type ID will be inferred and requested explicitly. Examples:: client.fetch(Asset) client.fetch(Entry) client.fet...
[ "def", "fetch", "(", "self", ",", "resource_class", ")", ":", "if", "issubclass", "(", "resource_class", ",", "Entry", ")", ":", "params", "=", "None", "content_type", "=", "getattr", "(", "resource_class", ",", "'__content_type__'", ",", "None", ")", "if", ...
Construct a :class:`.Request` for the given resource type. Provided an :class:`.Entry` subclass, the Content Type ID will be inferred and requested explicitly. Examples:: client.fetch(Asset) client.fetch(Entry) client.fetch(ContentType) client.fetch(Cus...
[ "Construct", "a", ":", "class", ":", ".", "Request", "for", "the", "given", "resource", "type", "." ]
train
https://github.com/contentful-labs/contentful.py/blob/d9eb4a68abcad33e4766e2be8c7b35e605210b5a/contentful/cda/client.py#L72-L100
contentful-labs/contentful.py
contentful/cda/client.py
Client.resolve
def resolve(self, link_resource_type, resource_id, array=None): """Resolve a link to a CDA resource. Provided an `array` argument, attempt to retrieve the resource from the `mapped_items` section of that array (containing both included and regular resources), in case the resource cannot...
python
def resolve(self, link_resource_type, resource_id, array=None): """Resolve a link to a CDA resource. Provided an `array` argument, attempt to retrieve the resource from the `mapped_items` section of that array (containing both included and regular resources), in case the resource cannot...
[ "def", "resolve", "(", "self", ",", "link_resource_type", ",", "resource_id", ",", "array", "=", "None", ")", ":", "result", "=", "None", "if", "array", "is", "not", "None", ":", "container", "=", "array", ".", "items_mapped", ".", "get", "(", "link_reso...
Resolve a link to a CDA resource. Provided an `array` argument, attempt to retrieve the resource from the `mapped_items` section of that array (containing both included and regular resources), in case the resource cannot be found in the array (or if no `array` was provided) - attempt to fetch ...
[ "Resolve", "a", "link", "to", "a", "CDA", "resource", "." ]
train
https://github.com/contentful-labs/contentful.py/blob/d9eb4a68abcad33e4766e2be8c7b35e605210b5a/contentful/cda/client.py#L109-L132
contentful-labs/contentful.py
contentful/cda/client.py
Client.resolve_resource_link
def resolve_resource_link(self, resource_link, array=None): """Convenience method for resolving links given a :class:`.resources.ResourceLink` object. Extract link values and pass to the :func:`.resolve` method of this class. :param resource_link: (:class:`.ResourceLink`) instance. :pa...
python
def resolve_resource_link(self, resource_link, array=None): """Convenience method for resolving links given a :class:`.resources.ResourceLink` object. Extract link values and pass to the :func:`.resolve` method of this class. :param resource_link: (:class:`.ResourceLink`) instance. :pa...
[ "def", "resolve_resource_link", "(", "self", ",", "resource_link", ",", "array", "=", "None", ")", ":", "return", "self", ".", "resolve", "(", "resource_link", ".", "link_type", ",", "resource_link", ".", "resource_id", ",", "array", ")" ]
Convenience method for resolving links given a :class:`.resources.ResourceLink` object. Extract link values and pass to the :func:`.resolve` method of this class. :param resource_link: (:class:`.ResourceLink`) instance. :param array: (:class:`.Array`) Optional array resource. :return: ...
[ "Convenience", "method", "for", "resolving", "links", "given", "a", ":", "class", ":", ".", "resources", ".", "ResourceLink", "object", "." ]
train
https://github.com/contentful-labs/contentful.py/blob/d9eb4a68abcad33e4766e2be8c7b35e605210b5a/contentful/cda/client.py#L134-L143
contentful-labs/contentful.py
contentful/cda/client.py
Client.resolve_dict_link
def resolve_dict_link(self, dct, array=None): """Convenience method for resolving links given a dict object. Extract link values and pass to the :func:`.resolve` method of this class. :param dct: (dict) Dictionary with the link data. :param array: (:class:`.Array`) Optional array resou...
python
def resolve_dict_link(self, dct, array=None): """Convenience method for resolving links given a dict object. Extract link values and pass to the :func:`.resolve` method of this class. :param dct: (dict) Dictionary with the link data. :param array: (:class:`.Array`) Optional array resou...
[ "def", "resolve_dict_link", "(", "self", ",", "dct", ",", "array", "=", "None", ")", ":", "sys", "=", "dct", ".", "get", "(", "'sys'", ")", "return", "self", ".", "resolve", "(", "sys", "[", "'linkType'", "]", ",", "sys", "[", "'id'", "]", ",", "...
Convenience method for resolving links given a dict object. Extract link values and pass to the :func:`.resolve` method of this class. :param dct: (dict) Dictionary with the link data. :param array: (:class:`.Array`) Optional array resource. :return: :class:`.Resource` subclass, `None`...
[ "Convenience", "method", "for", "resolving", "links", "given", "a", "dict", "object", "." ]
train
https://github.com/contentful-labs/contentful.py/blob/d9eb4a68abcad33e4766e2be8c7b35e605210b5a/contentful/cda/client.py#L145-L155
contentful-labs/contentful.py
contentful/cda/client.py
Dispatcher.invoke
def invoke(self, request): """Invoke the given :class:`.Request` instance using the associated :class:`.Dispatcher`. :param request: :class:`.Request` instance to invoke. :return: :class:`.Resource` subclass. """ url = '{0}/{1}'.format(self.base_url, request.remote_path) ...
python
def invoke(self, request): """Invoke the given :class:`.Request` instance using the associated :class:`.Dispatcher`. :param request: :class:`.Request` instance to invoke. :return: :class:`.Resource` subclass. """ url = '{0}/{1}'.format(self.base_url, request.remote_path) ...
[ "def", "invoke", "(", "self", ",", "request", ")", ":", "url", "=", "'{0}/{1}'", ".", "format", "(", "self", ".", "base_url", ",", "request", ".", "remote_path", ")", "r", "=", "self", ".", "httpclient", ".", "get", "(", "url", ",", "params", "=", ...
Invoke the given :class:`.Request` instance using the associated :class:`.Dispatcher`. :param request: :class:`.Request` instance to invoke. :return: :class:`.Resource` subclass.
[ "Invoke", "the", "given", ":", "class", ":", ".", "Request", "instance", "using", "the", "associated", ":", "class", ":", ".", "Dispatcher", "." ]
train
https://github.com/contentful-labs/contentful.py/blob/d9eb4a68abcad33e4766e2be8c7b35e605210b5a/contentful/cda/client.py#L209-L223
contentful-labs/contentful.py
contentful/cda/client.py
RequestArray.all
def all(self): """Attempt to retrieve all available resources matching this request. :return: Result instance as returned by the :class:`.Dispatcher`. """ result = self.invoke() if self.resolve_links: result.resolve_links() return result
python
def all(self): """Attempt to retrieve all available resources matching this request. :return: Result instance as returned by the :class:`.Dispatcher`. """ result = self.invoke() if self.resolve_links: result.resolve_links() return result
[ "def", "all", "(", "self", ")", ":", "result", "=", "self", ".", "invoke", "(", ")", "if", "self", ".", "resolve_links", ":", "result", ".", "resolve_links", "(", ")", "return", "result" ]
Attempt to retrieve all available resources matching this request. :return: Result instance as returned by the :class:`.Dispatcher`.
[ "Attempt", "to", "retrieve", "all", "available", "resources", "matching", "this", "request", "." ]
train
https://github.com/contentful-labs/contentful.py/blob/d9eb4a68abcad33e4766e2be8c7b35e605210b5a/contentful/cda/client.py#L263-L272
contentful-labs/contentful.py
contentful/cda/client.py
RequestArray.first
def first(self): """Attempt to retrieve only the first resource matching this request. :return: Result instance, or `None` if there are no matching resources. """ self.params['limit'] = 1 result = self.all() return result.items[0] if result.total > 0 else None
python
def first(self): """Attempt to retrieve only the first resource matching this request. :return: Result instance, or `None` if there are no matching resources. """ self.params['limit'] = 1 result = self.all() return result.items[0] if result.total > 0 else None
[ "def", "first", "(", "self", ")", ":", "self", ".", "params", "[", "'limit'", "]", "=", "1", "result", "=", "self", ".", "all", "(", ")", "return", "result", ".", "items", "[", "0", "]", "if", "result", ".", "total", ">", "0", "else", "None" ]
Attempt to retrieve only the first resource matching this request. :return: Result instance, or `None` if there are no matching resources.
[ "Attempt", "to", "retrieve", "only", "the", "first", "resource", "matching", "this", "request", "." ]
train
https://github.com/contentful-labs/contentful.py/blob/d9eb4a68abcad33e4766e2be8c7b35e605210b5a/contentful/cda/client.py#L274-L281
contentful-labs/contentful.py
contentful/cda/client.py
RequestArray.where
def where(self, params): """Set a dict of parameters to be passed to the API when invoking this request. :param params: (dict) query parameters. :return: this :class:`.RequestArray` instance for convenience. """ self.params = dict(self.params, **params) # params overrides self...
python
def where(self, params): """Set a dict of parameters to be passed to the API when invoking this request. :param params: (dict) query parameters. :return: this :class:`.RequestArray` instance for convenience. """ self.params = dict(self.params, **params) # params overrides self...
[ "def", "where", "(", "self", ",", "params", ")", ":", "self", ".", "params", "=", "dict", "(", "self", ".", "params", ",", "*", "*", "params", ")", "# params overrides self.params", "return", "self" ]
Set a dict of parameters to be passed to the API when invoking this request. :param params: (dict) query parameters. :return: this :class:`.RequestArray` instance for convenience.
[ "Set", "a", "dict", "of", "parameters", "to", "be", "passed", "to", "the", "API", "when", "invoking", "this", "request", "." ]
train
https://github.com/contentful-labs/contentful.py/blob/d9eb4a68abcad33e4766e2be8c7b35e605210b5a/contentful/cda/client.py#L283-L290
dusktreader/py-buzz
examples/require_condition.py
complex_require_condition
def complex_require_condition(): """ This function demonstrates a more complex usage of the require_condition function. It shows argument interpolation and handling a more complex boolean expression """ print("Demonstrating complex require_condition example") val = 64 Buzz.require_condi...
python
def complex_require_condition(): """ This function demonstrates a more complex usage of the require_condition function. It shows argument interpolation and handling a more complex boolean expression """ print("Demonstrating complex require_condition example") val = 64 Buzz.require_condi...
[ "def", "complex_require_condition", "(", ")", ":", "print", "(", "\"Demonstrating complex require_condition example\"", ")", "val", "=", "64", "Buzz", ".", "require_condition", "(", "is_even", "(", "val", ")", ",", "'This condition should pass'", ")", "val", "=", "8...
This function demonstrates a more complex usage of the require_condition function. It shows argument interpolation and handling a more complex boolean expression
[ "This", "function", "demonstrates", "a", "more", "complex", "usage", "of", "the", "require_condition", "function", ".", "It", "shows", "argument", "interpolation", "and", "handling", "a", "more", "complex", "boolean", "expression" ]
train
https://github.com/dusktreader/py-buzz/blob/f2fd97abe158a1688188647992a5be6531058ec3/examples/require_condition.py#L27-L38
ozgurgunes/django-manifest
manifest/core/templatetags/navigation.py
active_url
def active_url(context, urls, css=None): """ Highlight menu item based on url tag. Returns a css class if ``request.path`` is in given ``url``. :param url: Django url to be reversed. :param css: Css class to be returned for highlighting. Return active if none set. """...
python
def active_url(context, urls, css=None): """ Highlight menu item based on url tag. Returns a css class if ``request.path`` is in given ``url``. :param url: Django url to be reversed. :param css: Css class to be returned for highlighting. Return active if none set. """...
[ "def", "active_url", "(", "context", ",", "urls", ",", "css", "=", "None", ")", ":", "request", "=", "context", "[", "'request'", "]", "if", "request", ".", "get_full_path", "in", "(", "reverse", "(", "url", ")", "for", "url", "in", "urls", ".", "spl...
Highlight menu item based on url tag. Returns a css class if ``request.path`` is in given ``url``. :param url: Django url to be reversed. :param css: Css class to be returned for highlighting. Return active if none set.
[ "Highlight", "menu", "item", "based", "on", "url", "tag", ".", "Returns", "a", "css", "class", "if", "request", ".", "path", "is", "in", "given", "url", ".", ":", "param", "url", ":", "Django", "url", "to", "be", "reversed", "." ]
train
https://github.com/ozgurgunes/django-manifest/blob/9873bbf2a475b76284ad7e36b2b26c92131e72dd/manifest/core/templatetags/navigation.py#L61-L77
ozgurgunes/django-manifest
manifest/core/templatetags/navigation.py
active_path
def active_path(context, pattern, css=None): """ Highlight menu item based on path. Returns a css class if ``request.path`` is in given ``pattern``. :param pattern: Regex url pattern. :param css: Css class to be returned for highlighting. Return active if none set. ""...
python
def active_path(context, pattern, css=None): """ Highlight menu item based on path. Returns a css class if ``request.path`` is in given ``pattern``. :param pattern: Regex url pattern. :param css: Css class to be returned for highlighting. Return active if none set. ""...
[ "def", "active_path", "(", "context", ",", "pattern", ",", "css", "=", "None", ")", ":", "request", "=", "context", "[", "'request'", "]", "#pattern = \"^\" + pattern + \"$\"", "if", "re", ".", "search", "(", "pattern", ",", "request", ".", "path", ")", ":...
Highlight menu item based on path. Returns a css class if ``request.path`` is in given ``pattern``. :param pattern: Regex url pattern. :param css: Css class to be returned for highlighting. Return active if none set.
[ "Highlight", "menu", "item", "based", "on", "path", ".", "Returns", "a", "css", "class", "if", "request", ".", "path", "is", "in", "given", "pattern", ".", ":", "param", "pattern", ":", "Regex", "url", "pattern", "." ]
train
https://github.com/ozgurgunes/django-manifest/blob/9873bbf2a475b76284ad7e36b2b26c92131e72dd/manifest/core/templatetags/navigation.py#L80-L97
zeroSteiner/smoke-zephyr
smoke_zephyr/configuration.py
MemoryConfiguration.get
def get(self, item_name): """ Retrieve the value of an option. :param str item_name: The name of the option to retrieve. :return: The value of *item_name* in the configuration. """ if self.prefix: item_name = self.prefix + self.seperator + item_name item_names = item_name.split(self.seperator) node ...
python
def get(self, item_name): """ Retrieve the value of an option. :param str item_name: The name of the option to retrieve. :return: The value of *item_name* in the configuration. """ if self.prefix: item_name = self.prefix + self.seperator + item_name item_names = item_name.split(self.seperator) node ...
[ "def", "get", "(", "self", ",", "item_name", ")", ":", "if", "self", ".", "prefix", ":", "item_name", "=", "self", ".", "prefix", "+", "self", ".", "seperator", "+", "item_name", "item_names", "=", "item_name", ".", "split", "(", "self", ".", "seperato...
Retrieve the value of an option. :param str item_name: The name of the option to retrieve. :return: The value of *item_name* in the configuration.
[ "Retrieve", "the", "value", "of", "an", "option", "." ]
train
https://github.com/zeroSteiner/smoke-zephyr/blob/a6d2498aeacc72ee52e7806f783a4d83d537ffb2/smoke_zephyr/configuration.py#L80-L93
zeroSteiner/smoke-zephyr
smoke_zephyr/configuration.py
MemoryConfiguration.get_if_exists
def get_if_exists(self, item_name, default_value=None): """ Retrieve the value of an option if it exists, otherwise return *default_value* instead of raising an error: :param str item_name: The name of the option to retrieve. :param default_value: The value to return if *item_name* does not exist. :return:...
python
def get_if_exists(self, item_name, default_value=None): """ Retrieve the value of an option if it exists, otherwise return *default_value* instead of raising an error: :param str item_name: The name of the option to retrieve. :param default_value: The value to return if *item_name* does not exist. :return:...
[ "def", "get_if_exists", "(", "self", ",", "item_name", ",", "default_value", "=", "None", ")", ":", "if", "self", ".", "has_option", "(", "item_name", ")", ":", "return", "self", ".", "get", "(", "item_name", ")", "return", "default_value" ]
Retrieve the value of an option if it exists, otherwise return *default_value* instead of raising an error: :param str item_name: The name of the option to retrieve. :param default_value: The value to return if *item_name* does not exist. :return: The value of *item_name* in the configuration.
[ "Retrieve", "the", "value", "of", "an", "option", "if", "it", "exists", "otherwise", "return", "*", "default_value", "*", "instead", "of", "raising", "an", "error", ":" ]
train
https://github.com/zeroSteiner/smoke-zephyr/blob/a6d2498aeacc72ee52e7806f783a4d83d537ffb2/smoke_zephyr/configuration.py#L95-L106
zeroSteiner/smoke-zephyr
smoke_zephyr/configuration.py
MemoryConfiguration.has_option
def has_option(self, option_name): """ Check that an option exists. :param str option_name: The name of the option to check. :return: True of the option exists in the configuration. :rtype: bool """ if self.prefix: option_name = self.prefix + self.seperator + option_name item_names = option_name.spl...
python
def has_option(self, option_name): """ Check that an option exists. :param str option_name: The name of the option to check. :return: True of the option exists in the configuration. :rtype: bool """ if self.prefix: option_name = self.prefix + self.seperator + option_name item_names = option_name.spl...
[ "def", "has_option", "(", "self", ",", "option_name", ")", ":", "if", "self", ".", "prefix", ":", "option_name", "=", "self", ".", "prefix", "+", "self", ".", "seperator", "+", "option_name", "item_names", "=", "option_name", ".", "split", "(", "self", "...
Check that an option exists. :param str option_name: The name of the option to check. :return: True of the option exists in the configuration. :rtype: bool
[ "Check", "that", "an", "option", "exists", "." ]
train
https://github.com/zeroSteiner/smoke-zephyr/blob/a6d2498aeacc72ee52e7806f783a4d83d537ffb2/smoke_zephyr/configuration.py#L118-L136
zeroSteiner/smoke-zephyr
smoke_zephyr/configuration.py
MemoryConfiguration.has_section
def has_section(self, section_name): """ Checks that an option exists and that it contains sub options. :param str section_name: The name of the section to check. :return: True if the section exists. :rtype: dict """ if not self.has_option(section_name): return False return isinstance(self.get(secti...
python
def has_section(self, section_name): """ Checks that an option exists and that it contains sub options. :param str section_name: The name of the section to check. :return: True if the section exists. :rtype: dict """ if not self.has_option(section_name): return False return isinstance(self.get(secti...
[ "def", "has_section", "(", "self", ",", "section_name", ")", ":", "if", "not", "self", ".", "has_option", "(", "section_name", ")", ":", "return", "False", "return", "isinstance", "(", "self", ".", "get", "(", "section_name", ")", ",", "dict", ")" ]
Checks that an option exists and that it contains sub options. :param str section_name: The name of the section to check. :return: True if the section exists. :rtype: dict
[ "Checks", "that", "an", "option", "exists", "and", "that", "it", "contains", "sub", "options", "." ]
train
https://github.com/zeroSteiner/smoke-zephyr/blob/a6d2498aeacc72ee52e7806f783a4d83d537ffb2/smoke_zephyr/configuration.py#L138-L148
zeroSteiner/smoke-zephyr
smoke_zephyr/configuration.py
MemoryConfiguration.set
def set(self, item_name, item_value): """ Sets the value of an option in the configuration. :param str item_name: The name of the option to set. :param item_value: The value of the option to set. """ if self.prefix: item_name = self.prefix + self.seperator + item_name item_names = item_name.split(self...
python
def set(self, item_name, item_value): """ Sets the value of an option in the configuration. :param str item_name: The name of the option to set. :param item_value: The value of the option to set. """ if self.prefix: item_name = self.prefix + self.seperator + item_name item_names = item_name.split(self...
[ "def", "set", "(", "self", ",", "item_name", ",", "item_value", ")", ":", "if", "self", ".", "prefix", ":", "item_name", "=", "self", ".", "prefix", "+", "self", ".", "seperator", "+", "item_name", "item_names", "=", "item_name", ".", "split", "(", "se...
Sets the value of an option in the configuration. :param str item_name: The name of the option to set. :param item_value: The value of the option to set.
[ "Sets", "the", "value", "of", "an", "option", "in", "the", "configuration", "." ]
train
https://github.com/zeroSteiner/smoke-zephyr/blob/a6d2498aeacc72ee52e7806f783a4d83d537ffb2/smoke_zephyr/configuration.py#L150-L167
zeroSteiner/smoke-zephyr
smoke_zephyr/configuration.py
Configuration.get_missing
def get_missing(self, verify_file): """ Use a verification configuration which has a list of required options and their respective types. This information is used to identify missing and incompatible options in the loaded configuration. :param str verify_file: The file to load for verification data. :retur...
python
def get_missing(self, verify_file): """ Use a verification configuration which has a list of required options and their respective types. This information is used to identify missing and incompatible options in the loaded configuration. :param str verify_file: The file to load for verification data. :retur...
[ "def", "get_missing", "(", "self", ",", "verify_file", ")", ":", "vconf", "=", "Configuration", "(", "verify_file", ")", "missing", "=", "{", "}", "for", "setting", ",", "setting_type", "in", "vconf", ".", "get", "(", "'settings'", ")", ".", "items", "("...
Use a verification configuration which has a list of required options and their respective types. This information is used to identify missing and incompatible options in the loaded configuration. :param str verify_file: The file to load for verification data. :return: A dictionary of missing and incompatible ...
[ "Use", "a", "verification", "configuration", "which", "has", "a", "list", "of", "required", "options", "and", "their", "respective", "types", ".", "This", "information", "is", "used", "to", "identify", "missing", "and", "incompatible", "options", "in", "the", ...
train
https://github.com/zeroSteiner/smoke-zephyr/blob/a6d2498aeacc72ee52e7806f783a4d83d537ffb2/smoke_zephyr/configuration.py#L197-L216
zeroSteiner/smoke-zephyr
smoke_zephyr/configuration.py
Configuration.save
def save(self): """ Save the current configuration to disk. """ with open(self.configuration_file, 'w') as file_h: file_h.write(self._serializer('dumps', self._storage))
python
def save(self): """ Save the current configuration to disk. """ with open(self.configuration_file, 'w') as file_h: file_h.write(self._serializer('dumps', self._storage))
[ "def", "save", "(", "self", ")", ":", "with", "open", "(", "self", ".", "configuration_file", ",", "'w'", ")", "as", "file_h", ":", "file_h", ".", "write", "(", "self", ".", "_serializer", "(", "'dumps'", ",", "self", ".", "_storage", ")", ")" ]
Save the current configuration to disk.
[ "Save", "the", "current", "configuration", "to", "disk", "." ]
train
https://github.com/zeroSteiner/smoke-zephyr/blob/a6d2498aeacc72ee52e7806f783a4d83d537ffb2/smoke_zephyr/configuration.py#L218-L223
ARMmbed/autoversion
src/auto_version/auto_version_tool.py
replace_lines
def replace_lines(regexer, handler, lines): """Uses replacement handler to perform replacements on lines of text First we strip off all whitespace We run the replacement on a clean 'content' string Finally we replace the original content with the replaced version This ensures that we retain the cor...
python
def replace_lines(regexer, handler, lines): """Uses replacement handler to perform replacements on lines of text First we strip off all whitespace We run the replacement on a clean 'content' string Finally we replace the original content with the replaced version This ensures that we retain the cor...
[ "def", "replace_lines", "(", "regexer", ",", "handler", ",", "lines", ")", ":", "result", "=", "[", "]", "for", "line", "in", "lines", ":", "content", "=", "line", ".", "strip", "(", ")", "replaced", "=", "regexer", ".", "sub", "(", "handler", ",", ...
Uses replacement handler to perform replacements on lines of text First we strip off all whitespace We run the replacement on a clean 'content' string Finally we replace the original content with the replaced version This ensures that we retain the correct whitespace from the original line
[ "Uses", "replacement", "handler", "to", "perform", "replacements", "on", "lines", "of", "text" ]
train
https://github.com/ARMmbed/autoversion/blob/c5b127d2059c8219f5637fe45bf9e1be3a0af2aa/src/auto_version/auto_version_tool.py#L37-L50
ARMmbed/autoversion
src/auto_version/auto_version_tool.py
write_targets
def write_targets(targets, **params): """Writes version info into version file""" handler = ReplacementHandler(**params) for target, regexer in regexer_for_targets(targets): with open(target) as fh: lines = fh.readlines() lines = replace_lines(regexer, handler, lines) wit...
python
def write_targets(targets, **params): """Writes version info into version file""" handler = ReplacementHandler(**params) for target, regexer in regexer_for_targets(targets): with open(target) as fh: lines = fh.readlines() lines = replace_lines(regexer, handler, lines) wit...
[ "def", "write_targets", "(", "targets", ",", "*", "*", "params", ")", ":", "handler", "=", "ReplacementHandler", "(", "*", "*", "params", ")", "for", "target", ",", "regexer", "in", "regexer_for_targets", "(", "targets", ")", ":", "with", "open", "(", "t...
Writes version info into version file
[ "Writes", "version", "info", "into", "version", "file" ]
train
https://github.com/ARMmbed/autoversion/blob/c5b127d2059c8219f5637fe45bf9e1be3a0af2aa/src/auto_version/auto_version_tool.py#L53-L65
ARMmbed/autoversion
src/auto_version/auto_version_tool.py
regexer_for_targets
def regexer_for_targets(targets): """Pairs up target files with their correct regex""" for target in targets: path, file_ext = os.path.splitext(target) regexer = config.regexers[file_ext] yield target, regexer
python
def regexer_for_targets(targets): """Pairs up target files with their correct regex""" for target in targets: path, file_ext = os.path.splitext(target) regexer = config.regexers[file_ext] yield target, regexer
[ "def", "regexer_for_targets", "(", "targets", ")", ":", "for", "target", "in", "targets", ":", "path", ",", "file_ext", "=", "os", ".", "path", ".", "splitext", "(", "target", ")", "regexer", "=", "config", ".", "regexers", "[", "file_ext", "]", "yield",...
Pairs up target files with their correct regex
[ "Pairs", "up", "target", "files", "with", "their", "correct", "regex" ]
train
https://github.com/ARMmbed/autoversion/blob/c5b127d2059c8219f5637fe45bf9e1be3a0af2aa/src/auto_version/auto_version_tool.py#L68-L73
ARMmbed/autoversion
src/auto_version/auto_version_tool.py
extract_keypairs
def extract_keypairs(lines, regexer): """Given some lines of text, extract key-value pairs from them""" updates = {} for line in lines: # for consistency we must match the replacer and strip whitespace / newlines match = regexer.match(line.strip()) if not match: continue ...
python
def extract_keypairs(lines, regexer): """Given some lines of text, extract key-value pairs from them""" updates = {} for line in lines: # for consistency we must match the replacer and strip whitespace / newlines match = regexer.match(line.strip()) if not match: continue ...
[ "def", "extract_keypairs", "(", "lines", ",", "regexer", ")", ":", "updates", "=", "{", "}", "for", "line", "in", "lines", ":", "# for consistency we must match the replacer and strip whitespace / newlines", "match", "=", "regexer", ".", "match", "(", "line", ".", ...
Given some lines of text, extract key-value pairs from them
[ "Given", "some", "lines", "of", "text", "extract", "key", "-", "value", "pairs", "from", "them" ]
train
https://github.com/ARMmbed/autoversion/blob/c5b127d2059c8219f5637fe45bf9e1be3a0af2aa/src/auto_version/auto_version_tool.py#L76-L86
ARMmbed/autoversion
src/auto_version/auto_version_tool.py
read_targets
def read_targets(targets): """Reads generic key-value pairs from input files""" results = {} for target, regexer in regexer_for_targets(targets): with open(target) as fh: results.update(extract_keypairs(fh.readlines(), regexer)) return results
python
def read_targets(targets): """Reads generic key-value pairs from input files""" results = {} for target, regexer in regexer_for_targets(targets): with open(target) as fh: results.update(extract_keypairs(fh.readlines(), regexer)) return results
[ "def", "read_targets", "(", "targets", ")", ":", "results", "=", "{", "}", "for", "target", ",", "regexer", "in", "regexer_for_targets", "(", "targets", ")", ":", "with", "open", "(", "target", ")", "as", "fh", ":", "results", ".", "update", "(", "extr...
Reads generic key-value pairs from input files
[ "Reads", "generic", "key", "-", "value", "pairs", "from", "input", "files" ]
train
https://github.com/ARMmbed/autoversion/blob/c5b127d2059c8219f5637fe45bf9e1be3a0af2aa/src/auto_version/auto_version_tool.py#L89-L95
ARMmbed/autoversion
src/auto_version/auto_version_tool.py
detect_file_triggers
def detect_file_triggers(trigger_patterns): """The existence of files matching configured globs will trigger a version bump""" triggers = set() for trigger, pattern in trigger_patterns.items(): matches = glob.glob(pattern) if matches: _LOG.debug("trigger: %s bump from %r\n\t%s", ...
python
def detect_file_triggers(trigger_patterns): """The existence of files matching configured globs will trigger a version bump""" triggers = set() for trigger, pattern in trigger_patterns.items(): matches = glob.glob(pattern) if matches: _LOG.debug("trigger: %s bump from %r\n\t%s", ...
[ "def", "detect_file_triggers", "(", "trigger_patterns", ")", ":", "triggers", "=", "set", "(", ")", "for", "trigger", ",", "pattern", "in", "trigger_patterns", ".", "items", "(", ")", ":", "matches", "=", "glob", ".", "glob", "(", "pattern", ")", "if", "...
The existence of files matching configured globs will trigger a version bump
[ "The", "existence", "of", "files", "matching", "configured", "globs", "will", "trigger", "a", "version", "bump" ]
train
https://github.com/ARMmbed/autoversion/blob/c5b127d2059c8219f5637fe45bf9e1be3a0af2aa/src/auto_version/auto_version_tool.py#L98-L108
ARMmbed/autoversion
src/auto_version/auto_version_tool.py
get_all_triggers
def get_all_triggers(bump, file_triggers): """Aggregated set of significant figures to bump""" triggers = set() if file_triggers: triggers = triggers.union(detect_file_triggers(config.trigger_patterns)) if bump: _LOG.debug("trigger: %s bump requested", bump) triggers.add(bump) ...
python
def get_all_triggers(bump, file_triggers): """Aggregated set of significant figures to bump""" triggers = set() if file_triggers: triggers = triggers.union(detect_file_triggers(config.trigger_patterns)) if bump: _LOG.debug("trigger: %s bump requested", bump) triggers.add(bump) ...
[ "def", "get_all_triggers", "(", "bump", ",", "file_triggers", ")", ":", "triggers", "=", "set", "(", ")", "if", "file_triggers", ":", "triggers", "=", "triggers", ".", "union", "(", "detect_file_triggers", "(", "config", ".", "trigger_patterns", ")", ")", "i...
Aggregated set of significant figures to bump
[ "Aggregated", "set", "of", "significant", "figures", "to", "bump" ]
train
https://github.com/ARMmbed/autoversion/blob/c5b127d2059c8219f5637fe45bf9e1be3a0af2aa/src/auto_version/auto_version_tool.py#L111-L119
ARMmbed/autoversion
src/auto_version/auto_version_tool.py
get_lock_behaviour
def get_lock_behaviour(triggers, all_data, lock): """Binary state lock protects from version increments if set""" updates = {} lock_key = config._forward_aliases.get(Constants.VERSION_LOCK_FIELD) # if we are explicitly setting or locking the version, then set the lock field True anyway if lock: ...
python
def get_lock_behaviour(triggers, all_data, lock): """Binary state lock protects from version increments if set""" updates = {} lock_key = config._forward_aliases.get(Constants.VERSION_LOCK_FIELD) # if we are explicitly setting or locking the version, then set the lock field True anyway if lock: ...
[ "def", "get_lock_behaviour", "(", "triggers", ",", "all_data", ",", "lock", ")", ":", "updates", "=", "{", "}", "lock_key", "=", "config", ".", "_forward_aliases", ".", "get", "(", "Constants", ".", "VERSION_LOCK_FIELD", ")", "# if we are explicitly setting or loc...
Binary state lock protects from version increments if set
[ "Binary", "state", "lock", "protects", "from", "version", "increments", "if", "set" ]
train
https://github.com/ARMmbed/autoversion/blob/c5b127d2059c8219f5637fe45bf9e1be3a0af2aa/src/auto_version/auto_version_tool.py#L122-L136
ARMmbed/autoversion
src/auto_version/auto_version_tool.py
get_final_version_string
def get_final_version_string(release_mode, semver, commit_count=0): """Generates update dictionary entries for the version string""" version_string = ".".join(semver) maybe_dev_version_string = version_string updates = {} if release_mode: # in production, we have something like `1.2.3`, as w...
python
def get_final_version_string(release_mode, semver, commit_count=0): """Generates update dictionary entries for the version string""" version_string = ".".join(semver) maybe_dev_version_string = version_string updates = {} if release_mode: # in production, we have something like `1.2.3`, as w...
[ "def", "get_final_version_string", "(", "release_mode", ",", "semver", ",", "commit_count", "=", "0", ")", ":", "version_string", "=", "\".\"", ".", "join", "(", "semver", ")", "maybe_dev_version_string", "=", "version_string", "updates", "=", "{", "}", "if", ...
Generates update dictionary entries for the version string
[ "Generates", "update", "dictionary", "entries", "for", "the", "version", "string" ]
train
https://github.com/ARMmbed/autoversion/blob/c5b127d2059c8219f5637fe45bf9e1be3a0af2aa/src/auto_version/auto_version_tool.py#L139-L156
ARMmbed/autoversion
src/auto_version/auto_version_tool.py
get_dvcs_info
def get_dvcs_info(): """Gets current repository info from git""" cmd = "git rev-list --count HEAD" commit_count = str( int(subprocess.check_output(shlex.split(cmd)).decode("utf8").strip()) ) cmd = "git rev-parse HEAD" commit = str(subprocess.check_output(shlex.split(cmd)).decode("utf8")....
python
def get_dvcs_info(): """Gets current repository info from git""" cmd = "git rev-list --count HEAD" commit_count = str( int(subprocess.check_output(shlex.split(cmd)).decode("utf8").strip()) ) cmd = "git rev-parse HEAD" commit = str(subprocess.check_output(shlex.split(cmd)).decode("utf8")....
[ "def", "get_dvcs_info", "(", ")", ":", "cmd", "=", "\"git rev-list --count HEAD\"", "commit_count", "=", "str", "(", "int", "(", "subprocess", ".", "check_output", "(", "shlex", ".", "split", "(", "cmd", ")", ")", ".", "decode", "(", "\"utf8\"", ")", ".", ...
Gets current repository info from git
[ "Gets", "current", "repository", "info", "from", "git" ]
train
https://github.com/ARMmbed/autoversion/blob/c5b127d2059c8219f5637fe45bf9e1be3a0af2aa/src/auto_version/auto_version_tool.py#L159-L167
ARMmbed/autoversion
src/auto_version/auto_version_tool.py
main
def main( set_to=None, set_patch_count=None, release=None, bump=None, lock=None, file_triggers=None, config_path=None, **extra_updates ): """Main workflow. Load config from cli and file Detect "bump triggers" - things that cause a version increment Find the current versi...
python
def main( set_to=None, set_patch_count=None, release=None, bump=None, lock=None, file_triggers=None, config_path=None, **extra_updates ): """Main workflow. Load config from cli and file Detect "bump triggers" - things that cause a version increment Find the current versi...
[ "def", "main", "(", "set_to", "=", "None", ",", "set_patch_count", "=", "None", ",", "release", "=", "None", ",", "bump", "=", "None", ",", "lock", "=", "None", ",", "file_triggers", "=", "None", ",", "config_path", "=", "None", ",", "*", "*", "extra...
Main workflow. Load config from cli and file Detect "bump triggers" - things that cause a version increment Find the current version Create a new version Write out new version and any other requested variables :param set_to: explicitly set semver to this version string :param set_patch_cou...
[ "Main", "workflow", "." ]
train
https://github.com/ARMmbed/autoversion/blob/c5b127d2059c8219f5637fe45bf9e1be3a0af2aa/src/auto_version/auto_version_tool.py#L170-L266
ARMmbed/autoversion
src/auto_version/auto_version_tool.py
main_from_cli
def main_from_cli(): """Main workflow. Load config from cli and file Detect "bump triggers" - things that cause a version increment Find the current version Create a new version Write out new version and any other requested variables """ args, others = get_cli() if args.version: ...
python
def main_from_cli(): """Main workflow. Load config from cli and file Detect "bump triggers" - things that cause a version increment Find the current version Create a new version Write out new version and any other requested variables """ args, others = get_cli() if args.version: ...
[ "def", "main_from_cli", "(", ")", ":", "args", ",", "others", "=", "get_cli", "(", ")", "if", "args", ".", "version", ":", "print", "(", "__version__", ")", "exit", "(", "0", ")", "log_level", "=", "logging", ".", "WARNING", "-", "10", "*", "args", ...
Main workflow. Load config from cli and file Detect "bump triggers" - things that cause a version increment Find the current version Create a new version Write out new version and any other requested variables
[ "Main", "workflow", "." ]
train
https://github.com/ARMmbed/autoversion/blob/c5b127d2059c8219f5637fe45bf9e1be3a0af2aa/src/auto_version/auto_version_tool.py#L284-L320
Clinical-Genomics/trailblazer
trailblazer/cli/core.py
log_cmd
def log_cmd(context, sampleinfo, sacct, quiet, config): """Log an analysis. CONFIG: MIP config file for an analysis """ log_analysis = LogAnalysis(context.obj['store']) try: new_run = log_analysis(config, sampleinfo=sampleinfo, sacct=sacct) except MissingFileError as error: clic...
python
def log_cmd(context, sampleinfo, sacct, quiet, config): """Log an analysis. CONFIG: MIP config file for an analysis """ log_analysis = LogAnalysis(context.obj['store']) try: new_run = log_analysis(config, sampleinfo=sampleinfo, sacct=sacct) except MissingFileError as error: clic...
[ "def", "log_cmd", "(", "context", ",", "sampleinfo", ",", "sacct", ",", "quiet", ",", "config", ")", ":", "log_analysis", "=", "LogAnalysis", "(", "context", ".", "obj", "[", "'store'", "]", ")", "try", ":", "new_run", "=", "log_analysis", "(", "config",...
Log an analysis. CONFIG: MIP config file for an analysis
[ "Log", "an", "analysis", "." ]
train
https://github.com/Clinical-Genomics/trailblazer/blob/27f3cd21043a1077bd7029e85783459a50a7b798/trailblazer/cli/core.py#L49-L68
Clinical-Genomics/trailblazer
trailblazer/cli/core.py
start
def start(context, mip_config, email, priority, dryrun, command, start_with, family): """Start a new analysis.""" mip_cli = MipCli(context.obj['script']) mip_config = mip_config or context.obj['mip_config'] email = email or environ_email() kwargs = dict(config=mip_config, family=family, priority=pri...
python
def start(context, mip_config, email, priority, dryrun, command, start_with, family): """Start a new analysis.""" mip_cli = MipCli(context.obj['script']) mip_config = mip_config or context.obj['mip_config'] email = email or environ_email() kwargs = dict(config=mip_config, family=family, priority=pri...
[ "def", "start", "(", "context", ",", "mip_config", ",", "email", ",", "priority", ",", "dryrun", ",", "command", ",", "start_with", ",", "family", ")", ":", "mip_cli", "=", "MipCli", "(", "context", ".", "obj", "[", "'script'", "]", ")", "mip_config", ...
Start a new analysis.
[ "Start", "a", "new", "analysis", "." ]
train
https://github.com/Clinical-Genomics/trailblazer/blob/27f3cd21043a1077bd7029e85783459a50a7b798/trailblazer/cli/core.py#L80-L95
Clinical-Genomics/trailblazer
trailblazer/cli/core.py
init
def init(context, reset, force): """Setup the database.""" existing_tables = context.obj['store'].engine.table_names() if force or reset: if existing_tables and not force: message = f"Delete existing tables? [{', '.join(existing_tables)}]" click.confirm(click.style(message, f...
python
def init(context, reset, force): """Setup the database.""" existing_tables = context.obj['store'].engine.table_names() if force or reset: if existing_tables and not force: message = f"Delete existing tables? [{', '.join(existing_tables)}]" click.confirm(click.style(message, f...
[ "def", "init", "(", "context", ",", "reset", ",", "force", ")", ":", "existing_tables", "=", "context", ".", "obj", "[", "'store'", "]", ".", "engine", ".", "table_names", "(", ")", "if", "force", "or", "reset", ":", "if", "existing_tables", "and", "no...
Setup the database.
[ "Setup", "the", "database", "." ]
train
https://github.com/Clinical-Genomics/trailblazer/blob/27f3cd21043a1077bd7029e85783459a50a7b798/trailblazer/cli/core.py#L102-L116
Clinical-Genomics/trailblazer
trailblazer/cli/core.py
scan
def scan(context, root_dir): """Scan a directory for analyses.""" root_dir = root_dir or context.obj['root'] config_files = Path(root_dir).glob('*/analysis/*_config.yaml') for config_file in config_files: LOG.debug("found analysis config: %s", config_file) with config_file.open() as stre...
python
def scan(context, root_dir): """Scan a directory for analyses.""" root_dir = root_dir or context.obj['root'] config_files = Path(root_dir).glob('*/analysis/*_config.yaml') for config_file in config_files: LOG.debug("found analysis config: %s", config_file) with config_file.open() as stre...
[ "def", "scan", "(", "context", ",", "root_dir", ")", ":", "root_dir", "=", "root_dir", "or", "context", ".", "obj", "[", "'root'", "]", "config_files", "=", "Path", "(", "root_dir", ")", ".", "glob", "(", "'*/analysis/*_config.yaml'", ")", "for", "config_f...
Scan a directory for analyses.
[ "Scan", "a", "directory", "for", "analyses", "." ]
train
https://github.com/Clinical-Genomics/trailblazer/blob/27f3cd21043a1077bd7029e85783459a50a7b798/trailblazer/cli/core.py#L122-L131
Clinical-Genomics/trailblazer
trailblazer/cli/core.py
user
def user(context, name, email): """Add a new or display information about an existing user.""" existing_user = context.obj['store'].user(email) if existing_user: click.echo(existing_user.to_dict()) elif name: new_user = context.obj['store'].add_user(name, email) click.echo(click....
python
def user(context, name, email): """Add a new or display information about an existing user.""" existing_user = context.obj['store'].user(email) if existing_user: click.echo(existing_user.to_dict()) elif name: new_user = context.obj['store'].add_user(name, email) click.echo(click....
[ "def", "user", "(", "context", ",", "name", ",", "email", ")", ":", "existing_user", "=", "context", ".", "obj", "[", "'store'", "]", ".", "user", "(", "email", ")", "if", "existing_user", ":", "click", ".", "echo", "(", "existing_user", ".", "to_dict"...
Add a new or display information about an existing user.
[ "Add", "a", "new", "or", "display", "information", "about", "an", "existing", "user", "." ]
train
https://github.com/Clinical-Genomics/trailblazer/blob/27f3cd21043a1077bd7029e85783459a50a7b798/trailblazer/cli/core.py#L138-L147
Clinical-Genomics/trailblazer
trailblazer/cli/core.py
cancel
def cancel(context, jobs, analysis_id): """Cancel all jobs in a run.""" analysis_obj = context.obj['store'].analysis(analysis_id) if analysis_obj is None: click.echo('analysis not found') context.abort() elif analysis_obj.status != 'running': click.echo(f"analysis not running: {a...
python
def cancel(context, jobs, analysis_id): """Cancel all jobs in a run.""" analysis_obj = context.obj['store'].analysis(analysis_id) if analysis_obj is None: click.echo('analysis not found') context.abort() elif analysis_obj.status != 'running': click.echo(f"analysis not running: {a...
[ "def", "cancel", "(", "context", ",", "jobs", ",", "analysis_id", ")", ":", "analysis_obj", "=", "context", ".", "obj", "[", "'store'", "]", ".", "analysis", "(", "analysis_id", ")", "if", "analysis_obj", "is", "None", ":", "click", ".", "echo", "(", "...
Cancel all jobs in a run.
[ "Cancel", "all", "jobs", "in", "a", "run", "." ]
train
https://github.com/Clinical-Genomics/trailblazer/blob/27f3cd21043a1077bd7029e85783459a50a7b798/trailblazer/cli/core.py#L154-L188
pytroll/posttroll
posttroll/ns.py
get_pub_addresses
def get_pub_addresses(names=None, timeout=10, nameserver="localhost"): """Get the address of the publisher for a given list of publisher *names* from the nameserver on *nameserver* (localhost by default). """ addrs = [] if names is None: names = ["", ] for name in names: then = d...
python
def get_pub_addresses(names=None, timeout=10, nameserver="localhost"): """Get the address of the publisher for a given list of publisher *names* from the nameserver on *nameserver* (localhost by default). """ addrs = [] if names is None: names = ["", ] for name in names: then = d...
[ "def", "get_pub_addresses", "(", "names", "=", "None", ",", "timeout", "=", "10", ",", "nameserver", "=", "\"localhost\"", ")", ":", "addrs", "=", "[", "]", "if", "names", "is", "None", ":", "names", "=", "[", "\"\"", ",", "]", "for", "name", "in", ...
Get the address of the publisher for a given list of publisher *names* from the nameserver on *nameserver* (localhost by default).
[ "Get", "the", "address", "of", "the", "publisher", "for", "a", "given", "list", "of", "publisher", "*", "names", "*", "from", "the", "nameserver", "on", "*", "nameserver", "*", "(", "localhost", "by", "default", ")", "." ]
train
https://github.com/pytroll/posttroll/blob/8e811a0544b5182c4a72aed074b2ff8c4324e94d/posttroll/ns.py#L59-L73
pytroll/posttroll
posttroll/ns.py
get_pub_address
def get_pub_address(name, timeout=10, nameserver="localhost"): """Get the address of the publisher for a given publisher *name* from the nameserver on *nameserver* (localhost by default). """ # Socket to talk to server socket = get_context().socket(REQ) try: socket.setsockopt(LINGER, ti...
python
def get_pub_address(name, timeout=10, nameserver="localhost"): """Get the address of the publisher for a given publisher *name* from the nameserver on *nameserver* (localhost by default). """ # Socket to talk to server socket = get_context().socket(REQ) try: socket.setsockopt(LINGER, ti...
[ "def", "get_pub_address", "(", "name", ",", "timeout", "=", "10", ",", "nameserver", "=", "\"localhost\"", ")", ":", "# Socket to talk to server", "socket", "=", "get_context", "(", ")", ".", "socket", "(", "REQ", ")", "try", ":", "socket", ".", "setsockopt"...
Get the address of the publisher for a given publisher *name* from the nameserver on *nameserver* (localhost by default).
[ "Get", "the", "address", "of", "the", "publisher", "for", "a", "given", "publisher", "*", "name", "*", "from", "the", "nameserver", "on", "*", "nameserver", "*", "(", "localhost", "by", "default", ")", "." ]
train
https://github.com/pytroll/posttroll/blob/8e811a0544b5182c4a72aed074b2ff8c4324e94d/posttroll/ns.py#L76-L104
pytroll/posttroll
posttroll/ns.py
get_active_address
def get_active_address(name, arec): """Get the addresses of the active modules for a given publisher *name*. """ addrs = arec.get(name) if addrs: return Message("/oper/ns", "info", addrs) else: return Message("/oper/ns", "info", "")
python
def get_active_address(name, arec): """Get the addresses of the active modules for a given publisher *name*. """ addrs = arec.get(name) if addrs: return Message("/oper/ns", "info", addrs) else: return Message("/oper/ns", "info", "")
[ "def", "get_active_address", "(", "name", ",", "arec", ")", ":", "addrs", "=", "arec", ".", "get", "(", "name", ")", "if", "addrs", ":", "return", "Message", "(", "\"/oper/ns\"", ",", "\"info\"", ",", "addrs", ")", "else", ":", "return", "Message", "("...
Get the addresses of the active modules for a given publisher *name*.
[ "Get", "the", "addresses", "of", "the", "active", "modules", "for", "a", "given", "publisher", "*", "name", "*", "." ]
train
https://github.com/pytroll/posttroll/blob/8e811a0544b5182c4a72aed074b2ff8c4324e94d/posttroll/ns.py#L109-L116
pytroll/posttroll
posttroll/ns.py
NameServer.run
def run(self, *args): """Run the listener and answer to requests. """ del args arec = AddressReceiver(max_age=self._max_age, multicast_enabled=self._multicast_enabled) arec.start() port = PORT try: with nslock: ...
python
def run(self, *args): """Run the listener and answer to requests. """ del args arec = AddressReceiver(max_age=self._max_age, multicast_enabled=self._multicast_enabled) arec.start() port = PORT try: with nslock: ...
[ "def", "run", "(", "self", ",", "*", "args", ")", ":", "del", "args", "arec", "=", "AddressReceiver", "(", "max_age", "=", "self", ".", "_max_age", ",", "multicast_enabled", "=", "self", ".", "_multicast_enabled", ")", "arec", ".", "start", "(", ")", "...
Run the listener and answer to requests.
[ "Run", "the", "listener", "and", "answer", "to", "requests", "." ]
train
https://github.com/pytroll/posttroll/blob/8e811a0544b5182c4a72aed074b2ff8c4324e94d/posttroll/ns.py#L130-L164
pytroll/posttroll
posttroll/ns.py
NameServer.stop
def stop(self): """Stop the name server. """ self.listener.setsockopt(LINGER, 1) self.loop = False with nslock: self.listener.close()
python
def stop(self): """Stop the name server. """ self.listener.setsockopt(LINGER, 1) self.loop = False with nslock: self.listener.close()
[ "def", "stop", "(", "self", ")", ":", "self", ".", "listener", ".", "setsockopt", "(", "LINGER", ",", "1", ")", "self", ".", "loop", "=", "False", "with", "nslock", ":", "self", ".", "listener", ".", "close", "(", ")" ]
Stop the name server.
[ "Stop", "the", "name", "server", "." ]
train
https://github.com/pytroll/posttroll/blob/8e811a0544b5182c4a72aed074b2ff8c4324e94d/posttroll/ns.py#L166-L172
zeroSteiner/smoke-zephyr
smoke_zephyr/requirements.py
check_requirements
def check_requirements(requirements, ignore=None): """ Parse requirements for package information to determine if all requirements are met. The *requirements* argument can be a string to a requirements file, a file like object to be read, or a list of strings representing the package requirements. :param require...
python
def check_requirements(requirements, ignore=None): """ Parse requirements for package information to determine if all requirements are met. The *requirements* argument can be a string to a requirements file, a file like object to be read, or a list of strings representing the package requirements. :param require...
[ "def", "check_requirements", "(", "requirements", ",", "ignore", "=", "None", ")", ":", "ignore", "=", "(", "ignore", "or", "[", "]", ")", "not_satisfied", "=", "[", "]", "working_set", "=", "pkg_resources", ".", "working_set", "installed_packages", "=", "di...
Parse requirements for package information to determine if all requirements are met. The *requirements* argument can be a string to a requirements file, a file like object to be read, or a list of strings representing the package requirements. :param requirements: The file to parse. :type requirements: file obj, ...
[ "Parse", "requirements", "for", "package", "information", "to", "determine", "if", "all", "requirements", "are", "met", ".", "The", "*", "requirements", "*", "argument", "can", "be", "a", "string", "to", "a", "requirements", "file", "a", "file", "like", "obj...
train
https://github.com/zeroSteiner/smoke-zephyr/blob/a6d2498aeacc72ee52e7806f783a4d83d537ffb2/smoke_zephyr/requirements.py#L38-L96
andrewda/frc-livescore
livescore/simpleocr_utils/segmentation.py
segments_from_numpy
def segments_from_numpy(segments): """reverses segments_to_numpy""" segments = segments if SEGMENTS_DIRECTION == 0 else segments.tranpose() segments = [map(int, s) for s in segments] return segments
python
def segments_from_numpy(segments): """reverses segments_to_numpy""" segments = segments if SEGMENTS_DIRECTION == 0 else segments.tranpose() segments = [map(int, s) for s in segments] return segments
[ "def", "segments_from_numpy", "(", "segments", ")", ":", "segments", "=", "segments", "if", "SEGMENTS_DIRECTION", "==", "0", "else", "segments", ".", "tranpose", "(", ")", "segments", "=", "[", "map", "(", "int", ",", "s", ")", "for", "s", "in", "segment...
reverses segments_to_numpy
[ "reverses", "segments_to_numpy" ]
train
https://github.com/andrewda/frc-livescore/blob/71594cd6d2c8b6c5feb3889bb05552d09b8128b1/livescore/simpleocr_utils/segmentation.py#L13-L17
andrewda/frc-livescore
livescore/simpleocr_utils/segmentation.py
segments_to_numpy
def segments_to_numpy(segments): """given a list of 4-element tuples, transforms it into a numpy array""" segments = numpy.array(segments, dtype=SEGMENT_DATATYPE, ndmin=2) # each segment in a row segments = segments if SEGMENTS_DIRECTION == 0 else numpy.transpose(segments) return segments
python
def segments_to_numpy(segments): """given a list of 4-element tuples, transforms it into a numpy array""" segments = numpy.array(segments, dtype=SEGMENT_DATATYPE, ndmin=2) # each segment in a row segments = segments if SEGMENTS_DIRECTION == 0 else numpy.transpose(segments) return segments
[ "def", "segments_to_numpy", "(", "segments", ")", ":", "segments", "=", "numpy", ".", "array", "(", "segments", ",", "dtype", "=", "SEGMENT_DATATYPE", ",", "ndmin", "=", "2", ")", "# each segment in a row", "segments", "=", "segments", "if", "SEGMENTS_DIRECTION"...
given a list of 4-element tuples, transforms it into a numpy array
[ "given", "a", "list", "of", "4", "-", "element", "tuples", "transforms", "it", "into", "a", "numpy", "array" ]
train
https://github.com/andrewda/frc-livescore/blob/71594cd6d2c8b6c5feb3889bb05552d09b8128b1/livescore/simpleocr_utils/segmentation.py#L20-L24
andrewda/frc-livescore
livescore/simpleocr_utils/segmentation.py
region_from_segment
def region_from_segment(image, segment): """given a segment (rectangle) and an image, returns it's corresponding subimage""" x, y, w, h = segment return image[y:y + h, x:x + w]
python
def region_from_segment(image, segment): """given a segment (rectangle) and an image, returns it's corresponding subimage""" x, y, w, h = segment return image[y:y + h, x:x + w]
[ "def", "region_from_segment", "(", "image", ",", "segment", ")", ":", "x", ",", "y", ",", "w", ",", "h", "=", "segment", "return", "image", "[", "y", ":", "y", "+", "h", ",", "x", ":", "x", "+", "w", "]" ]
given a segment (rectangle) and an image, returns it's corresponding subimage
[ "given", "a", "segment", "(", "rectangle", ")", "and", "an", "image", "returns", "it", "s", "corresponding", "subimage" ]
train
https://github.com/andrewda/frc-livescore/blob/71594cd6d2c8b6c5feb3889bb05552d09b8128b1/livescore/simpleocr_utils/segmentation.py#L27-L30
thespacedoctor/sherlock
sherlock/imports/marshall.py
marshall.ingest
def ingest(self): """*Ingest the ePESSTO Marshall transient stream into the catalogues database* The method first creates the tables for the various marshall feeder surveys in the sherlock-catalogues database (if they do not yet exist). Then the marshall database is queried for each transient survey an...
python
def ingest(self): """*Ingest the ePESSTO Marshall transient stream into the catalogues database* The method first creates the tables for the various marshall feeder surveys in the sherlock-catalogues database (if they do not yet exist). Then the marshall database is queried for each transient survey an...
[ "def", "ingest", "(", "self", ")", ":", "self", ".", "log", ".", "debug", "(", "'starting the ``get`` method'", ")", "# A YAML DICTIONARY OF sherlock-catalogues TABLE NAME AND THE SELECT", "# QUERY TO LIFT THE DATA FROM THE MARSHALL", "yamlFilePath", "=", "'/'", ".", "join", ...
*Ingest the ePESSTO Marshall transient stream into the catalogues database* The method first creates the tables for the various marshall feeder surveys in the sherlock-catalogues database (if they do not yet exist). Then the marshall database is queried for each transient survey and the results imported into t...
[ "*", "Ingest", "the", "ePESSTO", "Marshall", "transient", "stream", "into", "the", "catalogues", "database", "*" ]
train
https://github.com/thespacedoctor/sherlock/blob/2c80fb6fa31b04e7820e6928e3d437a21e692dd3/sherlock/imports/marshall.py#L57-L108
thespacedoctor/sherlock
sherlock/imports/marshall.py
marshall._create_dictionary_of_marshall
def _create_dictionary_of_marshall( self, marshallQuery, marshallTable): """create a list of dictionaries containing all the rows in the marshall stream **Key Arguments:** - ``marshallQuery`` -- the query used to lift the required data from the marshall d...
python
def _create_dictionary_of_marshall( self, marshallQuery, marshallTable): """create a list of dictionaries containing all the rows in the marshall stream **Key Arguments:** - ``marshallQuery`` -- the query used to lift the required data from the marshall d...
[ "def", "_create_dictionary_of_marshall", "(", "self", ",", "marshallQuery", ",", "marshallTable", ")", ":", "self", ".", "log", ".", "debug", "(", "'starting the ``_create_dictionary_of_marshall`` method'", ")", "dictList", "=", "[", "]", "tableName", "=", "self", "...
create a list of dictionaries containing all the rows in the marshall stream **Key Arguments:** - ``marshallQuery`` -- the query used to lift the required data from the marshall database. - ``marshallTable`` -- the name of the marshall table we are lifting the data from. **Retu...
[ "create", "a", "list", "of", "dictionaries", "containing", "all", "the", "rows", "in", "the", "marshall", "stream" ]
train
https://github.com/thespacedoctor/sherlock/blob/2c80fb6fa31b04e7820e6928e3d437a21e692dd3/sherlock/imports/marshall.py#L110-L151
thespacedoctor/sherlock
sherlock/imports/ned_d.py
ned_d.ingest
def ingest(self): """Import the ned_d catalogue into the catalogues database The method first generates a list of python dictionaries from the ned_d datafile, imports this list of dictionaries into a database table and then generates the HTMIDs for that table. **Usage:** See clas...
python
def ingest(self): """Import the ned_d catalogue into the catalogues database The method first generates a list of python dictionaries from the ned_d datafile, imports this list of dictionaries into a database table and then generates the HTMIDs for that table. **Usage:** See clas...
[ "def", "ingest", "(", "self", ")", ":", "self", ".", "log", ".", "debug", "(", "'starting the ``get`` method'", ")", "dictList", "=", "self", ".", "_create_dictionary_of_ned_d", "(", ")", "self", ".", "primaryIdColumnName", "=", "\"primaryId\"", "self", ".", "...
Import the ned_d catalogue into the catalogues database The method first generates a list of python dictionaries from the ned_d datafile, imports this list of dictionaries into a database table and then generates the HTMIDs for that table. **Usage:** See class docstring for usage ...
[ "Import", "the", "ned_d", "catalogue", "into", "the", "catalogues", "database" ]
train
https://github.com/thespacedoctor/sherlock/blob/2c80fb6fa31b04e7820e6928e3d437a21e692dd3/sherlock/imports/ned_d.py#L66-L175
thespacedoctor/sherlock
sherlock/imports/ned_d.py
ned_d._create_dictionary_of_ned_d
def _create_dictionary_of_ned_d( self): """create a list of dictionaries containing all the rows in the ned_d catalogue **Return:** - ``dictList`` - a list of dictionaries containing all the rows in the ned_d catalogue .. todo :: - update key arguments valu...
python
def _create_dictionary_of_ned_d( self): """create a list of dictionaries containing all the rows in the ned_d catalogue **Return:** - ``dictList`` - a list of dictionaries containing all the rows in the ned_d catalogue .. todo :: - update key arguments valu...
[ "def", "_create_dictionary_of_ned_d", "(", "self", ")", ":", "self", ".", "log", ".", "debug", "(", "'starting the ``_create_dictionary_of_ned_d`` method'", ")", "count", "=", "0", "with", "open", "(", "self", ".", "pathToDataFile", ",", "'rb'", ")", "as", "csvF...
create a list of dictionaries containing all the rows in the ned_d catalogue **Return:** - ``dictList`` - a list of dictionaries containing all the rows in the ned_d catalogue .. todo :: - update key arguments values and definitions with defaults - update return va...
[ "create", "a", "list", "of", "dictionaries", "containing", "all", "the", "rows", "in", "the", "ned_d", "catalogue" ]
train
https://github.com/thespacedoctor/sherlock/blob/2c80fb6fa31b04e7820e6928e3d437a21e692dd3/sherlock/imports/ned_d.py#L177-L274
thespacedoctor/sherlock
sherlock/imports/ned_d.py
ned_d._clean_up_columns
def _clean_up_columns( self): """clean up columns of the NED table .. todo :: - update key arguments values and definitions with defaults - update return values and definitions - update usage examples and text - update docstring text ...
python
def _clean_up_columns( self): """clean up columns of the NED table .. todo :: - update key arguments values and definitions with defaults - update return values and definitions - update usage examples and text - update docstring text ...
[ "def", "_clean_up_columns", "(", "self", ")", ":", "self", ".", "log", ".", "debug", "(", "'starting the ``_clean_up_columns`` method'", ")", "tableName", "=", "self", ".", "dbTableName", "print", "\"cleaning up %(tableName)s columns\"", "%", "locals", "(", ")", "sq...
clean up columns of the NED table .. todo :: - update key arguments values and definitions with defaults - update return values and definitions - update usage examples and text - update docstring text - check sublime snippet exists - clip...
[ "clean", "up", "columns", "of", "the", "NED", "table" ]
train
https://github.com/thespacedoctor/sherlock/blob/2c80fb6fa31b04e7820e6928e3d437a21e692dd3/sherlock/imports/ned_d.py#L276-L323
thespacedoctor/sherlock
sherlock/imports/ned_d.py
ned_d._get_metadata_for_galaxies
def _get_metadata_for_galaxies( self): """get metadata for galaxies .. todo :: - update key arguments values and definitions with defaults - update return values and definitions - update usage examples and text - update docstring text ...
python
def _get_metadata_for_galaxies( self): """get metadata for galaxies .. todo :: - update key arguments values and definitions with defaults - update return values and definitions - update usage examples and text - update docstring text ...
[ "def", "_get_metadata_for_galaxies", "(", "self", ")", ":", "self", ".", "log", ".", "debug", "(", "'starting the ``_get_metadata_for_galaxies`` method'", ")", "total", ",", "batches", "=", "self", ".", "_count_galaxies_requiring_metadata", "(", ")", "print", "\"%(tot...
get metadata for galaxies .. todo :: - update key arguments values and definitions with defaults - update return values and definitions - update usage examples and text - update docstring text - check sublime snippet exists - clip any use...
[ "get", "metadata", "for", "galaxies" ]
train
https://github.com/thespacedoctor/sherlock/blob/2c80fb6fa31b04e7820e6928e3d437a21e692dd3/sherlock/imports/ned_d.py#L325-L361
thespacedoctor/sherlock
sherlock/imports/ned_d.py
ned_d._get_3000_galaxies_needing_metadata
def _get_3000_galaxies_needing_metadata( self): """ get 3000 galaxies needing metadata **Return:** - ``len(self.theseIds)`` -- the number of NED IDs returned .. todo :: - update key arguments values and definitions with defaults - update return ...
python
def _get_3000_galaxies_needing_metadata( self): """ get 3000 galaxies needing metadata **Return:** - ``len(self.theseIds)`` -- the number of NED IDs returned .. todo :: - update key arguments values and definitions with defaults - update return ...
[ "def", "_get_3000_galaxies_needing_metadata", "(", "self", ")", ":", "self", ".", "log", ".", "debug", "(", "'starting the ``_get_3000_galaxies_needing_metadata`` method'", ")", "tableName", "=", "self", ".", "dbTableName", "# SELECT THE DATA FROM NED TABLE", "self", ".", ...
get 3000 galaxies needing metadata **Return:** - ``len(self.theseIds)`` -- the number of NED IDs returned .. todo :: - update key arguments values and definitions with defaults - update return values and definitions - update usage examples and text ...
[ "get", "3000", "galaxies", "needing", "metadata" ]
train
https://github.com/thespacedoctor/sherlock/blob/2c80fb6fa31b04e7820e6928e3d437a21e692dd3/sherlock/imports/ned_d.py#L404-L443
thespacedoctor/sherlock
sherlock/imports/ned_d.py
ned_d._query_ned_and_add_results_to_database
def _query_ned_and_add_results_to_database( self, batchCount): """ query ned and add results to database **Key Arguments:** - ``batchCount`` - the index number of the batch sent to NED .. todo :: - update key arguments values and definitions wit...
python
def _query_ned_and_add_results_to_database( self, batchCount): """ query ned and add results to database **Key Arguments:** - ``batchCount`` - the index number of the batch sent to NED .. todo :: - update key arguments values and definitions wit...
[ "def", "_query_ned_and_add_results_to_database", "(", "self", ",", "batchCount", ")", ":", "self", ".", "log", ".", "debug", "(", "'starting the ``_query_ned_and_add_results_to_database`` method'", ")", "tableName", "=", "self", ".", "dbTableName", "# ASTROCALC UNIT CONVERT...
query ned and add results to database **Key Arguments:** - ``batchCount`` - the index number of the batch sent to NED .. todo :: - update key arguments values and definitions with defaults - update return values and definitions - update usage examples a...
[ "query", "ned", "and", "add", "results", "to", "database" ]
train
https://github.com/thespacedoctor/sherlock/blob/2c80fb6fa31b04e7820e6928e3d437a21e692dd3/sherlock/imports/ned_d.py#L445-L553
thespacedoctor/sherlock
sherlock/imports/ned_d.py
ned_d._update_sdss_coverage
def _update_sdss_coverage( self): """ update sdss coverage .. todo :: - update key arguments values and definitions with defaults - update return values and definitions - update usage examples and text - update docstring text - ch...
python
def _update_sdss_coverage( self): """ update sdss coverage .. todo :: - update key arguments values and definitions with defaults - update return values and definitions - update usage examples and text - update docstring text - ch...
[ "def", "_update_sdss_coverage", "(", "self", ")", ":", "self", ".", "log", ".", "debug", "(", "'starting the ``_update_sdss_coverage`` method'", ")", "tableName", "=", "self", ".", "dbTableName", "# SELECT THE LOCATIONS NEEDING TO BE CHECKED", "sqlQuery", "=", "u\"\"\"\n ...
update sdss coverage .. todo :: - update key arguments values and definitions with defaults - update return values and definitions - update usage examples and text - update docstring text - check sublime snippet exists - clip any useful t...
[ "update", "sdss", "coverage" ]
train
https://github.com/thespacedoctor/sherlock/blob/2c80fb6fa31b04e7820e6928e3d437a21e692dd3/sherlock/imports/ned_d.py#L555-L636
emichael/PyREM
pyrem/host.py
RemoteHost.run
def run(self, command, **kwargs): """Run a command on the remote host. This is just a wrapper around ``RemoteTask(self.hostname, ...)`` """ return RemoteTask(self.hostname, command, identity_file=self._identity_file, **kwargs)
python
def run(self, command, **kwargs): """Run a command on the remote host. This is just a wrapper around ``RemoteTask(self.hostname, ...)`` """ return RemoteTask(self.hostname, command, identity_file=self._identity_file, **kwargs)
[ "def", "run", "(", "self", ",", "command", ",", "*", "*", "kwargs", ")", ":", "return", "RemoteTask", "(", "self", ".", "hostname", ",", "command", ",", "identity_file", "=", "self", ".", "_identity_file", ",", "*", "*", "kwargs", ")" ]
Run a command on the remote host. This is just a wrapper around ``RemoteTask(self.hostname, ...)``
[ "Run", "a", "command", "on", "the", "remote", "host", "." ]
train
https://github.com/emichael/PyREM/blob/2609249ead197cd9496d164f4998ca9985503579/pyrem/host.py#L53-L59
emichael/PyREM
pyrem/host.py
RemoteHost._rsync_cmd
def _rsync_cmd(self): """Helper method to generate base rsync command.""" cmd = ['rsync'] if self._identity_file: cmd += ['-e', 'ssh -i ' + os.path.expanduser(self._identity_file)] return cmd
python
def _rsync_cmd(self): """Helper method to generate base rsync command.""" cmd = ['rsync'] if self._identity_file: cmd += ['-e', 'ssh -i ' + os.path.expanduser(self._identity_file)] return cmd
[ "def", "_rsync_cmd", "(", "self", ")", ":", "cmd", "=", "[", "'rsync'", "]", "if", "self", ".", "_identity_file", ":", "cmd", "+=", "[", "'-e'", ",", "'ssh -i '", "+", "os", ".", "path", ".", "expanduser", "(", "self", ".", "_identity_file", ")", "]"...
Helper method to generate base rsync command.
[ "Helper", "method", "to", "generate", "base", "rsync", "command", "." ]
train
https://github.com/emichael/PyREM/blob/2609249ead197cd9496d164f4998ca9985503579/pyrem/host.py#L61-L66
emichael/PyREM
pyrem/host.py
RemoteHost.send_file
def send_file(self, file_name, remote_destination=None, **kwargs): """Send a file to a remote host with rsync. Args: file_name (str): The relative location of the file on the local host. remote_destination (str): The destination for the file on the remote ...
python
def send_file(self, file_name, remote_destination=None, **kwargs): """Send a file to a remote host with rsync. Args: file_name (str): The relative location of the file on the local host. remote_destination (str): The destination for the file on the remote ...
[ "def", "send_file", "(", "self", ",", "file_name", ",", "remote_destination", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "not", "remote_destination", ":", "remote_destination", "=", "file_name", "return", "SubprocessTask", "(", "self", ".", "_rsync_...
Send a file to a remote host with rsync. Args: file_name (str): The relative location of the file on the local host. remote_destination (str): The destination for the file on the remote host. If `None`, will be assumed to be the same as *...
[ "Send", "a", "file", "to", "a", "remote", "host", "with", "rsync", "." ]
train
https://github.com/emichael/PyREM/blob/2609249ead197cd9496d164f4998ca9985503579/pyrem/host.py#L68-L90
emichael/PyREM
pyrem/host.py
RemoteHost.get_file
def get_file(self, file_name, local_destination=None, **kwargs): """Get a file from a remote host with rsync. Args: file_name (str): The relative location of the file on the remote host. local_destination (str): The destination for the file on the local ...
python
def get_file(self, file_name, local_destination=None, **kwargs): """Get a file from a remote host with rsync. Args: file_name (str): The relative location of the file on the remote host. local_destination (str): The destination for the file on the local ...
[ "def", "get_file", "(", "self", ",", "file_name", ",", "local_destination", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "not", "local_destination", ":", "local_destination", "=", "file_name", "return", "SubprocessTask", "(", "self", ".", "_rsync_cmd"...
Get a file from a remote host with rsync. Args: file_name (str): The relative location of the file on the remote host. local_destination (str): The destination for the file on the local host. If `None`, will be assumed to be the same as *...
[ "Get", "a", "file", "from", "a", "remote", "host", "with", "rsync", "." ]
train
https://github.com/emichael/PyREM/blob/2609249ead197cd9496d164f4998ca9985503579/pyrem/host.py#L92-L114
Clinical-Genomics/trailblazer
trailblazer/mip/config.py
ConfigHandler.make_config
def make_config(self, data: dict): """Make a MIP config.""" self.validate_config(data) config_data = self.prepare_config(data) return config_data
python
def make_config(self, data: dict): """Make a MIP config.""" self.validate_config(data) config_data = self.prepare_config(data) return config_data
[ "def", "make_config", "(", "self", ",", "data", ":", "dict", ")", ":", "self", ".", "validate_config", "(", "data", ")", "config_data", "=", "self", ".", "prepare_config", "(", "data", ")", "return", "config_data" ]
Make a MIP config.
[ "Make", "a", "MIP", "config", "." ]
train
https://github.com/Clinical-Genomics/trailblazer/blob/27f3cd21043a1077bd7029e85783459a50a7b798/trailblazer/mip/config.py#L43-L47
Clinical-Genomics/trailblazer
trailblazer/mip/config.py
ConfigHandler.validate_config
def validate_config(data: dict) -> dict: """Convert to MIP config format.""" errors = ConfigSchema().validate(data) if errors: for field, messages in errors.items(): if isinstance(messages, dict): for level, sample_errors in messages.items(): ...
python
def validate_config(data: dict) -> dict: """Convert to MIP config format.""" errors = ConfigSchema().validate(data) if errors: for field, messages in errors.items(): if isinstance(messages, dict): for level, sample_errors in messages.items(): ...
[ "def", "validate_config", "(", "data", ":", "dict", ")", "->", "dict", ":", "errors", "=", "ConfigSchema", "(", ")", ".", "validate", "(", "data", ")", "if", "errors", ":", "for", "field", ",", "messages", "in", "errors", ".", "items", "(", ")", ":",...
Convert to MIP config format.
[ "Convert", "to", "MIP", "config", "format", "." ]
train
https://github.com/Clinical-Genomics/trailblazer/blob/27f3cd21043a1077bd7029e85783459a50a7b798/trailblazer/mip/config.py#L50-L62
Clinical-Genomics/trailblazer
trailblazer/mip/config.py
ConfigHandler.prepare_config
def prepare_config(data: dict) -> dict: """Prepare the config data.""" data_copy = deepcopy(data) # handle single sample cases with 'unknown' phenotype if len(data_copy['samples']) == 1: if data_copy['samples'][0]['phenotype'] == 'unknown': LOG.info("setting '...
python
def prepare_config(data: dict) -> dict: """Prepare the config data.""" data_copy = deepcopy(data) # handle single sample cases with 'unknown' phenotype if len(data_copy['samples']) == 1: if data_copy['samples'][0]['phenotype'] == 'unknown': LOG.info("setting '...
[ "def", "prepare_config", "(", "data", ":", "dict", ")", "->", "dict", ":", "data_copy", "=", "deepcopy", "(", "data", ")", "# handle single sample cases with 'unknown' phenotype", "if", "len", "(", "data_copy", "[", "'samples'", "]", ")", "==", "1", ":", "if",...
Prepare the config data.
[ "Prepare", "the", "config", "data", "." ]
train
https://github.com/Clinical-Genomics/trailblazer/blob/27f3cd21043a1077bd7029e85783459a50a7b798/trailblazer/mip/config.py#L65-L79
Clinical-Genomics/trailblazer
trailblazer/mip/config.py
ConfigHandler.save_config
def save_config(self, data: dict) -> Path: """Save a config to the expected location.""" out_dir = Path(self.families_dir) / data['family'] out_dir.mkdir(parents=True, exist_ok=True) out_path = out_dir / 'pedigree.yaml' dump = ruamel.yaml.round_trip_dump(data, indent=4, block_seq...
python
def save_config(self, data: dict) -> Path: """Save a config to the expected location.""" out_dir = Path(self.families_dir) / data['family'] out_dir.mkdir(parents=True, exist_ok=True) out_path = out_dir / 'pedigree.yaml' dump = ruamel.yaml.round_trip_dump(data, indent=4, block_seq...
[ "def", "save_config", "(", "self", ",", "data", ":", "dict", ")", "->", "Path", ":", "out_dir", "=", "Path", "(", "self", ".", "families_dir", ")", "/", "data", "[", "'family'", "]", "out_dir", ".", "mkdir", "(", "parents", "=", "True", ",", "exist_o...
Save a config to the expected location.
[ "Save", "a", "config", "to", "the", "expected", "location", "." ]
train
https://github.com/Clinical-Genomics/trailblazer/blob/27f3cd21043a1077bd7029e85783459a50a7b798/trailblazer/mip/config.py#L81-L88
andrewda/frc-livescore
livescore/simpleocr_utils/processor.py
_broadcast
def _broadcast(src_processor, src_atr_name, dest_processors, dest_atr_name, transform_function): """ To be used exclusively by create_broadcast. A broadcast function gets an attribute on the src_processor and sets it (possibly under a different name) on dest_processors """ value = getattr(src_pr...
python
def _broadcast(src_processor, src_atr_name, dest_processors, dest_atr_name, transform_function): """ To be used exclusively by create_broadcast. A broadcast function gets an attribute on the src_processor and sets it (possibly under a different name) on dest_processors """ value = getattr(src_pr...
[ "def", "_broadcast", "(", "src_processor", ",", "src_atr_name", ",", "dest_processors", ",", "dest_atr_name", ",", "transform_function", ")", ":", "value", "=", "getattr", "(", "src_processor", ",", "src_atr_name", ")", "value", "=", "transform_function", "(", "va...
To be used exclusively by create_broadcast. A broadcast function gets an attribute on the src_processor and sets it (possibly under a different name) on dest_processors
[ "To", "be", "used", "exclusively", "by", "create_broadcast", ".", "A", "broadcast", "function", "gets", "an", "attribute", "on", "the", "src_processor", "and", "sets", "it", "(", "possibly", "under", "a", "different", "name", ")", "on", "dest_processors" ]
train
https://github.com/andrewda/frc-livescore/blob/71594cd6d2c8b6c5feb3889bb05552d09b8128b1/livescore/simpleocr_utils/processor.py#L13-L22
andrewda/frc-livescore
livescore/simpleocr_utils/processor.py
create_broadcast
def create_broadcast(src_atr_name, dest_processors, dest_atr_name=None, transform_function=lambda x: x): """ This method creates a function, intended to be called as a Processor posthook, that copies some of the processor's attributes to other processors """ from functools import partial if ...
python
def create_broadcast(src_atr_name, dest_processors, dest_atr_name=None, transform_function=lambda x: x): """ This method creates a function, intended to be called as a Processor posthook, that copies some of the processor's attributes to other processors """ from functools import partial if ...
[ "def", "create_broadcast", "(", "src_atr_name", ",", "dest_processors", ",", "dest_atr_name", "=", "None", ",", "transform_function", "=", "lambda", "x", ":", "x", ")", ":", "from", "functools", "import", "partial", "if", "dest_atr_name", "==", "None", ":", "d...
This method creates a function, intended to be called as a Processor posthook, that copies some of the processor's attributes to other processors
[ "This", "method", "creates", "a", "function", "intended", "to", "be", "called", "as", "a", "Processor", "posthook", "that", "copies", "some", "of", "the", "processor", "s", "attributes", "to", "other", "processors" ]
train
https://github.com/andrewda/frc-livescore/blob/71594cd6d2c8b6c5feb3889bb05552d09b8128b1/livescore/simpleocr_utils/processor.py#L25-L37
andrewda/frc-livescore
livescore/simpleocr_utils/processor.py
Processor.get_parameters
def get_parameters(self): """returns a dictionary with the processor's stored parameters""" parameter_names = self.PARAMETERS.keys() # TODO: Unresolved reference for processor parameter_values = [getattr(processor, n) for n in parameter_names] return dict(zip(parameter_names, par...
python
def get_parameters(self): """returns a dictionary with the processor's stored parameters""" parameter_names = self.PARAMETERS.keys() # TODO: Unresolved reference for processor parameter_values = [getattr(processor, n) for n in parameter_names] return dict(zip(parameter_names, par...
[ "def", "get_parameters", "(", "self", ")", ":", "parameter_names", "=", "self", ".", "PARAMETERS", ".", "keys", "(", ")", "# TODO: Unresolved reference for processor", "parameter_values", "=", "[", "getattr", "(", "processor", ",", "n", ")", "for", "n", "in", ...
returns a dictionary with the processor's stored parameters
[ "returns", "a", "dictionary", "with", "the", "processor", "s", "stored", "parameters" ]
train
https://github.com/andrewda/frc-livescore/blob/71594cd6d2c8b6c5feb3889bb05552d09b8128b1/livescore/simpleocr_utils/processor.py#L66-L71
andrewda/frc-livescore
livescore/simpleocr_utils/processor.py
Processor.set_parameters
def set_parameters(self, **args): """sets the processor stored parameters""" for k, v in self.PARAMETERS.items(): new_value = args.get(k) if new_value != None: if not _same_type(new_value, v): raise Exception( "On proces...
python
def set_parameters(self, **args): """sets the processor stored parameters""" for k, v in self.PARAMETERS.items(): new_value = args.get(k) if new_value != None: if not _same_type(new_value, v): raise Exception( "On proces...
[ "def", "set_parameters", "(", "self", ",", "*", "*", "args", ")", ":", "for", "k", ",", "v", "in", "self", ".", "PARAMETERS", ".", "items", "(", ")", ":", "new_value", "=", "args", ".", "get", "(", "k", ")", "if", "new_value", "!=", "None", ":", ...
sets the processor stored parameters
[ "sets", "the", "processor", "stored", "parameters" ]
train
https://github.com/andrewda/frc-livescore/blob/71594cd6d2c8b6c5feb3889bb05552d09b8128b1/livescore/simpleocr_utils/processor.py#L73-L85
andrewda/frc-livescore
livescore/simpleocr_utils/processor.py
ProcessorStack.get_parameters
def get_parameters(self): """gets from all wrapped processors""" d = {} for p in self.processors: parameter_names = list(p.PARAMETERS.keys()) parameter_values = [getattr(p, n) for n in parameter_names] d.update(dict(zip(parameter_names, parameter_values))) ...
python
def get_parameters(self): """gets from all wrapped processors""" d = {} for p in self.processors: parameter_names = list(p.PARAMETERS.keys()) parameter_values = [getattr(p, n) for n in parameter_names] d.update(dict(zip(parameter_names, parameter_values))) ...
[ "def", "get_parameters", "(", "self", ")", ":", "d", "=", "{", "}", "for", "p", "in", "self", ".", "processors", ":", "parameter_names", "=", "list", "(", "p", ".", "PARAMETERS", ".", "keys", "(", ")", ")", "parameter_values", "=", "[", "getattr", "(...
gets from all wrapped processors
[ "gets", "from", "all", "wrapped", "processors" ]
train
https://github.com/andrewda/frc-livescore/blob/71594cd6d2c8b6c5feb3889bb05552d09b8128b1/livescore/simpleocr_utils/processor.py#L128-L135