code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def convert_to_feature_collection(self): """Convert data into a FeatureCollection if it is not already.""" if self.data['type'] == 'FeatureCollection': return if not self.embed: raise ValueError( 'Data is not a FeatureCollection, but it should be to apply ...
def function[convert_to_feature_collection, parameter[self]]: constant[Convert data into a FeatureCollection if it is not already.] if compare[call[name[self].data][constant[type]] equal[==] constant[FeatureCollection]] begin[:] return[None] if <ast.UnaryOp object at 0x7da2049630d0> begi...
keyword[def] identifier[convert_to_feature_collection] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[data] [ literal[string] ]== literal[string] : keyword[return] keyword[if] keyword[not] identifier[self] . identifier[embed] : ...
def convert_to_feature_collection(self): """Convert data into a FeatureCollection if it is not already.""" if self.data['type'] == 'FeatureCollection': return # depends on [control=['if'], data=[]] if not self.embed: raise ValueError('Data is not a FeatureCollection, but it should be to app...
def get_image_format(filename): """Get the image format.""" image = None bad_image = 1 image_format = NONE_FORMAT sequenced = False try: bad_image = Image.open(filename).verify() image = Image.open(filename) image_format = image.format sequenced = _is_image_sequen...
def function[get_image_format, parameter[filename]]: constant[Get the image format.] variable[image] assign[=] constant[None] variable[bad_image] assign[=] constant[1] variable[image_format] assign[=] name[NONE_FORMAT] variable[sequenced] assign[=] constant[False] <ast.Try ob...
keyword[def] identifier[get_image_format] ( identifier[filename] ): literal[string] identifier[image] = keyword[None] identifier[bad_image] = literal[int] identifier[image_format] = identifier[NONE_FORMAT] identifier[sequenced] = keyword[False] keyword[try] : identifier[bad...
def get_image_format(filename): """Get the image format.""" image = None bad_image = 1 image_format = NONE_FORMAT sequenced = False try: bad_image = Image.open(filename).verify() image = Image.open(filename) image_format = image.format sequenced = _is_image_sequen...
def symlink(parser, cmd, args): """ Set up symlinks for (a subset of) the pwny apps. """ parser.add_argument( 'apps', nargs=argparse.REMAINDER, help='Which apps to create symlinks for.' ) args = parser.parse_args(args) base_dir, pwny_main = os.path.split(sys.argv[0]...
def function[symlink, parameter[parser, cmd, args]]: constant[ Set up symlinks for (a subset of) the pwny apps. ] call[name[parser].add_argument, parameter[constant[apps]]] variable[args] assign[=] call[name[parser].parse_args, parameter[name[args]]] <ast.Tuple object at 0x7da18f...
keyword[def] identifier[symlink] ( identifier[parser] , identifier[cmd] , identifier[args] ): literal[string] identifier[parser] . identifier[add_argument] ( literal[string] , identifier[nargs] = identifier[argparse] . identifier[REMAINDER] , identifier[help] = literal[string] ) i...
def symlink(parser, cmd, args): """ Set up symlinks for (a subset of) the pwny apps. """ parser.add_argument('apps', nargs=argparse.REMAINDER, help='Which apps to create symlinks for.') args = parser.parse_args(args) (base_dir, pwny_main) = os.path.split(sys.argv[0]) for (app_name, config) i...
def _on_dynamodb_exception(self, error): """Dynamically handle DynamoDB exceptions, returning HTTP error responses. :param exceptions.DynamoDBException error: """ if isinstance(error, exceptions.ConditionalCheckFailedException): raise web.HTTPError(409, reason='Cond...
def function[_on_dynamodb_exception, parameter[self, error]]: constant[Dynamically handle DynamoDB exceptions, returning HTTP error responses. :param exceptions.DynamoDBException error: ] if call[name[isinstance], parameter[name[error], name[exceptions].ConditionalCheckFailedEx...
keyword[def] identifier[_on_dynamodb_exception] ( identifier[self] , identifier[error] ): literal[string] keyword[if] identifier[isinstance] ( identifier[error] , identifier[exceptions] . identifier[ConditionalCheckFailedException] ): keyword[raise] identifier[web] . identifier[HTTPE...
def _on_dynamodb_exception(self, error): """Dynamically handle DynamoDB exceptions, returning HTTP error responses. :param exceptions.DynamoDBException error: """ if isinstance(error, exceptions.ConditionalCheckFailedException): raise web.HTTPError(409, reason='Condition Check ...
def b_rgb(self, r, g, b, text=None, fore=None, style=None): """ A chained method that sets the back color to an RGB value. Arguments: r : Red value. g : Green value. b : Blue value. text : Text to style if not building up c...
def function[b_rgb, parameter[self, r, g, b, text, fore, style]]: constant[ A chained method that sets the back color to an RGB value. Arguments: r : Red value. g : Green value. b : Blue value. text : Text to style if not b...
keyword[def] identifier[b_rgb] ( identifier[self] , identifier[r] , identifier[g] , identifier[b] , identifier[text] = keyword[None] , identifier[fore] = keyword[None] , identifier[style] = keyword[None] ): literal[string] keyword[return] identifier[self] . identifier[chained] ( identifier[text] =...
def b_rgb(self, r, g, b, text=None, fore=None, style=None): """ A chained method that sets the back color to an RGB value. Arguments: r : Red value. g : Green value. b : Blue value. text : Text to style if not building up color...
def _get_mean(self, C, mag, rake, dip, rrup, rjb): """ Return mean value (eq. 1, page 319). """ f1 = self._compute_magnitude_scaling(C, mag) f2 = self._compute_distance_scaling(C, mag, rrup) f3 = self._compute_faulting_mechanism(C, rake, dip) f4 = self._compute_fa...
def function[_get_mean, parameter[self, C, mag, rake, dip, rrup, rjb]]: constant[ Return mean value (eq. 1, page 319). ] variable[f1] assign[=] call[name[self]._compute_magnitude_scaling, parameter[name[C], name[mag]]] variable[f2] assign[=] call[name[self]._compute_distance_scal...
keyword[def] identifier[_get_mean] ( identifier[self] , identifier[C] , identifier[mag] , identifier[rake] , identifier[dip] , identifier[rrup] , identifier[rjb] ): literal[string] identifier[f1] = identifier[self] . identifier[_compute_magnitude_scaling] ( identifier[C] , identifier[mag] ) ...
def _get_mean(self, C, mag, rake, dip, rrup, rjb): """ Return mean value (eq. 1, page 319). """ f1 = self._compute_magnitude_scaling(C, mag) f2 = self._compute_distance_scaling(C, mag, rrup) f3 = self._compute_faulting_mechanism(C, rake, dip) f4 = self._compute_far_source_soil_effect...
def diff(self, dt=None, abs=True): """ Returns the difference between two Date objects as a Period. :type dt: Date or None :param abs: Whether to return an absolute interval or not :type abs: bool :rtype: Period """ if dt is None: dt = self....
def function[diff, parameter[self, dt, abs]]: constant[ Returns the difference between two Date objects as a Period. :type dt: Date or None :param abs: Whether to return an absolute interval or not :type abs: bool :rtype: Period ] if compare[name[dt] is...
keyword[def] identifier[diff] ( identifier[self] , identifier[dt] = keyword[None] , identifier[abs] = keyword[True] ): literal[string] keyword[if] identifier[dt] keyword[is] keyword[None] : identifier[dt] = identifier[self] . identifier[today] () keyword[return] identifie...
def diff(self, dt=None, abs=True): """ Returns the difference between two Date objects as a Period. :type dt: Date or None :param abs: Whether to return an absolute interval or not :type abs: bool :rtype: Period """ if dt is None: dt = self.today() # d...
def child_parsers(self): """Iterate over all the code objects nested within this one. The iteration includes `self` as its first value. """ children = CodeObjects(self.code) return [ByteParser(code=c, text=self.text) for c in children]
def function[child_parsers, parameter[self]]: constant[Iterate over all the code objects nested within this one. The iteration includes `self` as its first value. ] variable[children] assign[=] call[name[CodeObjects], parameter[name[self].code]] return[<ast.ListComp object at 0x7da...
keyword[def] identifier[child_parsers] ( identifier[self] ): literal[string] identifier[children] = identifier[CodeObjects] ( identifier[self] . identifier[code] ) keyword[return] [ identifier[ByteParser] ( identifier[code] = identifier[c] , identifier[text] = identifier[self] . identifier...
def child_parsers(self): """Iterate over all the code objects nested within this one. The iteration includes `self` as its first value. """ children = CodeObjects(self.code) return [ByteParser(code=c, text=self.text) for c in children]
def create_with_zero_body(self, uri=None, timeout=-1, custom_headers=None): """ Makes a POST request to create a resource when no request body is required. Args: uri: Can be either the resource ID or the resource URI. timeout: Timeout in s...
def function[create_with_zero_body, parameter[self, uri, timeout, custom_headers]]: constant[ Makes a POST request to create a resource when no request body is required. Args: uri: Can be either the resource ID or the resource URI. timeout: ...
keyword[def] identifier[create_with_zero_body] ( identifier[self] , identifier[uri] = keyword[None] , identifier[timeout] =- literal[int] , identifier[custom_headers] = keyword[None] ): literal[string] keyword[if] keyword[not] identifier[uri] : identifier[uri] = identifier[self] . id...
def create_with_zero_body(self, uri=None, timeout=-1, custom_headers=None): """ Makes a POST request to create a resource when no request body is required. Args: uri: Can be either the resource ID or the resource URI. timeout: Timeout in secon...
def overlay(self, matchers, force=False): """ Given a list of matchers create overlays based on them. Normally I will remember what overlays were run this way and will avoid re-running them but you can `force` me to. This is the recommended way of running overlays.c """ ...
def function[overlay, parameter[self, matchers, force]]: constant[ Given a list of matchers create overlays based on them. Normally I will remember what overlays were run this way and will avoid re-running them but you can `force` me to. This is the recommended way of running ove...
keyword[def] identifier[overlay] ( identifier[self] , identifier[matchers] , identifier[force] = keyword[False] ): literal[string] keyword[for] identifier[m] keyword[in] identifier[matchers] : keyword[if] identifier[m] keyword[in] identifier[self] . identifier[_ran_matchers] : ...
def overlay(self, matchers, force=False): """ Given a list of matchers create overlays based on them. Normally I will remember what overlays were run this way and will avoid re-running them but you can `force` me to. This is the recommended way of running overlays.c """ f...
def _fact_to_tuple(self, fact): """ Convert a ``Fact`` to its normalized tuple. This is where all type conversion for ``Fact`` attributes to strings as well as any normalization happens. Note: Because different writers may require different types, we need to ...
def function[_fact_to_tuple, parameter[self, fact]]: constant[ Convert a ``Fact`` to its normalized tuple. This is where all type conversion for ``Fact`` attributes to strings as well as any normalization happens. Note: Because different writers may require differen...
keyword[def] identifier[_fact_to_tuple] ( identifier[self] , identifier[fact] ): literal[string] keyword[if] identifier[fact] . identifier[category] : identifier[category] = identifier[fact] . identifier[category] . identifier[name] keyword[else] : iden...
def _fact_to_tuple(self, fact): """ Convert a ``Fact`` to its normalized tuple. This is where all type conversion for ``Fact`` attributes to strings as well as any normalization happens. Note: Because different writers may require different types, we need to ...
def present(self, results): "Present the results as a list." for (score, d) in results: doc = self.documents[d] print ("%5.2f|%25s | %s" % (100 * score, doc.url, doc.title[:45].expandtabs()))
def function[present, parameter[self, results]]: constant[Present the results as a list.] for taget[tuple[[<ast.Name object at 0x7da18bccaf50>, <ast.Name object at 0x7da18bccb9d0>]]] in starred[name[results]] begin[:] variable[doc] assign[=] call[name[self].documents][name[d]] ...
keyword[def] identifier[present] ( identifier[self] , identifier[results] ): literal[string] keyword[for] ( identifier[score] , identifier[d] ) keyword[in] identifier[results] : identifier[doc] = identifier[self] . identifier[documents] [ identifier[d] ] identifier[print]...
def present(self, results): """Present the results as a list.""" for (score, d) in results: doc = self.documents[d] print('%5.2f|%25s | %s' % (100 * score, doc.url, doc.title[:45].expandtabs())) # depends on [control=['for'], data=[]]
def _updateParamsFrom(self, otherObj, updater=_default_param_updater, exclude=None, prefix=""): """ :note: doc in :func:`~hwt.synthesizer.interfaceLevel.propDeclCollector._updateParamsFrom` """ PropDeclrCollector._updateParamsFrom(self, otherObj, updater, exclud...
def function[_updateParamsFrom, parameter[self, otherObj, updater, exclude, prefix]]: constant[ :note: doc in :func:`~hwt.synthesizer.interfaceLevel.propDeclCollector._updateParamsFrom` ] call[name[PropDeclrCollector]._updateParamsFrom, parameter[name[self], name[otherObj], name[updater]...
keyword[def] identifier[_updateParamsFrom] ( identifier[self] , identifier[otherObj] , identifier[updater] = identifier[_default_param_updater] , identifier[exclude] = keyword[None] , identifier[prefix] = literal[string] ): literal[string] identifier[PropDeclrCollector] . identifier[_updateParamsF...
def _updateParamsFrom(self, otherObj, updater=_default_param_updater, exclude=None, prefix=''): """ :note: doc in :func:`~hwt.synthesizer.interfaceLevel.propDeclCollector._updateParamsFrom` """ PropDeclrCollector._updateParamsFrom(self, otherObj, updater, exclude, prefix)
def track_execution(cmd, project, experiment, **kwargs): """Guard the execution of the given command. The given command (`cmd`) will be executed inside a database context. As soon as you leave the context we will commit the transaction. Any necessary modifications to the database can be identified insi...
def function[track_execution, parameter[cmd, project, experiment]]: constant[Guard the execution of the given command. The given command (`cmd`) will be executed inside a database context. As soon as you leave the context we will commit the transaction. Any necessary modifications to the database c...
keyword[def] identifier[track_execution] ( identifier[cmd] , identifier[project] , identifier[experiment] ,** identifier[kwargs] ): literal[string] identifier[runner] = identifier[RunInfo] ( identifier[cmd] = identifier[cmd] , identifier[project] = identifier[project] , identifier[experiment] = identifier...
def track_execution(cmd, project, experiment, **kwargs): """Guard the execution of the given command. The given command (`cmd`) will be executed inside a database context. As soon as you leave the context we will commit the transaction. Any necessary modifications to the database can be identified insi...
async def set_update_cb(self, cb): """Register the update callback.""" if self._report_task is not None and not self._report_task.cancelled(): self.loop.create_task(self._report_task.cancel()) self._update_cb = cb if cb is not None: self._report_task = self.loop.c...
<ast.AsyncFunctionDef object at 0x7da18f720880>
keyword[async] keyword[def] identifier[set_update_cb] ( identifier[self] , identifier[cb] ): literal[string] keyword[if] identifier[self] . identifier[_report_task] keyword[is] keyword[not] keyword[None] keyword[and] keyword[not] identifier[self] . identifier[_report_task] . identifier[canc...
async def set_update_cb(self, cb): """Register the update callback.""" if self._report_task is not None and (not self._report_task.cancelled()): self.loop.create_task(self._report_task.cancel()) # depends on [control=['if'], data=[]] self._update_cb = cb if cb is not None: self._report_...
def read(*p): """Build a file path from paths and return the contents.""" with open(os.path.join(*p), 'r') as fi: return fi.read()
def function[read, parameter[]]: constant[Build a file path from paths and return the contents.] with call[name[open], parameter[call[name[os].path.join, parameter[<ast.Starred object at 0x7da20c7cbf70>]], constant[r]]] begin[:] return[call[name[fi].read, parameter[]]]
keyword[def] identifier[read] (* identifier[p] ): literal[string] keyword[with] identifier[open] ( identifier[os] . identifier[path] . identifier[join] (* identifier[p] ), literal[string] ) keyword[as] identifier[fi] : keyword[return] identifier[fi] . identifier[read] ()
def read(*p): """Build a file path from paths and return the contents.""" with open(os.path.join(*p), 'r') as fi: return fi.read() # depends on [control=['with'], data=['fi']]
def patch(): """ patch the built-in `urllib/httplib/httplib.client` methods for tracing. """ if getattr(httplib, PATCH_FLAG, False): return # we set an attribute to avoid multiple wrapping setattr(httplib, PATCH_FLAG, True) wrapt.wrap_function_wrapper( httplib_client_module,...
def function[patch, parameter[]]: constant[ patch the built-in `urllib/httplib/httplib.client` methods for tracing. ] if call[name[getattr], parameter[name[httplib], name[PATCH_FLAG], constant[False]]] begin[:] return[None] call[name[setattr], parameter[name[httplib], name[PATCH_...
keyword[def] identifier[patch] (): literal[string] keyword[if] identifier[getattr] ( identifier[httplib] , identifier[PATCH_FLAG] , keyword[False] ): keyword[return] identifier[setattr] ( identifier[httplib] , identifier[PATCH_FLAG] , keyword[True] ) identifier[wrapt] . ident...
def patch(): """ patch the built-in `urllib/httplib/httplib.client` methods for tracing. """ if getattr(httplib, PATCH_FLAG, False): return # depends on [control=['if'], data=[]] # we set an attribute to avoid multiple wrapping setattr(httplib, PATCH_FLAG, True) wrapt.wrap_function_...
def load_all_methods(self): r'''Method which picks out coefficients for the specified chemical from the various dictionaries and DataFrames storing it. All data is stored as attributes. This method also sets :obj:`Tmin`, :obj:`Tmax`, :obj:`all_methods` and obj:`all_methods_P` as a set of...
def function[load_all_methods, parameter[self]]: constant[Method which picks out coefficients for the specified chemical from the various dictionaries and DataFrames storing it. All data is stored as attributes. This method also sets :obj:`Tmin`, :obj:`Tmax`, :obj:`all_methods` and obj:`...
keyword[def] identifier[load_all_methods] ( identifier[self] ): literal[string] identifier[methods] , identifier[methods_P] =[],[] identifier[Tmins] , identifier[Tmaxs] =[],[] keyword[if] identifier[self] . identifier[CASRN] keyword[in] identifier[_VDISaturationDict] : ...
def load_all_methods(self): """Method which picks out coefficients for the specified chemical from the various dictionaries and DataFrames storing it. All data is stored as attributes. This method also sets :obj:`Tmin`, :obj:`Tmax`, :obj:`all_methods` and obj:`all_methods_P` as a set of meth...
def update_source(self, id, **kwargs): # noqa: E501 """Update metadata (description or tags) for a specific source. # noqa: E501 The \"hidden\" property is stored as a tag. To set the value, add \"hidden\": &lt;value&gt; to the list of tags. # noqa: E501 This method makes a synchronous HTTP ...
def function[update_source, parameter[self, id]]: constant[Update metadata (description or tags) for a specific source. # noqa: E501 The "hidden" property is stored as a tag. To set the value, add "hidden": &lt;value&gt; to the list of tags. # noqa: E501 This method makes a synchronous HTTP r...
keyword[def] identifier[update_source] ( identifier[self] , identifier[id] ,** identifier[kwargs] ): literal[string] identifier[kwargs] [ literal[string] ]= keyword[True] keyword[if] identifier[kwargs] . identifier[get] ( literal[string] ): keyword[return] identifier[self] ...
def update_source(self, id, **kwargs): # noqa: E501 'Update metadata (description or tags) for a specific source. # noqa: E501\n\n The "hidden" property is stored as a tag. To set the value, add "hidden": &lt;value&gt; to the list of tags. # noqa: E501\n This method makes a synchronous HTTP request...
def chunks(event_list, chunk_size): """Yield successive n-sized chunks from the event list.""" for i in range(0, len(event_list), chunk_size): yield event_list[i:i + chunk_size]
def function[chunks, parameter[event_list, chunk_size]]: constant[Yield successive n-sized chunks from the event list.] for taget[name[i]] in starred[call[name[range], parameter[constant[0], call[name[len], parameter[name[event_list]]], name[chunk_size]]]] begin[:] <ast.Yield object at 0...
keyword[def] identifier[chunks] ( identifier[event_list] , identifier[chunk_size] ): literal[string] keyword[for] identifier[i] keyword[in] identifier[range] ( literal[int] , identifier[len] ( identifier[event_list] ), identifier[chunk_size] ): keyword[yield] identifier[event_list] [ identifie...
def chunks(event_list, chunk_size): """Yield successive n-sized chunks from the event list.""" for i in range(0, len(event_list), chunk_size): yield event_list[i:i + chunk_size] # depends on [control=['for'], data=['i']]
def _read_certificates(self): """ Reads end-entity and intermediate certificate information from the TLS session """ cert_context_pointer_pointer = new(crypt32, 'CERT_CONTEXT **') result = secur32.QueryContextAttributesW( self._context_handle_pointer, ...
def function[_read_certificates, parameter[self]]: constant[ Reads end-entity and intermediate certificate information from the TLS session ] variable[cert_context_pointer_pointer] assign[=] call[name[new], parameter[name[crypt32], constant[CERT_CONTEXT **]]] variable[res...
keyword[def] identifier[_read_certificates] ( identifier[self] ): literal[string] identifier[cert_context_pointer_pointer] = identifier[new] ( identifier[crypt32] , literal[string] ) identifier[result] = identifier[secur32] . identifier[QueryContextAttributesW] ( identifier[self]...
def _read_certificates(self): """ Reads end-entity and intermediate certificate information from the TLS session """ cert_context_pointer_pointer = new(crypt32, 'CERT_CONTEXT **') result = secur32.QueryContextAttributesW(self._context_handle_pointer, Secur32Const.SECPKG_ATTR_REMOTE_C...
def crc16(cmd, use_byte=False): """ CRC16 检验 - 启用``use_byte`` 则返回 bytes 类型. :param cmd: 无crc检验的指令 :type cmd: :param use_byte: 是否返回byte类型 :type use_byte: :return: 返回crc值 :rtype: """ crc = 0xFFFF # crc16 计算方法, 需要使用 byte if hasattr(cmd, 'encode'): cmd =...
def function[crc16, parameter[cmd, use_byte]]: constant[ CRC16 检验 - 启用``use_byte`` 则返回 bytes 类型. :param cmd: 无crc检验的指令 :type cmd: :param use_byte: 是否返回byte类型 :type use_byte: :return: 返回crc值 :rtype: ] variable[crc] assign[=] constant[65535] if call[nam...
keyword[def] identifier[crc16] ( identifier[cmd] , identifier[use_byte] = keyword[False] ): literal[string] identifier[crc] = literal[int] keyword[if] identifier[hasattr] ( identifier[cmd] , literal[string] ): identifier[cmd] = identifier[bytes] . identifier[fromhex] ( identifier[cmd]...
def crc16(cmd, use_byte=False): """ CRC16 检验 - 启用``use_byte`` 则返回 bytes 类型. :param cmd: 无crc检验的指令 :type cmd: :param use_byte: 是否返回byte类型 :type use_byte: :return: 返回crc值 :rtype: """ crc = 65535 # crc16 计算方法, 需要使用 byte if hasattr(cmd, 'encode'): cmd = b...
def do_cmd_output_sub(self, cmd, regexp, subst): '''Apply a regexp substitution to command output archived by sosreport. cmd is the command name from which output is collected (i.e. excluding parameters). The regexp can be a string or a compiled re object. The substitution string, subst,...
def function[do_cmd_output_sub, parameter[self, cmd, regexp, subst]]: constant[Apply a regexp substitution to command output archived by sosreport. cmd is the command name from which output is collected (i.e. excluding parameters). The regexp can be a string or a compiled re object. The ...
keyword[def] identifier[do_cmd_output_sub] ( identifier[self] , identifier[cmd] , identifier[regexp] , identifier[subst] ): literal[string] identifier[globstr] = literal[string] + identifier[cmd] + literal[string] identifier[self] . identifier[_log_debug] ( literal[string] %( ide...
def do_cmd_output_sub(self, cmd, regexp, subst): """Apply a regexp substitution to command output archived by sosreport. cmd is the command name from which output is collected (i.e. excluding parameters). The regexp can be a string or a compiled re object. The substitution string, subst, is ...
def _run_and_log(cmd, ostree_repo_path, error_msg, wd=None): """ run provided command and log all of its output; set path to ostree repo """ logger.debug("running command %s", cmd) kwargs = { "stderr": subprocess.STDOUT, "env": os.environ.copy(), } if ostr...
def function[_run_and_log, parameter[cmd, ostree_repo_path, error_msg, wd]]: constant[ run provided command and log all of its output; set path to ostree repo ] call[name[logger].debug, parameter[constant[running command %s], name[cmd]]] variable[kwargs] assign[=] dictionary[[<ast.Constant objec...
keyword[def] identifier[_run_and_log] ( identifier[cmd] , identifier[ostree_repo_path] , identifier[error_msg] , identifier[wd] = keyword[None] ): literal[string] identifier[logger] . identifier[debug] ( literal[string] , identifier[cmd] ) identifier[kwargs] ={ literal[string] : i...
def _run_and_log(cmd, ostree_repo_path, error_msg, wd=None): """ run provided command and log all of its output; set path to ostree repo """ logger.debug('running command %s', cmd) kwargs = {'stderr': subprocess.STDOUT, 'env': os.environ.copy()} if ostree_repo_path: # must not exist, ostree will...
def SMGetJobDictionaries(self, domain='kSMDomainSystemLaunchd'): """Copy all Job Dictionaries from the ServiceManagement. Args: domain: The name of a constant in Foundation referencing the domain. Will copy all launchd services by default. Returns: A marshalled python list of dic...
def function[SMGetJobDictionaries, parameter[self, domain]]: constant[Copy all Job Dictionaries from the ServiceManagement. Args: domain: The name of a constant in Foundation referencing the domain. Will copy all launchd services by default. Returns: A marshalled python list ...
keyword[def] identifier[SMGetJobDictionaries] ( identifier[self] , identifier[domain] = literal[string] ): literal[string] identifier[cfstring_launchd] = identifier[ctypes] . identifier[c_void_p] . identifier[in_dll] ( identifier[self] . identifier[dll] , identifier[domain] ) keyword[return] identifi...
def SMGetJobDictionaries(self, domain='kSMDomainSystemLaunchd'): """Copy all Job Dictionaries from the ServiceManagement. Args: domain: The name of a constant in Foundation referencing the domain. Will copy all launchd services by default. Returns: A marshalled python list of dic...
def add_vertices(self, vertices, vid_field=None): """ Add vertices to the SGraph. Vertices should be input as a list of :class:`~turicreate.Vertex` objects, an :class:`~turicreate.SFrame`, or a pandas DataFrame. If vertices are specified by SFrame or DataFrame, ``vid_field`` spec...
def function[add_vertices, parameter[self, vertices, vid_field]]: constant[ Add vertices to the SGraph. Vertices should be input as a list of :class:`~turicreate.Vertex` objects, an :class:`~turicreate.SFrame`, or a pandas DataFrame. If vertices are specified by SFrame or DataFrame, ...
keyword[def] identifier[add_vertices] ( identifier[self] , identifier[vertices] , identifier[vid_field] = keyword[None] ): literal[string] identifier[sf] = identifier[_vertex_data_to_sframe] ( identifier[vertices] , identifier[vid_field] ) keyword[with] identifier[cython_context] (): ...
def add_vertices(self, vertices, vid_field=None): """ Add vertices to the SGraph. Vertices should be input as a list of :class:`~turicreate.Vertex` objects, an :class:`~turicreate.SFrame`, or a pandas DataFrame. If vertices are specified by SFrame or DataFrame, ``vid_field`` specifie...
def indices(db=None): ''' Show all indices in the database CLI Example: .. code-block:: bash salt '*' sqlite3.indices /root/test.db ''' cur = _connect(db) if not cur: return False cur.execute( "SELECT name FROM sqlite_master WHERE type='index' ORDER BY name;"...
def function[indices, parameter[db]]: constant[ Show all indices in the database CLI Example: .. code-block:: bash salt '*' sqlite3.indices /root/test.db ] variable[cur] assign[=] call[name[_connect], parameter[name[db]]] if <ast.UnaryOp object at 0x7da1b2045540> begin...
keyword[def] identifier[indices] ( identifier[db] = keyword[None] ): literal[string] identifier[cur] = identifier[_connect] ( identifier[db] ) keyword[if] keyword[not] identifier[cur] : keyword[return] keyword[False] identifier[cur] . identifier[execute] ( literal[string] ...
def indices(db=None): """ Show all indices in the database CLI Example: .. code-block:: bash salt '*' sqlite3.indices /root/test.db """ cur = _connect(db) if not cur: return False # depends on [control=['if'], data=[]] cur.execute("SELECT name FROM sqlite_master WHERE...
def install_setuptools(python_cmd='python', use_sudo=True): """ Install the latest version of `setuptools`_. :: import burlap burlap.python_setuptools.install_setuptools() """ setuptools_version = package_version('setuptools', python_cmd) distribute_version = package_version...
def function[install_setuptools, parameter[python_cmd, use_sudo]]: constant[ Install the latest version of `setuptools`_. :: import burlap burlap.python_setuptools.install_setuptools() ] variable[setuptools_version] assign[=] call[name[package_version], parameter[constant...
keyword[def] identifier[install_setuptools] ( identifier[python_cmd] = literal[string] , identifier[use_sudo] = keyword[True] ): literal[string] identifier[setuptools_version] = identifier[package_version] ( literal[string] , identifier[python_cmd] ) identifier[distribute_version] = identifier[packag...
def install_setuptools(python_cmd='python', use_sudo=True): """ Install the latest version of `setuptools`_. :: import burlap burlap.python_setuptools.install_setuptools() """ setuptools_version = package_version('setuptools', python_cmd) distribute_version = package_version(...
def _trigger_events(view_obj, events_map, additional_kw=None): """ Common logic to trigger before/after events. :param view_obj: Instance of View that processes the request. :param events_map: Map of events from which event class should be picked. :returns: Instance if triggered event. """ ...
def function[_trigger_events, parameter[view_obj, events_map, additional_kw]]: constant[ Common logic to trigger before/after events. :param view_obj: Instance of View that processes the request. :param events_map: Map of events from which event class should be picked. :returns: Instance if...
keyword[def] identifier[_trigger_events] ( identifier[view_obj] , identifier[events_map] , identifier[additional_kw] = keyword[None] ): literal[string] keyword[if] identifier[additional_kw] keyword[is] keyword[None] : identifier[additional_kw] ={} identifier[event_kwargs] = identifier[_ge...
def _trigger_events(view_obj, events_map, additional_kw=None): """ Common logic to trigger before/after events. :param view_obj: Instance of View that processes the request. :param events_map: Map of events from which event class should be picked. :returns: Instance if triggered event. """ ...
def run_freidman_supsmu(x, y, bass_enhancement=0.0): """Run the FORTRAN supersmoother.""" N = len(x) weight = numpy.ones(N) results = numpy.zeros(N) flags = numpy.zeros((N, 7)) mace.supsmu(x, y, weight, 1, 0.0, bass_enhancement, results, flags) return results
def function[run_freidman_supsmu, parameter[x, y, bass_enhancement]]: constant[Run the FORTRAN supersmoother.] variable[N] assign[=] call[name[len], parameter[name[x]]] variable[weight] assign[=] call[name[numpy].ones, parameter[name[N]]] variable[results] assign[=] call[name[numpy].zero...
keyword[def] identifier[run_freidman_supsmu] ( identifier[x] , identifier[y] , identifier[bass_enhancement] = literal[int] ): literal[string] identifier[N] = identifier[len] ( identifier[x] ) identifier[weight] = identifier[numpy] . identifier[ones] ( identifier[N] ) identifier[results] = identif...
def run_freidman_supsmu(x, y, bass_enhancement=0.0): """Run the FORTRAN supersmoother.""" N = len(x) weight = numpy.ones(N) results = numpy.zeros(N) flags = numpy.zeros((N, 7)) mace.supsmu(x, y, weight, 1, 0.0, bass_enhancement, results, flags) return results
def num_cpus(): """Return the effective number of CPUs in the system as an integer. This cross-platform function makes an attempt at finding the total number of available CPUs in the system, as returned by various underlying system and python calls. If it can't find a sensible answer, it returns 1 (tho...
def function[num_cpus, parameter[]]: constant[Return the effective number of CPUs in the system as an integer. This cross-platform function makes an attempt at finding the total number of available CPUs in the system, as returned by various underlying system and python calls. If it can't find a se...
keyword[def] identifier[num_cpus] (): literal[string] identifier[ncpufuncs] ={ literal[string] : identifier[_num_cpus_unix] , literal[string] : identifier[_num_cpus_darwin] , literal[string] : identifier[_num_cpus_windows] , literal[string] : identifier[_num_cpus_windows] , ...
def num_cpus(): """Return the effective number of CPUs in the system as an integer. This cross-platform function makes an attempt at finding the total number of available CPUs in the system, as returned by various underlying system and python calls. If it can't find a sensible answer, it returns 1 (th...
def get_withdrawal(self, withdrawal_id, **params): """https://developers.coinbase.com/api/v2#show-a-withdrawal""" return self.api_client.get_withdrawal(self.id, withdrawal_id, **params)
def function[get_withdrawal, parameter[self, withdrawal_id]]: constant[https://developers.coinbase.com/api/v2#show-a-withdrawal] return[call[name[self].api_client.get_withdrawal, parameter[name[self].id, name[withdrawal_id]]]]
keyword[def] identifier[get_withdrawal] ( identifier[self] , identifier[withdrawal_id] ,** identifier[params] ): literal[string] keyword[return] identifier[self] . identifier[api_client] . identifier[get_withdrawal] ( identifier[self] . identifier[id] , identifier[withdrawal_id] ,** identifier[par...
def get_withdrawal(self, withdrawal_id, **params): """https://developers.coinbase.com/api/v2#show-a-withdrawal""" return self.api_client.get_withdrawal(self.id, withdrawal_id, **params)
def _sanitize_string(unsanitized, itemsep, kvsep): """ sanitizes a string that contains multiple key/value items :param unsanitized: the unsanitized string :param itemsep: string that separates items :param kvsep: string that separates key from value :return: a sanitized string """ sanit...
def function[_sanitize_string, parameter[unsanitized, itemsep, kvsep]]: constant[ sanitizes a string that contains multiple key/value items :param unsanitized: the unsanitized string :param itemsep: string that separates items :param kvsep: string that separates key from value :return: a san...
keyword[def] identifier[_sanitize_string] ( identifier[unsanitized] , identifier[itemsep] , identifier[kvsep] ): literal[string] identifier[sanitized] =[] identifier[kvs] = identifier[unsanitized] . identifier[split] ( identifier[itemsep] ) keyword[for] identifier[kv] keyword[in] identifier[kv...
def _sanitize_string(unsanitized, itemsep, kvsep): """ sanitizes a string that contains multiple key/value items :param unsanitized: the unsanitized string :param itemsep: string that separates items :param kvsep: string that separates key from value :return: a sanitized string """ sanit...
def _merge_doc(original, to_merge): # type: (str, str) -> str """Merge two usage strings together. Args: original: The source of headers and initial section lines. to_merge: The source for the additional section lines to append. Returns: A new usage string that contains informa...
def function[_merge_doc, parameter[original, to_merge]]: constant[Merge two usage strings together. Args: original: The source of headers and initial section lines. to_merge: The source for the additional section lines to append. Returns: A new usage string that contains inform...
keyword[def] identifier[_merge_doc] ( identifier[original] , identifier[to_merge] ): literal[string] keyword[if] keyword[not] identifier[original] : keyword[return] identifier[to_merge] keyword[or] literal[string] keyword[if] keyword[not] identifier[to_merge] : keyword[retur...
def _merge_doc(original, to_merge): # type: (str, str) -> str 'Merge two usage strings together.\n\n Args:\n original: The source of headers and initial section lines.\n to_merge: The source for the additional section lines to append.\n\n Returns:\n A new usage string that contains in...
def comment_issue(self, issue_id, body): """ Comment to an issue. :param issue_id: the id of the comment :param body: the comment body :return: """ request_url = "{}issue/{}/comment".format(self.create_basic_url(), ...
def function[comment_issue, parameter[self, issue_id, body]]: constant[ Comment to an issue. :param issue_id: the id of the comment :param body: the comment body :return: ] variable[request_url] assign[=] call[constant[{}issue/{}/comment].format, parameter[call[na...
keyword[def] identifier[comment_issue] ( identifier[self] , identifier[issue_id] , identifier[body] ): literal[string] identifier[request_url] = literal[string] . identifier[format] ( identifier[self] . identifier[create_basic_url] (), identifier[issue_id] ) identifier[payload] =...
def comment_issue(self, issue_id, body): """ Comment to an issue. :param issue_id: the id of the comment :param body: the comment body :return: """ request_url = '{}issue/{}/comment'.format(self.create_basic_url(), issue_id) payload = {'comment': body} return_valu...
def kick(self, channel, nick, message=None): """Attempt to kick a user from a channel. If a message is not provided, defaults to own nick. """ self.send("KICK", channel, nick, ":%s" % (message or self.user.nick))
def function[kick, parameter[self, channel, nick, message]]: constant[Attempt to kick a user from a channel. If a message is not provided, defaults to own nick. ] call[name[self].send, parameter[constant[KICK], name[channel], name[nick], binary_operation[constant[:%s] <ast.Mod object at...
keyword[def] identifier[kick] ( identifier[self] , identifier[channel] , identifier[nick] , identifier[message] = keyword[None] ): literal[string] identifier[self] . identifier[send] ( literal[string] , identifier[channel] , identifier[nick] , literal[string] %( identifier[message] keyword[or] id...
def kick(self, channel, nick, message=None): """Attempt to kick a user from a channel. If a message is not provided, defaults to own nick. """ self.send('KICK', channel, nick, ':%s' % (message or self.user.nick))
def create_event_object(self, event_type, code, value, timeval=None): """Create an evdev style structure.""" if not timeval: self.update_timeval() timeval = self.timeva...
def function[create_event_object, parameter[self, event_type, code, value, timeval]]: constant[Create an evdev style structure.] if <ast.UnaryOp object at 0x7da18ede6230> begin[:] call[name[self].update_timeval, parameter[]] variable[timeval] assign[=] name[self].timeval ...
keyword[def] identifier[create_event_object] ( identifier[self] , identifier[event_type] , identifier[code] , identifier[value] , identifier[timeval] = keyword[None] ): literal[string] keyword[if] keyword[not] identifier[timeval] : identifier[self] . identifier[update_timeval] ()...
def create_event_object(self, event_type, code, value, timeval=None): """Create an evdev style structure.""" if not timeval: self.update_timeval() timeval = self.timeval # depends on [control=['if'], data=[]] try: event_code = self.type_codes[event_type] # depends on [control=['try...
def queryset_iterator(queryset, chunksize=1000): """ The queryset iterator helps to keep the memory consumption down. And also making it easier to process for weaker computers. """ if queryset.exists(): primary_key = 0 last_pk = queryset.order_by('-pk')[0].pk queryset = query...
def function[queryset_iterator, parameter[queryset, chunksize]]: constant[ The queryset iterator helps to keep the memory consumption down. And also making it easier to process for weaker computers. ] if call[name[queryset].exists, parameter[]] begin[:] variable[primary_key] ...
keyword[def] identifier[queryset_iterator] ( identifier[queryset] , identifier[chunksize] = literal[int] ): literal[string] keyword[if] identifier[queryset] . identifier[exists] (): identifier[primary_key] = literal[int] identifier[last_pk] = identifier[queryset] . identifier[order_by] ...
def queryset_iterator(queryset, chunksize=1000): """ The queryset iterator helps to keep the memory consumption down. And also making it easier to process for weaker computers. """ if queryset.exists(): primary_key = 0 last_pk = queryset.order_by('-pk')[0].pk queryset = query...
def encode_params(self, data=None, **kwargs): """ Build the body for a text/plain request. Will successfully encode parameters when passed as a dict or a list of 2-tuples. Order is retained if data is a list of 2-tuples but arbitrary if parameters are supplied as a dict. ...
def function[encode_params, parameter[self, data]]: constant[ Build the body for a text/plain request. Will successfully encode parameters when passed as a dict or a list of 2-tuples. Order is retained if data is a list of 2-tuples but arbitrary if parameters are supplied as a di...
keyword[def] identifier[encode_params] ( identifier[self] , identifier[data] = keyword[None] ,** identifier[kwargs] ): literal[string] identifier[charset] = identifier[kwargs] . identifier[get] ( literal[string] , identifier[self] . identifier[charset] ) identifier[collection_format] = ide...
def encode_params(self, data=None, **kwargs): """ Build the body for a text/plain request. Will successfully encode parameters when passed as a dict or a list of 2-tuples. Order is retained if data is a list of 2-tuples but arbitrary if parameters are supplied as a dict. """ ...
def from_pandas(cls, df): """Create baloo DataFrame from pandas DataFrame. Parameters ---------- df : pandas.frame.DataFrame Returns ------- DataFrame """ from pandas import DataFrame as PandasDataFrame, Index as PandasIndex, MultiIndex as Panda...
def function[from_pandas, parameter[cls, df]]: constant[Create baloo DataFrame from pandas DataFrame. Parameters ---------- df : pandas.frame.DataFrame Returns ------- DataFrame ] from relative_module[pandas] import module[DataFrame], module[Index],...
keyword[def] identifier[from_pandas] ( identifier[cls] , identifier[df] ): literal[string] keyword[from] identifier[pandas] keyword[import] identifier[DataFrame] keyword[as] identifier[PandasDataFrame] , identifier[Index] keyword[as] identifier[PandasIndex] , identifier[MultiIndex] keyword[...
def from_pandas(cls, df): """Create baloo DataFrame from pandas DataFrame. Parameters ---------- df : pandas.frame.DataFrame Returns ------- DataFrame """ from pandas import DataFrame as PandasDataFrame, Index as PandasIndex, MultiIndex as PandasMultiIn...
def check_token(self, user, token): """ Check that a password reset token is correct for a given user. """ # Parse the token try: ts_b36, hash = token.split("-") except ValueError: return False try: ts = base36_to_int(ts_b36) ...
def function[check_token, parameter[self, user, token]]: constant[ Check that a password reset token is correct for a given user. ] <ast.Try object at 0x7da20c6c7790> <ast.Try object at 0x7da20c6c75b0> if <ast.UnaryOp object at 0x7da20c6c4d60> begin[:] return[constant[Fal...
keyword[def] identifier[check_token] ( identifier[self] , identifier[user] , identifier[token] ): literal[string] keyword[try] : identifier[ts_b36] , identifier[hash] = identifier[token] . identifier[split] ( literal[string] ) keyword[except] identifier[ValueError] :...
def check_token(self, user, token): """ Check that a password reset token is correct for a given user. """ # Parse the token try: (ts_b36, hash) = token.split('-') # depends on [control=['try'], data=[]] except ValueError: return False # depends on [control=['except'], ...
def feed_forward_layers(inputs, outputs, connections): """ Collect the layers whose members can be evaluated in parallel in a feed-forward network. :param inputs: list of the network input nodes :param outputs: list of the output node identifiers :param connections: list of (input, output) connectio...
def function[feed_forward_layers, parameter[inputs, outputs, connections]]: constant[ Collect the layers whose members can be evaluated in parallel in a feed-forward network. :param inputs: list of the network input nodes :param outputs: list of the output node identifiers :param connections: li...
keyword[def] identifier[feed_forward_layers] ( identifier[inputs] , identifier[outputs] , identifier[connections] ): literal[string] identifier[required] = identifier[required_for_output] ( identifier[inputs] , identifier[outputs] , identifier[connections] ) identifier[layers] =[] identifier[s]...
def feed_forward_layers(inputs, outputs, connections): """ Collect the layers whose members can be evaluated in parallel in a feed-forward network. :param inputs: list of the network input nodes :param outputs: list of the output node identifiers :param connections: list of (input, output) connectio...
def handle_json_GET_routes(self, params): """Return a list of all routes.""" schedule = self.server.schedule result = [] for r in schedule.GetRouteList(): result.append( (r.route_id, r.route_short_name, r.route_long_name) ) result.sort(key = lambda x: x[1:3]) return result
def function[handle_json_GET_routes, parameter[self, params]]: constant[Return a list of all routes.] variable[schedule] assign[=] name[self].server.schedule variable[result] assign[=] list[[]] for taget[name[r]] in starred[call[name[schedule].GetRouteList, parameter[]]] begin[:] ...
keyword[def] identifier[handle_json_GET_routes] ( identifier[self] , identifier[params] ): literal[string] identifier[schedule] = identifier[self] . identifier[server] . identifier[schedule] identifier[result] =[] keyword[for] identifier[r] keyword[in] identifier[schedule] . identifier[GetRou...
def handle_json_GET_routes(self, params): """Return a list of all routes.""" schedule = self.server.schedule result = [] for r in schedule.GetRouteList(): result.append((r.route_id, r.route_short_name, r.route_long_name)) # depends on [control=['for'], data=['r']] result.sort(key=lambda x: ...
def _gsa_force(grav, mass_i, mass_j, position_i, position_j): """Gives the force of solution j on solution i. Variable name in GSA paper given in () args: grav: The gravitational constant. (G) mass_i: The mass of solution i (derived from fitness). (M_i) mass_j: The mass of solution...
def function[_gsa_force, parameter[grav, mass_i, mass_j, position_i, position_j]]: constant[Gives the force of solution j on solution i. Variable name in GSA paper given in () args: grav: The gravitational constant. (G) mass_i: The mass of solution i (derived from fitness). (M_i) ...
keyword[def] identifier[_gsa_force] ( identifier[grav] , identifier[mass_i] , identifier[mass_j] , identifier[position_i] , identifier[position_j] ): literal[string] identifier[position_diff] = identifier[numpy] . identifier[subtract] ( identifier[position_j] , identifier[position_i] ) identifier[dis...
def _gsa_force(grav, mass_i, mass_j, position_i, position_j): """Gives the force of solution j on solution i. Variable name in GSA paper given in () args: grav: The gravitational constant. (G) mass_i: The mass of solution i (derived from fitness). (M_i) mass_j: The mass of solution...
def K(self): """Normalizing constant for wishart CDF.""" K1 = np.float_power(pi, 0.5 * self.n_min * self.n_min) K1 /= ( np.float_power(2, 0.5 * self.n_min * self._n_max) * self._mgamma(0.5 * self._n_max, self.n_min) * self._mgamma(0.5 * self.n_min, self.n_min)...
def function[K, parameter[self]]: constant[Normalizing constant for wishart CDF.] variable[K1] assign[=] call[name[np].float_power, parameter[name[pi], binary_operation[binary_operation[constant[0.5] * name[self].n_min] * name[self].n_min]]] <ast.AugAssign object at 0x7da20c6e4370> variable[...
keyword[def] identifier[K] ( identifier[self] ): literal[string] identifier[K1] = identifier[np] . identifier[float_power] ( identifier[pi] , literal[int] * identifier[self] . identifier[n_min] * identifier[self] . identifier[n_min] ) identifier[K1] /=( identifier[np] . identifier...
def K(self): """Normalizing constant for wishart CDF.""" K1 = np.float_power(pi, 0.5 * self.n_min * self.n_min) K1 /= np.float_power(2, 0.5 * self.n_min * self._n_max) * self._mgamma(0.5 * self._n_max, self.n_min) * self._mgamma(0.5 * self.n_min, self.n_min) K2 = np.float_power(2, self.alpha * self.size...
def add_fast(self, filepath, hashfn=None, force=False): """ Bespoke function to add filepaths but set shortcircuit to True, which means only the first calculable hash will be stored. In this way only one "fast" hashing function need be called for each filepath. """ if has...
def function[add_fast, parameter[self, filepath, hashfn, force]]: constant[ Bespoke function to add filepaths but set shortcircuit to True, which means only the first calculable hash will be stored. In this way only one "fast" hashing function need be called for each filepath. ] ...
keyword[def] identifier[add_fast] ( identifier[self] , identifier[filepath] , identifier[hashfn] = keyword[None] , identifier[force] = keyword[False] ): literal[string] keyword[if] identifier[hashfn] keyword[is] keyword[None] : identifier[hashfn] = identifier[fast_hashes] ...
def add_fast(self, filepath, hashfn=None, force=False): """ Bespoke function to add filepaths but set shortcircuit to True, which means only the first calculable hash will be stored. In this way only one "fast" hashing function need be called for each filepath. """ if hashfn is N...
def print_serial_number_info(self, serial_number, print_to_screen=True): """Print information about the run. Args: serial_number: serial number. print_to_screen: runs the print statement if True, returns txt if not. Returns: txt if print_to_s...
def function[print_serial_number_info, parameter[self, serial_number, print_to_screen]]: constant[Print information about the run. Args: serial_number: serial number. print_to_screen: runs the print statement if True, returns txt if not. Returns: ...
keyword[def] identifier[print_serial_number_info] ( identifier[self] , identifier[serial_number] , identifier[print_to_screen] = keyword[True] ): literal[string] identifier[r] = identifier[self] . identifier[select_serial_number_row] ( identifier[serial_number] ) keyword[if] identifier[r]...
def print_serial_number_info(self, serial_number, print_to_screen=True): """Print information about the run. Args: serial_number: serial number. print_to_screen: runs the print statement if True, returns txt if not. Returns: txt if print_to_scree...
def serialize(self): """Convert the parameter into a dictionary. :return: The parameter dictionary. :rtype: dict """ pickle = super(ResourceParameter, self).serialize() pickle['frequency'] = self.frequency pickle['unit'] = self._unit.serialize() return pi...
def function[serialize, parameter[self]]: constant[Convert the parameter into a dictionary. :return: The parameter dictionary. :rtype: dict ] variable[pickle] assign[=] call[call[name[super], parameter[name[ResourceParameter], name[self]]].serialize, parameter[]] call[na...
keyword[def] identifier[serialize] ( identifier[self] ): literal[string] identifier[pickle] = identifier[super] ( identifier[ResourceParameter] , identifier[self] ). identifier[serialize] () identifier[pickle] [ literal[string] ]= identifier[self] . identifier[frequency] identifi...
def serialize(self): """Convert the parameter into a dictionary. :return: The parameter dictionary. :rtype: dict """ pickle = super(ResourceParameter, self).serialize() pickle['frequency'] = self.frequency pickle['unit'] = self._unit.serialize() return pickle
def execute(self, *args, **options): """ Overriden in order to send emails on unhandled exception. If an unhandled exception in ``def handle(self, *args, **options)`` occurs and `--email-exception` is set or `self.email_exception` is set to True send an email to ADMINS with the ...
def function[execute, parameter[self]]: constant[ Overriden in order to send emails on unhandled exception. If an unhandled exception in ``def handle(self, *args, **options)`` occurs and `--email-exception` is set or `self.email_exception` is set to True send an email to ADMINS ...
keyword[def] identifier[execute] ( identifier[self] ,* identifier[args] ,** identifier[options] ): literal[string] keyword[try] : identifier[super] ( identifier[EmailNotificationCommand] , identifier[self] ). identifier[execute] (* identifier[args] ,** identifier[options] ) ke...
def execute(self, *args, **options): """ Overriden in order to send emails on unhandled exception. If an unhandled exception in ``def handle(self, *args, **options)`` occurs and `--email-exception` is set or `self.email_exception` is set to True send an email to ADMINS with the trac...
def tuple_roll(self, count=0): '''One or more die rolls. :param count: [0] Return list of ``count`` rolls :return: (face, value) of roll or list of same ''' if count: return [self._faces[random.randint(1, self._sides) - 1] for i in range(count)] else: ...
def function[tuple_roll, parameter[self, count]]: constant[One or more die rolls. :param count: [0] Return list of ``count`` rolls :return: (face, value) of roll or list of same ] if name[count] begin[:] return[<ast.ListComp object at 0x7da2045654e0>]
keyword[def] identifier[tuple_roll] ( identifier[self] , identifier[count] = literal[int] ): literal[string] keyword[if] identifier[count] : keyword[return] [ identifier[self] . identifier[_faces] [ identifier[random] . identifier[randint] ( literal[int] , identifier[self] . identifie...
def tuple_roll(self, count=0): """One or more die rolls. :param count: [0] Return list of ``count`` rolls :return: (face, value) of roll or list of same """ if count: return [self._faces[random.randint(1, self._sides) - 1] for i in range(count)] # depends on [control=['if'], dat...
def get_urls(session, name, data, find_changelogs_fn, **kwargs): """ Gets URLs to changelogs. :param session: requests Session instance :param name: str, package name :param data: dict, meta data :param find_changelogs_fn: function, find_changelogs :return: tuple, (set(changelog URLs), set(r...
def function[get_urls, parameter[session, name, data, find_changelogs_fn]]: constant[ Gets URLs to changelogs. :param session: requests Session instance :param name: str, package name :param data: dict, meta data :param find_changelogs_fn: function, find_changelogs :return: tuple, (set(c...
keyword[def] identifier[get_urls] ( identifier[session] , identifier[name] , identifier[data] , identifier[find_changelogs_fn] ,** identifier[kwargs] ): literal[string] identifier[map] = identifier[get_url_map] () keyword[if] identifier[name] . identifier[lower] (). identifier[replace] ( literal...
def get_urls(session, name, data, find_changelogs_fn, **kwargs): """ Gets URLs to changelogs. :param session: requests Session instance :param name: str, package name :param data: dict, meta data :param find_changelogs_fn: function, find_changelogs :return: tuple, (set(changelog URLs), set(r...
def full_clean(self, exclude, validate_unique=False): """ Validate node, on error raising ValidationErrors which can be handled by django forms :param exclude: :param validate_unique: Check if conflicting node exists in the labels indexes :return: """ # validate...
def function[full_clean, parameter[self, exclude, validate_unique]]: constant[ Validate node, on error raising ValidationErrors which can be handled by django forms :param exclude: :param validate_unique: Check if conflicting node exists in the labels indexes :return: ] ...
keyword[def] identifier[full_clean] ( identifier[self] , identifier[exclude] , identifier[validate_unique] = keyword[False] ): literal[string] keyword[try] : identifier[self] . identifier[deflate] ( identifier[self] . identifier[__properties__] , identifier[self] ) k...
def full_clean(self, exclude, validate_unique=False): """ Validate node, on error raising ValidationErrors which can be handled by django forms :param exclude: :param validate_unique: Check if conflicting node exists in the labels indexes :return: """ # validate against ...
def get_children(self): """Cache superclass result""" key = self.CHILDREN_KEY % self.pk #children = cache.get(key, None) # if children is None: children = super(Page, self).get_children() #cache.set(key, children) return children
def function[get_children, parameter[self]]: constant[Cache superclass result] variable[key] assign[=] binary_operation[name[self].CHILDREN_KEY <ast.Mod object at 0x7da2590d6920> name[self].pk] variable[children] assign[=] call[call[name[super], parameter[name[Page], name[self]]].get_children, p...
keyword[def] identifier[get_children] ( identifier[self] ): literal[string] identifier[key] = identifier[self] . identifier[CHILDREN_KEY] % identifier[self] . identifier[pk] identifier[children] = identifier[super] ( identifier[Page] , identifier[self] ). identifier[get_...
def get_children(self): """Cache superclass result""" key = self.CHILDREN_KEY % self.pk #children = cache.get(key, None) # if children is None: children = super(Page, self).get_children() #cache.set(key, children) return children
def get_mounts_by_path(): ''' Gets all mounted devices and paths :return: dict of mounted devices and related information by path ''' mount_info = [] f = open('/proc/mounts', 'r') for line in f: _tmp = line.split(" ") mount_info.append({'path': _tmp[1], ...
def function[get_mounts_by_path, parameter[]]: constant[ Gets all mounted devices and paths :return: dict of mounted devices and related information by path ] variable[mount_info] assign[=] list[[]] variable[f] assign[=] call[name[open], parameter[constant[/proc/mounts], constant[r]]...
keyword[def] identifier[get_mounts_by_path] (): literal[string] identifier[mount_info] =[] identifier[f] = identifier[open] ( literal[string] , literal[string] ) keyword[for] identifier[line] keyword[in] identifier[f] : identifier[_tmp] = identifier[line] . identifier[split] ( literal...
def get_mounts_by_path(): """ Gets all mounted devices and paths :return: dict of mounted devices and related information by path """ mount_info = [] f = open('/proc/mounts', 'r') for line in f: _tmp = line.split(' ') mount_info.append({'path': _tmp[1], 'device': _tmp[0], 'ty...
def _get_env_vars_value(filename): """ If the user provided a file containing values of environment variables, this method will read the file and return its value :param string filename: Path to file containing environment variable values :return dict: Value of environment varia...
def function[_get_env_vars_value, parameter[filename]]: constant[ If the user provided a file containing values of environment variables, this method will read the file and return its value :param string filename: Path to file containing environment variable values :return dict:...
keyword[def] identifier[_get_env_vars_value] ( identifier[filename] ): literal[string] keyword[if] keyword[not] identifier[filename] : keyword[return] keyword[None] keyword[try] : keyword[with] identifier[open] ( identifier[filename] , literal[...
def _get_env_vars_value(filename): """ If the user provided a file containing values of environment variables, this method will read the file and return its value :param string filename: Path to file containing environment variable values :return dict: Value of environment variables...
def url_report(self, scan_url, apikey): """ Send URLS for list of past malicous associations """ url = self.base_url + "url/report" params = {"apikey": apikey, 'resource': scan_url} rate_limit_clear = self.rate_limit() if rate_limit_clear: response = r...
def function[url_report, parameter[self, scan_url, apikey]]: constant[ Send URLS for list of past malicous associations ] variable[url] assign[=] binary_operation[name[self].base_url + constant[url/report]] variable[params] assign[=] dictionary[[<ast.Constant object at 0x7da1b196...
keyword[def] identifier[url_report] ( identifier[self] , identifier[scan_url] , identifier[apikey] ): literal[string] identifier[url] = identifier[self] . identifier[base_url] + literal[string] identifier[params] ={ literal[string] : identifier[apikey] , literal[string] : identifier[scan_...
def url_report(self, scan_url, apikey): """ Send URLS for list of past malicous associations """ url = self.base_url + 'url/report' params = {'apikey': apikey, 'resource': scan_url} rate_limit_clear = self.rate_limit() if rate_limit_clear: response = requests.post(url, params...
def __AddEntryType(self, entry_type_name, entry_schema, parent_name): """Add a type for a list entry.""" entry_schema.pop('description', None) description = 'Single entry in a %s.' % parent_name schema = { 'id': entry_type_name, 'type': 'object', 'desc...
def function[__AddEntryType, parameter[self, entry_type_name, entry_schema, parent_name]]: constant[Add a type for a list entry.] call[name[entry_schema].pop, parameter[constant[description], constant[None]]] variable[description] assign[=] binary_operation[constant[Single entry in a %s.] <ast.M...
keyword[def] identifier[__AddEntryType] ( identifier[self] , identifier[entry_type_name] , identifier[entry_schema] , identifier[parent_name] ): literal[string] identifier[entry_schema] . identifier[pop] ( literal[string] , keyword[None] ) identifier[description] = literal[string] % identi...
def __AddEntryType(self, entry_type_name, entry_schema, parent_name): """Add a type for a list entry.""" entry_schema.pop('description', None) description = 'Single entry in a %s.' % parent_name schema = {'id': entry_type_name, 'type': 'object', 'description': description, 'properties': {'entry': {'type...
def addr(self): """ Get the concrete address of the instruction pointer, without triggering SimInspect breakpoints or generating SimActions. An integer is returned, or an exception is raised if the instruction pointer is symbolic. :return: an int """ ip = self.regs._ip ...
def function[addr, parameter[self]]: constant[ Get the concrete address of the instruction pointer, without triggering SimInspect breakpoints or generating SimActions. An integer is returned, or an exception is raised if the instruction pointer is symbolic. :return: an int ] ...
keyword[def] identifier[addr] ( identifier[self] ): literal[string] identifier[ip] = identifier[self] . identifier[regs] . identifier[_ip] keyword[if] identifier[isinstance] ( identifier[ip] , identifier[SootAddressDescriptor] ): keyword[return] identifier[ip] ke...
def addr(self): """ Get the concrete address of the instruction pointer, without triggering SimInspect breakpoints or generating SimActions. An integer is returned, or an exception is raised if the instruction pointer is symbolic. :return: an int """ ip = self.regs._ip if is...
def local_path_export(at_start=True, env_cmd=None): """Retrieve paths to local install, also including environment paths if env_cmd included. """ paths = [get_bcbio_bin()] if env_cmd: env_path = os.path.dirname(get_program_python(env_cmd)) if env_path not in paths: paths.inse...
def function[local_path_export, parameter[at_start, env_cmd]]: constant[Retrieve paths to local install, also including environment paths if env_cmd included. ] variable[paths] assign[=] list[[<ast.Call object at 0x7da1b18bedd0>]] if name[env_cmd] begin[:] variable[env_path] ...
keyword[def] identifier[local_path_export] ( identifier[at_start] = keyword[True] , identifier[env_cmd] = keyword[None] ): literal[string] identifier[paths] =[ identifier[get_bcbio_bin] ()] keyword[if] identifier[env_cmd] : identifier[env_path] = identifier[os] . identifier[path] . identifie...
def local_path_export(at_start=True, env_cmd=None): """Retrieve paths to local install, also including environment paths if env_cmd included. """ paths = [get_bcbio_bin()] if env_cmd: env_path = os.path.dirname(get_program_python(env_cmd)) if env_path not in paths: paths.inse...
def serialize( self, value, # type: Any state # type: _ProcessorState ): # type: (...) -> ET.Element """ Serialize the value into a new element object and return the element. If the omit_empty option was specified and the value is falsey, then t...
def function[serialize, parameter[self, value, state]]: constant[ Serialize the value into a new element object and return the element. If the omit_empty option was specified and the value is falsey, then this will return None. ] <ast.Tuple object at 0x7da1b25d34f0> assign[=] ca...
keyword[def] identifier[serialize] ( identifier[self] , identifier[value] , identifier[state] ): literal[string] identifier[start_element] , identifier[end_element] = identifier[_element_path_create_new] ( identifier[self] . identifier[element_path] ) identifier[self...
def serialize(self, value, state): # type: Any # type: _ProcessorState # type: (...) -> ET.Element '\n Serialize the value into a new element object and return the element.\n\n If the omit_empty option was specified and the value is falsey, then this will return None.\n ' # For pri...
def query_positions(self, accounts): """查询现金和持仓 Arguments: accounts {[type]} -- [description] Returns: dict-- {'cash_available':xxx,'hold_available':xxx} """ try: data = self.call("positions", {'client': accounts}) if data is not ...
def function[query_positions, parameter[self, accounts]]: constant[查询现金和持仓 Arguments: accounts {[type]} -- [description] Returns: dict-- {'cash_available':xxx,'hold_available':xxx} ] <ast.Try object at 0x7da1b2006ad0>
keyword[def] identifier[query_positions] ( identifier[self] , identifier[accounts] ): literal[string] keyword[try] : identifier[data] = identifier[self] . identifier[call] ( literal[string] ,{ literal[string] : identifier[accounts] }) keyword[if] identifier[data] keyword...
def query_positions(self, accounts): """查询现金和持仓 Arguments: accounts {[type]} -- [description] Returns: dict-- {'cash_available':xxx,'hold_available':xxx} """ try: data = self.call('positions', {'client': accounts}) if data is not None: ...
def _initialize_with_array(self, data, rowBased=True): """Set the matrix values from a two dimensional list.""" if rowBased: self.matrix = [] if len(data) != self._rows: raise ValueError("Size of Matrix does not match") for col in xrange(self._columns)...
def function[_initialize_with_array, parameter[self, data, rowBased]]: constant[Set the matrix values from a two dimensional list.] if name[rowBased] begin[:] name[self].matrix assign[=] list[[]] if compare[call[name[len], parameter[name[data]]] not_equal[!=] name[self]._...
keyword[def] identifier[_initialize_with_array] ( identifier[self] , identifier[data] , identifier[rowBased] = keyword[True] ): literal[string] keyword[if] identifier[rowBased] : identifier[self] . identifier[matrix] =[] keyword[if] identifier[len] ( identifier[data] )!=...
def _initialize_with_array(self, data, rowBased=True): """Set the matrix values from a two dimensional list.""" if rowBased: self.matrix = [] if len(data) != self._rows: raise ValueError('Size of Matrix does not match') # depends on [control=['if'], data=[]] for col in xrang...
def eqToEq2000(ra_deg, dec_deg, eq): """Convert Eq to Eq 2000.""" ra_rad = math.radians(ra_deg) dec_rad = math.radians(dec_deg) x = math.cos(dec_rad) * math.cos(ra_rad) y = math.cos(dec_rad) * math.sin(ra_rad) z = math.sin(dec_rad) p11, p12, p13, p21, p22, p23, p31, p32, p33 = trans_coeff(...
def function[eqToEq2000, parameter[ra_deg, dec_deg, eq]]: constant[Convert Eq to Eq 2000.] variable[ra_rad] assign[=] call[name[math].radians, parameter[name[ra_deg]]] variable[dec_rad] assign[=] call[name[math].radians, parameter[name[dec_deg]]] variable[x] assign[=] binary_operation[ca...
keyword[def] identifier[eqToEq2000] ( identifier[ra_deg] , identifier[dec_deg] , identifier[eq] ): literal[string] identifier[ra_rad] = identifier[math] . identifier[radians] ( identifier[ra_deg] ) identifier[dec_rad] = identifier[math] . identifier[radians] ( identifier[dec_deg] ) identifier[x]...
def eqToEq2000(ra_deg, dec_deg, eq): """Convert Eq to Eq 2000.""" ra_rad = math.radians(ra_deg) dec_rad = math.radians(dec_deg) x = math.cos(dec_rad) * math.cos(ra_rad) y = math.cos(dec_rad) * math.sin(ra_rad) z = math.sin(dec_rad) (p11, p12, p13, p21, p22, p23, p31, p32, p33) = trans_coeff(...
def expect_no_raises(message=None, extras=None): """Expects no exception is raised in a context. If the expectation is not met, the test is marked as fail after its execution finishes. A default message is added to the exception `details`. Args: message: string, custom message to add to e...
def function[expect_no_raises, parameter[message, extras]]: constant[Expects no exception is raised in a context. If the expectation is not met, the test is marked as fail after its execution finishes. A default message is added to the exception `details`. Args: message: string, custo...
keyword[def] identifier[expect_no_raises] ( identifier[message] = keyword[None] , identifier[extras] = keyword[None] ): literal[string] keyword[try] : keyword[yield] keyword[except] identifier[Exception] keyword[as] identifier[e] : identifier[e_record] = identifier[records] . ide...
def expect_no_raises(message=None, extras=None): """Expects no exception is raised in a context. If the expectation is not met, the test is marked as fail after its execution finishes. A default message is added to the exception `details`. Args: message: string, custom message to add to e...
def set_name(self, name): """ RETURN NEW FILE WITH GIVEN EXTENSION """ path = self._filename.split("/") parts = path[-1].split(".") if len(parts) == 1: path[-1] = name else: path[-1] = name + "." + parts[-1] return File("/".join(pat...
def function[set_name, parameter[self, name]]: constant[ RETURN NEW FILE WITH GIVEN EXTENSION ] variable[path] assign[=] call[name[self]._filename.split, parameter[constant[/]]] variable[parts] assign[=] call[call[name[path]][<ast.UnaryOp object at 0x7da18ede6350>].split, paramet...
keyword[def] identifier[set_name] ( identifier[self] , identifier[name] ): literal[string] identifier[path] = identifier[self] . identifier[_filename] . identifier[split] ( literal[string] ) identifier[parts] = identifier[path] [- literal[int] ]. identifier[split] ( literal[string] ) ...
def set_name(self, name): """ RETURN NEW FILE WITH GIVEN EXTENSION """ path = self._filename.split('/') parts = path[-1].split('.') if len(parts) == 1: path[-1] = name # depends on [control=['if'], data=[]] else: path[-1] = name + '.' + parts[-1] return File('/'....
def train_agent_real_env(env, learner, hparams, epoch): """Train the PPO agent in the real environment.""" base_algo_str = hparams.base_algo train_hparams = trainer_lib.create_hparams(hparams.base_algo_params) rl_utils.update_hparams_from_hparams( train_hparams, hparams, "real_" + base_algo_str + "_" )...
def function[train_agent_real_env, parameter[env, learner, hparams, epoch]]: constant[Train the PPO agent in the real environment.] variable[base_algo_str] assign[=] name[hparams].base_algo variable[train_hparams] assign[=] call[name[trainer_lib].create_hparams, parameter[name[hparams].base_algo...
keyword[def] identifier[train_agent_real_env] ( identifier[env] , identifier[learner] , identifier[hparams] , identifier[epoch] ): literal[string] identifier[base_algo_str] = identifier[hparams] . identifier[base_algo] identifier[train_hparams] = identifier[trainer_lib] . identifier[create_hparams] ( iden...
def train_agent_real_env(env, learner, hparams, epoch): """Train the PPO agent in the real environment.""" base_algo_str = hparams.base_algo train_hparams = trainer_lib.create_hparams(hparams.base_algo_params) rl_utils.update_hparams_from_hparams(train_hparams, hparams, 'real_' + base_algo_str + '_') ...
def visualize(G, settings, filename="dependencies", no_graphviz=False): """ Uses networkX to draw a graphviz dot file either (a) calls the graphviz command "dot" to turn it into a SVG and remove the dotfile (default), or (b) if no_graphviz is True, just output the graphviz dot file Args: ...
def function[visualize, parameter[G, settings, filename, no_graphviz]]: constant[ Uses networkX to draw a graphviz dot file either (a) calls the graphviz command "dot" to turn it into a SVG and remove the dotfile (default), or (b) if no_graphviz is True, just output the graphviz dot file Ar...
keyword[def] identifier[visualize] ( identifier[G] , identifier[settings] , identifier[filename] = literal[string] , identifier[no_graphviz] = keyword[False] ): literal[string] identifier[error] = identifier[settings] [ literal[string] ] keyword[if] identifier[no_graphviz] : identifier[write...
def visualize(G, settings, filename='dependencies', no_graphviz=False): """ Uses networkX to draw a graphviz dot file either (a) calls the graphviz command "dot" to turn it into a SVG and remove the dotfile (default), or (b) if no_graphviz is True, just output the graphviz dot file Args: ...
def _get_result_paths(self,data): """Return dict of {key: ResultPath} """ #clustalw .aln is used when no or unkown output type specified _treeinfo_formats = {'nj':'.nj', 'dist':'.dst', 'nexus':'.tre'} result = {} p...
def function[_get_result_paths, parameter[self, data]]: constant[Return dict of {key: ResultPath} ] variable[_treeinfo_formats] assign[=] dictionary[[<ast.Constant object at 0x7da1b0b725c0>, <ast.Constant object at 0x7da1b0b73be0>, <ast.Constant object at 0x7da1b0b721d0>], [<ast.Constant object ...
keyword[def] identifier[_get_result_paths] ( identifier[self] , identifier[data] ): literal[string] identifier[_treeinfo_formats] ={ literal[string] : literal[string] , literal[string] : literal[string] , literal[string] : literal[string] } identifier[result] =...
def _get_result_paths(self, data): """Return dict of {key: ResultPath} """ #clustalw .aln is used when no or unkown output type specified _treeinfo_formats = {'nj': '.nj', 'dist': '.dst', 'nexus': '.tre'} result = {} par = self.Parameters abs = self._absolute if par['-align'].isOn():...
def merkleroot(merkletree: 'MerkleTreeState') -> Locksroot: """ Return the root element of the merkle tree. """ assert merkletree.layers, 'the merkle tree layers are empty' assert merkletree.layers[MERKLEROOT], 'the root layer is empty' return Locksroot(merkletree.layers[MERKLEROOT][0])
def function[merkleroot, parameter[merkletree]]: constant[ Return the root element of the merkle tree. ] assert[name[merkletree].layers] assert[call[name[merkletree].layers][name[MERKLEROOT]]] return[call[name[Locksroot], parameter[call[call[name[merkletree].layers][name[MERKLEROOT]]][constant[0]]]]...
keyword[def] identifier[merkleroot] ( identifier[merkletree] : literal[string] )-> identifier[Locksroot] : literal[string] keyword[assert] identifier[merkletree] . identifier[layers] , literal[string] keyword[assert] identifier[merkletree] . identifier[layers] [ identifier[MERKLEROOT] ], literal[st...
def merkleroot(merkletree: 'MerkleTreeState') -> Locksroot: """ Return the root element of the merkle tree. """ assert merkletree.layers, 'the merkle tree layers are empty' assert merkletree.layers[MERKLEROOT], 'the root layer is empty' return Locksroot(merkletree.layers[MERKLEROOT][0])
def get(self, url, parameters=None): """ Implement libgreader's interface for authenticated GET request """ if self._http == None: self._setupHttp() uri = url + "?" + self.getParameters(parameters) response, content = self._http.request(uri, "GET") ret...
def function[get, parameter[self, url, parameters]]: constant[ Implement libgreader's interface for authenticated GET request ] if compare[name[self]._http equal[==] constant[None]] begin[:] call[name[self]._setupHttp, parameter[]] variable[uri] assign[=] binary_o...
keyword[def] identifier[get] ( identifier[self] , identifier[url] , identifier[parameters] = keyword[None] ): literal[string] keyword[if] identifier[self] . identifier[_http] == keyword[None] : identifier[self] . identifier[_setupHttp] () identifier[uri] = identifier[url] + l...
def get(self, url, parameters=None): """ Implement libgreader's interface for authenticated GET request """ if self._http == None: self._setupHttp() # depends on [control=['if'], data=[]] uri = url + '?' + self.getParameters(parameters) (response, content) = self._http.request(u...
def set_repo_permission(self, repo, permission): """ :calls: `PUT /teams/:id/repos/:org/:repo <http://developer.github.com/v3/orgs/teams>`_ :param repo: :class:`github.Repository.Repository` :param permission: string :rtype: None """ assert isinstance(repo, github...
def function[set_repo_permission, parameter[self, repo, permission]]: constant[ :calls: `PUT /teams/:id/repos/:org/:repo <http://developer.github.com/v3/orgs/teams>`_ :param repo: :class:`github.Repository.Repository` :param permission: string :rtype: None ] assert[ca...
keyword[def] identifier[set_repo_permission] ( identifier[self] , identifier[repo] , identifier[permission] ): literal[string] keyword[assert] identifier[isinstance] ( identifier[repo] , identifier[github] . identifier[Repository] . identifier[Repository] ), identifier[repo] identifier[p...
def set_repo_permission(self, repo, permission): """ :calls: `PUT /teams/:id/repos/:org/:repo <http://developer.github.com/v3/orgs/teams>`_ :param repo: :class:`github.Repository.Repository` :param permission: string :rtype: None """ assert isinstance(repo, github.Reposit...
def get_readlock(pid, path): """Obtain a readlock on a file. Parameters ---------- path : str Name of the file on which to obtain a readlock """ timestamp = int(time.time() * 1e6) lockdir_name = "%s.readlock.%i.%i" % (path, pid, timestamp) os.mkdir(lockdir_name) # Register...
def function[get_readlock, parameter[pid, path]]: constant[Obtain a readlock on a file. Parameters ---------- path : str Name of the file on which to obtain a readlock ] variable[timestamp] assign[=] call[name[int], parameter[binary_operation[call[name[time].time, parameter[]] ...
keyword[def] identifier[get_readlock] ( identifier[pid] , identifier[path] ): literal[string] identifier[timestamp] = identifier[int] ( identifier[time] . identifier[time] ()* literal[int] ) identifier[lockdir_name] = literal[string] %( identifier[path] , identifier[pid] , identifier[timestamp] ) ...
def get_readlock(pid, path): """Obtain a readlock on a file. Parameters ---------- path : str Name of the file on which to obtain a readlock """ timestamp = int(time.time() * 1000000.0) lockdir_name = '%s.readlock.%i.%i' % (path, pid, timestamp) os.mkdir(lockdir_name) # Reg...
def calledWith(self, *args, **kwargs): #pylint: disable=invalid-name """ Determining whether args/kwargs are called previously Eg. f(1, 2, 3) spy.calledWith(1, 2) will return True, because they are called partially f(a=1, b=2, c=3) spy.calledWith(a...
def function[calledWith, parameter[self]]: constant[ Determining whether args/kwargs are called previously Eg. f(1, 2, 3) spy.calledWith(1, 2) will return True, because they are called partially f(a=1, b=2, c=3) spy.calledWith(a=1, b=3) will return...
keyword[def] identifier[calledWith] ( identifier[self] ,* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[self] . identifier[__get_func] = identifier[SinonSpy] . identifier[__get_directly] keyword[return] identifier[self] . identifier[calledWithMatch] (* identifier[...
def calledWith(self, *args, **kwargs): #pylint: disable=invalid-name '\n Determining whether args/kwargs are called previously\n Eg.\n f(1, 2, 3)\n spy.calledWith(1, 2) will return True, because they are called partially\n f(a=1, b=2, c=3)\n spy.calledWith(...
def clear_not_launched_queued_tasks(self, session=None): """ If the airflow scheduler restarts with pending "Queued" tasks, the tasks may or may not have been launched Thus, on starting up the scheduler let's check every "Queued" task to see if it has been launched (ie: i...
def function[clear_not_launched_queued_tasks, parameter[self, session]]: constant[ If the airflow scheduler restarts with pending "Queued" tasks, the tasks may or may not have been launched Thus, on starting up the scheduler let's check every "Queued" task to see if it ha...
keyword[def] identifier[clear_not_launched_queued_tasks] ( identifier[self] , identifier[session] = keyword[None] ): literal[string] identifier[queued_tasks] = identifier[session] . identifier[query] ( identifier[TaskInstance] ). identifier[filter] ( identifier[TaskInstance] . identifier[state] == ...
def clear_not_launched_queued_tasks(self, session=None): """ If the airflow scheduler restarts with pending "Queued" tasks, the tasks may or may not have been launched Thus, on starting up the scheduler let's check every "Queued" task to see if it has been launched (ie: if th...
def chk_module_statements(ctx, module_stmt, canonical=False): """Validate the statement hierarchy according to the grammar. Return True if module is valid, False otherwise. """ return chk_statement(ctx, module_stmt, top_stmts, canonical)
def function[chk_module_statements, parameter[ctx, module_stmt, canonical]]: constant[Validate the statement hierarchy according to the grammar. Return True if module is valid, False otherwise. ] return[call[name[chk_statement], parameter[name[ctx], name[module_stmt], name[top_stmts], name[canonica...
keyword[def] identifier[chk_module_statements] ( identifier[ctx] , identifier[module_stmt] , identifier[canonical] = keyword[False] ): literal[string] keyword[return] identifier[chk_statement] ( identifier[ctx] , identifier[module_stmt] , identifier[top_stmts] , identifier[canonical] )
def chk_module_statements(ctx, module_stmt, canonical=False): """Validate the statement hierarchy according to the grammar. Return True if module is valid, False otherwise. """ return chk_statement(ctx, module_stmt, top_stmts, canonical)
def app_list(**kwargs): """ Show uploaded applications. """ ctx = Context(**kwargs) ctx.execute_action('app:list', **{ 'storage': ctx.repo.create_secure_service('storage'), })
def function[app_list, parameter[]]: constant[ Show uploaded applications. ] variable[ctx] assign[=] call[name[Context], parameter[]] call[name[ctx].execute_action, parameter[constant[app:list]]]
keyword[def] identifier[app_list] (** identifier[kwargs] ): literal[string] identifier[ctx] = identifier[Context] (** identifier[kwargs] ) identifier[ctx] . identifier[execute_action] ( literal[string] ,**{ literal[string] : identifier[ctx] . identifier[repo] . identifier[create_secure_service] (...
def app_list(**kwargs): """ Show uploaded applications. """ ctx = Context(**kwargs) ctx.execute_action('app:list', **{'storage': ctx.repo.create_secure_service('storage')})
def _find_statement_by_line(node, line): """Extracts the statement on a specific line from an AST. If the line number of node matches line, it will be returned; otherwise its children are iterated and the function is called recursively. :param node: An astroid node. :type node: astroid.bases.N...
def function[_find_statement_by_line, parameter[node, line]]: constant[Extracts the statement on a specific line from an AST. If the line number of node matches line, it will be returned; otherwise its children are iterated and the function is called recursively. :param node: An astroid node. ...
keyword[def] identifier[_find_statement_by_line] ( identifier[node] , identifier[line] ): literal[string] keyword[if] identifier[isinstance] ( identifier[node] ,( identifier[nodes] . identifier[ClassDef] , identifier[nodes] . identifier[FunctionDef] )): identifier[node_line] =...
def _find_statement_by_line(node, line): """Extracts the statement on a specific line from an AST. If the line number of node matches line, it will be returned; otherwise its children are iterated and the function is called recursively. :param node: An astroid node. :type node: astroid.bases.N...
def random_val(index, tune_params): """return a random value for a parameter""" key = list(tune_params.keys())[index] return random.choice(tune_params[key])
def function[random_val, parameter[index, tune_params]]: constant[return a random value for a parameter] variable[key] assign[=] call[call[name[list], parameter[call[name[tune_params].keys, parameter[]]]]][name[index]] return[call[name[random].choice, parameter[call[name[tune_params]][name[key]]]]]
keyword[def] identifier[random_val] ( identifier[index] , identifier[tune_params] ): literal[string] identifier[key] = identifier[list] ( identifier[tune_params] . identifier[keys] ())[ identifier[index] ] keyword[return] identifier[random] . identifier[choice] ( identifier[tune_params] [ identifier[...
def random_val(index, tune_params): """return a random value for a parameter""" key = list(tune_params.keys())[index] return random.choice(tune_params[key])
def subontology(self, minimal=False): """ Generates a sub-ontology based on associations """ return self.ontology.subontology(self.objects, minimal=minimal)
def function[subontology, parameter[self, minimal]]: constant[ Generates a sub-ontology based on associations ] return[call[name[self].ontology.subontology, parameter[name[self].objects]]]
keyword[def] identifier[subontology] ( identifier[self] , identifier[minimal] = keyword[False] ): literal[string] keyword[return] identifier[self] . identifier[ontology] . identifier[subontology] ( identifier[self] . identifier[objects] , identifier[minimal] = identifier[minimal] )
def subontology(self, minimal=False): """ Generates a sub-ontology based on associations """ return self.ontology.subontology(self.objects, minimal=minimal)
def concat_sheets(xl_path: str, sheetnames=None, add_tab_names=False): """ Return a pandas DataFrame with the concat'ed content of the `sheetnames` from the Excel file in `xl_path`. Parameters ---------- xl_path: str Path to the Excel file sheetnames: list of str List of ex...
def function[concat_sheets, parameter[xl_path, sheetnames, add_tab_names]]: constant[ Return a pandas DataFrame with the concat'ed content of the `sheetnames` from the Excel file in `xl_path`. Parameters ---------- xl_path: str Path to the Excel file sheetnames: list of str ...
keyword[def] identifier[concat_sheets] ( identifier[xl_path] : identifier[str] , identifier[sheetnames] = keyword[None] , identifier[add_tab_names] = keyword[False] ): literal[string] identifier[xl_path] , identifier[choice] = identifier[_check_xl_path] ( identifier[xl_path] ) keyword[if] identifier...
def concat_sheets(xl_path: str, sheetnames=None, add_tab_names=False): """ Return a pandas DataFrame with the concat'ed content of the `sheetnames` from the Excel file in `xl_path`. Parameters ---------- xl_path: str Path to the Excel file sheetnames: list of str List of ex...
def create_source(self, datapusher=True): """ Populate ckan directory from preloaded image and copy who.ini and schema.xml info conf directory """ task.create_source(self.target, self._preload_image(), datapusher)
def function[create_source, parameter[self, datapusher]]: constant[ Populate ckan directory from preloaded image and copy who.ini and schema.xml info conf directory ] call[name[task].create_source, parameter[name[self].target, call[name[self]._preload_image, parameter[]], name[da...
keyword[def] identifier[create_source] ( identifier[self] , identifier[datapusher] = keyword[True] ): literal[string] identifier[task] . identifier[create_source] ( identifier[self] . identifier[target] , identifier[self] . identifier[_preload_image] (), identifier[datapusher] )
def create_source(self, datapusher=True): """ Populate ckan directory from preloaded image and copy who.ini and schema.xml info conf directory """ task.create_source(self.target, self._preload_image(), datapusher)
def convert_simple_rnn(builder, layer, input_names, output_names, keras_layer): """Convert an SimpleRNN layer from keras to coreml. Parameters ---------- keras_layer: layer A keras layer object. builder: NeuralNetworkBuilder A neural network builder object. """ # Get input ...
def function[convert_simple_rnn, parameter[builder, layer, input_names, output_names, keras_layer]]: constant[Convert an SimpleRNN layer from keras to coreml. Parameters ---------- keras_layer: layer A keras layer object. builder: NeuralNetworkBuilder A neural network builder o...
keyword[def] identifier[convert_simple_rnn] ( identifier[builder] , identifier[layer] , identifier[input_names] , identifier[output_names] , identifier[keras_layer] ): literal[string] identifier[hidden_size] = identifier[keras_layer] . identifier[output_dim] identifier[input_size] = identifier[k...
def convert_simple_rnn(builder, layer, input_names, output_names, keras_layer): """Convert an SimpleRNN layer from keras to coreml. Parameters ---------- keras_layer: layer A keras layer object. builder: NeuralNetworkBuilder A neural network builder object. """ # Get input ...
def _decrypt(message, encryption_data, key_encryption_key=None, resolver=None): ''' Decrypts the given ciphertext using AES256 in CBC mode with 128 bit padding. Unwraps the content-encryption-key using the user-provided or resolved key-encryption-key (kek). Returns the original plaintex. :param str mes...
def function[_decrypt, parameter[message, encryption_data, key_encryption_key, resolver]]: constant[ Decrypts the given ciphertext using AES256 in CBC mode with 128 bit padding. Unwraps the content-encryption-key using the user-provided or resolved key-encryption-key (kek). Returns the original plaintex...
keyword[def] identifier[_decrypt] ( identifier[message] , identifier[encryption_data] , identifier[key_encryption_key] = keyword[None] , identifier[resolver] = keyword[None] ): literal[string] identifier[_validate_not_none] ( literal[string] , identifier[message] ) identifier[content_encryption_key] =...
def _decrypt(message, encryption_data, key_encryption_key=None, resolver=None): """ Decrypts the given ciphertext using AES256 in CBC mode with 128 bit padding. Unwraps the content-encryption-key using the user-provided or resolved key-encryption-key (kek). Returns the original plaintex. :param str mes...
def grow(self, len): """Grow up the content of the input buffer, the old data are preserved This routine handle the I18N transcoding to internal UTF-8 This routine is used when operating the parser in normal (pull) mode TODO: one should be able to remove one extra copy b...
def function[grow, parameter[self, len]]: constant[Grow up the content of the input buffer, the old data are preserved This routine handle the I18N transcoding to internal UTF-8 This routine is used when operating the parser in normal (pull) mode TODO: one should be able to ...
keyword[def] identifier[grow] ( identifier[self] , identifier[len] ): literal[string] identifier[ret] = identifier[libxml2mod] . identifier[xmlParserInputBufferGrow] ( identifier[self] . identifier[_o] , identifier[len] ) keyword[return] identifier[ret]
def grow(self, len): """Grow up the content of the input buffer, the old data are preserved This routine handle the I18N transcoding to internal UTF-8 This routine is used when operating the parser in normal (pull) mode TODO: one should be able to remove one extra copy by co...
def run(self, definition): """Processing the pipeline.""" self.logger.info("Running with Python %s", sys.version.replace("\n", "")) self.logger.info("Running on platform %s", platform.platform()) self.logger.info("Current cpu count is %d", multiprocessing.cpu_count()) self.logger...
def function[run, parameter[self, definition]]: constant[Processing the pipeline.] call[name[self].logger.info, parameter[constant[Running with Python %s], call[name[sys].version.replace, parameter[constant[ ], constant[]]]]] call[name[self].logger.info, parameter[constant[Running on platform %s...
keyword[def] identifier[run] ( identifier[self] , identifier[definition] ): literal[string] identifier[self] . identifier[logger] . identifier[info] ( literal[string] , identifier[sys] . identifier[version] . identifier[replace] ( literal[string] , literal[string] )) identifier[self] . ide...
def run(self, definition): """Processing the pipeline.""" self.logger.info('Running with Python %s', sys.version.replace('\n', '')) self.logger.info('Running on platform %s', platform.platform()) self.logger.info('Current cpu count is %d', multiprocessing.cpu_count()) self.logger.info("Processing pi...
def get_current_user(self): """ Override get_current_user for Google AppEngine Checks for oauth capable request first, if this fails fall back to standard users API """ from google.appengine.api import users if _IS_DEVELOPMENT_SERVER: return users.get_current...
def function[get_current_user, parameter[self]]: constant[ Override get_current_user for Google AppEngine Checks for oauth capable request first, if this fails fall back to standard users API ] from relative_module[google.appengine.api] import module[users] if name[_IS_DEVELO...
keyword[def] identifier[get_current_user] ( identifier[self] ): literal[string] keyword[from] identifier[google] . identifier[appengine] . identifier[api] keyword[import] identifier[users] keyword[if] identifier[_IS_DEVELOPMENT_SERVER] : keyword[return] identifier[users...
def get_current_user(self): """ Override get_current_user for Google AppEngine Checks for oauth capable request first, if this fails fall back to standard users API """ from google.appengine.api import users if _IS_DEVELOPMENT_SERVER: return users.get_current_user() # depend...
def __get_mapping(self, structures): """ match each pattern to each molecule. if all patterns matches with all molecules return generator of all possible mapping. :param structures: disjoint molecules :return: mapping generator """ for c in permutations(s...
def function[__get_mapping, parameter[self, structures]]: constant[ match each pattern to each molecule. if all patterns matches with all molecules return generator of all possible mapping. :param structures: disjoint molecules :return: mapping generator ] ...
keyword[def] identifier[__get_mapping] ( identifier[self] , identifier[structures] ): literal[string] keyword[for] identifier[c] keyword[in] identifier[permutations] ( identifier[structures] , identifier[len] ( identifier[self] . identifier[__patterns] )): keyword[for] identifier[m...
def __get_mapping(self, structures): """ match each pattern to each molecule. if all patterns matches with all molecules return generator of all possible mapping. :param structures: disjoint molecules :return: mapping generator """ for c in permutations(structure...
def pause(self, workflow_id, email_id): """ Pause an automated email. :param workflow_id: The unique id for the Automation workflow. :type workflow_id: :py:class:`str` :param email_id: The unique id for the Automation workflow email. :type email_id: :py:class:`str` ...
def function[pause, parameter[self, workflow_id, email_id]]: constant[ Pause an automated email. :param workflow_id: The unique id for the Automation workflow. :type workflow_id: :py:class:`str` :param email_id: The unique id for the Automation workflow email. :type emai...
keyword[def] identifier[pause] ( identifier[self] , identifier[workflow_id] , identifier[email_id] ): literal[string] identifier[self] . identifier[workflow_id] = identifier[workflow_id] identifier[self] . identifier[email_id] = identifier[email_id] keyword[return] identifier[s...
def pause(self, workflow_id, email_id): """ Pause an automated email. :param workflow_id: The unique id for the Automation workflow. :type workflow_id: :py:class:`str` :param email_id: The unique id for the Automation workflow email. :type email_id: :py:class:`str` "...
def _delete_node_storage(self, node): """delete storage :param node: node in form of list, or BLANK_NODE """ if node == BLANK_NODE: return # assert isinstance(node, list) encoded = self._encode_node(node, put_in_db=False) if len(encoded) < 32: ...
def function[_delete_node_storage, parameter[self, node]]: constant[delete storage :param node: node in form of list, or BLANK_NODE ] if compare[name[node] equal[==] name[BLANK_NODE]] begin[:] return[None] variable[encoded] assign[=] call[name[self]._encode_node, paramete...
keyword[def] identifier[_delete_node_storage] ( identifier[self] , identifier[node] ): literal[string] keyword[if] identifier[node] == identifier[BLANK_NODE] : keyword[return] identifier[encoded] = identifier[self] . identifier[_encode_node] ( identifier[node] ,...
def _delete_node_storage(self, node): """delete storage :param node: node in form of list, or BLANK_NODE """ if node == BLANK_NODE: return # depends on [control=['if'], data=[]] # assert isinstance(node, list) encoded = self._encode_node(node, put_in_db=False) if len(encoded...
def add_users_to_user_group(self, id, **kwargs): # noqa: E501 """Add multiple users to a specific user group # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.a...
def function[add_users_to_user_group, parameter[self, id]]: constant[Add multiple users to a specific user group # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = ap...
keyword[def] identifier[add_users_to_user_group] ( identifier[self] , identifier[id] ,** identifier[kwargs] ): literal[string] identifier[kwargs] [ literal[string] ]= keyword[True] keyword[if] identifier[kwargs] . identifier[get] ( literal[string] ): keyword[return] identif...
def add_users_to_user_group(self, id, **kwargs): # noqa: E501 'Add multiple users to a specific user group # noqa: E501\n\n # noqa: E501\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.ad...
def get_time_rate(self): ''' getter Time rate. ''' if isinstance(self.__time_rate, float) is False: raise TypeError("The type of __time_rate must be float.") if self.__time_rate <= 0.0: raise ValueError("The value of __time_rate must be greater th...
def function[get_time_rate, parameter[self]]: constant[ getter Time rate. ] if compare[call[name[isinstance], parameter[name[self].__time_rate, name[float]]] is constant[False]] begin[:] <ast.Raise object at 0x7da1b07ada50> if compare[name[self].__time_rate less_o...
keyword[def] identifier[get_time_rate] ( identifier[self] ): literal[string] keyword[if] identifier[isinstance] ( identifier[self] . identifier[__time_rate] , identifier[float] ) keyword[is] keyword[False] : keyword[raise] identifier[TypeError] ( literal[string] ) keyword[...
def get_time_rate(self): """ getter Time rate. """ if isinstance(self.__time_rate, float) is False: raise TypeError('The type of __time_rate must be float.') # depends on [control=['if'], data=[]] if self.__time_rate <= 0.0: raise ValueError('The value of __time_rate...
def from_response_data(cls, response_data): """ Response factory :param response_data: requests.models.Response :return: pybomb.clients.Response """ response_json = response_data.json() return cls( response_data.url, response_json["numbe...
def function[from_response_data, parameter[cls, response_data]]: constant[ Response factory :param response_data: requests.models.Response :return: pybomb.clients.Response ] variable[response_json] assign[=] call[name[response_data].json, parameter[]] return[call[nam...
keyword[def] identifier[from_response_data] ( identifier[cls] , identifier[response_data] ): literal[string] identifier[response_json] = identifier[response_data] . identifier[json] () keyword[return] identifier[cls] ( identifier[response_data] . identifier[url] , iden...
def from_response_data(cls, response_data): """ Response factory :param response_data: requests.models.Response :return: pybomb.clients.Response """ response_json = response_data.json() return cls(response_data.url, response_json['number_of_page_results'], response_json['num...
def close(self): """Close this consumer thread and its underlying connection. """ try: if self.consumer: self.requeue_messages(m for _, m in iter_queue(self.delay_queue)) self.consumer.close() except ConnectionError: pass
def function[close, parameter[self]]: constant[Close this consumer thread and its underlying connection. ] <ast.Try object at 0x7da1b18c8df0>
keyword[def] identifier[close] ( identifier[self] ): literal[string] keyword[try] : keyword[if] identifier[self] . identifier[consumer] : identifier[self] . identifier[requeue_messages] ( identifier[m] keyword[for] identifier[_] , identifier[m] keyword[in] identif...
def close(self): """Close this consumer thread and its underlying connection. """ try: if self.consumer: self.requeue_messages((m for (_, m) in iter_queue(self.delay_queue))) self.consumer.close() # depends on [control=['if'], data=[]] # depends on [control=['try'], dat...
def summary(): ''' .. versionadded:: 2014.7.0 Show a summary of the last puppet agent run CLI Example: .. code-block:: bash salt '*' puppet.summary ''' puppet = _Puppet() try: with salt.utils.files.fopen(puppet.lastrunfile, 'r') as fp_: report = salt.uti...
def function[summary, parameter[]]: constant[ .. versionadded:: 2014.7.0 Show a summary of the last puppet agent run CLI Example: .. code-block:: bash salt '*' puppet.summary ] variable[puppet] assign[=] call[name[_Puppet], parameter[]] <ast.Try object at 0x7da18fe926...
keyword[def] identifier[summary] (): literal[string] identifier[puppet] = identifier[_Puppet] () keyword[try] : keyword[with] identifier[salt] . identifier[utils] . identifier[files] . identifier[fopen] ( identifier[puppet] . identifier[lastrunfile] , literal[string] ) keyword[as] identif...
def summary(): """ .. versionadded:: 2014.7.0 Show a summary of the last puppet agent run CLI Example: .. code-block:: bash salt '*' puppet.summary """ puppet = _Puppet() try: with salt.utils.files.fopen(puppet.lastrunfile, 'r') as fp_: report = salt.utils...
def inherit_kwargs(inherit_func): """ TODO move to util_decor inherit_func = inspect_pdfs func = encoder.visualize.im_func """ import utool as ut keys, is_arbitrary = ut.get_kwargs(inherit_func) if is_arbitrary: keys += ['**kwargs'] kwargs_append = '\n'.join(keys) #from s...
def function[inherit_kwargs, parameter[inherit_func]]: constant[ TODO move to util_decor inherit_func = inspect_pdfs func = encoder.visualize.im_func ] import module[utool] as alias[ut] <ast.Tuple object at 0x7da1b24e9b70> assign[=] call[name[ut].get_kwargs, parameter[name[inherit_fu...
keyword[def] identifier[inherit_kwargs] ( identifier[inherit_func] ): literal[string] keyword[import] identifier[utool] keyword[as] identifier[ut] identifier[keys] , identifier[is_arbitrary] = identifier[ut] . identifier[get_kwargs] ( identifier[inherit_func] ) keyword[if] identifier[is_arbi...
def inherit_kwargs(inherit_func): """ TODO move to util_decor inherit_func = inspect_pdfs func = encoder.visualize.im_func """ import utool as ut (keys, is_arbitrary) = ut.get_kwargs(inherit_func) if is_arbitrary: keys += ['**kwargs'] # depends on [control=['if'], data=[]] k...
def independentlinear60__ffnn(): """ 4-Layer Neural Network """ from keras.models import Sequential from keras.layers import Dense model = Sequential() model.add(Dense(32, activation='relu', input_dim=60)) model.add(Dense(20, activation='relu')) model.add(Dense(20, activation='relu')) ...
def function[independentlinear60__ffnn, parameter[]]: constant[ 4-Layer Neural Network ] from relative_module[keras.models] import module[Sequential] from relative_module[keras.layers] import module[Dense] variable[model] assign[=] call[name[Sequential], parameter[]] call[name[model]...
keyword[def] identifier[independentlinear60__ffnn] (): literal[string] keyword[from] identifier[keras] . identifier[models] keyword[import] identifier[Sequential] keyword[from] identifier[keras] . identifier[layers] keyword[import] identifier[Dense] identifier[model] = identifier[Sequent...
def independentlinear60__ffnn(): """ 4-Layer Neural Network """ from keras.models import Sequential from keras.layers import Dense model = Sequential() model.add(Dense(32, activation='relu', input_dim=60)) model.add(Dense(20, activation='relu')) model.add(Dense(20, activation='relu')) ...
def clear(mnt): ''' Pass in the mnt dict returned from nbd_mount to unmount and disconnect the image from nbd. If all of the partitions are unmounted return an empty dict, otherwise return a dict containing the still mounted partitions CLI Example: .. code-block:: bash salt '*' qe...
def function[clear, parameter[mnt]]: constant[ Pass in the mnt dict returned from nbd_mount to unmount and disconnect the image from nbd. If all of the partitions are unmounted return an empty dict, otherwise return a dict containing the still mounted partitions CLI Example: .. code-bl...
keyword[def] identifier[clear] ( identifier[mnt] ): literal[string] identifier[ret] ={} identifier[nbds] = identifier[set] () keyword[for] identifier[m_pt] , identifier[dev] keyword[in] identifier[six] . identifier[iteritems] ( identifier[mnt] ): identifier[mnt_ret] = identifier[__sal...
def clear(mnt): """ Pass in the mnt dict returned from nbd_mount to unmount and disconnect the image from nbd. If all of the partitions are unmounted return an empty dict, otherwise return a dict containing the still mounted partitions CLI Example: .. code-block:: bash salt '*' qe...
async def cas(self, value: Any, **kwargs) -> bool: """ Checks and sets the specified value for the locked key. If the value has changed since the lock was created, it will raise an :class:`aiocache.lock.OptimisticLockError` exception. :raises: :class:`aiocache.lock.OptimisticLoc...
<ast.AsyncFunctionDef object at 0x7da18c4cc580>
keyword[async] keyword[def] identifier[cas] ( identifier[self] , identifier[value] : identifier[Any] ,** identifier[kwargs] )-> identifier[bool] : literal[string] identifier[success] = keyword[await] identifier[self] . identifier[client] . identifier[set] ( identifier[self] . identifier[key] , id...
async def cas(self, value: Any, **kwargs) -> bool: """ Checks and sets the specified value for the locked key. If the value has changed since the lock was created, it will raise an :class:`aiocache.lock.OptimisticLockError` exception. :raises: :class:`aiocache.lock.OptimisticLockErr...
def getLabel(self, inferenceType=None): """ Helper method that generates a unique label for a :class:`MetricSpec` / :class:`~nupic.frameworks.opf.opf_utils.InferenceType` pair. The label is formatted as follows: :: <predictionKind>:<metric type>:(paramName=value)*:field=<fieldna...
def function[getLabel, parameter[self, inferenceType]]: constant[ Helper method that generates a unique label for a :class:`MetricSpec` / :class:`~nupic.frameworks.opf.opf_utils.InferenceType` pair. The label is formatted as follows: :: <predictionKind>:<metric type>:(paramN...
keyword[def] identifier[getLabel] ( identifier[self] , identifier[inferenceType] = keyword[None] ): literal[string] identifier[result] =[] keyword[if] identifier[inferenceType] keyword[is] keyword[not] keyword[None] : identifier[result] . identifier[append] ( identifier[InferenceType] . ide...
def getLabel(self, inferenceType=None): """ Helper method that generates a unique label for a :class:`MetricSpec` / :class:`~nupic.frameworks.opf.opf_utils.InferenceType` pair. The label is formatted as follows: :: <predictionKind>:<metric type>:(paramName=value)*:field=<fieldna...
def max_pool(arr, block_size, cval=0, preserve_dtype=True): """ Resize an array using max-pooling. dtype support:: See :func:`imgaug.imgaug.pool`. Parameters ---------- arr : (H,W) ndarray or (H,W,C) ndarray Image-like array to pool. See :func:`imgaug.pool` for details. b...
def function[max_pool, parameter[arr, block_size, cval, preserve_dtype]]: constant[ Resize an array using max-pooling. dtype support:: See :func:`imgaug.imgaug.pool`. Parameters ---------- arr : (H,W) ndarray or (H,W,C) ndarray Image-like array to pool. See :func:`imgaug.p...
keyword[def] identifier[max_pool] ( identifier[arr] , identifier[block_size] , identifier[cval] = literal[int] , identifier[preserve_dtype] = keyword[True] ): literal[string] keyword[return] identifier[pool] ( identifier[arr] , identifier[block_size] , identifier[np] . identifier[max] , identifier[cval] =...
def max_pool(arr, block_size, cval=0, preserve_dtype=True): """ Resize an array using max-pooling. dtype support:: See :func:`imgaug.imgaug.pool`. Parameters ---------- arr : (H,W) ndarray or (H,W,C) ndarray Image-like array to pool. See :func:`imgaug.pool` for details. b...