code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def inserir(self, name): """Inserts a new Brand and returns its identifier :param name: Brand name. String with a minimum 3 and maximum of 100 characters :return: Dictionary with the following structure: :: {'marca': {'id': < id_brand >}} :raise InvalidParameterE...
def function[inserir, parameter[self, name]]: constant[Inserts a new Brand and returns its identifier :param name: Brand name. String with a minimum 3 and maximum of 100 characters :return: Dictionary with the following structure: :: {'marca': {'id': < id_brand >}} ...
keyword[def] identifier[inserir] ( identifier[self] , identifier[name] ): literal[string] identifier[brand_map] = identifier[dict] () identifier[brand_map] [ literal[string] ]= identifier[name] identifier[code] , identifier[xml] = identifier[self] . identifier[submit] ({ literal...
def inserir(self, name): """Inserts a new Brand and returns its identifier :param name: Brand name. String with a minimum 3 and maximum of 100 characters :return: Dictionary with the following structure: :: {'marca': {'id': < id_brand >}} :raise InvalidParameterError...
def delete_queue(self, queue_name): """ Delete a queue with the specified name. :param queue_name: :return: """ self.connect() channel = self.connection.channel() channel.queue_delete(queue=queue_name) self.close()
def function[delete_queue, parameter[self, queue_name]]: constant[ Delete a queue with the specified name. :param queue_name: :return: ] call[name[self].connect, parameter[]] variable[channel] assign[=] call[name[self].connection.channel, parameter[]] call...
keyword[def] identifier[delete_queue] ( identifier[self] , identifier[queue_name] ): literal[string] identifier[self] . identifier[connect] () identifier[channel] = identifier[self] . identifier[connection] . identifier[channel] () identifier[channel] . identifier[queue_delete] ( ...
def delete_queue(self, queue_name): """ Delete a queue with the specified name. :param queue_name: :return: """ self.connect() channel = self.connection.channel() channel.queue_delete(queue=queue_name) self.close()
def parse(filename): """ parse a scene release string and return a dictionary of parsed values.""" screensize = re.compile('720p|1080p', re.I) source = re.compile( '\.(AHDTV|MBluRay|MDVDR|CAM|TS|TELESYNC|DVDSCR|DVD9|BDSCR|DDC|R5LINE|R5|DVDRip|HDRip|BRRip|BDRip|WEBRip|WEB-?HD|HDtv|PDTV|WEBDL|BluRay)'...
def function[parse, parameter[filename]]: constant[ parse a scene release string and return a dictionary of parsed values.] variable[screensize] assign[=] call[name[re].compile, parameter[constant[720p|1080p], name[re].I]] variable[source] assign[=] call[name[re].compile, parameter[constant[\.(A...
keyword[def] identifier[parse] ( identifier[filename] ): literal[string] identifier[screensize] = identifier[re] . identifier[compile] ( literal[string] , identifier[re] . identifier[I] ) identifier[source] = identifier[re] . identifier[compile] ( literal[string] , identifier[re] . identifier[I] ...
def parse(filename): """ parse a scene release string and return a dictionary of parsed values.""" screensize = re.compile('720p|1080p', re.I) source = re.compile('\\.(AHDTV|MBluRay|MDVDR|CAM|TS|TELESYNC|DVDSCR|DVD9|BDSCR|DDC|R5LINE|R5|DVDRip|HDRip|BRRip|BDRip|WEBRip|WEB-?HD|HDtv|PDTV|WEBDL|BluRay)', re.I) ...
def raise_for_status(self): """Raises stored :class:`HTTPError` or :class:`URLError`, if occurred. """ if not self.ok: reason = self.reason or 'No response from %s' % self.url if not self.status_code: raise HttpConnectionError(reason, response=self) ...
def function[raise_for_status, parameter[self]]: constant[Raises stored :class:`HTTPError` or :class:`URLError`, if occurred. ] if <ast.UnaryOp object at 0x7da20c6a9bd0> begin[:] variable[reason] assign[=] <ast.BoolOp object at 0x7da18bc72500> if <ast.UnaryOp obje...
keyword[def] identifier[raise_for_status] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[ok] : identifier[reason] = identifier[self] . identifier[reason] keyword[or] literal[string] % identifier[self] . identifier[url] key...
def raise_for_status(self): """Raises stored :class:`HTTPError` or :class:`URLError`, if occurred. """ if not self.ok: reason = self.reason or 'No response from %s' % self.url if not self.status_code: raise HttpConnectionError(reason, response=self) # depends on [control=['i...
def is_active(self): """Determines whether this plugin is active. This plugin is only active if TensorBoard sampled any text summaries. Returns: Whether this plugin is active. """ if not self._multiplexer: return False if self._index_cached is not None: # If we already have ...
def function[is_active, parameter[self]]: constant[Determines whether this plugin is active. This plugin is only active if TensorBoard sampled any text summaries. Returns: Whether this plugin is active. ] if <ast.UnaryOp object at 0x7da1b21ce620> begin[:] return[constant[Fals...
keyword[def] identifier[is_active] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[_multiplexer] : keyword[return] keyword[False] keyword[if] identifier[self] . identifier[_index_cached] keyword[is] keyword[not] keyword[None] : ...
def is_active(self): """Determines whether this plugin is active. This plugin is only active if TensorBoard sampled any text summaries. Returns: Whether this plugin is active. """ if not self._multiplexer: return False # depends on [control=['if'], data=[]] if self._index_cached...
def download(self, updates): ''' Download the updates passed in the updates collection. Load the updates collection using ``search`` or ``available`` Args: updates (Updates): An instance of the Updates class containing a the updates to be downloaded. Re...
def function[download, parameter[self, updates]]: constant[ Download the updates passed in the updates collection. Load the updates collection using ``search`` or ``available`` Args: updates (Updates): An instance of the Updates class containing a the updates to...
keyword[def] identifier[download] ( identifier[self] , identifier[updates] ): literal[string] keyword[if] identifier[updates] . identifier[count] ()== literal[int] : identifier[ret] ={ literal[string] : keyword[False] , literal[string] : literal[string] } ...
def download(self, updates): """ Download the updates passed in the updates collection. Load the updates collection using ``search`` or ``available`` Args: updates (Updates): An instance of the Updates class containing a the updates to be downloaded. Return...
def barnes_point(sq_dist, values, kappa, gamma=None): r"""Generate a single pass barnes interpolation value for a point. The calculated value is based on the given distances, kappa and gamma values. Parameters ---------- sq_dist: (N, ) ndarray Squared distance between observations and grid...
def function[barnes_point, parameter[sq_dist, values, kappa, gamma]]: constant[Generate a single pass barnes interpolation value for a point. The calculated value is based on the given distances, kappa and gamma values. Parameters ---------- sq_dist: (N, ) ndarray Squared distance betw...
keyword[def] identifier[barnes_point] ( identifier[sq_dist] , identifier[values] , identifier[kappa] , identifier[gamma] = keyword[None] ): literal[string] keyword[if] identifier[gamma] keyword[is] keyword[None] : identifier[gamma] = literal[int] identifier[weights] = identifier[tools] . ...
def barnes_point(sq_dist, values, kappa, gamma=None): """Generate a single pass barnes interpolation value for a point. The calculated value is based on the given distances, kappa and gamma values. Parameters ---------- sq_dist: (N, ) ndarray Squared distance between observations and grid ...
def get_reference(self, datas, name): """ Get serialized reference datas Because every reference is turned to a dict (that stands on ``keys`` variable that is a list of key names), every variables must have the same exact length of word than the key name list. A referen...
def function[get_reference, parameter[self, datas, name]]: constant[ Get serialized reference datas Because every reference is turned to a dict (that stands on ``keys`` variable that is a list of key names), every variables must have the same exact length of word than the key na...
keyword[def] identifier[get_reference] ( identifier[self] , identifier[datas] , identifier[name] ): literal[string] identifier[rule_name] = literal[string] . identifier[join] (( identifier[RULE_REFERENCE] , identifier[name] )) identifier[structure_mode] = literal[string] keyword...
def get_reference(self, datas, name): """ Get serialized reference datas Because every reference is turned to a dict (that stands on ``keys`` variable that is a list of key names), every variables must have the same exact length of word than the key name list. A reference n...
def read_config(path): """ Read a configuration from disk. Arguments path -- the loation to deserialize """ parser = _make_parser() if parser.read(path): return parser raise Exception("Failed to read {}".format(path))
def function[read_config, parameter[path]]: constant[ Read a configuration from disk. Arguments path -- the loation to deserialize ] variable[parser] assign[=] call[name[_make_parser], parameter[]] if call[name[parser].read, parameter[name[path]]] begin[:] return[name[pa...
keyword[def] identifier[read_config] ( identifier[path] ): literal[string] identifier[parser] = identifier[_make_parser] () keyword[if] identifier[parser] . identifier[read] ( identifier[path] ): keyword[return] identifier[parser] keyword[raise] identifier[Exception] ( literal[string...
def read_config(path): """ Read a configuration from disk. Arguments path -- the loation to deserialize """ parser = _make_parser() if parser.read(path): return parser # depends on [control=['if'], data=[]] raise Exception('Failed to read {}'.format(path))
def authenticate_http_request(token=None): """Validate auth0 tokens passed in the request's header, hence ensuring that the user is authenticated. Code copied from: https://github.com/auth0/auth0-python/tree/master/examples/flask-api Return a PntCommonException if failed to validate authentication. ...
def function[authenticate_http_request, parameter[token]]: constant[Validate auth0 tokens passed in the request's header, hence ensuring that the user is authenticated. Code copied from: https://github.com/auth0/auth0-python/tree/master/examples/flask-api Return a PntCommonException if failed to va...
keyword[def] identifier[authenticate_http_request] ( identifier[token] = keyword[None] ): literal[string] keyword[if] identifier[token] : identifier[auth] = identifier[token] keyword[else] : identifier[auth] = identifier[request] . identifier[headers] . identifier[get] ( literal[s...
def authenticate_http_request(token=None): """Validate auth0 tokens passed in the request's header, hence ensuring that the user is authenticated. Code copied from: https://github.com/auth0/auth0-python/tree/master/examples/flask-api Return a PntCommonException if failed to validate authentication. ...
def _parse_pattern(self, element): """ Parse the trigger pattern :param element: The XML Element object :type element: etree._Element """ # If this is a raw regular expression, compile it and immediately return self._log.info('Parsing Trigger Pattern: ' + element...
def function[_parse_pattern, parameter[self, element]]: constant[ Parse the trigger pattern :param element: The XML Element object :type element: etree._Element ] call[name[self]._log.info, parameter[binary_operation[constant[Parsing Trigger Pattern: ] + name[element].te...
keyword[def] identifier[_parse_pattern] ( identifier[self] , identifier[element] ): literal[string] identifier[self] . identifier[_log] . identifier[info] ( literal[string] + identifier[element] . identifier[text] ) identifier[self] . identifier[pattern_words] , identifier[self] ....
def _parse_pattern(self, element): """ Parse the trigger pattern :param element: The XML Element object :type element: etree._Element """ # If this is a raw regular expression, compile it and immediately return self._log.info('Parsing Trigger Pattern: ' + element.text) (...
def _ascii2(value): """ A variant of the `ascii()` built-in function known from Python 3 that: (1) ensures ASCII-only output, and (2) produces a nicer formatting for use in exception and warning messages and other human consumption. This function calls `ascii()` and post-processes its outp...
def function[_ascii2, parameter[value]]: constant[ A variant of the `ascii()` built-in function known from Python 3 that: (1) ensures ASCII-only output, and (2) produces a nicer formatting for use in exception and warning messages and other human consumption. This function calls `ascii...
keyword[def] identifier[_ascii2] ( identifier[value] ): literal[string] keyword[if] identifier[isinstance] ( identifier[value] , identifier[Mapping] ): identifier[items] =[ identifier[_ascii2] ( identifier[k] )+ literal[string] + identifier[_ascii2] ( identifier[v] ) keyword[f...
def _ascii2(value): """ A variant of the `ascii()` built-in function known from Python 3 that: (1) ensures ASCII-only output, and (2) produces a nicer formatting for use in exception and warning messages and other human consumption. This function calls `ascii()` and post-processes its outp...
def _normalize_params(params): """ Returns a normalized query string sorted first by key, then by value excluding the ``realm`` and ``oauth_signature`` parameters as specified here: http://oauth.net/core/1.0a/#rfc.section.9.1.1. :param params: :class:`dict` or :class:`list` of tuples. ...
def function[_normalize_params, parameter[params]]: constant[ Returns a normalized query string sorted first by key, then by value excluding the ``realm`` and ``oauth_signature`` parameters as specified here: http://oauth.net/core/1.0a/#rfc.section.9.1.1. :param params: :class:`dict` or...
keyword[def] identifier[_normalize_params] ( identifier[params] ): literal[string] keyword[if] identifier[isinstance] ( identifier[params] , identifier[dict] ): identifier[params] = identifier[list] ( identifier[params] . identifier[items] ()) identifier[params] = identifier[sorte...
def _normalize_params(params): """ Returns a normalized query string sorted first by key, then by value excluding the ``realm`` and ``oauth_signature`` parameters as specified here: http://oauth.net/core/1.0a/#rfc.section.9.1.1. :param params: :class:`dict` or :class:`list` of tuples. ...
def joint_shape(*args) -> tuple: """Given a set of arrays, return the joint shape. Parameters ---------- args : array-likes Returns ------- tuple of int Joint shape. """ if len(args) == 0: return () shape = [] shapes = [a.shape for a in args] ndim = args...
def function[joint_shape, parameter[]]: constant[Given a set of arrays, return the joint shape. Parameters ---------- args : array-likes Returns ------- tuple of int Joint shape. ] if compare[call[name[len], parameter[name[args]]] equal[==] constant[0]] begin[:] ...
keyword[def] identifier[joint_shape] (* identifier[args] )-> identifier[tuple] : literal[string] keyword[if] identifier[len] ( identifier[args] )== literal[int] : keyword[return] () identifier[shape] =[] identifier[shapes] =[ identifier[a] . identifier[shape] keyword[for] identifier[a...
def joint_shape(*args) -> tuple: """Given a set of arrays, return the joint shape. Parameters ---------- args : array-likes Returns ------- tuple of int Joint shape. """ if len(args) == 0: return () # depends on [control=['if'], data=[]] shape = [] shapes =...
def update(self, other): """Merges other item with this object Args: other: Object containing items to merge into this object Must be a dictionary or NdMapping type """ if isinstance(other, NdMapping): dims = [d for d in other.kdims if d not in se...
def function[update, parameter[self, other]]: constant[Merges other item with this object Args: other: Object containing items to merge into this object Must be a dictionary or NdMapping type ] if call[name[isinstance], parameter[name[other], name[NdMapping]]...
keyword[def] identifier[update] ( identifier[self] , identifier[other] ): literal[string] keyword[if] identifier[isinstance] ( identifier[other] , identifier[NdMapping] ): identifier[dims] =[ identifier[d] keyword[for] identifier[d] keyword[in] identifier[other] . identifier[kdims...
def update(self, other): """Merges other item with this object Args: other: Object containing items to merge into this object Must be a dictionary or NdMapping type """ if isinstance(other, NdMapping): dims = [d for d in other.kdims if d not in self.kdims] ...
def find_all_matches(finder, ireq, pre=False): # type: (PackageFinder, InstallRequirement, bool) -> List[InstallationCandidate] """Find all matching dependencies using the supplied finder and the given ireq. :param finder: A package finder for discovering matching candidates. :type finder: :class:`...
def function[find_all_matches, parameter[finder, ireq, pre]]: constant[Find all matching dependencies using the supplied finder and the given ireq. :param finder: A package finder for discovering matching candidates. :type finder: :class:`~pip._internal.index.PackageFinder` :param ireq: An inst...
keyword[def] identifier[find_all_matches] ( identifier[finder] , identifier[ireq] , identifier[pre] = keyword[False] ): literal[string] identifier[candidates] = identifier[clean_requires_python] ( identifier[finder] . identifier[find_all_candidates] ( identifier[ireq] . identifier[name] )) identifi...
def find_all_matches(finder, ireq, pre=False): # type: (PackageFinder, InstallRequirement, bool) -> List[InstallationCandidate] 'Find all matching dependencies using the supplied finder and the\n given ireq.\n\n :param finder: A package finder for discovering matching candidates.\n :type finder: :class...
def add_file(self, asset_data, label=None, asset_type=None, asset_content_type=None, asset_content_record_types=None, asset_name='', asset_description=''): """stub""" if asset_data is N...
def function[add_file, parameter[self, asset_data, label, asset_type, asset_content_type, asset_content_record_types, asset_name, asset_description]]: constant[stub] if compare[name[asset_data] is constant[None]] begin[:] <ast.Raise object at 0x7da204620940> if <ast.UnaryOp object at 0x7...
keyword[def] identifier[add_file] ( identifier[self] , identifier[asset_data] , identifier[label] = keyword[None] , identifier[asset_type] = keyword[None] , identifier[asset_content_type] = keyword[None] , identifier[asset_content_record_types] = keyword[None] , identifier[asset_name] = literal[string] , ident...
def add_file(self, asset_data, label=None, asset_type=None, asset_content_type=None, asset_content_record_types=None, asset_name='', asset_description=''): """stub""" if asset_data is None: raise NullArgument('asset_data cannot be None') # depends on [control=['if'], data=[]] if not isinstance(asse...
def _restart_on_unavailable(restart): """Restart iteration after :exc:`.ServiceUnavailable`. :type restart: callable :param restart: curried function returning iterator """ resume_token = b"" item_buffer = [] iterator = restart() while True: try: for item in iterator...
def function[_restart_on_unavailable, parameter[restart]]: constant[Restart iteration after :exc:`.ServiceUnavailable`. :type restart: callable :param restart: curried function returning iterator ] variable[resume_token] assign[=] constant[b''] variable[item_buffer] assign[=] list[[...
keyword[def] identifier[_restart_on_unavailable] ( identifier[restart] ): literal[string] identifier[resume_token] = literal[string] identifier[item_buffer] =[] identifier[iterator] = identifier[restart] () keyword[while] keyword[True] : keyword[try] : keyword[for] i...
def _restart_on_unavailable(restart): """Restart iteration after :exc:`.ServiceUnavailable`. :type restart: callable :param restart: curried function returning iterator """ resume_token = b'' item_buffer = [] iterator = restart() while True: try: for item in iterator...
def configureWhere(self, where): """Configure the working directory or directories for the test run. """ from nose.importer import add_path self.workingDir = None where = tolist(where) warned = False for path in where: if not self.workingDir: ...
def function[configureWhere, parameter[self, where]]: constant[Configure the working directory or directories for the test run. ] from relative_module[nose.importer] import module[add_path] name[self].workingDir assign[=] constant[None] variable[where] assign[=] call[name[tolist], pa...
keyword[def] identifier[configureWhere] ( identifier[self] , identifier[where] ): literal[string] keyword[from] identifier[nose] . identifier[importer] keyword[import] identifier[add_path] identifier[self] . identifier[workingDir] = keyword[None] identifier[where] = identifie...
def configureWhere(self, where): """Configure the working directory or directories for the test run. """ from nose.importer import add_path self.workingDir = None where = tolist(where) warned = False for path in where: if not self.workingDir: abs_path = absdir(path) ...
def raw(self) -> str: """ Return signed raw format string of the Membership instance :return: """ return """Version: {0} Type: Membership Currency: {1} Issuer: {2} Block: {3} Membership: {4} UserID: {5} CertTS: {6} """.format(self.version, self.currency, se...
def function[raw, parameter[self]]: constant[ Return signed raw format string of the Membership instance :return: ] return[call[constant[Version: {0} Type: Membership Currency: {1} Issuer: {2} Block: {3} Membership: {4} UserID: {5} CertTS: {6} ].format, parameter[name[self].version,...
keyword[def] identifier[raw] ( identifier[self] )-> identifier[str] : literal[string] keyword[return] literal[string] . identifier[format] ( identifier[self] . identifier[version] , identifier[self] . identifier[currency] , identifier[self] . identifier[issuer] , identif...
def raw(self) -> str: """ Return signed raw format string of the Membership instance :return: """ return 'Version: {0}\nType: Membership\nCurrency: {1}\nIssuer: {2}\nBlock: {3}\nMembership: {4}\nUserID: {5}\nCertTS: {6}\n'.format(self.version, self.currency, self.issuer, self.membership...
def index(index, length): """Generates an index. :param index: The index, can be positive or negative. :param length: The length of the sequence to index. :raises: IndexError Negative indices are typically used to index a sequence in reverse order. But to use them, the indexed object must con...
def function[index, parameter[index, length]]: constant[Generates an index. :param index: The index, can be positive or negative. :param length: The length of the sequence to index. :raises: IndexError Negative indices are typically used to index a sequence in reverse order. But to use th...
keyword[def] identifier[index] ( identifier[index] , identifier[length] ): literal[string] keyword[if] identifier[index] < literal[int] : identifier[index] += identifier[length] keyword[if] literal[int] <= identifier[index] < identifier[length] : keyword[return] identifier[index]...
def index(index, length): """Generates an index. :param index: The index, can be positive or negative. :param length: The length of the sequence to index. :raises: IndexError Negative indices are typically used to index a sequence in reverse order. But to use them, the indexed object must con...
def next_page(self): """ Fetches next result set. :return: Collection object. """ for link in self.links: if link.rel.lower() == 'next': return self._load(link.href) raise PaginationError('No more entries.')
def function[next_page, parameter[self]]: constant[ Fetches next result set. :return: Collection object. ] for taget[name[link]] in starred[name[self].links] begin[:] if compare[call[name[link].rel.lower, parameter[]] equal[==] constant[next]] begin[:] ...
keyword[def] identifier[next_page] ( identifier[self] ): literal[string] keyword[for] identifier[link] keyword[in] identifier[self] . identifier[links] : keyword[if] identifier[link] . identifier[rel] . identifier[lower] ()== literal[string] : keyword[return] iden...
def next_page(self): """ Fetches next result set. :return: Collection object. """ for link in self.links: if link.rel.lower() == 'next': return self._load(link.href) # depends on [control=['if'], data=[]] # depends on [control=['for'], data=['link']] raise Pagin...
def topic(self): """ | Comment: The id of the topic that the post belongs to """ if self.api and self.topic_id: return self.api._get_topic(self.topic_id)
def function[topic, parameter[self]]: constant[ | Comment: The id of the topic that the post belongs to ] if <ast.BoolOp object at 0x7da20c7c8b80> begin[:] return[call[name[self].api._get_topic, parameter[name[self].topic_id]]]
keyword[def] identifier[topic] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[api] keyword[and] identifier[self] . identifier[topic_id] : keyword[return] identifier[self] . identifier[api] . identifier[_get_topic] ( identifier[self] . identifier[top...
def topic(self): """ | Comment: The id of the topic that the post belongs to """ if self.api and self.topic_id: return self.api._get_topic(self.topic_id) # depends on [control=['if'], data=[]]
def extractdata(pattern, text=None, filepath=None): """ Read through an entire file or body of text one line at a time. Parse each line that matches the supplied pattern string and ignore the rest. If *text* is supplied, it will be parsed according to the *pattern* string. If *text* is not supplied...
def function[extractdata, parameter[pattern, text, filepath]]: constant[ Read through an entire file or body of text one line at a time. Parse each line that matches the supplied pattern string and ignore the rest. If *text* is supplied, it will be parsed according to the *pattern* string. If *...
keyword[def] identifier[extractdata] ( identifier[pattern] , identifier[text] = keyword[None] , identifier[filepath] = keyword[None] ): literal[string] identifier[y] =[] keyword[if] identifier[text] keyword[is] keyword[None] : identifier[textsource] = identifier[open] ( identifier[filepath...
def extractdata(pattern, text=None, filepath=None): """ Read through an entire file or body of text one line at a time. Parse each line that matches the supplied pattern string and ignore the rest. If *text* is supplied, it will be parsed according to the *pattern* string. If *text* is not supplied...
def create_model(self): """Return :class:`NativeModel` fully loaded into memory.""" properties = { 'name': self.name, 'biomass': self.biomass_reaction, 'extracellular': self.extracellular_compartment, 'default_compartment': self.default_compartment, ...
def function[create_model, parameter[self]]: constant[Return :class:`NativeModel` fully loaded into memory.] variable[properties] assign[=] dictionary[[<ast.Constant object at 0x7da20c6c5420>, <ast.Constant object at 0x7da20c6c4e50>, <ast.Constant object at 0x7da20c6c4e80>, <ast.Constant object at 0x7da...
keyword[def] identifier[create_model] ( identifier[self] ): literal[string] identifier[properties] ={ literal[string] : identifier[self] . identifier[name] , literal[string] : identifier[self] . identifier[biomass_reaction] , literal[string] : identifier[self] . identifi...
def create_model(self): """Return :class:`NativeModel` fully loaded into memory.""" properties = {'name': self.name, 'biomass': self.biomass_reaction, 'extracellular': self.extracellular_compartment, 'default_compartment': self.default_compartment, 'default_flux_limit': self.default_flux_limit} if self.cont...
def dimensions(self, selection='all', label=False): """Lists the available dimensions on the object Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. 'key' or 'value' dimensions. By default 'all' dimensions are ...
def function[dimensions, parameter[self, selection, label]]: constant[Lists the available dimensions on the object Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. 'key' or 'value' dimensions. By default 'all' dimensi...
keyword[def] identifier[dimensions] ( identifier[self] , identifier[selection] = literal[string] , identifier[label] = keyword[False] ): literal[string] keyword[if] identifier[label] keyword[in] [ literal[string] , keyword[True] ]: identifier[label] = literal[string] keywor...
def dimensions(self, selection='all', label=False): """Lists the available dimensions on the object Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. 'key' or 'value' dimensions. By default 'all' dimensions are ret...
def _capture_snapshot(a_snapshot: Snapshot, resolved_kwargs: Mapping[str, Any]) -> Any: """ Capture the snapshot from the keyword arguments resolved before the function call (including the default values). :param a_snapshot: snapshot to be captured :param resolved_kwargs: resolved keyword arguments (in...
def function[_capture_snapshot, parameter[a_snapshot, resolved_kwargs]]: constant[ Capture the snapshot from the keyword arguments resolved before the function call (including the default values). :param a_snapshot: snapshot to be captured :param resolved_kwargs: resolved keyword arguments (includi...
keyword[def] identifier[_capture_snapshot] ( identifier[a_snapshot] : identifier[Snapshot] , identifier[resolved_kwargs] : identifier[Mapping] [ identifier[str] , identifier[Any] ])-> identifier[Any] : literal[string] keyword[if] identifier[a_snapshot] . identifier[arg] keyword[is] keyword[not] keyword...
def _capture_snapshot(a_snapshot: Snapshot, resolved_kwargs: Mapping[str, Any]) -> Any: """ Capture the snapshot from the keyword arguments resolved before the function call (including the default values). :param a_snapshot: snapshot to be captured :param resolved_kwargs: resolved keyword arguments (in...
def _reduce_helper(input_shape, output_shape, input_tensor_layout, reduction_fn_string="SUM"): """Returns slicewise function and reduced mesh dimensions. Args: input_shape: a Shape output_shape: a Shape input_tensor_layout: a TensorLayout red...
def function[_reduce_helper, parameter[input_shape, output_shape, input_tensor_layout, reduction_fn_string]]: constant[Returns slicewise function and reduced mesh dimensions. Args: input_shape: a Shape output_shape: a Shape input_tensor_layout: a TensorLayout reduction_fn_string: "SUM" or "MA...
keyword[def] identifier[_reduce_helper] ( identifier[input_shape] , identifier[output_shape] , identifier[input_tensor_layout] , identifier[reduction_fn_string] = literal[string] ): literal[string] identifier[reduce_dims_indices] =[ identifier[i] keyword[for] identifier[i] , identifier[d] keyword[in] ...
def _reduce_helper(input_shape, output_shape, input_tensor_layout, reduction_fn_string='SUM'): """Returns slicewise function and reduced mesh dimensions. Args: input_shape: a Shape output_shape: a Shape input_tensor_layout: a TensorLayout reduction_fn_string: "SUM" or "MAX" Returns: reduce_...
def splitarg(args): ''' This function will split arguments separated by spaces or commas to be backwards compatible with the original ArcGet command line tool ''' if not args: return args split = list() for arg in args: if ',' in arg: split.extend([x for x in arg...
def function[splitarg, parameter[args]]: constant[ This function will split arguments separated by spaces or commas to be backwards compatible with the original ArcGet command line tool ] if <ast.UnaryOp object at 0x7da18fe915a0> begin[:] return[name[args]] variable[split] a...
keyword[def] identifier[splitarg] ( identifier[args] ): literal[string] keyword[if] keyword[not] identifier[args] : keyword[return] identifier[args] identifier[split] = identifier[list] () keyword[for] identifier[arg] keyword[in] identifier[args] : keyword[if] literal[st...
def splitarg(args): """ This function will split arguments separated by spaces or commas to be backwards compatible with the original ArcGet command line tool """ if not args: return args # depends on [control=['if'], data=[]] split = list() for arg in args: if ',' in arg: ...
def _get_data_files(data_specs, existing): """Expand data file specs into valid data files metadata. Parameters ---------- data_specs: list of tuples See [createcmdclass] for description. existing: list of tuples The existing distribution data_files metadata. Returns ------...
def function[_get_data_files, parameter[data_specs, existing]]: constant[Expand data file specs into valid data files metadata. Parameters ---------- data_specs: list of tuples See [createcmdclass] for description. existing: list of tuples The existing distribution data_files me...
keyword[def] identifier[_get_data_files] ( identifier[data_specs] , identifier[existing] ): literal[string] identifier[file_data] = identifier[defaultdict] ( identifier[list] ) keyword[for] ( identifier[path] , identifier[files] ) keyword[in] identifier[existing] keyword[or] []: identi...
def _get_data_files(data_specs, existing): """Expand data file specs into valid data files metadata. Parameters ---------- data_specs: list of tuples See [createcmdclass] for description. existing: list of tuples The existing distribution data_files metadata. Returns ------...
def client_receives_message(self, *parameters): """Receive a message with template defined using `New Message` and validate field values. Message template has to be defined with `New Message` before calling this. Optional parameters: - `name` the client name (default is...
def function[client_receives_message, parameter[self]]: constant[Receive a message with template defined using `New Message` and validate field values. Message template has to be defined with `New Message` before calling this. Optional parameters: - `name` the client na...
keyword[def] identifier[client_receives_message] ( identifier[self] ,* identifier[parameters] ): literal[string] keyword[with] identifier[self] . identifier[_receive] ( identifier[self] . identifier[_clients] ,* identifier[parameters] ) keyword[as] ( identifier[msg] , identifier[message_fields] , ...
def client_receives_message(self, *parameters): """Receive a message with template defined using `New Message` and validate field values. Message template has to be defined with `New Message` before calling this. Optional parameters: - `name` the client name (default is the...
def wait_until_first_element_is_found(self, elements, timeout=None): """Search list of elements and wait until one of them is found :param elements: list of PageElements or element locators as a tuple (locator_type, locator_value) to be found sequentially :param timeout...
def function[wait_until_first_element_is_found, parameter[self, elements, timeout]]: constant[Search list of elements and wait until one of them is found :param elements: list of PageElements or element locators as a tuple (locator_type, locator_value) to be found sequentially ...
keyword[def] identifier[wait_until_first_element_is_found] ( identifier[self] , identifier[elements] , identifier[timeout] = keyword[None] ): literal[string] keyword[try] : keyword[return] identifier[self] . identifier[_wait_until] ( identifier[self] . identifier[_expected_condition_f...
def wait_until_first_element_is_found(self, elements, timeout=None): """Search list of elements and wait until one of them is found :param elements: list of PageElements or element locators as a tuple (locator_type, locator_value) to be found sequentially :param timeout: ma...
def emit_event(self, event_name, event_body): """ Publishes an event of type ``event_name`` to all subscribers, having the body ``event_body``. The event is pushed through all available event transports. The event body must be a Python object that can be represented as a JSON. ...
def function[emit_event, parameter[self, event_name, event_body]]: constant[ Publishes an event of type ``event_name`` to all subscribers, having the body ``event_body``. The event is pushed through all available event transports. The event body must be a Python object that can be repre...
keyword[def] identifier[emit_event] ( identifier[self] , identifier[event_name] , identifier[event_body] ): literal[string] keyword[for] identifier[transport] keyword[in] identifier[self] . identifier[event_transports] : identifier[transport] . identifier[emit_event] ( identifier[e...
def emit_event(self, event_name, event_body): """ Publishes an event of type ``event_name`` to all subscribers, having the body ``event_body``. The event is pushed through all available event transports. The event body must be a Python object that can be represented as a JSON. :par...
def validate(self): """ validate whether value in config file is correct. """ spec = self._create_specs() # support in future functions = {} validator = validate.Validator(functions=functions) self.config.configspec = spec result = self.config....
def function[validate, parameter[self]]: constant[ validate whether value in config file is correct. ] variable[spec] assign[=] call[name[self]._create_specs, parameter[]] variable[functions] assign[=] dictionary[[], []] variable[validator] assign[=] call[name[validate].V...
keyword[def] identifier[validate] ( identifier[self] ): literal[string] identifier[spec] = identifier[self] . identifier[_create_specs] () identifier[functions] ={} identifier[validator] = identifier[validate] . identifier[Validator] ( identifier[functions] = identifie...
def validate(self): """ validate whether value in config file is correct. """ spec = self._create_specs() # support in future functions = {} validator = validate.Validator(functions=functions) self.config.configspec = spec result = self.config.validate(validator, preserve_err...
def get_details(self, obj): """ returns uri of API image resource """ args = { 'slug': obj.node.slug, 'pk': obj.pk } return reverse('api_node_image_detail', kwargs=args, request=self.context.get('request', None))
def function[get_details, parameter[self, obj]]: constant[ returns uri of API image resource ] variable[args] assign[=] dictionary[[<ast.Constant object at 0x7da20c6e7dc0>, <ast.Constant object at 0x7da20c6e4370>], [<ast.Attribute object at 0x7da1b26afe20>, <ast.Attribute object at 0x7da1b26aff10>]] ...
keyword[def] identifier[get_details] ( identifier[self] , identifier[obj] ): literal[string] identifier[args] ={ literal[string] : identifier[obj] . identifier[node] . identifier[slug] , literal[string] : identifier[obj] . identifier[pk] } keyword[return] identi...
def get_details(self, obj): """ returns uri of API image resource """ args = {'slug': obj.node.slug, 'pk': obj.pk} return reverse('api_node_image_detail', kwargs=args, request=self.context.get('request', None))
def getservers(self, vhost = None): ''' Return current servers :param vhost: return only servers of vhost if specified. '' to return only default servers. None for all servers. ''' if vhost is not None: return [s for s in self.connection...
def function[getservers, parameter[self, vhost]]: constant[ Return current servers :param vhost: return only servers of vhost if specified. '' to return only default servers. None for all servers. ] if compare[name[vhost] is_not constant[None]] begi...
keyword[def] identifier[getservers] ( identifier[self] , identifier[vhost] = keyword[None] ): literal[string] keyword[if] identifier[vhost] keyword[is] keyword[not] keyword[None] : keyword[return] [ identifier[s] keyword[for] identifier[s] keyword[in] identifier[self] . identif...
def getservers(self, vhost=None): """ Return current servers :param vhost: return only servers of vhost if specified. '' to return only default servers. None for all servers. """ if vhost is not None: return [s for s in self.connections if s.protoco...
def _get_base_rates(self, base_params): ''' Defines the base moment rate that should be assigned to places of zero strain (i.e. Intraplate regions). In Bird et al (2010) this is taken as basic rate of Intraplate events in GCMT catalogue above the threshold magnitude :par...
def function[_get_base_rates, parameter[self, base_params]]: constant[ Defines the base moment rate that should be assigned to places of zero strain (i.e. Intraplate regions). In Bird et al (2010) this is taken as basic rate of Intraplate events in GCMT catalogue above the thresh...
keyword[def] identifier[_get_base_rates] ( identifier[self] , identifier[base_params] ): literal[string] identifier[base_ipl_rate] = identifier[base_params] [ literal[string] ]/( identifier[base_params] [ literal[string] ]* identifier[base_params] [ literal[string] ]) identifier[b...
def _get_base_rates(self, base_params): """ Defines the base moment rate that should be assigned to places of zero strain (i.e. Intraplate regions). In Bird et al (2010) this is taken as basic rate of Intraplate events in GCMT catalogue above the threshold magnitude :param d...
def patch(name, source=None, source_hash=None, source_hash_name=None, skip_verify=False, template=None, context=None, defaults=None, options='', reject_file=None, strip=None, saltenv=None, **kwargs): ...
def function[patch, parameter[name, source, source_hash, source_hash_name, skip_verify, template, context, defaults, options, reject_file, strip, saltenv]]: constant[ Ensure that a patch has been applied to the specified file or directory .. versionchanged:: 2019.2.0 The ``hash`` and ``dry_run_...
keyword[def] identifier[patch] ( identifier[name] , identifier[source] = keyword[None] , identifier[source_hash] = keyword[None] , identifier[source_hash_name] = keyword[None] , identifier[skip_verify] = keyword[False] , identifier[template] = keyword[None] , identifier[context] = keyword[None] , identifier[de...
def patch(name, source=None, source_hash=None, source_hash_name=None, skip_verify=False, template=None, context=None, defaults=None, options='', reject_file=None, strip=None, saltenv=None, **kwargs): """ Ensure that a patch has been applied to the specified file or directory .. versionchanged:: 2019.2.0 ...
def main(self): """ Run the required methods in the appropriate order """ self.targets() self.bait(k=49) self.reversebait(maskmiddle='t', k=19) self.subsample_reads()
def function[main, parameter[self]]: constant[ Run the required methods in the appropriate order ] call[name[self].targets, parameter[]] call[name[self].bait, parameter[]] call[name[self].reversebait, parameter[]] call[name[self].subsample_reads, parameter[]]
keyword[def] identifier[main] ( identifier[self] ): literal[string] identifier[self] . identifier[targets] () identifier[self] . identifier[bait] ( identifier[k] = literal[int] ) identifier[self] . identifier[reversebait] ( identifier[maskmiddle] = literal[string] , identifier[k] ...
def main(self): """ Run the required methods in the appropriate order """ self.targets() self.bait(k=49) self.reversebait(maskmiddle='t', k=19) self.subsample_reads()
def strip_dbm_antsignal(self, idx): """strip(1 byte) radiotap.dbm.ant_signal :idx: int :return: int idx :return: int """ dbm_antsignal, = struct.unpack_from('<b', self._rtap, idx) return idx + 1, dbm_antsignal
def function[strip_dbm_antsignal, parameter[self, idx]]: constant[strip(1 byte) radiotap.dbm.ant_signal :idx: int :return: int idx :return: int ] <ast.Tuple object at 0x7da1aff00370> assign[=] call[name[struct].unpack_from, parameter[constant[<b], name[self]._...
keyword[def] identifier[strip_dbm_antsignal] ( identifier[self] , identifier[idx] ): literal[string] identifier[dbm_antsignal] ,= identifier[struct] . identifier[unpack_from] ( literal[string] , identifier[self] . identifier[_rtap] , identifier[idx] ) keyword[return] identifier[idx] + lit...
def strip_dbm_antsignal(self, idx): """strip(1 byte) radiotap.dbm.ant_signal :idx: int :return: int idx :return: int """ (dbm_antsignal,) = struct.unpack_from('<b', self._rtap, idx) return (idx + 1, dbm_antsignal)
def start_tag(self, name, attrs=None): """Open an XML tag""" if not attrs: self._write('<%s>' % name) else: self._write('<' + name) for (name, value) in sorted(attrs.items()): self._write( ' %s=%s' % (name, quoteattr(scienti...
def function[start_tag, parameter[self, name, attrs]]: constant[Open an XML tag] if <ast.UnaryOp object at 0x7da204622c50> begin[:] call[name[self]._write, parameter[binary_operation[constant[<%s>] <ast.Mod object at 0x7da2590d6920> name[name]]]] <ast.AugAssign object at 0x7da2046204...
keyword[def] identifier[start_tag] ( identifier[self] , identifier[name] , identifier[attrs] = keyword[None] ): literal[string] keyword[if] keyword[not] identifier[attrs] : identifier[self] . identifier[_write] ( literal[string] % identifier[name] ) keyword[else] : ...
def start_tag(self, name, attrs=None): """Open an XML tag""" if not attrs: self._write('<%s>' % name) # depends on [control=['if'], data=[]] else: self._write('<' + name) for (name, value) in sorted(attrs.items()): self._write(' %s=%s' % (name, quoteattr(scientificformat...
def from_dict(data, require=None): """Validates a dictionary containing Google service account data. Creates and returns a :class:`google.auth.crypt.Signer` instance from the private key specified in the data. Args: data (Mapping[str, str]): The service account data require (Sequence[s...
def function[from_dict, parameter[data, require]]: constant[Validates a dictionary containing Google service account data. Creates and returns a :class:`google.auth.crypt.Signer` instance from the private key specified in the data. Args: data (Mapping[str, str]): The service account data ...
keyword[def] identifier[from_dict] ( identifier[data] , identifier[require] = keyword[None] ): literal[string] identifier[keys_needed] = identifier[set] ( identifier[require] keyword[if] identifier[require] keyword[is] keyword[not] keyword[None] keyword[else] []) identifier[missing] = identifie...
def from_dict(data, require=None): """Validates a dictionary containing Google service account data. Creates and returns a :class:`google.auth.crypt.Signer` instance from the private key specified in the data. Args: data (Mapping[str, str]): The service account data require (Sequence[s...
def get_face_fun_on(self): """ determine extend fmt """ command = const.CMD_OPTIONS_RRQ command_string = b'FaceFunOn\x00' response_size = 1024 cmd_response = self.__send_command(command, command_string, response_size) if cmd_response.get('status'): ...
def function[get_face_fun_on, parameter[self]]: constant[ determine extend fmt ] variable[command] assign[=] name[const].CMD_OPTIONS_RRQ variable[command_string] assign[=] constant[b'FaceFunOn\x00'] variable[response_size] assign[=] constant[1024] variable[cmd_res...
keyword[def] identifier[get_face_fun_on] ( identifier[self] ): literal[string] identifier[command] = identifier[const] . identifier[CMD_OPTIONS_RRQ] identifier[command_string] = literal[string] identifier[response_size] = literal[int] identifier[cmd_response] = identi...
def get_face_fun_on(self): """ determine extend fmt """ command = const.CMD_OPTIONS_RRQ command_string = b'FaceFunOn\x00' response_size = 1024 cmd_response = self.__send_command(command, command_string, response_size) if cmd_response.get('status'): response = self.__data....
def check_status(status): """ Check the status of a mkl functions and raise a python exeption if there is an error. """ if status: msg = lib.DftiErrorMessage(status) msg = ctypes.c_char_p(msg).value raise RuntimeError(msg)
def function[check_status, parameter[status]]: constant[ Check the status of a mkl functions and raise a python exeption if there is an error. ] if name[status] begin[:] variable[msg] assign[=] call[name[lib].DftiErrorMessage, parameter[name[status]]] variable[msg...
keyword[def] identifier[check_status] ( identifier[status] ): literal[string] keyword[if] identifier[status] : identifier[msg] = identifier[lib] . identifier[DftiErrorMessage] ( identifier[status] ) identifier[msg] = identifier[ctypes] . identifier[c_char_p] ( identifier[msg] ). identifi...
def check_status(status): """ Check the status of a mkl functions and raise a python exeption if there is an error. """ if status: msg = lib.DftiErrorMessage(status) msg = ctypes.c_char_p(msg).value raise RuntimeError(msg) # depends on [control=['if'], data=[]]
def run( self, host: Optional[str] = None, port: Optional[int] = None, debug: bool = False, ssl: Union[dict, SSLContext, None] = None, sock: Optional[socket] = None, workers: int = 1, protocol: Type[Protocol] = None, backlog: int = 100, sto...
def function[run, parameter[self, host, port, debug, ssl, sock, workers, protocol, backlog, stop_event, register_sys_signals, access_log]]: constant[Run the HTTP Server and listen until keyboard interrupt or term signal. On termination, drain connections before closing. :param host: Address to ...
keyword[def] identifier[run] ( identifier[self] , identifier[host] : identifier[Optional] [ identifier[str] ]= keyword[None] , identifier[port] : identifier[Optional] [ identifier[int] ]= keyword[None] , identifier[debug] : identifier[bool] = keyword[False] , identifier[ssl] : identifier[Union] [ identifier[dict...
def run(self, host: Optional[str]=None, port: Optional[int]=None, debug: bool=False, ssl: Union[dict, SSLContext, None]=None, sock: Optional[socket]=None, workers: int=1, protocol: Type[Protocol]=None, backlog: int=100, stop_event: Any=None, register_sys_signals: bool=True, access_log: Optional[bool]=None, **kwargs: An...
def add_layer_from_yaml_file(self, filename): """This function implements loading a YAML file and populating a new empty layer (Layer) with its contents :param filename: The name of a file to read :type filename: string """ if filename.endswith(('.yaml', '.yml')): ...
def function[add_layer_from_yaml_file, parameter[self, filename]]: constant[This function implements loading a YAML file and populating a new empty layer (Layer) with its contents :param filename: The name of a file to read :type filename: string ] if call[name[filename]...
keyword[def] identifier[add_layer_from_yaml_file] ( identifier[self] , identifier[filename] ): literal[string] keyword[if] identifier[filename] . identifier[endswith] (( literal[string] , literal[string] )): identifier[file_stream] = keyword[None] keyword[try] : ...
def add_layer_from_yaml_file(self, filename): """This function implements loading a YAML file and populating a new empty layer (Layer) with its contents :param filename: The name of a file to read :type filename: string """ if filename.endswith(('.yaml', '.yml')): file_s...
def config_replace(self, *args, **kwargs): """Replaces the existing config with a user-defined config. Make sure to back up the config file first if neccessary, as this operation can't be undone. """ return self._client.request('/config/replace', args, ...
def function[config_replace, parameter[self]]: constant[Replaces the existing config with a user-defined config. Make sure to back up the config file first if neccessary, as this operation can't be undone. ] return[call[name[self]._client.request, parameter[constant[/config/replace]...
keyword[def] identifier[config_replace] ( identifier[self] ,* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[return] identifier[self] . identifier[_client] . identifier[request] ( literal[string] , identifier[args] , identifier[decoder] = literal[string] ,** identifier...
def config_replace(self, *args, **kwargs): """Replaces the existing config with a user-defined config. Make sure to back up the config file first if neccessary, as this operation can't be undone. """ return self._client.request('/config/replace', args, decoder='json', **kwargs)
def set_prop(self, prop, value, ef=None): """ set attributes values :param prop: :param value: :param ef: :return: """ if ef: # prop should be restricted to n_decoys, an int, the no. of decoys corresponding to a given FPF. # value i...
def function[set_prop, parameter[self, prop, value, ef]]: constant[ set attributes values :param prop: :param value: :param ef: :return: ] if name[ef] begin[:] call[name[self].ef][name[prop]] assign[=] name[value]
keyword[def] identifier[set_prop] ( identifier[self] , identifier[prop] , identifier[value] , identifier[ef] = keyword[None] ): literal[string] keyword[if] identifier[ef] : identifier[self] . identifier[ef] [ identifier[prop] ]= identifier[value] keyword[el...
def set_prop(self, prop, value, ef=None): """ set attributes values :param prop: :param value: :param ef: :return: """ if ef: # prop should be restricted to n_decoys, an int, the no. of decoys corresponding to a given FPF. # value is restricted to ...
def from_heatmaps(heatmaps, class_indices=None, nb_classes=None): """ Convert heatmaps to segmentation map. Assumes that each class is represented as a single heatmap channel. Parameters ---------- heatmaps : imgaug.HeatmapsOnImage Heatmaps to convert. ...
def function[from_heatmaps, parameter[heatmaps, class_indices, nb_classes]]: constant[ Convert heatmaps to segmentation map. Assumes that each class is represented as a single heatmap channel. Parameters ---------- heatmaps : imgaug.HeatmapsOnImage Heatmaps ...
keyword[def] identifier[from_heatmaps] ( identifier[heatmaps] , identifier[class_indices] = keyword[None] , identifier[nb_classes] = keyword[None] ): literal[string] keyword[if] identifier[class_indices] keyword[is] keyword[None] : keyword[return] identifier[SegmentationMapOnImage]...
def from_heatmaps(heatmaps, class_indices=None, nb_classes=None): """ Convert heatmaps to segmentation map. Assumes that each class is represented as a single heatmap channel. Parameters ---------- heatmaps : imgaug.HeatmapsOnImage Heatmaps to convert. ...
def list_difference(left, right): """ Take the not-in-place difference of two lists (left - right), similar to sets but preserving order. """ blocked = set(right) difference = [] for item in left: if item not in blocked: blocked.add(item) difference.append(item) ...
def function[list_difference, parameter[left, right]]: constant[ Take the not-in-place difference of two lists (left - right), similar to sets but preserving order. ] variable[blocked] assign[=] call[name[set], parameter[name[right]]] variable[difference] assign[=] list[[]] for t...
keyword[def] identifier[list_difference] ( identifier[left] , identifier[right] ): literal[string] identifier[blocked] = identifier[set] ( identifier[right] ) identifier[difference] =[] keyword[for] identifier[item] keyword[in] identifier[left] : keyword[if] identifier[item] keyword...
def list_difference(left, right): """ Take the not-in-place difference of two lists (left - right), similar to sets but preserving order. """ blocked = set(right) difference = [] for item in left: if item not in blocked: blocked.add(item) difference.append(item) ...
def simxJointGetForce(clientID, jointHandle, operationMode): ''' Please have a look at the function description/documentation in the V-REP user manual ''' force = ct.c_float() return c_GetJointForce(clientID, jointHandle, ct.byref(force), operationMode), force.value
def function[simxJointGetForce, parameter[clientID, jointHandle, operationMode]]: constant[ Please have a look at the function description/documentation in the V-REP user manual ] variable[force] assign[=] call[name[ct].c_float, parameter[]] return[tuple[[<ast.Call object at 0x7da1b15d1b10>,...
keyword[def] identifier[simxJointGetForce] ( identifier[clientID] , identifier[jointHandle] , identifier[operationMode] ): literal[string] identifier[force] = identifier[ct] . identifier[c_float] () keyword[return] identifier[c_GetJointForce] ( identifier[clientID] , identifier[jointHandle] , identif...
def simxJointGetForce(clientID, jointHandle, operationMode): """ Please have a look at the function description/documentation in the V-REP user manual """ force = ct.c_float() return (c_GetJointForce(clientID, jointHandle, ct.byref(force), operationMode), force.value)
def get_spec_list(image_specs, container_args): """ Given a list of specs and a set of container args, return a tuple of the final container argument list and the original list size """ spec_list = [spec.strip() for spec in image_specs.split('|')] original_count = len(spec_list) if 'count' in cont...
def function[get_spec_list, parameter[image_specs, container_args]]: constant[ Given a list of specs and a set of container args, return a tuple of the final container argument list and the original list size ] variable[spec_list] assign[=] <ast.ListComp object at 0x7da20c6c5810> variable[or...
keyword[def] identifier[get_spec_list] ( identifier[image_specs] , identifier[container_args] ): literal[string] identifier[spec_list] =[ identifier[spec] . identifier[strip] () keyword[for] identifier[spec] keyword[in] identifier[image_specs] . identifier[split] ( literal[string] )] identifier[or...
def get_spec_list(image_specs, container_args): """ Given a list of specs and a set of container args, return a tuple of the final container argument list and the original list size """ spec_list = [spec.strip() for spec in image_specs.split('|')] original_count = len(spec_list) if 'count' in contai...
def inject(self, contents=None, **kwargs): """ Adds content data in this element. This will be used in the rendering of this element's childs. Multiple injections on the same key will override the content (dict.update behavior). """ if contents and not isinstance(contents, dict):...
def function[inject, parameter[self, contents]]: constant[ Adds content data in this element. This will be used in the rendering of this element's childs. Multiple injections on the same key will override the content (dict.update behavior). ] if <ast.BoolOp object at 0x7da1b0e25c...
keyword[def] identifier[inject] ( identifier[self] , identifier[contents] = keyword[None] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[contents] keyword[and] keyword[not] identifier[isinstance] ( identifier[contents] , identifier[dict] ): keyword[raise] identif...
def inject(self, contents=None, **kwargs): """ Adds content data in this element. This will be used in the rendering of this element's childs. Multiple injections on the same key will override the content (dict.update behavior). """ if contents and (not isinstance(contents, dict)): ...
def run(self, name, *args): """Run an action as specified by its name.""" assert isinstance(name, string_types) # Resolve the alias if it is an alias. name = self._aliases.get(name, name) # Get the action. action = self._actions_dict.get(name, None) if not action:...
def function[run, parameter[self, name]]: constant[Run an action as specified by its name.] assert[call[name[isinstance], parameter[name[name], name[string_types]]]] variable[name] assign[=] call[name[self]._aliases.get, parameter[name[name], name[name]]] variable[action] assign[=] call[name...
keyword[def] identifier[run] ( identifier[self] , identifier[name] ,* identifier[args] ): literal[string] keyword[assert] identifier[isinstance] ( identifier[name] , identifier[string_types] ) identifier[name] = identifier[self] . identifier[_aliases] . identifier[get] ( identifi...
def run(self, name, *args): """Run an action as specified by its name.""" assert isinstance(name, string_types) # Resolve the alias if it is an alias. name = self._aliases.get(name, name) # Get the action. action = self._actions_dict.get(name, None) if not action: raise ValueError("A...
def get_full_description(self): """Generates the FULL description Returns: The FULL description Raises: FormatException: if formating fails and throw_exception_on_parse_error is True """ try: time_segment = self.get_time_of_day_description()...
def function[get_full_description, parameter[self]]: constant[Generates the FULL description Returns: The FULL description Raises: FormatException: if formating fails and throw_exception_on_parse_error is True ] <ast.Try object at 0x7da1b04059f0> return[...
keyword[def] identifier[get_full_description] ( identifier[self] ): literal[string] keyword[try] : identifier[time_segment] = identifier[self] . identifier[get_time_of_day_description] () identifier[day_of_month_desc] = identifier[self] . identifier[get_day_of_month_descr...
def get_full_description(self): """Generates the FULL description Returns: The FULL description Raises: FormatException: if formating fails and throw_exception_on_parse_error is True """ try: time_segment = self.get_time_of_day_description() day_...
def stop_request(self, stop_now=False): """Send a stop request to the daemon :param stop_now: stop now or go to stop wait mode :type stop_now: bool :return: the daemon response (True) """ logger.debug("Sending stop request to %s, stop now: %s", self.name, stop_now) ...
def function[stop_request, parameter[self, stop_now]]: constant[Send a stop request to the daemon :param stop_now: stop now or go to stop wait mode :type stop_now: bool :return: the daemon response (True) ] call[name[logger].debug, parameter[constant[Sending stop request...
keyword[def] identifier[stop_request] ( identifier[self] , identifier[stop_now] = keyword[False] ): literal[string] identifier[logger] . identifier[debug] ( literal[string] , identifier[self] . identifier[name] , identifier[stop_now] ) identifier[res] = identifier[self] . identifier[con] ...
def stop_request(self, stop_now=False): """Send a stop request to the daemon :param stop_now: stop now or go to stop wait mode :type stop_now: bool :return: the daemon response (True) """ logger.debug('Sending stop request to %s, stop now: %s', self.name, stop_now) res = sel...
def get_scipy_minimizer(**kwargs): """Get minimizer which uses `scipy.optimize.minimize`""" def minimizer(objective, n_params): params = [random.random() for _ in range(n_params)] result = scipy_minimizer(objective, params, **kwargs) return result.x return minimizer
def function[get_scipy_minimizer, parameter[]]: constant[Get minimizer which uses `scipy.optimize.minimize`] def function[minimizer, parameter[objective, n_params]]: variable[params] assign[=] <ast.ListComp object at 0x7da2044c0940> variable[result] assign[=] call[name[sc...
keyword[def] identifier[get_scipy_minimizer] (** identifier[kwargs] ): literal[string] keyword[def] identifier[minimizer] ( identifier[objective] , identifier[n_params] ): identifier[params] =[ identifier[random] . identifier[random] () keyword[for] identifier[_] keyword[in] identifier[range] ...
def get_scipy_minimizer(**kwargs): """Get minimizer which uses `scipy.optimize.minimize`""" def minimizer(objective, n_params): params = [random.random() for _ in range(n_params)] result = scipy_minimizer(objective, params, **kwargs) return result.x return minimizer
def _flatten_per_cluster(per_cluster): """Convert a dictionary {cluster: spikes} to a spikes array.""" return np.sort(np.concatenate(list(per_cluster.values()))).astype(np.int64)
def function[_flatten_per_cluster, parameter[per_cluster]]: constant[Convert a dictionary {cluster: spikes} to a spikes array.] return[call[call[name[np].sort, parameter[call[name[np].concatenate, parameter[call[name[list], parameter[call[name[per_cluster].values, parameter[]]]]]]]].astype, parameter[name[n...
keyword[def] identifier[_flatten_per_cluster] ( identifier[per_cluster] ): literal[string] keyword[return] identifier[np] . identifier[sort] ( identifier[np] . identifier[concatenate] ( identifier[list] ( identifier[per_cluster] . identifier[values] ()))). identifier[astype] ( identifier[np] . identifier[...
def _flatten_per_cluster(per_cluster): """Convert a dictionary {cluster: spikes} to a spikes array.""" return np.sort(np.concatenate(list(per_cluster.values()))).astype(np.int64)
def diff(self, other=diff.Diffable.Index, paths=None, create_patch=False, **kwargs): """Diff this index against the working copy or a Tree or Commit object For a documentation of the parameters and return values, see Diffable.diff :note: Will only work with indices that rep...
def function[diff, parameter[self, other, paths, create_patch]]: constant[Diff this index against the working copy or a Tree or Commit object For a documentation of the parameters and return values, see Diffable.diff :note: Will only work with indices that represent the def...
keyword[def] identifier[diff] ( identifier[self] , identifier[other] = identifier[diff] . identifier[Diffable] . identifier[Index] , identifier[paths] = keyword[None] , identifier[create_patch] = keyword[False] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[other] keywo...
def diff(self, other=diff.Diffable.Index, paths=None, create_patch=False, **kwargs): """Diff this index against the working copy or a Tree or Commit object For a documentation of the parameters and return values, see Diffable.diff :note: Will only work with indices that represe...
def write(self, *text, sep=' '): """ Write text to response :param text: :param sep: :return: """ self.text += markdown.text(*text, sep) return self
def function[write, parameter[self]]: constant[ Write text to response :param text: :param sep: :return: ] <ast.AugAssign object at 0x7da1b18f9060> return[name[self]]
keyword[def] identifier[write] ( identifier[self] ,* identifier[text] , identifier[sep] = literal[string] ): literal[string] identifier[self] . identifier[text] += identifier[markdown] . identifier[text] (* identifier[text] , identifier[sep] ) keyword[return] identifier[self]
def write(self, *text, sep=' '): """ Write text to response :param text: :param sep: :return: """ self.text += markdown.text(*text, sep) return self
def reads(self): ''' The reads in this PileupCollection. All reads will have an alignment that overlaps at least one of the included loci. Since SAM (and pysam) have no real notion of a "read", the returned instances are actually pysam.AlignedSegment instances, (i.e. al...
def function[reads, parameter[self]]: constant[ The reads in this PileupCollection. All reads will have an alignment that overlaps at least one of the included loci. Since SAM (and pysam) have no real notion of a "read", the returned instances are actually pysam.AlignedSegment i...
keyword[def] identifier[reads] ( identifier[self] ): literal[string] keyword[def] identifier[alignment_precedence] ( identifier[pysam_alignment_record] ): keyword[return] identifier[pysam_alignment_record] . identifier[mapping_quality] identifier[result] ={} ...
def reads(self): """ The reads in this PileupCollection. All reads will have an alignment that overlaps at least one of the included loci. Since SAM (and pysam) have no real notion of a "read", the returned instances are actually pysam.AlignedSegment instances, (i.e. alignm...
def trigger(self, when=1): """Declare a window with this window's size and a trigger policy. When the window is triggered is defined by `when`. If `when` is an `int` then the window is triggered every `when` tuples. For example, with ``when=5`` the window will be triggered eve...
def function[trigger, parameter[self, when]]: constant[Declare a window with this window's size and a trigger policy. When the window is triggered is defined by `when`. If `when` is an `int` then the window is triggered every `when` tuples. For example, with ``when=5`` the window ...
keyword[def] identifier[trigger] ( identifier[self] , identifier[when] = literal[int] ): literal[string] identifier[tw] = identifier[Window] ( identifier[self] . identifier[stream] , identifier[self] . identifier[_config] [ literal[string] ]) identifier[tw] . identifier[_config] [ literal[...
def trigger(self, when=1): """Declare a window with this window's size and a trigger policy. When the window is triggered is defined by `when`. If `when` is an `int` then the window is triggered every `when` tuples. For example, with ``when=5`` the window will be triggered every f...
def _fetch_itemslist(self, item): """ We define two collection: - Number of work injuries ("Arbetsolycka") - Number of workrelated diseases ("Arbetssjukdom") Each contains four datasets: - Per municipality and year - Per county and year - Per municipality and mont...
def function[_fetch_itemslist, parameter[self, item]]: constant[ We define two collection: - Number of work injuries ("Arbetsolycka") - Number of workrelated diseases ("Arbetssjukdom") Each contains four datasets: - Per municipality and year - Per county and year ...
keyword[def] identifier[_fetch_itemslist] ( identifier[self] , identifier[item] ): literal[string] keyword[if] identifier[item] . identifier[is_root] : keyword[for] identifier[c] keyword[in] [ literal[string] , literal[string] ]: keyword[yield] identifier[Collectio...
def _fetch_itemslist(self, item): """ We define two collection: - Number of work injuries ("Arbetsolycka") - Number of workrelated diseases ("Arbetssjukdom") Each contains four datasets: - Per municipality and year - Per county and year - Per municipality and month ...
def rmdir(self, req, parent, name): """Remove a directory Valid replies: reply_err """ self.reply_err(req, errno.EROFS)
def function[rmdir, parameter[self, req, parent, name]]: constant[Remove a directory Valid replies: reply_err ] call[name[self].reply_err, parameter[name[req], name[errno].EROFS]]
keyword[def] identifier[rmdir] ( identifier[self] , identifier[req] , identifier[parent] , identifier[name] ): literal[string] identifier[self] . identifier[reply_err] ( identifier[req] , identifier[errno] . identifier[EROFS] )
def rmdir(self, req, parent, name): """Remove a directory Valid replies: reply_err """ self.reply_err(req, errno.EROFS)
def vblk_erase(self, address): """nvm_vblk erase""" cmd = ["nvm_vblk erase", self.envs, "0x%x" % address] status, _, _ = cij.ssh.command(cmd, shell=True) return status
def function[vblk_erase, parameter[self, address]]: constant[nvm_vblk erase] variable[cmd] assign[=] list[[<ast.Constant object at 0x7da18f09e200>, <ast.Attribute object at 0x7da18f09f820>, <ast.BinOp object at 0x7da18f09e1a0>]] <ast.Tuple object at 0x7da18f09f580> assign[=] call[name[cij].ssh.c...
keyword[def] identifier[vblk_erase] ( identifier[self] , identifier[address] ): literal[string] identifier[cmd] =[ literal[string] , identifier[self] . identifier[envs] , literal[string] % identifier[address] ] identifier[status] , identifier[_] , identifier[_] = identifier[cij] . ident...
def vblk_erase(self, address): """nvm_vblk erase""" cmd = ['nvm_vblk erase', self.envs, '0x%x' % address] (status, _, _) = cij.ssh.command(cmd, shell=True) return status
def show(uuid): ''' Show manifest of a given image uuid : string uuid of image CLI Example: .. code-block:: bash salt '*' imgadm.show e42f8c84-bbea-11e2-b920-078fab2aab1f salt '*' imgadm.show plexinc/pms-docker:plexpass ''' ret = {} if _is_uuid(uuid) or _is_d...
def function[show, parameter[uuid]]: constant[ Show manifest of a given image uuid : string uuid of image CLI Example: .. code-block:: bash salt '*' imgadm.show e42f8c84-bbea-11e2-b920-078fab2aab1f salt '*' imgadm.show plexinc/pms-docker:plexpass ] variabl...
keyword[def] identifier[show] ( identifier[uuid] ): literal[string] identifier[ret] ={} keyword[if] identifier[_is_uuid] ( identifier[uuid] ) keyword[or] identifier[_is_docker_uuid] ( identifier[uuid] ): identifier[cmd] = literal[string] . identifier[format] ( identifier[uuid] ) i...
def show(uuid): """ Show manifest of a given image uuid : string uuid of image CLI Example: .. code-block:: bash salt '*' imgadm.show e42f8c84-bbea-11e2-b920-078fab2aab1f salt '*' imgadm.show plexinc/pms-docker:plexpass """ ret = {} if _is_uuid(uuid) or _is_do...
def apply( self, func, axis=0, broadcast=None, raw=False, reduce=None, result_type=None, convert_dtype=True, args=(), **kwds ): """Apply a function along input axis of DataFrame. Args: func: T...
def function[apply, parameter[self, func, axis, broadcast, raw, reduce, result_type, convert_dtype, args]]: constant[Apply a function along input axis of DataFrame. Args: func: The function to apply axis: The axis over which to apply the func. broadcast: Whether or n...
keyword[def] identifier[apply] ( identifier[self] , identifier[func] , identifier[axis] = literal[int] , identifier[broadcast] = keyword[None] , identifier[raw] = keyword[False] , identifier[reduce] = keyword[None] , identifier[result_type] = keyword[None] , identifier[convert_dtype] = keyword[True] ,...
def apply(self, func, axis=0, broadcast=None, raw=False, reduce=None, result_type=None, convert_dtype=True, args=(), **kwds): """Apply a function along input axis of DataFrame. Args: func: The function to apply axis: The axis over which to apply the func. broadcast: Whet...
def createProduct(self, powerups): """ Create a new L{Product} instance which confers the given powerups. @type powerups: C{list} of powerup item types @rtype: L{Product} @return: The new product instance. """ types = [qual(powerup).decode('ascii') ...
def function[createProduct, parameter[self, powerups]]: constant[ Create a new L{Product} instance which confers the given powerups. @type powerups: C{list} of powerup item types @rtype: L{Product} @return: The new product instance. ] variable[types] ass...
keyword[def] identifier[createProduct] ( identifier[self] , identifier[powerups] ): literal[string] identifier[types] =[ identifier[qual] ( identifier[powerup] ). identifier[decode] ( literal[string] ) keyword[for] identifier[powerup] keyword[in] identifier[powerups] ] keyword[...
def createProduct(self, powerups): """ Create a new L{Product} instance which confers the given powerups. @type powerups: C{list} of powerup item types @rtype: L{Product} @return: The new product instance. """ types = [qual(powerup).decode('ascii') for powerup i...
def add_output(self, address, value, unit='satoshi'): """ Add an output (a person who will receive funds via this tx). If no unit is specified, satoshi is implied. """ value_satoshi = self.from_unit_to_satoshi(value, unit) if self.verbose: print("Adding outpu...
def function[add_output, parameter[self, address, value, unit]]: constant[ Add an output (a person who will receive funds via this tx). If no unit is specified, satoshi is implied. ] variable[value_satoshi] assign[=] call[name[self].from_unit_to_satoshi, parameter[name[value], na...
keyword[def] identifier[add_output] ( identifier[self] , identifier[address] , identifier[value] , identifier[unit] = literal[string] ): literal[string] identifier[value_satoshi] = identifier[self] . identifier[from_unit_to_satoshi] ( identifier[value] , identifier[unit] ) keyword[if] id...
def add_output(self, address, value, unit='satoshi'): """ Add an output (a person who will receive funds via this tx). If no unit is specified, satoshi is implied. """ value_satoshi = self.from_unit_to_satoshi(value, unit) if self.verbose: print('Adding output of: %s satoshi ...
def plot(self, fig=None, plot_trap=False, name=False, trap_color='g', trap_kwargs=None, **kwargs): """ Makes a simple plot of signal :param fig: (optional) Argument for :func:`plotutils.setfig`. :param plot_trap: (optional) Whether to plot the (best...
def function[plot, parameter[self, fig, plot_trap, name, trap_color, trap_kwargs]]: constant[ Makes a simple plot of signal :param fig: (optional) Argument for :func:`plotutils.setfig`. :param plot_trap: (optional) Whether to plot the (best-fit least-sq) trapezo...
keyword[def] identifier[plot] ( identifier[self] , identifier[fig] = keyword[None] , identifier[plot_trap] = keyword[False] , identifier[name] = keyword[False] , identifier[trap_color] = literal[string] , identifier[trap_kwargs] = keyword[None] ,** identifier[kwargs] ): literal[string] identifier...
def plot(self, fig=None, plot_trap=False, name=False, trap_color='g', trap_kwargs=None, **kwargs): """ Makes a simple plot of signal :param fig: (optional) Argument for :func:`plotutils.setfig`. :param plot_trap: (optional) Whether to plot the (best-fit least-sq) tr...
def _cleanup(self): ''' Cleanup all the local data. ''' self._select_cb = None self._commit_cb = None self._rollback_cb = None super(TransactionClass, self)._cleanup()
def function[_cleanup, parameter[self]]: constant[ Cleanup all the local data. ] name[self]._select_cb assign[=] constant[None] name[self]._commit_cb assign[=] constant[None] name[self]._rollback_cb assign[=] constant[None] call[call[name[super], parameter[name[Tr...
keyword[def] identifier[_cleanup] ( identifier[self] ): literal[string] identifier[self] . identifier[_select_cb] = keyword[None] identifier[self] . identifier[_commit_cb] = keyword[None] identifier[self] . identifier[_rollback_cb] = keyword[None] identifier[super] ( i...
def _cleanup(self): """ Cleanup all the local data. """ self._select_cb = None self._commit_cb = None self._rollback_cb = None super(TransactionClass, self)._cleanup()
def resample_factor(self, factor): """Resample to a new regular grid. Parameters ---------- factor : float The number of grid cells are scaled with `factor` in each dimension, i.e., ``factor * N_i`` cells along each dimension i. Returns ...
def function[resample_factor, parameter[self, factor]]: constant[Resample to a new regular grid. Parameters ---------- factor : float The number of grid cells are scaled with `factor` in each dimension, i.e., ``factor * N_i`` cells along each dimensi...
keyword[def] identifier[resample_factor] ( identifier[self] , identifier[factor] ): literal[string] identifier[newlengths] =[( identifier[N] - literal[int] )* identifier[float] ( identifier[factor] )+ literal[int] keyword[for] identifier[N] keyword[in] identifier[self] . identifier[_le...
def resample_factor(self, factor): """Resample to a new regular grid. Parameters ---------- factor : float The number of grid cells are scaled with `factor` in each dimension, i.e., ``factor * N_i`` cells along each dimension i. Returns ...
def compile(source, name): """ Compile the string source code into a shared object linked against the static version of cufft for callback support. """ cache = os.path.join(pycbc._cache_dir_path, name) hash_file = cache + ".hash" lib_file = cache + ".so" obj_file = cache + ".o" try: ...
def function[compile, parameter[source, name]]: constant[ Compile the string source code into a shared object linked against the static version of cufft for callback support. ] variable[cache] assign[=] call[name[os].path.join, parameter[name[pycbc]._cache_dir_path, name[name]]] variable...
keyword[def] identifier[compile] ( identifier[source] , identifier[name] ): literal[string] identifier[cache] = identifier[os] . identifier[path] . identifier[join] ( identifier[pycbc] . identifier[_cache_dir_path] , identifier[name] ) identifier[hash_file] = identifier[cache] + literal[string] ...
def compile(source, name): """ Compile the string source code into a shared object linked against the static version of cufft for callback support. """ cache = os.path.join(pycbc._cache_dir_path, name) hash_file = cache + '.hash' lib_file = cache + '.so' obj_file = cache + '.o' try: ...
def _initParams(self): """ initialize paramters to vector of zeros """ params = SP.zeros(self.getNumberParams()) self.setParams(params)
def function[_initParams, parameter[self]]: constant[ initialize paramters to vector of zeros ] variable[params] assign[=] call[name[SP].zeros, parameter[call[name[self].getNumberParams, parameter[]]]] call[name[self].setParams, parameter[name[params]]]
keyword[def] identifier[_initParams] ( identifier[self] ): literal[string] identifier[params] = identifier[SP] . identifier[zeros] ( identifier[self] . identifier[getNumberParams] ()) identifier[self] . identifier[setParams] ( identifier[params] )
def _initParams(self): """ initialize paramters to vector of zeros """ params = SP.zeros(self.getNumberParams()) self.setParams(params)
def _crop_pad_default(x, size, padding_mode='reflection', row_pct:uniform = 0.5, col_pct:uniform = 0.5): "Crop and pad tfm - `row_pct`,`col_pct` sets focal point." padding_mode = _pad_mode_convert[padding_mode] size = tis2hw(size) if x.shape[1:] == torch.Size(size): return x rows,cols = size row...
def function[_crop_pad_default, parameter[x, size, padding_mode, row_pct, col_pct]]: constant[Crop and pad tfm - `row_pct`,`col_pct` sets focal point.] variable[padding_mode] assign[=] call[name[_pad_mode_convert]][name[padding_mode]] variable[size] assign[=] call[name[tis2hw], parameter[name[si...
keyword[def] identifier[_crop_pad_default] ( identifier[x] , identifier[size] , identifier[padding_mode] = literal[string] , identifier[row_pct] : identifier[uniform] = literal[int] , identifier[col_pct] : identifier[uniform] = literal[int] ): literal[string] identifier[padding_mode] = identifier[_pad_mode...
def _crop_pad_default(x, size, padding_mode='reflection', row_pct: uniform=0.5, col_pct: uniform=0.5): """Crop and pad tfm - `row_pct`,`col_pct` sets focal point.""" padding_mode = _pad_mode_convert[padding_mode] size = tis2hw(size) if x.shape[1:] == torch.Size(size): return x # depends on [con...
def before_render(self): """Before template render hook """ super(BatchFolderContentsView, self).before_render() if self.context.portal_type == "BatchFolder": self.request.set("disable_border", 1)
def function[before_render, parameter[self]]: constant[Before template render hook ] call[call[name[super], parameter[name[BatchFolderContentsView], name[self]]].before_render, parameter[]] if compare[name[self].context.portal_type equal[==] constant[BatchFolder]] begin[:] ...
keyword[def] identifier[before_render] ( identifier[self] ): literal[string] identifier[super] ( identifier[BatchFolderContentsView] , identifier[self] ). identifier[before_render] () keyword[if] identifier[self] . identifier[context] . identifier[portal_type] == literal[string] : ...
def before_render(self): """Before template render hook """ super(BatchFolderContentsView, self).before_render() if self.context.portal_type == 'BatchFolder': self.request.set('disable_border', 1) # depends on [control=['if'], data=[]]
def get_cfg_router_ids(self, context, host, router_ids=None, hosting_device_ids=None): """Returns IDs of routers scheduled to l3 agent on <host>""" return self._l3plugin.cfg_list_router_ids_on_host(context, host, router_ids, ...
def function[get_cfg_router_ids, parameter[self, context, host, router_ids, hosting_device_ids]]: constant[Returns IDs of routers scheduled to l3 agent on <host>] return[call[name[self]._l3plugin.cfg_list_router_ids_on_host, parameter[name[context], name[host], name[router_ids], name[hosting_device_ids]]]]
keyword[def] identifier[get_cfg_router_ids] ( identifier[self] , identifier[context] , identifier[host] , identifier[router_ids] = keyword[None] , identifier[hosting_device_ids] = keyword[None] ): literal[string] keyword[return] identifier[self] . identifier[_l3plugin] . identifier[cfg_list_route...
def get_cfg_router_ids(self, context, host, router_ids=None, hosting_device_ids=None): """Returns IDs of routers scheduled to l3 agent on <host>""" return self._l3plugin.cfg_list_router_ids_on_host(context, host, router_ids, hosting_device_ids)
def generate(self, model, outfolder): """ Generate artifacts for given model. Attributes: model: Model for which to generate code. outfolder: Folder where code files are created. """ _logger.info('Generating code t...
def function[generate, parameter[self, model, outfolder]]: constant[ Generate artifacts for given model. Attributes: model: Model for which to generate code. outfolder: Folder where code files are created. ] call[n...
keyword[def] identifier[generate] ( identifier[self] , identifier[model] , identifier[outfolder] ): literal[string] identifier[_logger] . identifier[info] ( literal[string] . identifier[format] ( identifier[outfolder] )) keyword[for] identifier[task] keyword[in] identifier[self] . iden...
def generate(self, model, outfolder): """ Generate artifacts for given model. Attributes: model: Model for which to generate code. outfolder: Folder where code files are created. """ _logger.info('Generating code to {!r}.'...
def append(self, listIndex, changeType, initialValue=None, isMd5=False): ''' Adds a change spec to the current list of changes. The `listIndex` represents the line number (in multi-line mode) or word number (in single-line mode), and must be **INCLUSIVE** of both additions and deletions. ''' ...
def function[append, parameter[self, listIndex, changeType, initialValue, isMd5]]: constant[ Adds a change spec to the current list of changes. The `listIndex` represents the line number (in multi-line mode) or word number (in single-line mode), and must be **INCLUSIVE** of both additions and de...
keyword[def] identifier[append] ( identifier[self] , identifier[listIndex] , identifier[changeType] , identifier[initialValue] = keyword[None] , identifier[isMd5] = keyword[False] ): literal[string] keyword[if] keyword[not] identifier[isMd5] keyword[and] identifier[initialValue] keyword[is] keyword[n...
def append(self, listIndex, changeType, initialValue=None, isMd5=False): """ Adds a change spec to the current list of changes. The `listIndex` represents the line number (in multi-line mode) or word number (in single-line mode), and must be **INCLUSIVE** of both additions and deletions. """ ...
def get_converter(in_type, out_type, *args, **kwargs): ''' Scans the list of available Converters and returns an instantiation of the first one whose input and output types match those passed in. Args: in_type (type): The type of input the converter must have. out_type (type): The type of o...
def function[get_converter, parameter[in_type, out_type]]: constant[ Scans the list of available Converters and returns an instantiation of the first one whose input and output types match those passed in. Args: in_type (type): The type of input the converter must have. out_type (type):...
keyword[def] identifier[get_converter] ( identifier[in_type] , identifier[out_type] ,* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[convs] = identifier[pliers] . identifier[converters] . identifier[__all__] identifier[out_type] = identifier[listify] ( identifier[ou...
def get_converter(in_type, out_type, *args, **kwargs): """ Scans the list of available Converters and returns an instantiation of the first one whose input and output types match those passed in. Args: in_type (type): The type of input the converter must have. out_type (type): The type of o...
def encode_keys(self, keys): """ Run the encoder on a dict of values """ return dict(((k, self.encode(v)) for k, v in six.iteritems(keys) if not is_null(v)))
def function[encode_keys, parameter[self, keys]]: constant[ Run the encoder on a dict of values ] return[call[name[dict], parameter[<ast.GeneratorExp object at 0x7da2043444f0>]]]
keyword[def] identifier[encode_keys] ( identifier[self] , identifier[keys] ): literal[string] keyword[return] identifier[dict] ((( identifier[k] , identifier[self] . identifier[encode] ( identifier[v] )) keyword[for] identifier[k] , identifier[v] keyword[in] identifier[six] . identifier[iterite...
def encode_keys(self, keys): """ Run the encoder on a dict of values """ return dict(((k, self.encode(v)) for (k, v) in six.iteritems(keys) if not is_null(v)))
def longest_increasing_subsequence(x): """Longest increasing subsequence :param x: sequence :returns: longest strictly increasing subsequence y :complexity: `O(|x|*log(|y|))` """ n = len(x) p = [None] * n h = [None] b = [float('-inf')] # - infinity for i in range(n): if...
def function[longest_increasing_subsequence, parameter[x]]: constant[Longest increasing subsequence :param x: sequence :returns: longest strictly increasing subsequence y :complexity: `O(|x|*log(|y|))` ] variable[n] assign[=] call[name[len], parameter[name[x]]] variable[p] assig...
keyword[def] identifier[longest_increasing_subsequence] ( identifier[x] ): literal[string] identifier[n] = identifier[len] ( identifier[x] ) identifier[p] =[ keyword[None] ]* identifier[n] identifier[h] =[ keyword[None] ] identifier[b] =[ identifier[float] ( literal[string] )] keyword[...
def longest_increasing_subsequence(x): """Longest increasing subsequence :param x: sequence :returns: longest strictly increasing subsequence y :complexity: `O(|x|*log(|y|))` """ n = len(x) p = [None] * n h = [None] b = [float('-inf')] # - infinity for i in range(n): if...
def _check_nodegroup_minions(self, expr, greedy): # pylint: disable=unused-argument ''' Return minions found by looking at nodegroups ''' return self._check_compound_minions(nodegroup_comp(expr, self.opts['nodegroups']), DEFAULT_TARGET_DELIM, greedy)
def function[_check_nodegroup_minions, parameter[self, expr, greedy]]: constant[ Return minions found by looking at nodegroups ] return[call[name[self]._check_compound_minions, parameter[call[name[nodegroup_comp], parameter[name[expr], call[name[self].opts][constant[nodegroups]]]], name[DEFA...
keyword[def] identifier[_check_nodegroup_minions] ( identifier[self] , identifier[expr] , identifier[greedy] ): literal[string] keyword[return] identifier[self] . identifier[_check_compound_minions] ( identifier[nodegroup_comp] ( identifier[expr] , identifier[self] . identifier[opts] [ literal[str...
def _check_nodegroup_minions(self, expr, greedy): # pylint: disable=unused-argument '\n Return minions found by looking at nodegroups\n ' return self._check_compound_minions(nodegroup_comp(expr, self.opts['nodegroups']), DEFAULT_TARGET_DELIM, greedy)
def _start_browsing_some_sites(self): ''' Starts browsing some sites. Raises: NoBrowsersAvailable if none available ''' # acquire_multi() raises NoBrowsersAvailable if none available browsers = self._browser_pool.acquire_multi( (self._browser_...
def function[_start_browsing_some_sites, parameter[self]]: constant[ Starts browsing some sites. Raises: NoBrowsersAvailable if none available ] variable[browsers] assign[=] call[name[self]._browser_pool.acquire_multi, parameter[binary_operation[binary_operation[call...
keyword[def] identifier[_start_browsing_some_sites] ( identifier[self] ): literal[string] identifier[browsers] = identifier[self] . identifier[_browser_pool] . identifier[acquire_multi] ( ( identifier[self] . identifier[_browser_pool] . identifier[num_available] ()+ literal[int] )/...
def _start_browsing_some_sites(self): """ Starts browsing some sites. Raises: NoBrowsersAvailable if none available """ # acquire_multi() raises NoBrowsersAvailable if none available browsers = self._browser_pool.acquire_multi((self._browser_pool.num_available() + 1) // ...
def run_local( context: cli.CommandContext, project: projects.Project, project_steps: typing.List[projects.ProjectStep], force: bool, continue_after: bool, single_step: bool, limit: int, print_status: bool, skip_library_reload: bool = False ) -> en...
def function[run_local, parameter[context, project, project_steps, force, continue_after, single_step, limit, print_status, skip_library_reload]]: constant[ Execute the run command locally within this cauldron environment :param context: :param project: :param project_steps: :param force: ...
keyword[def] identifier[run_local] ( identifier[context] : identifier[cli] . identifier[CommandContext] , identifier[project] : identifier[projects] . identifier[Project] , identifier[project_steps] : identifier[typing] . identifier[List] [ identifier[projects] . identifier[ProjectStep] ], identifier[force] : ide...
def run_local(context: cli.CommandContext, project: projects.Project, project_steps: typing.List[projects.ProjectStep], force: bool, continue_after: bool, single_step: bool, limit: int, print_status: bool, skip_library_reload: bool=False) -> environ.Response: """ Execute the run command locally within this caul...
def array_to_hdf5(a, parent, name, **kwargs): """Write a Numpy array to an HDF5 dataset. Parameters ---------- a : ndarray Data to write. parent : string or h5py group Parent HDF5 file or group. If a string, will be treated as HDF5 file name. name : string Name o...
def function[array_to_hdf5, parameter[a, parent, name]]: constant[Write a Numpy array to an HDF5 dataset. Parameters ---------- a : ndarray Data to write. parent : string or h5py group Parent HDF5 file or group. If a string, will be treated as HDF5 file name. name : ...
keyword[def] identifier[array_to_hdf5] ( identifier[a] , identifier[parent] , identifier[name] ,** identifier[kwargs] ): literal[string] keyword[import] identifier[h5py] identifier[h5f] = keyword[None] keyword[if] identifier[isinstance] ( identifier[parent] , identifier[str] ): id...
def array_to_hdf5(a, parent, name, **kwargs): """Write a Numpy array to an HDF5 dataset. Parameters ---------- a : ndarray Data to write. parent : string or h5py group Parent HDF5 file or group. If a string, will be treated as HDF5 file name. name : string Name o...
def vlans(self): """list[dict]: A list of dictionary items describing the details of vlan interfaces. This method fetches the VLAN interfaces Examples: >>> import pynos.device >>> switch = '10.24.39.202' >>> auth = ('admin', 'password') >>>...
def function[vlans, parameter[self]]: constant[list[dict]: A list of dictionary items describing the details of vlan interfaces. This method fetches the VLAN interfaces Examples: >>> import pynos.device >>> switch = '10.24.39.202' >>> auth = ('admin', ...
keyword[def] identifier[vlans] ( identifier[self] ): literal[string] identifier[urn] = literal[string] identifier[result] =[] identifier[has_more] = literal[string] identifier[last_vlan_id] = literal[string] keyword[while] ( identifier[has_more] == literal[st...
def vlans(self): """list[dict]: A list of dictionary items describing the details of vlan interfaces. This method fetches the VLAN interfaces Examples: >>> import pynos.device >>> switch = '10.24.39.202' >>> auth = ('admin', 'password') >>> con...
def EMAIL_VERIFICATION(self): """ See e-mail verification method """ from allauth.account import app_settings as account_settings return self._setting("EMAIL_VERIFICATION", account_settings.EMAIL_VERIFICATION)
def function[EMAIL_VERIFICATION, parameter[self]]: constant[ See e-mail verification method ] from relative_module[allauth.account] import module[app_settings] return[call[name[self]._setting, parameter[constant[EMAIL_VERIFICATION], name[account_settings].EMAIL_VERIFICATION]]]
keyword[def] identifier[EMAIL_VERIFICATION] ( identifier[self] ): literal[string] keyword[from] identifier[allauth] . identifier[account] keyword[import] identifier[app_settings] keyword[as] identifier[account_settings] keyword[return] identifier[self] . identifier[_setting] ( liter...
def EMAIL_VERIFICATION(self): """ See e-mail verification method """ from allauth.account import app_settings as account_settings return self._setting('EMAIL_VERIFICATION', account_settings.EMAIL_VERIFICATION)
def saveBestScore(self): """ save current best score in the default file """ if self.score > self.best_score: self.best_score = self.score try: with open(self.scores_file, 'w') as f: f.write(str(self.best_score)) except: ...
def function[saveBestScore, parameter[self]]: constant[ save current best score in the default file ] if compare[name[self].score greater[>] name[self].best_score] begin[:] name[self].best_score assign[=] name[self].score <ast.Try object at 0x7da1b0832cb0> return[...
keyword[def] identifier[saveBestScore] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[score] > identifier[self] . identifier[best_score] : identifier[self] . identifier[best_score] = identifier[self] . identifier[score] keyword[try] : ...
def saveBestScore(self): """ save current best score in the default file """ if self.score > self.best_score: self.best_score = self.score # depends on [control=['if'], data=[]] try: with open(self.scores_file, 'w') as f: f.write(str(self.best_score)) # depends ...
def attn(image_feat, query, hparams, name="attn"): """Attention on image feature with question as query.""" with tf.variable_scope(name, "attn", values=[image_feat, query]): attn_dim = hparams.attn_dim num_glimps = hparams.num_glimps num_channels = common_layers.shape_list(image_feat)[-1] if len(com...
def function[attn, parameter[image_feat, query, hparams, name]]: constant[Attention on image feature with question as query.] with call[name[tf].variable_scope, parameter[name[name], constant[attn]]] begin[:] variable[attn_dim] assign[=] name[hparams].attn_dim variable[nu...
keyword[def] identifier[attn] ( identifier[image_feat] , identifier[query] , identifier[hparams] , identifier[name] = literal[string] ): literal[string] keyword[with] identifier[tf] . identifier[variable_scope] ( identifier[name] , literal[string] , identifier[values] =[ identifier[image_feat] , identifier[qu...
def attn(image_feat, query, hparams, name='attn'): """Attention on image feature with question as query.""" with tf.variable_scope(name, 'attn', values=[image_feat, query]): attn_dim = hparams.attn_dim num_glimps = hparams.num_glimps num_channels = common_layers.shape_list(image_feat)[-1...
def _get_link(self, cobj): """Get a valid link, False if not found""" fullname = cobj['module_short'] + '.' + cobj['name'] try: value = self._searchindex['objects'][cobj['module_short']] match = value[cobj['name']] except KeyError: link = False ...
def function[_get_link, parameter[self, cobj]]: constant[Get a valid link, False if not found] variable[fullname] assign[=] binary_operation[binary_operation[call[name[cobj]][constant[module_short]] + constant[.]] + call[name[cobj]][constant[name]]] <ast.Try object at 0x7da1b26af280> return[name...
keyword[def] identifier[_get_link] ( identifier[self] , identifier[cobj] ): literal[string] identifier[fullname] = identifier[cobj] [ literal[string] ]+ literal[string] + identifier[cobj] [ literal[string] ] keyword[try] : identifier[value] = identifier[self] . identifier[_se...
def _get_link(self, cobj): """Get a valid link, False if not found""" fullname = cobj['module_short'] + '.' + cobj['name'] try: value = self._searchindex['objects'][cobj['module_short']] match = value[cobj['name']] # depends on [control=['try'], data=[]] except KeyError: link = ...
def _rfc3339_nanos_to_datetime(dt_str): """Convert a nanosecond-precision timestamp to a native datetime. .. note:: Python datetimes do not support nanosecond precision; this function therefore truncates such values to microseconds. :type dt_str: str :param dt_str: The string to conver...
def function[_rfc3339_nanos_to_datetime, parameter[dt_str]]: constant[Convert a nanosecond-precision timestamp to a native datetime. .. note:: Python datetimes do not support nanosecond precision; this function therefore truncates such values to microseconds. :type dt_str: str :par...
keyword[def] identifier[_rfc3339_nanos_to_datetime] ( identifier[dt_str] ): literal[string] identifier[with_nanos] = identifier[_RFC3339_NANOS] . identifier[match] ( identifier[dt_str] ) keyword[if] identifier[with_nanos] keyword[is] keyword[None] : keyword[raise] identifier[ValueError] (...
def _rfc3339_nanos_to_datetime(dt_str): """Convert a nanosecond-precision timestamp to a native datetime. .. note:: Python datetimes do not support nanosecond precision; this function therefore truncates such values to microseconds. :type dt_str: str :param dt_str: The string to conver...
def maximum_size_estimated(self, sz): """ Set the CoRE Link Format sz attribute of the resource. :param sz: the CoRE Link Format sz attribute """ if not isinstance(sz, str): sz = str(sz) self._attributes["sz"] = sz
def function[maximum_size_estimated, parameter[self, sz]]: constant[ Set the CoRE Link Format sz attribute of the resource. :param sz: the CoRE Link Format sz attribute ] if <ast.UnaryOp object at 0x7da1b0689030> begin[:] variable[sz] assign[=] call[name[str], pa...
keyword[def] identifier[maximum_size_estimated] ( identifier[self] , identifier[sz] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[sz] , identifier[str] ): identifier[sz] = identifier[str] ( identifier[sz] ) identifier[self] . identifier[_att...
def maximum_size_estimated(self, sz): """ Set the CoRE Link Format sz attribute of the resource. :param sz: the CoRE Link Format sz attribute """ if not isinstance(sz, str): sz = str(sz) # depends on [control=['if'], data=[]] self._attributes['sz'] = sz
def add_criterion(self, name, priority, and_or, search_type, value): # pylint: disable=too-many-arguments """Add a search criteria object to a smart group. Args: name: String Criteria type name (e.g. "Application Title") priority: Int or Str number priority of criterion. ...
def function[add_criterion, parameter[self, name, priority, and_or, search_type, value]]: constant[Add a search criteria object to a smart group. Args: name: String Criteria type name (e.g. "Application Title") priority: Int or Str number priority of criterion. and_o...
keyword[def] identifier[add_criterion] ( identifier[self] , identifier[name] , identifier[priority] , identifier[and_or] , identifier[search_type] , identifier[value] ): literal[string] identifier[criterion] = identifier[SearchCriteria] ( identifier[name] , identifier[priority] , identifier[and_or]...
def add_criterion(self, name, priority, and_or, search_type, value): # pylint: disable=too-many-arguments 'Add a search criteria object to a smart group.\n\n Args:\n name: String Criteria type name (e.g. "Application Title")\n priority: Int or Str number priority of criterion.\n ...
def remove_property(self, prop): """Remove a property from the definition.""" self._properties.remove(prop) self._pairs.difference_update((o, prop) for o in self._objects)
def function[remove_property, parameter[self, prop]]: constant[Remove a property from the definition.] call[name[self]._properties.remove, parameter[name[prop]]] call[name[self]._pairs.difference_update, parameter[<ast.GeneratorExp object at 0x7da20c992c80>]]
keyword[def] identifier[remove_property] ( identifier[self] , identifier[prop] ): literal[string] identifier[self] . identifier[_properties] . identifier[remove] ( identifier[prop] ) identifier[self] . identifier[_pairs] . identifier[difference_update] (( identifier[o] , identifier[prop] )...
def remove_property(self, prop): """Remove a property from the definition.""" self._properties.remove(prop) self._pairs.difference_update(((o, prop) for o in self._objects))
def get_uri(self): """Return the Item source""" if self.source_file and os.path.exists(self.source_file.path): return self.source_file.path elif self.source_url: return self.source_url return None
def function[get_uri, parameter[self]]: constant[Return the Item source] if <ast.BoolOp object at 0x7da18dc99f90> begin[:] return[name[self].source_file.path] return[constant[None]]
keyword[def] identifier[get_uri] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[source_file] keyword[and] identifier[os] . identifier[path] . identifier[exists] ( identifier[self] . identifier[source_file] . identifier[path] ): keyword[return] ident...
def get_uri(self): """Return the Item source""" if self.source_file and os.path.exists(self.source_file.path): return self.source_file.path # depends on [control=['if'], data=[]] elif self.source_url: return self.source_url # depends on [control=['if'], data=[]] return None
def get_nameserver_detail_output_show_nameserver_nameserver_cos(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") get_nameserver_detail = ET.Element("get_nameserver_detail") config = get_nameserver_detail output = ET.SubElement(get_nameserver_detai...
def function[get_nameserver_detail_output_show_nameserver_nameserver_cos, parameter[self]]: constant[Auto Generated Code ] variable[config] assign[=] call[name[ET].Element, parameter[constant[config]]] variable[get_nameserver_detail] assign[=] call[name[ET].Element, parameter[constant[ge...
keyword[def] identifier[get_nameserver_detail_output_show_nameserver_nameserver_cos] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[config] = identifier[ET] . identifier[Element] ( literal[string] ) identifier[get_nameserver_detail] = identifier[ET] . identifier[El...
def get_nameserver_detail_output_show_nameserver_nameserver_cos(self, **kwargs): """Auto Generated Code """ config = ET.Element('config') get_nameserver_detail = ET.Element('get_nameserver_detail') config = get_nameserver_detail output = ET.SubElement(get_nameserver_detail, 'output') sho...
def approximate_split(x, num_splits, axis=0): """Split approximately equally into num_splits parts. Args: x: a Tensor num_splits: an integer axis: an integer. Returns: a list of num_splits Tensors. """ size = shape_list(x)[axis] size_splits = [tf.div(size + i, num_splits) for i in range(nu...
def function[approximate_split, parameter[x, num_splits, axis]]: constant[Split approximately equally into num_splits parts. Args: x: a Tensor num_splits: an integer axis: an integer. Returns: a list of num_splits Tensors. ] variable[size] assign[=] call[call[name[shape_list], pa...
keyword[def] identifier[approximate_split] ( identifier[x] , identifier[num_splits] , identifier[axis] = literal[int] ): literal[string] identifier[size] = identifier[shape_list] ( identifier[x] )[ identifier[axis] ] identifier[size_splits] =[ identifier[tf] . identifier[div] ( identifier[size] + identifier...
def approximate_split(x, num_splits, axis=0): """Split approximately equally into num_splits parts. Args: x: a Tensor num_splits: an integer axis: an integer. Returns: a list of num_splits Tensors. """ size = shape_list(x)[axis] size_splits = [tf.div(size + i, num_splits) for i in ra...
def plot (data, pconfig=None): """ Plot a scatter plot with X,Y data. :param data: 2D dict, first keys as sample names, then x:y data pairs :param pconfig: optional dict with config key:value pairs. See CONTRIBUTING.md :return: HTML and JS, ready to be inserted into the page """ if pconfig is No...
def function[plot, parameter[data, pconfig]]: constant[ Plot a scatter plot with X,Y data. :param data: 2D dict, first keys as sample names, then x:y data pairs :param pconfig: optional dict with config key:value pairs. See CONTRIBUTING.md :return: HTML and JS, ready to be inserted into the page ...
keyword[def] identifier[plot] ( identifier[data] , identifier[pconfig] = keyword[None] ): literal[string] keyword[if] identifier[pconfig] keyword[is] keyword[None] : identifier[pconfig] ={} keyword[if] literal[string] keyword[in] identifier[pconfig] keyword[and] identifier[p...
def plot(data, pconfig=None): """ Plot a scatter plot with X,Y data. :param data: 2D dict, first keys as sample names, then x:y data pairs :param pconfig: optional dict with config key:value pairs. See CONTRIBUTING.md :return: HTML and JS, ready to be inserted into the page """ if pconfig is Non...
def t_t_eopen(self, t): r'~"|~\'' if t.value[1] == '"': t.lexer.push_state('escapequotes') elif t.value[1] == '\'': t.lexer.push_state('escapeapostrophe') return t
def function[t_t_eopen, parameter[self, t]]: constant[~"|~\'] if compare[call[name[t].value][constant[1]] equal[==] constant["]] begin[:] call[name[t].lexer.push_state, parameter[constant[escapequotes]]] return[name[t]]
keyword[def] identifier[t_t_eopen] ( identifier[self] , identifier[t] ): literal[string] keyword[if] identifier[t] . identifier[value] [ literal[int] ]== literal[string] : identifier[t] . identifier[lexer] . identifier[push_state] ( literal[string] ) keyword[elif] identifier...
def t_t_eopen(self, t): """~"|~\\'""" if t.value[1] == '"': t.lexer.push_state('escapequotes') # depends on [control=['if'], data=[]] elif t.value[1] == "'": t.lexer.push_state('escapeapostrophe') # depends on [control=['if'], data=[]] return t