code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def register_service(service): """ Register the ryu application specified by 'service' as a provider of events defined in the calling module. If an application being loaded consumes events (in the sense of set_ev_cls) provided by the 'service' application, the latter application will be automat...
def function[register_service, parameter[service]]: constant[ Register the ryu application specified by 'service' as a provider of events defined in the calling module. If an application being loaded consumes events (in the sense of set_ev_cls) provided by the 'service' application, the latter ...
keyword[def] identifier[register_service] ( identifier[service] ): literal[string] identifier[frame] = identifier[inspect] . identifier[currentframe] () identifier[m_name] = identifier[frame] . identifier[f_back] . identifier[f_globals] [ literal[string] ] identifier[m] = identifier[sys] . identi...
def register_service(service): """ Register the ryu application specified by 'service' as a provider of events defined in the calling module. If an application being loaded consumes events (in the sense of set_ev_cls) provided by the 'service' application, the latter application will be automat...
def _findNearest(arr, value): """ Finds the value in arr that value is closest to """ arr = np.array(arr) # find nearest value in array idx = (abs(arr-value)).argmin() return arr[idx]
def function[_findNearest, parameter[arr, value]]: constant[ Finds the value in arr that value is closest to ] variable[arr] assign[=] call[name[np].array, parameter[name[arr]]] variable[idx] assign[=] call[call[name[abs], parameter[binary_operation[name[arr] - name[value]]]].argmin, paramet...
keyword[def] identifier[_findNearest] ( identifier[arr] , identifier[value] ): literal[string] identifier[arr] = identifier[np] . identifier[array] ( identifier[arr] ) identifier[idx] =( identifier[abs] ( identifier[arr] - identifier[value] )). identifier[argmin] () keyword[return] identifi...
def _findNearest(arr, value): """ Finds the value in arr that value is closest to """ arr = np.array(arr) # find nearest value in array idx = abs(arr - value).argmin() return arr[idx]
def set_active_vectors(self, name, preference='cell'): """Finds the vectors by name and appropriately sets it as active""" _, field = get_scalar(self, name, preference=preference, info=True) if field == POINT_DATA_FIELD: self.GetPointData().SetActiveVectors(name) elif field =...
def function[set_active_vectors, parameter[self, name, preference]]: constant[Finds the vectors by name and appropriately sets it as active] <ast.Tuple object at 0x7da18f8138b0> assign[=] call[name[get_scalar], parameter[name[self], name[name]]] if compare[name[field] equal[==] name[POINT_DATA_F...
keyword[def] identifier[set_active_vectors] ( identifier[self] , identifier[name] , identifier[preference] = literal[string] ): literal[string] identifier[_] , identifier[field] = identifier[get_scalar] ( identifier[self] , identifier[name] , identifier[preference] = identifier[preference] , identi...
def set_active_vectors(self, name, preference='cell'): """Finds the vectors by name and appropriately sets it as active""" (_, field) = get_scalar(self, name, preference=preference, info=True) if field == POINT_DATA_FIELD: self.GetPointData().SetActiveVectors(name) # depends on [control=['if'], dat...
def create(self, type, name=None, data=None, priority=None, port=None, weight=None): """ Parameters ---------- type: str {A, AAAA, CNAME, MX, TXT, SRV, NS} name: str Name of the record data: object, type-dependent type ==...
def function[create, parameter[self, type, name, data, priority, port, weight]]: constant[ Parameters ---------- type: str {A, AAAA, CNAME, MX, TXT, SRV, NS} name: str Name of the record data: object, type-dependent type == 'A' : IPv4 a...
keyword[def] identifier[create] ( identifier[self] , identifier[type] , identifier[name] = keyword[None] , identifier[data] = keyword[None] , identifier[priority] = keyword[None] , identifier[port] = keyword[None] , identifier[weight] = keyword[None] ): literal[string] keyword[if] identifier[type...
def create(self, type, name=None, data=None, priority=None, port=None, weight=None): """ Parameters ---------- type: str {A, AAAA, CNAME, MX, TXT, SRV, NS} name: str Name of the record data: object, type-dependent type == 'A' : IPv4 address...
def history(self, channel, **kwargs): """ https://api.slack.com/methods/im.history """ self.params.update({ 'channel': channel, }) if kwargs: self.params.update(kwargs) return FromUrl('https://slack.com/api/im.history', self._requests)(data=sel...
def function[history, parameter[self, channel]]: constant[ https://api.slack.com/methods/im.history ] call[name[self].params.update, parameter[dictionary[[<ast.Constant object at 0x7da18f723e80>], [<ast.Name object at 0x7da18f721ed0>]]]] if name[kwargs] begin[:] call[name...
keyword[def] identifier[history] ( identifier[self] , identifier[channel] ,** identifier[kwargs] ): literal[string] identifier[self] . identifier[params] . identifier[update] ({ literal[string] : identifier[channel] , }) keyword[if] identifier[kwargs] : ident...
def history(self, channel, **kwargs): """ https://api.slack.com/methods/im.history """ self.params.update({'channel': channel}) if kwargs: self.params.update(kwargs) # depends on [control=['if'], data=[]] return FromUrl('https://slack.com/api/im.history', self._requests)(data=self.param...
def check_resistor_board_measurements(data_file, reference_data_file=None, create_plot=True, **kwargs): """ To check basic system function a test board was built with multiple resistors attached to for connectors each. Measurements can thus be validated against known el...
def function[check_resistor_board_measurements, parameter[data_file, reference_data_file, create_plot]]: constant[ To check basic system function a test board was built with multiple resistors attached to for connectors each. Measurements can thus be validated against known electrical (ohmic) resistance...
keyword[def] identifier[check_resistor_board_measurements] ( identifier[data_file] , identifier[reference_data_file] = keyword[None] , identifier[create_plot] = keyword[True] ,** identifier[kwargs] ): literal[string] identifier[column_names] =[ literal[string] , literal[string] , literal[st...
def check_resistor_board_measurements(data_file, reference_data_file=None, create_plot=True, **kwargs): """ To check basic system function a test board was built with multiple resistors attached to for connectors each. Measurements can thus be validated against known electrical (ohmic) resistances. Not...
def index_agreement(s, o): """ index of agreement input: s: simulated o: observed output: ia: index of agreement """ # s,o = filter_nan(s,o) ia = 1 - (np.sum((o-s)**2)) /\ (np.sum((np.abs(s-np.mean(o))+np.abs(o-np.mean(o)))**2)) return...
def function[index_agreement, parameter[s, o]]: constant[ index of agreement input: s: simulated o: observed output: ia: index of agreement ] variable[ia] assign[=] binary_operation[constant[1] - binary_operation[call[name[np].sum, parameter[binary...
keyword[def] identifier[index_agreement] ( identifier[s] , identifier[o] ): literal[string] identifier[ia] = literal[int] -( identifier[np] . identifier[sum] (( identifier[o] - identifier[s] )** literal[int] ))/( identifier[np] . identifier[sum] (( identifier[np] . identifier[abs] ( identifier[s] - id...
def index_agreement(s, o): """ index of agreement input: s: simulated o: observed output: ia: index of agreement """ # s,o = filter_nan(s,o) ia = 1 - np.sum((o - s) ** 2) / np.sum((np.abs(s - np.mean(o)) + np.abs(o - np.mean(o))) ** 2) return ia
def get_time_slide_id(xmldoc, time_slide, create_new = None, superset_ok = False, nonunique_ok = False): """ Return the time_slide_id corresponding to the offset vector described by time_slide, a dictionary of instrument/offset pairs. Example: >>> get_time_slide_id(xmldoc, {"H1": 0, "L1": 0}) 'time_slide:time_s...
def function[get_time_slide_id, parameter[xmldoc, time_slide, create_new, superset_ok, nonunique_ok]]: constant[ Return the time_slide_id corresponding to the offset vector described by time_slide, a dictionary of instrument/offset pairs. Example: >>> get_time_slide_id(xmldoc, {"H1": 0, "L1": 0}) 'time_s...
keyword[def] identifier[get_time_slide_id] ( identifier[xmldoc] , identifier[time_slide] , identifier[create_new] = keyword[None] , identifier[superset_ok] = keyword[False] , identifier[nonunique_ok] = keyword[False] ): literal[string] keyword[try] : identifier[tisitable] = identifier[lsctables] . identifier[...
def get_time_slide_id(xmldoc, time_slide, create_new=None, superset_ok=False, nonunique_ok=False): """ Return the time_slide_id corresponding to the offset vector described by time_slide, a dictionary of instrument/offset pairs. Example: >>> get_time_slide_id(xmldoc, {"H1": 0, "L1": 0}) 'time_slide:time_slid...
def read_constraints_from_config(cp, transforms=None, constraint_section='constraint'): """Loads parameter constraints from a configuration file. Parameters ---------- cp : WorkflowConfigParser An open config parser to read from. transforms : list, optional ...
def function[read_constraints_from_config, parameter[cp, transforms, constraint_section]]: constant[Loads parameter constraints from a configuration file. Parameters ---------- cp : WorkflowConfigParser An open config parser to read from. transforms : list, optional List of tran...
keyword[def] identifier[read_constraints_from_config] ( identifier[cp] , identifier[transforms] = keyword[None] , identifier[constraint_section] = literal[string] ): literal[string] identifier[cons] =[] keyword[for] identifier[subsection] keyword[in] identifier[cp] . identifier[get_subsections] ( ...
def read_constraints_from_config(cp, transforms=None, constraint_section='constraint'): """Loads parameter constraints from a configuration file. Parameters ---------- cp : WorkflowConfigParser An open config parser to read from. transforms : list, optional List of transforms to app...
def port_profile_fcoe_profile_fcoeport_fcoe_map_name(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") port_profile = ET.SubElement(config, "port-profile", xmlns="urn:brocade.com:mgmt:brocade-port-profile") name_key = ET.SubElement(port_profile, "name") ...
def function[port_profile_fcoe_profile_fcoeport_fcoe_map_name, parameter[self]]: constant[Auto Generated Code ] variable[config] assign[=] call[name[ET].Element, parameter[constant[config]]] variable[port_profile] assign[=] call[name[ET].SubElement, parameter[name[config], constant[port-...
keyword[def] identifier[port_profile_fcoe_profile_fcoeport_fcoe_map_name] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[config] = identifier[ET] . identifier[Element] ( literal[string] ) identifier[port_profile] = identifier[ET] . identifier[SubElement] ( identifi...
def port_profile_fcoe_profile_fcoeport_fcoe_map_name(self, **kwargs): """Auto Generated Code """ config = ET.Element('config') port_profile = ET.SubElement(config, 'port-profile', xmlns='urn:brocade.com:mgmt:brocade-port-profile') name_key = ET.SubElement(port_profile, 'name') name_key.text ...
def _prepend_name(self, prefix, dict_): '''changes the keys of the dictionary prepending them with "name."''' return dict(['.'.join([prefix, name]), msg] for name, msg in dict_.iteritems())
def function[_prepend_name, parameter[self, prefix, dict_]]: constant[changes the keys of the dictionary prepending them with "name."] return[call[name[dict], parameter[<ast.GeneratorExp object at 0x7da18dc9aaa0>]]]
keyword[def] identifier[_prepend_name] ( identifier[self] , identifier[prefix] , identifier[dict_] ): literal[string] keyword[return] identifier[dict] ([ literal[string] . identifier[join] ([ identifier[prefix] , identifier[name] ]), identifier[msg] ] keyword[for] identifier[name] , iden...
def _prepend_name(self, prefix, dict_): '''changes the keys of the dictionary prepending them with "name."''' return dict((['.'.join([prefix, name]), msg] for (name, msg) in dict_.iteritems()))
def get_more(self, show=True, proxy=None, timeout=0): """ Calls get_querymore() Is for convenience. You like. """ return self.get_querymore(show, proxy, timeout)
def function[get_more, parameter[self, show, proxy, timeout]]: constant[ Calls get_querymore() Is for convenience. You like. ] return[call[name[self].get_querymore, parameter[name[show], name[proxy], name[timeout]]]]
keyword[def] identifier[get_more] ( identifier[self] , identifier[show] = keyword[True] , identifier[proxy] = keyword[None] , identifier[timeout] = literal[int] ): literal[string] keyword[return] identifier[self] . identifier[get_querymore] ( identifier[show] , identifier[proxy] , identifier[timeo...
def get_more(self, show=True, proxy=None, timeout=0): """ Calls get_querymore() Is for convenience. You like. """ return self.get_querymore(show, proxy, timeout)
def _urlquote(string, safe=''): """ Quotes a unicode string for use in a URL :param string: A unicode string :param safe: A unicode string of character to not encode :return: None (if string is None) or an ASCII byte string of the quoted string """ if string is No...
def function[_urlquote, parameter[string, safe]]: constant[ Quotes a unicode string for use in a URL :param string: A unicode string :param safe: A unicode string of character to not encode :return: None (if string is None) or an ASCII byte string of the quoted string ...
keyword[def] identifier[_urlquote] ( identifier[string] , identifier[safe] = literal[string] ): literal[string] keyword[if] identifier[string] keyword[is] keyword[None] keyword[or] identifier[string] == literal[string] : keyword[return] keyword[None] identifier[esca...
def _urlquote(string, safe=''): """ Quotes a unicode string for use in a URL :param string: A unicode string :param safe: A unicode string of character to not encode :return: None (if string is None) or an ASCII byte string of the quoted string """ if string is Non...
def init_fields(self): """ Initialize each fields of the fields_desc dict """ if self.class_dont_cache.get(self.__class__, False): self.do_init_fields(self.fields_desc) else: self.do_init_cached_fields()
def function[init_fields, parameter[self]]: constant[ Initialize each fields of the fields_desc dict ] if call[name[self].class_dont_cache.get, parameter[name[self].__class__, constant[False]]] begin[:] call[name[self].do_init_fields, parameter[name[self].fields_desc]]
keyword[def] identifier[init_fields] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[class_dont_cache] . identifier[get] ( identifier[self] . identifier[__class__] , keyword[False] ): identifier[self] . identifier[do_init_fields] ( identifier[self] . i...
def init_fields(self): """ Initialize each fields of the fields_desc dict """ if self.class_dont_cache.get(self.__class__, False): self.do_init_fields(self.fields_desc) # depends on [control=['if'], data=[]] else: self.do_init_cached_fields()
def parse_navigation_html_to_tree(html, id): """Parse the given ``html`` (an etree object) to a tree. The ``id`` is required in order to assign the top-level tree id value. """ def xpath(x): return html.xpath(x, namespaces=HTML_DOCUMENT_NAMESPACES) try: value = xpath('//*[@data-type=...
def function[parse_navigation_html_to_tree, parameter[html, id]]: constant[Parse the given ``html`` (an etree object) to a tree. The ``id`` is required in order to assign the top-level tree id value. ] def function[xpath, parameter[x]]: return[call[name[html].xpath, parameter[name[x]]]] ...
keyword[def] identifier[parse_navigation_html_to_tree] ( identifier[html] , identifier[id] ): literal[string] keyword[def] identifier[xpath] ( identifier[x] ): keyword[return] identifier[html] . identifier[xpath] ( identifier[x] , identifier[namespaces] = identifier[HTML_DOCUMENT_NAMESPACES] ) ...
def parse_navigation_html_to_tree(html, id): """Parse the given ``html`` (an etree object) to a tree. The ``id`` is required in order to assign the top-level tree id value. """ def xpath(x): return html.xpath(x, namespaces=HTML_DOCUMENT_NAMESPACES) try: value = xpath('//*[@data-type...
def __parse_json_file(self, file_path): """Process Json file data :@param file_path :@type file_path: string :@throws IOError """ if file_path == '' or os.path.splitext(file_path)[1] != '.json': raise IOError('Invalid Json file') with open(file_path...
def function[__parse_json_file, parameter[self, file_path]]: constant[Process Json file data :@param file_path :@type file_path: string :@throws IOError ] if <ast.BoolOp object at 0x7da18eb54d30> begin[:] <ast.Raise object at 0x7da18eb561d0> with call[na...
keyword[def] identifier[__parse_json_file] ( identifier[self] , identifier[file_path] ): literal[string] keyword[if] identifier[file_path] == literal[string] keyword[or] identifier[os] . identifier[path] . identifier[splitext] ( identifier[file_path] )[ literal[int] ]!= literal[string] : ...
def __parse_json_file(self, file_path): """Process Json file data :@param file_path :@type file_path: string :@throws IOError """ if file_path == '' or os.path.splitext(file_path)[1] != '.json': raise IOError('Invalid Json file') # depends on [control=['if'], data=[]] ...
def geocode(self): """A Generator that reads from the address generators and returns geocode results. The generator yields ( address, geocode_results, object) """ submit_set = [] data_map = {} for address, o in self.gen: submit_set.append(address) ...
def function[geocode, parameter[self]]: constant[A Generator that reads from the address generators and returns geocode results. The generator yields ( address, geocode_results, object) ] variable[submit_set] assign[=] list[[]] variable[data_map] assign[=] dictionary[[]...
keyword[def] identifier[geocode] ( identifier[self] ): literal[string] identifier[submit_set] =[] identifier[data_map] ={} keyword[for] identifier[address] , identifier[o] keyword[in] identifier[self] . identifier[gen] : identifier[submit_set] . identifier[append...
def geocode(self): """A Generator that reads from the address generators and returns geocode results. The generator yields ( address, geocode_results, object) """ submit_set = [] data_map = {} for (address, o) in self.gen: submit_set.append(address) data_map[add...
def init(self): """Initialize the URL used to connect to SABnzbd.""" self.url = self.url.format(host=self.host, port=self.port, api_key=self.api_key)
def function[init, parameter[self]]: constant[Initialize the URL used to connect to SABnzbd.] name[self].url assign[=] call[name[self].url.format, parameter[]]
keyword[def] identifier[init] ( identifier[self] ): literal[string] identifier[self] . identifier[url] = identifier[self] . identifier[url] . identifier[format] ( identifier[host] = identifier[self] . identifier[host] , identifier[port] = identifier[self] . identifier[port] , identifier[ap...
def init(self): """Initialize the URL used to connect to SABnzbd.""" self.url = self.url.format(host=self.host, port=self.port, api_key=self.api_key)
def get(self, checkplotfname): '''This handles GET requests to serve a specific checkplot pickle. This is an AJAX endpoint; returns JSON that gets converted by the frontend into things to render. ''' if checkplotfname: # do the usual safing self.checkp...
def function[get, parameter[self, checkplotfname]]: constant[This handles GET requests to serve a specific checkplot pickle. This is an AJAX endpoint; returns JSON that gets converted by the frontend into things to render. ] if name[checkplotfname] begin[:] name...
keyword[def] identifier[get] ( identifier[self] , identifier[checkplotfname] ): literal[string] keyword[if] identifier[checkplotfname] : identifier[self] . identifier[checkplotfname] = identifier[xhtml_escape] ( identifier[base64] . identifier[b64decode] ( iden...
def get(self, checkplotfname): """This handles GET requests to serve a specific checkplot pickle. This is an AJAX endpoint; returns JSON that gets converted by the frontend into things to render. """ if checkplotfname: # do the usual safing self.checkplotfname = xhtml_e...
def update_field(self, f, obj): """ update a field :param str f: name of field to be updated. :param obj: value of field to be updated. """ n = self.get_private_name(f) if not hasattr(self, n): raise AttributeError('{0} is not in {1}'.format(n, self.__class__...
def function[update_field, parameter[self, f, obj]]: constant[ update a field :param str f: name of field to be updated. :param obj: value of field to be updated. ] variable[n] assign[=] call[name[self].get_private_name, parameter[name[f]]] if <ast.UnaryOp object at 0x7d...
keyword[def] identifier[update_field] ( identifier[self] , identifier[f] , identifier[obj] ): literal[string] identifier[n] = identifier[self] . identifier[get_private_name] ( identifier[f] ) keyword[if] keyword[not] identifier[hasattr] ( identifier[self] , identifier[n] ): ...
def update_field(self, f, obj): """ update a field :param str f: name of field to be updated. :param obj: value of field to be updated. """ n = self.get_private_name(f) if not hasattr(self, n): raise AttributeError('{0} is not in {1}'.format(n, self.__class__.__name__)) # d...
def _massageData(self, row): """ Convert a row into a tuple of Item instances, by slicing it according to the number of columns for each instance, and then proceeding as for ItemQuery._massageData. @param row: an n-tuple, where n is the total number of columns specified...
def function[_massageData, parameter[self, row]]: constant[ Convert a row into a tuple of Item instances, by slicing it according to the number of columns for each instance, and then proceeding as for ItemQuery._massageData. @param row: an n-tuple, where n is the total number of...
keyword[def] identifier[_massageData] ( identifier[self] , identifier[row] ): literal[string] identifier[offset] = literal[int] identifier[resultBits] =[] keyword[for] identifier[i] , identifier[tableClass] keyword[in] identifier[enumerate] ( identifier[self] . identifier[ta...
def _massageData(self, row): """ Convert a row into a tuple of Item instances, by slicing it according to the number of columns for each instance, and then proceeding as for ItemQuery._massageData. @param row: an n-tuple, where n is the total number of columns specified by a...
def report( callingClass, astr_key, ab_exitToOs=1, astr_header="" ): ''' Error handling. Based on the <astr_key>, error information is extracted from _dictErr and sent to log object. If <ab_exitToOs> is False, error is considered ...
def function[report, parameter[callingClass, astr_key, ab_exitToOs, astr_header]]: constant[ Error handling. Based on the <astr_key>, error information is extracted from _dictErr and sent to log object. If <ab_exitToOs> is False, error is considered non-fatal and processing can continue, o...
keyword[def] identifier[report] ( identifier[callingClass] , identifier[astr_key] , identifier[ab_exitToOs] = literal[int] , identifier[astr_header] = literal[string] ): literal[string] identifier[log] = identifier[callingClass] . identifier[log] () identifier[b_syslog] = identifier[log] . identif...
def report(callingClass, astr_key, ab_exitToOs=1, astr_header=''): """ Error handling. Based on the <astr_key>, error information is extracted from _dictErr and sent to log object. If <ab_exitToOs> is False, error is considered non-fatal and processing can continue, otherwise processing termin...
def pokeStorable(self, storable, objname, obj, container, visited=None, _stack=None, **kwargs): """ Arguments: storable (StorableHandler): storable instance. objname (any): record reference. obj (any): object to be serialized. container (any): containe...
def function[pokeStorable, parameter[self, storable, objname, obj, container, visited, _stack]]: constant[ Arguments: storable (StorableHandler): storable instance. objname (any): record reference. obj (any): object to be serialized. container (any): c...
keyword[def] identifier[pokeStorable] ( identifier[self] , identifier[storable] , identifier[objname] , identifier[obj] , identifier[container] , identifier[visited] = keyword[None] , identifier[_stack] = keyword[None] ,** identifier[kwargs] ): literal[string] identifier[storable] . identi...
def pokeStorable(self, storable, objname, obj, container, visited=None, _stack=None, **kwargs): """ Arguments: storable (StorableHandler): storable instance. objname (any): record reference. obj (any): object to be serialized. container (any): container. ...
def get_atoms(self, ligands=True, inc_alt_states=False): """Flat list of all the Atoms in the Polymer. Parameters ---------- inc_alt_states : bool If true atoms from alternate conformations are included rather than only the "active" states. Returns ...
def function[get_atoms, parameter[self, ligands, inc_alt_states]]: constant[Flat list of all the Atoms in the Polymer. Parameters ---------- inc_alt_states : bool If true atoms from alternate conformations are included rather than only the "active" states. ...
keyword[def] identifier[get_atoms] ( identifier[self] , identifier[ligands] = keyword[True] , identifier[inc_alt_states] = keyword[False] ): literal[string] keyword[if] identifier[ligands] keyword[and] identifier[self] . identifier[ligands] : identifier[monomers] = identifier[self] ...
def get_atoms(self, ligands=True, inc_alt_states=False): """Flat list of all the Atoms in the Polymer. Parameters ---------- inc_alt_states : bool If true atoms from alternate conformations are included rather than only the "active" states. Returns -...
def NS(domain, resolve=True, nameserver=None): ''' Return a list of IPs of the nameservers for ``domain`` If 'resolve' is False, don't resolve names. CLI Example: .. code-block:: bash salt ns1 dnsutil.NS google.com ''' if _has_dig(): return __salt__['dig.NS'](domain, res...
def function[NS, parameter[domain, resolve, nameserver]]: constant[ Return a list of IPs of the nameservers for ``domain`` If 'resolve' is False, don't resolve names. CLI Example: .. code-block:: bash salt ns1 dnsutil.NS google.com ] if call[name[_has_dig], parameter[]] ...
keyword[def] identifier[NS] ( identifier[domain] , identifier[resolve] = keyword[True] , identifier[nameserver] = keyword[None] ): literal[string] keyword[if] identifier[_has_dig] (): keyword[return] identifier[__salt__] [ literal[string] ]( identifier[domain] , identifier[resolve] , identifier[...
def NS(domain, resolve=True, nameserver=None): """ Return a list of IPs of the nameservers for ``domain`` If 'resolve' is False, don't resolve names. CLI Example: .. code-block:: bash salt ns1 dnsutil.NS google.com """ if _has_dig(): return __salt__['dig.NS'](domain, res...
def start(self, ccallbacks=None): """Establish and maintain connections.""" self.__manage_g = gevent.spawn(self.__manage_connections, ccallbacks) self.__ready_ev.wait()
def function[start, parameter[self, ccallbacks]]: constant[Establish and maintain connections.] name[self].__manage_g assign[=] call[name[gevent].spawn, parameter[name[self].__manage_connections, name[ccallbacks]]] call[name[self].__ready_ev.wait, parameter[]]
keyword[def] identifier[start] ( identifier[self] , identifier[ccallbacks] = keyword[None] ): literal[string] identifier[self] . identifier[__manage_g] = identifier[gevent] . identifier[spawn] ( identifier[self] . identifier[__manage_connections] , identifier[ccallbacks] ) identifier[self...
def start(self, ccallbacks=None): """Establish and maintain connections.""" self.__manage_g = gevent.spawn(self.__manage_connections, ccallbacks) self.__ready_ev.wait()
def save_load(jid, load, minions=None): ''' Save the load to the specified jid id ''' with _get_serv(commit=True) as cur: sql = '''INSERT INTO `jids` (`jid`, `load`) VALUES (%s, %s)''' try: cur.execute(sql, (jid, salt.utils.json.dumps(load))) except MySQLdb.Integrit...
def function[save_load, parameter[jid, load, minions]]: constant[ Save the load to the specified jid id ] with call[name[_get_serv], parameter[]] begin[:] variable[sql] assign[=] constant[INSERT INTO `jids` (`jid`, `load`) VALUES (%s, %s)] <ast.Try object at 0x7da2044c2ec...
keyword[def] identifier[save_load] ( identifier[jid] , identifier[load] , identifier[minions] = keyword[None] ): literal[string] keyword[with] identifier[_get_serv] ( identifier[commit] = keyword[True] ) keyword[as] identifier[cur] : identifier[sql] = literal[string] keyword[try] : ...
def save_load(jid, load, minions=None): """ Save the load to the specified jid id """ with _get_serv(commit=True) as cur: sql = 'INSERT INTO `jids` (`jid`, `load`) VALUES (%s, %s)' try: cur.execute(sql, (jid, salt.utils.json.dumps(load))) # depends on [control=['try'], data=...
def search_objects(self, query): """ Return list of objects which match all properties that are set (``not None``) using AND operator to all of them. Example: result = storage_handler.search_objects( DBPublication(isbn="azgabash") ) Args:...
def function[search_objects, parameter[self, query]]: constant[ Return list of objects which match all properties that are set (``not None``) using AND operator to all of them. Example: result = storage_handler.search_objects( DBPublication(isbn="azgabash") ...
keyword[def] identifier[search_objects] ( identifier[self] , identifier[query] ): literal[string] identifier[self] . identifier[_check_obj_properties] ( identifier[query] , literal[string] ) identifier[final_result] = keyword[None] keyword[for] identifier[result] keyw...
def search_objects(self, query): """ Return list of objects which match all properties that are set (``not None``) using AND operator to all of them. Example: result = storage_handler.search_objects( DBPublication(isbn="azgabash") ) Args: ...
def font(self, prefix, size): """Return a QFont corresponding to the given prefix and size.""" font = QFont(self.fontname[prefix]) font.setPixelSize(size) if prefix[-1] == 's': # solid style font.setStyleName('Solid') return font
def function[font, parameter[self, prefix, size]]: constant[Return a QFont corresponding to the given prefix and size.] variable[font] assign[=] call[name[QFont], parameter[call[name[self].fontname][name[prefix]]]] call[name[font].setPixelSize, parameter[name[size]]] if compare[call[name...
keyword[def] identifier[font] ( identifier[self] , identifier[prefix] , identifier[size] ): literal[string] identifier[font] = identifier[QFont] ( identifier[self] . identifier[fontname] [ identifier[prefix] ]) identifier[font] . identifier[setPixelSize] ( identifier[size] ) keywo...
def font(self, prefix, size): """Return a QFont corresponding to the given prefix and size.""" font = QFont(self.fontname[prefix]) font.setPixelSize(size) if prefix[-1] == 's': # solid style font.setStyleName('Solid') # depends on [control=['if'], data=[]] return font
def run_mutect(job, tumor_bam, normal_bam, univ_options, mutect_options, chrom): """ This module will run mutect on the DNA bams ARGUMENTS 1. tumor_bam: REFER ARGUMENTS of spawn_mutect() 2. normal_bam: REFER ARGUMENTS of spawn_mutect() 3. univ_options: REFER ARGUMENTS of spawn_mutect() 4. m...
def function[run_mutect, parameter[job, tumor_bam, normal_bam, univ_options, mutect_options, chrom]]: constant[ This module will run mutect on the DNA bams ARGUMENTS 1. tumor_bam: REFER ARGUMENTS of spawn_mutect() 2. normal_bam: REFER ARGUMENTS of spawn_mutect() 3. univ_options: REFER ARGUM...
keyword[def] identifier[run_mutect] ( identifier[job] , identifier[tumor_bam] , identifier[normal_bam] , identifier[univ_options] , identifier[mutect_options] , identifier[chrom] ): literal[string] identifier[job] . identifier[fileStore] . identifier[logToMaster] ( literal[string] %( identifier[univ_option...
def run_mutect(job, tumor_bam, normal_bam, univ_options, mutect_options, chrom): """ This module will run mutect on the DNA bams ARGUMENTS 1. tumor_bam: REFER ARGUMENTS of spawn_mutect() 2. normal_bam: REFER ARGUMENTS of spawn_mutect() 3. univ_options: REFER ARGUMENTS of spawn_mutect() 4. m...
def create_data_and_metadata_from_data(self, data: numpy.ndarray, intensity_calibration: Calibration.Calibration=None, dimensional_calibrations: typing.List[Calibration.Calibration]=None, metadata: dict=None, timestamp: str=None) -> DataAndMetadata.DataAndMetadata: """Create a data_and_metadata object from data...
def function[create_data_and_metadata_from_data, parameter[self, data, intensity_calibration, dimensional_calibrations, metadata, timestamp]]: constant[Create a data_and_metadata object from data. .. versionadded:: 1.0 .. deprecated:: 1.1 Use :py:meth:`~nion.swift.Facade.DataItem.cre...
keyword[def] identifier[create_data_and_metadata_from_data] ( identifier[self] , identifier[data] : identifier[numpy] . identifier[ndarray] , identifier[intensity_calibration] : identifier[Calibration] . identifier[Calibration] = keyword[None] , identifier[dimensional_calibrations] : identifier[typing] . identifier[L...
def create_data_and_metadata_from_data(self, data: numpy.ndarray, intensity_calibration: Calibration.Calibration=None, dimensional_calibrations: typing.List[Calibration.Calibration]=None, metadata: dict=None, timestamp: str=None) -> DataAndMetadata.DataAndMetadata: """Create a data_and_metadata object from data. ...
def number_occurences(self, proc): """ Returns the number of occurencies of commands that contain given text Returns: int: The number of occurencies of commands with given text .. note:: 'proc' can match anywhere in the command path, name or arguments. ""...
def function[number_occurences, parameter[self, proc]]: constant[ Returns the number of occurencies of commands that contain given text Returns: int: The number of occurencies of commands with given text .. note:: 'proc' can match anywhere in the command path, na...
keyword[def] identifier[number_occurences] ( identifier[self] , identifier[proc] ): literal[string] keyword[return] identifier[len] ([ keyword[True] keyword[for] identifier[row] keyword[in] identifier[self] . identifier[data] keyword[if] identifier[proc] keyword[in] identifier[row] [ ident...
def number_occurences(self, proc): """ Returns the number of occurencies of commands that contain given text Returns: int: The number of occurencies of commands with given text .. note:: 'proc' can match anywhere in the command path, name or arguments. """ ...
def duplicate_files(self): ''' Search for duplicates of submission file uploads for this assignment. This includes the search in other course, whether inactive or not. Returns a list of lists, where each latter is a set of duplicate submissions with at least on of them for this a...
def function[duplicate_files, parameter[self]]: constant[ Search for duplicates of submission file uploads for this assignment. This includes the search in other course, whether inactive or not. Returns a list of lists, where each latter is a set of duplicate submissions with at ...
keyword[def] identifier[duplicate_files] ( identifier[self] ): literal[string] identifier[result] = identifier[list] () identifier[files] = identifier[SubmissionFile] . identifier[valid_ones] . identifier[order_by] ( literal[string] ) keyword[for] identifier[key] , identifier[du...
def duplicate_files(self): """ Search for duplicates of submission file uploads for this assignment. This includes the search in other course, whether inactive or not. Returns a list of lists, where each latter is a set of duplicate submissions with at least on of them for this assig...
def add_path_segment(self, value): """ Add a new path segment to the end of the current string :param string value: the new path segment to use Example:: >>> u = URL('http://example.com/foo/') >>> u.add_path_segment('bar').as_string() 'http://exampl...
def function[add_path_segment, parameter[self, value]]: constant[ Add a new path segment to the end of the current string :param string value: the new path segment to use Example:: >>> u = URL('http://example.com/foo/') >>> u.add_path_segment('bar').as_string()...
keyword[def] identifier[add_path_segment] ( identifier[self] , identifier[value] ): literal[string] identifier[segments] = identifier[self] . identifier[path_segments] ()+( identifier[to_unicode] ( identifier[value] ),) keyword[return] identifier[self] . identifier[path_segments] ( identi...
def add_path_segment(self, value): """ Add a new path segment to the end of the current string :param string value: the new path segment to use Example:: >>> u = URL('http://example.com/foo/') >>> u.add_path_segment('bar').as_string() 'http://example.co...
def assess(model, reaction, flux_coefficient_cutoff=0.001, solver=None): """Assesses production capacity. Assesses the capacity of the model to produce the precursors for the reaction and absorb the production of the reaction while the reaction is operating at, or above, the specified cutoff. Para...
def function[assess, parameter[model, reaction, flux_coefficient_cutoff, solver]]: constant[Assesses production capacity. Assesses the capacity of the model to produce the precursors for the reaction and absorb the production of the reaction while the reaction is operating at, or above, the specifi...
keyword[def] identifier[assess] ( identifier[model] , identifier[reaction] , identifier[flux_coefficient_cutoff] = literal[int] , identifier[solver] = keyword[None] ): literal[string] identifier[reaction] = identifier[model] . identifier[reactions] . identifier[get_by_any] ( identifier[reaction] )[ literal...
def assess(model, reaction, flux_coefficient_cutoff=0.001, solver=None): """Assesses production capacity. Assesses the capacity of the model to produce the precursors for the reaction and absorb the production of the reaction while the reaction is operating at, or above, the specified cutoff. Para...
def coordinates(x0, y0, distance, angle): """ Returns the location of a point by rotating around origin (x0,y0). """ return (x0 + cos(radians(angle)) * distance, y0 + sin(radians(angle)) * distance)
def function[coordinates, parameter[x0, y0, distance, angle]]: constant[ Returns the location of a point by rotating around origin (x0,y0). ] return[tuple[[<ast.BinOp object at 0x7da1b004e140>, <ast.BinOp object at 0x7da1b004fcd0>]]]
keyword[def] identifier[coordinates] ( identifier[x0] , identifier[y0] , identifier[distance] , identifier[angle] ): literal[string] keyword[return] ( identifier[x0] + identifier[cos] ( identifier[radians] ( identifier[angle] ))* identifier[distance] , identifier[y0] + identifier[sin] ( identifier[...
def coordinates(x0, y0, distance, angle): """ Returns the location of a point by rotating around origin (x0,y0). """ return (x0 + cos(radians(angle)) * distance, y0 + sin(radians(angle)) * distance)
def node_pairing(self): """if "node" then test current node and next one if "tag", then create tests for every pair of the current tag. """ value = self.attributes['node_pairing'] if value not in IMB.NODE_PAIRING: msg = 'Unexpected {0} value: got "{1}" but valid value...
def function[node_pairing, parameter[self]]: constant[if "node" then test current node and next one if "tag", then create tests for every pair of the current tag. ] variable[value] assign[=] call[name[self].attributes][constant[node_pairing]] if compare[name[value] <ast.NotIn obj...
keyword[def] identifier[node_pairing] ( identifier[self] ): literal[string] identifier[value] = identifier[self] . identifier[attributes] [ literal[string] ] keyword[if] identifier[value] keyword[not] keyword[in] identifier[IMB] . identifier[NODE_PAIRING] : identifier[msg]...
def node_pairing(self): """if "node" then test current node and next one if "tag", then create tests for every pair of the current tag. """ value = self.attributes['node_pairing'] if value not in IMB.NODE_PAIRING: msg = 'Unexpected {0} value: got "{1}" but valid values are {2}' ...
def update_pypsa_generator_import(network): """ Translate graph based grid representation to PyPSA Network For details from a user perspective see API documentation of :meth:`~.grid.network.EDisGo.analyze` of the API class :class:`~.grid.network.EDisGo`. Translating eDisGo's grid topology to P...
def function[update_pypsa_generator_import, parameter[network]]: constant[ Translate graph based grid representation to PyPSA Network For details from a user perspective see API documentation of :meth:`~.grid.network.EDisGo.analyze` of the API class :class:`~.grid.network.EDisGo`. Translat...
keyword[def] identifier[update_pypsa_generator_import] ( identifier[network] ): literal[string] keyword[if] identifier[network] . identifier[pypsa] . identifier[edisgo_mode] keyword[is] keyword[None] : identifier[mv_components] = identifier[mv_to_pypsa] ( identifier[network] ) id...
def update_pypsa_generator_import(network): """ Translate graph based grid representation to PyPSA Network For details from a user perspective see API documentation of :meth:`~.grid.network.EDisGo.analyze` of the API class :class:`~.grid.network.EDisGo`. Translating eDisGo's grid topology to P...
def uuid(self): """ Return UUID of logical volume :return: str """ uuid_file = '/sys/block/%s/dm/uuid' % os.path.basename(os.path.realpath(self.volume_path())) lv_uuid = open(uuid_file).read().strip() if lv_uuid.startswith('LVM-') is True: return lv_uuid[4:] return lv_uuid
def function[uuid, parameter[self]]: constant[ Return UUID of logical volume :return: str ] variable[uuid_file] assign[=] binary_operation[constant[/sys/block/%s/dm/uuid] <ast.Mod object at 0x7da2590d6920> call[name[os].path.basename, parameter[call[name[os].path.realpath, parameter[call[name[self]...
keyword[def] identifier[uuid] ( identifier[self] ): literal[string] identifier[uuid_file] = literal[string] % identifier[os] . identifier[path] . identifier[basename] ( identifier[os] . identifier[path] . identifier[realpath] ( identifier[self] . identifier[volume_path] ())) identifier[lv_uuid] = identifier...
def uuid(self): """ Return UUID of logical volume :return: str """ uuid_file = '/sys/block/%s/dm/uuid' % os.path.basename(os.path.realpath(self.volume_path())) lv_uuid = open(uuid_file).read().strip() if lv_uuid.startswith('LVM-') is True: return lv_uuid[4:] # depends on [control=['if'], d...
def transform(self, data): """ :param data: :type data: dict :return: :rtype: dict """ out = {} for key, val in data.items(): if key in self._transform_map: target = self._transform_map[key] key, val = target(key...
def function[transform, parameter[self, data]]: constant[ :param data: :type data: dict :return: :rtype: dict ] variable[out] assign[=] dictionary[[], []] for taget[tuple[[<ast.Name object at 0x7da18dc07250>, <ast.Name object at 0x7da18dc05a80>]]] in starr...
keyword[def] identifier[transform] ( identifier[self] , identifier[data] ): literal[string] identifier[out] ={} keyword[for] identifier[key] , identifier[val] keyword[in] identifier[data] . identifier[items] (): keyword[if] identifier[key] keyword[in] identifier[self] . ...
def transform(self, data): """ :param data: :type data: dict :return: :rtype: dict """ out = {} for (key, val) in data.items(): if key in self._transform_map: target = self._transform_map[key] (key, val) = target(key, val) if type(targe...
def schema_delete_field(cls, key): """Deletes a field.""" root = '/'.join([API_ROOT, 'schemas', cls.__name__]) payload = { 'className': cls.__name__, 'fields': { key: { '__op': 'Delete' } } } ...
def function[schema_delete_field, parameter[cls, key]]: constant[Deletes a field.] variable[root] assign[=] call[constant[/].join, parameter[list[[<ast.Name object at 0x7da1b0510eb0>, <ast.Constant object at 0x7da1b05112d0>, <ast.Attribute object at 0x7da1b05114b0>]]]] variable[payload] assign[=...
keyword[def] identifier[schema_delete_field] ( identifier[cls] , identifier[key] ): literal[string] identifier[root] = literal[string] . identifier[join] ([ identifier[API_ROOT] , literal[string] , identifier[cls] . identifier[__name__] ]) identifier[payload] ={ literal[string] : ...
def schema_delete_field(cls, key): """Deletes a field.""" root = '/'.join([API_ROOT, 'schemas', cls.__name__]) payload = {'className': cls.__name__, 'fields': {key: {'__op': 'Delete'}}} cls.PUT(root, **payload)
def revise(self, data): """ Revise attributes value with dictionary data. **中文文档** 将一个字典中的数据更新到本条文档。当且仅当数据值不为None时。 """ if not isinstance(data, dict): raise TypeError("`data` has to be a dict!") for key, value in data.items(): if value i...
def function[revise, parameter[self, data]]: constant[ Revise attributes value with dictionary data. **中文文档** 将一个字典中的数据更新到本条文档。当且仅当数据值不为None时。 ] if <ast.UnaryOp object at 0x7da20e963820> begin[:] <ast.Raise object at 0x7da20e962f80> for taget[tuple[[<ast...
keyword[def] identifier[revise] ( identifier[self] , identifier[data] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[data] , identifier[dict] ): keyword[raise] identifier[TypeError] ( literal[string] ) keyword[for] identifier[key] , identi...
def revise(self, data): """ Revise attributes value with dictionary data. **中文文档** 将一个字典中的数据更新到本条文档。当且仅当数据值不为None时。 """ if not isinstance(data, dict): raise TypeError('`data` has to be a dict!') # depends on [control=['if'], data=[]] for (key, value) in data.items(...
def get_repo(name, config_path=_DEFAULT_CONFIG_PATH, with_packages=False): ''' Get detailed information about a local package repository. :param str name: The name of the local repository. :param str config_path: The path to the configuration file for the aptly instance. :param bool with_packages: ...
def function[get_repo, parameter[name, config_path, with_packages]]: constant[ Get detailed information about a local package repository. :param str name: The name of the local repository. :param str config_path: The path to the configuration file for the aptly instance. :param bool with_packag...
keyword[def] identifier[get_repo] ( identifier[name] , identifier[config_path] = identifier[_DEFAULT_CONFIG_PATH] , identifier[with_packages] = keyword[False] ): literal[string] identifier[_validate_config] ( identifier[config_path] ) identifier[with_packages] = identifier[six] . identifier[text_type]...
def get_repo(name, config_path=_DEFAULT_CONFIG_PATH, with_packages=False): """ Get detailed information about a local package repository. :param str name: The name of the local repository. :param str config_path: The path to the configuration file for the aptly instance. :param bool with_packages: ...
def delete_empty_children(self): """ Walk through the children of this node and delete any that are empty. """ for child in self.children: child.delete_empty_children() try: if os.path.exists(child.full_path): os.rmdir(child.ful...
def function[delete_empty_children, parameter[self]]: constant[ Walk through the children of this node and delete any that are empty. ] for taget[name[child]] in starred[name[self].children] begin[:] call[name[child].delete_empty_children, parameter[]] <ast.Try ob...
keyword[def] identifier[delete_empty_children] ( identifier[self] ): literal[string] keyword[for] identifier[child] keyword[in] identifier[self] . identifier[children] : identifier[child] . identifier[delete_empty_children] () keyword[try] : keyword[if]...
def delete_empty_children(self): """ Walk through the children of this node and delete any that are empty. """ for child in self.children: child.delete_empty_children() try: if os.path.exists(child.full_path): os.rmdir(child.full_path) # depends on [c...
def _fetch_index_package_info(self, package_name, current_version): """ :type package_name: str :type current_version: version.Version """ try: package_canonical_name = package_name if self.PYPI_API_TYPE == 'simple_html': package_canonical...
def function[_fetch_index_package_info, parameter[self, package_name, current_version]]: constant[ :type package_name: str :type current_version: version.Version ] <ast.Try object at 0x7da1b038ac50> if <ast.UnaryOp object at 0x7da1b038b490> begin[:] return[tuple[[<ast...
keyword[def] identifier[_fetch_index_package_info] ( identifier[self] , identifier[package_name] , identifier[current_version] ): literal[string] keyword[try] : identifier[package_canonical_name] = identifier[package_name] keyword[if] identifier[self] . identifier[PYPI_...
def _fetch_index_package_info(self, package_name, current_version): """ :type package_name: str :type current_version: version.Version """ try: package_canonical_name = package_name if self.PYPI_API_TYPE == 'simple_html': package_canonical_name = canonicalize_...
def url_signature(url: str) -> Optional[Tuple]: """ Return an identify signature for url :param url: item to get signature for :return: tuple containing last modified, length and, if present, etag """ request = urllib.request.Request(url) request.get_method = lambda: 'HEAD' response = No...
def function[url_signature, parameter[url]]: constant[ Return an identify signature for url :param url: item to get signature for :return: tuple containing last modified, length and, if present, etag ] variable[request] assign[=] call[name[urllib].request.Request, parameter[name[url]]] ...
keyword[def] identifier[url_signature] ( identifier[url] : identifier[str] )-> identifier[Optional] [ identifier[Tuple] ]: literal[string] identifier[request] = identifier[urllib] . identifier[request] . identifier[Request] ( identifier[url] ) identifier[request] . identifier[get_method] = keyword[lam...
def url_signature(url: str) -> Optional[Tuple]: """ Return an identify signature for url :param url: item to get signature for :return: tuple containing last modified, length and, if present, etag """ request = urllib.request.Request(url) request.get_method = lambda : 'HEAD' response = N...
async def get(self, request): """Gets the user_id for the request. Gets the ticket for the request using the get_ticket() function, and authenticates the ticket. Args: request: aiohttp Request object. Returns: The userid for the request, or None if the ...
<ast.AsyncFunctionDef object at 0x7da18ede6a10>
keyword[async] keyword[def] identifier[get] ( identifier[self] , identifier[request] ): literal[string] identifier[ticket] = keyword[await] identifier[self] . identifier[get_ticket] ( identifier[request] ) keyword[if] identifier[ticket] keyword[is] keyword[None] : keyword...
async def get(self, request): """Gets the user_id for the request. Gets the ticket for the request using the get_ticket() function, and authenticates the ticket. Args: request: aiohttp Request object. Returns: The userid for the request, or None if the tick...
def get(self, request, *args, **kwargs): """ Method for handling GET requests. Passes the following arguments to the context: * **versions** - The versions available for this object.\ These will be instances of the inner version class, and \ will not have access to the f...
def function[get, parameter[self, request]]: constant[ Method for handling GET requests. Passes the following arguments to the context: * **versions** - The versions available for this object. These will be instances of the inner version class, and will not have access to...
keyword[def] identifier[get] ( identifier[self] , identifier[request] ,* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[versions] = identifier[self] . identifier[_get_versions] () keyword[return] identifier[self] . identifier[render] ( identifier[request] , identifi...
def get(self, request, *args, **kwargs): """ Method for handling GET requests. Passes the following arguments to the context: * **versions** - The versions available for this object. These will be instances of the inner version class, and will not have access to the fields on...
def _build_cache(): """Preprocess collection queries.""" query = current_app.config['COLLECTIONS_DELETED_RECORDS'] for collection in Collection.query.filter( Collection.dbquery.isnot(None)).all(): yield collection.name, dict( query=query.format(dbquery=collection.dbquery), ...
def function[_build_cache, parameter[]]: constant[Preprocess collection queries.] variable[query] assign[=] call[name[current_app].config][constant[COLLECTIONS_DELETED_RECORDS]] for taget[name[collection]] in starred[call[call[name[Collection].query.filter, parameter[call[name[Collection].dbquer...
keyword[def] identifier[_build_cache] (): literal[string] identifier[query] = identifier[current_app] . identifier[config] [ literal[string] ] keyword[for] identifier[collection] keyword[in] identifier[Collection] . identifier[query] . identifier[filter] ( identifier[Collection] . identifier[d...
def _build_cache(): """Preprocess collection queries.""" query = current_app.config['COLLECTIONS_DELETED_RECORDS'] for collection in Collection.query.filter(Collection.dbquery.isnot(None)).all(): yield (collection.name, dict(query=query.format(dbquery=collection.dbquery), ancestors=set(_ancestors(co...
def _ngrams(segment, n): """Extracts n-grams from an input segment. Parameters ---------- segment: list Text segment from which n-grams will be extracted. n: int Order of n-gram. Returns ------- ngram_counts: Counter Contain all the nth n-grams in segment with a...
def function[_ngrams, parameter[segment, n]]: constant[Extracts n-grams from an input segment. Parameters ---------- segment: list Text segment from which n-grams will be extracted. n: int Order of n-gram. Returns ------- ngram_counts: Counter Contain all th...
keyword[def] identifier[_ngrams] ( identifier[segment] , identifier[n] ): literal[string] identifier[ngram_counts] = identifier[Counter] () keyword[for] identifier[i] keyword[in] identifier[range] ( literal[int] , identifier[len] ( identifier[segment] )- identifier[n] + literal[int] ): ide...
def _ngrams(segment, n): """Extracts n-grams from an input segment. Parameters ---------- segment: list Text segment from which n-grams will be extracted. n: int Order of n-gram. Returns ------- ngram_counts: Counter Contain all the nth n-grams in segment with a...
def purge_configs(): """ These will delete any configs found in either the current directory or the user's home directory """ user_config = path(CONFIG_FILE_NAME, root=USER) inplace_config = path(CONFIG_FILE_NAME) if os.path.isfile(user_config): os.remove(user_config) if os.pat...
def function[purge_configs, parameter[]]: constant[ These will delete any configs found in either the current directory or the user's home directory ] variable[user_config] assign[=] call[name[path], parameter[name[CONFIG_FILE_NAME]]] variable[inplace_config] assign[=] call[name[path...
keyword[def] identifier[purge_configs] (): literal[string] identifier[user_config] = identifier[path] ( identifier[CONFIG_FILE_NAME] , identifier[root] = identifier[USER] ) identifier[inplace_config] = identifier[path] ( identifier[CONFIG_FILE_NAME] ) keyword[if] identifier[os] . identifier[pat...
def purge_configs(): """ These will delete any configs found in either the current directory or the user's home directory """ user_config = path(CONFIG_FILE_NAME, root=USER) inplace_config = path(CONFIG_FILE_NAME) if os.path.isfile(user_config): os.remove(user_config) # depends on [...
def on(event, *args, **kwargs): """ Event method wrapper for bot mixins. When a bot is constructed, its metaclass inspects all members of all base classes, and looks for methods marked with an event attribute which is assigned via this wrapper. It then stores all the methods in a dict that maps ...
def function[on, parameter[event]]: constant[ Event method wrapper for bot mixins. When a bot is constructed, its metaclass inspects all members of all base classes, and looks for methods marked with an event attribute which is assigned via this wrapper. It then stores all the methods in a dict ...
keyword[def] identifier[on] ( identifier[event] ,* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[def] identifier[wrapper] ( identifier[func] ): keyword[for] identifier[i] , identifier[arg] keyword[in] identifier[args] : identifier[kwargs] [ identifier[i] ]= id...
def on(event, *args, **kwargs): """ Event method wrapper for bot mixins. When a bot is constructed, its metaclass inspects all members of all base classes, and looks for methods marked with an event attribute which is assigned via this wrapper. It then stores all the methods in a dict that maps ...
def merge_errors(self, errors_local, errors_remote): """ Merge errors Recursively traverses error graph to merge remote errors into local errors to return a new joined graph. :param errors_local: dict, local errors, will be updated :param errors_remote: dict, remote erro...
def function[merge_errors, parameter[self, errors_local, errors_remote]]: constant[ Merge errors Recursively traverses error graph to merge remote errors into local errors to return a new joined graph. :param errors_local: dict, local errors, will be updated :param error...
keyword[def] identifier[merge_errors] ( identifier[self] , identifier[errors_local] , identifier[errors_remote] ): literal[string] keyword[for] identifier[prop] keyword[in] identifier[errors_remote] : keyword[if] identifier[prop] keyword[not] keyword[in] identifier[err...
def merge_errors(self, errors_local, errors_remote): """ Merge errors Recursively traverses error graph to merge remote errors into local errors to return a new joined graph. :param errors_local: dict, local errors, will be updated :param errors_remote: dict, remote errors, ...
def import_from_file(request): """ Import a part of a source site's page tree via an import of a JSON file exported to a user's filesystem from the source site's Wagtail Admin The source site's base url and the source page id of the point in the tree to import defined what to import and the destina...
def function[import_from_file, parameter[request]]: constant[ Import a part of a source site's page tree via an import of a JSON file exported to a user's filesystem from the source site's Wagtail Admin The source site's base url and the source page id of the point in the tree to import defined...
keyword[def] identifier[import_from_file] ( identifier[request] ): literal[string] keyword[if] identifier[request] . identifier[method] == literal[string] : identifier[form] = identifier[ImportFromFileForm] ( identifier[request] . identifier[POST] , identifier[request] . identifier[FILES] ) ...
def import_from_file(request): """ Import a part of a source site's page tree via an import of a JSON file exported to a user's filesystem from the source site's Wagtail Admin The source site's base url and the source page id of the point in the tree to import defined what to import and the destina...
def get_stats(self): """ It returns a name and a value pairs of control files which are categorised in the stats group. """ stats = {} for name, cls in self.stats.items(): path = self.paths[name] if os.path.exists(path): try: ...
def function[get_stats, parameter[self]]: constant[ It returns a name and a value pairs of control files which are categorised in the stats group. ] variable[stats] assign[=] dictionary[[], []] for taget[tuple[[<ast.Name object at 0x7da20e9b1600>, <ast.Name object at 0x7d...
keyword[def] identifier[get_stats] ( identifier[self] ): literal[string] identifier[stats] ={} keyword[for] identifier[name] , identifier[cls] keyword[in] identifier[self] . identifier[stats] . identifier[items] (): identifier[path] = identifier[self] . identifier[paths] [ ...
def get_stats(self): """ It returns a name and a value pairs of control files which are categorised in the stats group. """ stats = {} for (name, cls) in self.stats.items(): path = self.paths[name] if os.path.exists(path): try: stats[name] ...
def getOutput(self): """ Returns the combined output of stdout and stderr """ output = self.stdout if self.stdout: output += '\r\n' output += self.stderr return output
def function[getOutput, parameter[self]]: constant[ Returns the combined output of stdout and stderr ] variable[output] assign[=] name[self].stdout if name[self].stdout begin[:] <ast.AugAssign object at 0x7da1b23e5c00> <ast.AugAssign object at 0x7da1b23e56c0> retu...
keyword[def] identifier[getOutput] ( identifier[self] ): literal[string] identifier[output] = identifier[self] . identifier[stdout] keyword[if] identifier[self] . identifier[stdout] : identifier[output] += literal[string] identifier[output] += identifier[self] . id...
def getOutput(self): """ Returns the combined output of stdout and stderr """ output = self.stdout if self.stdout: output += '\r\n' # depends on [control=['if'], data=[]] output += self.stderr return output
def get_conf_filename(): """ The configuration file either lives in ~/.peri.json or is specified on the command line via the environment variables PERI_CONF_FILE """ default = os.path.join(os.path.expanduser("~"), ".peri.json") return os.environ.get('PERI_CONF_FILE', default)
def function[get_conf_filename, parameter[]]: constant[ The configuration file either lives in ~/.peri.json or is specified on the command line via the environment variables PERI_CONF_FILE ] variable[default] assign[=] call[name[os].path.join, parameter[call[name[os].path.expanduser, paramet...
keyword[def] identifier[get_conf_filename] (): literal[string] identifier[default] = identifier[os] . identifier[path] . identifier[join] ( identifier[os] . identifier[path] . identifier[expanduser] ( literal[string] ), literal[string] ) keyword[return] identifier[os] . identifier[environ] . identifi...
def get_conf_filename(): """ The configuration file either lives in ~/.peri.json or is specified on the command line via the environment variables PERI_CONF_FILE """ default = os.path.join(os.path.expanduser('~'), '.peri.json') return os.environ.get('PERI_CONF_FILE', default)
def user_credentials(self): """ Provides the credentials required to authenticate the user for login. """ credentials = {} login = self.cleaned_data["login"] if app_settings.AUTHENTICATION_METHOD == AuthenticationMethod.EMAIL: credentials["email"] = lo...
def function[user_credentials, parameter[self]]: constant[ Provides the credentials required to authenticate the user for login. ] variable[credentials] assign[=] dictionary[[], []] variable[login] assign[=] call[name[self].cleaned_data][constant[login]] if compar...
keyword[def] identifier[user_credentials] ( identifier[self] ): literal[string] identifier[credentials] ={} identifier[login] = identifier[self] . identifier[cleaned_data] [ literal[string] ] keyword[if] identifier[app_settings] . identifier[AUTHENTICATION_METHOD] == identifier[A...
def user_credentials(self): """ Provides the credentials required to authenticate the user for login. """ credentials = {} login = self.cleaned_data['login'] if app_settings.AUTHENTICATION_METHOD == AuthenticationMethod.EMAIL: credentials['email'] = login # depends on [c...
def weight_list_to_tuple(data, attr_name): ''' Converts a list of values and corresponding weights to a tuple of values ''' if len(data['Value']) != len(data['Weight']): raise ValueError('Number of weights do not correspond to number of ' 'attributes in %s' % attr_name)...
def function[weight_list_to_tuple, parameter[data, attr_name]]: constant[ Converts a list of values and corresponding weights to a tuple of values ] if compare[call[name[len], parameter[call[name[data]][constant[Value]]]] not_equal[!=] call[name[len], parameter[call[name[data]][constant[Weight]]...
keyword[def] identifier[weight_list_to_tuple] ( identifier[data] , identifier[attr_name] ): literal[string] keyword[if] identifier[len] ( identifier[data] [ literal[string] ])!= identifier[len] ( identifier[data] [ literal[string] ]): keyword[raise] identifier[ValueError] ( literal[string] ...
def weight_list_to_tuple(data, attr_name): """ Converts a list of values and corresponding weights to a tuple of values """ if len(data['Value']) != len(data['Weight']): raise ValueError('Number of weights do not correspond to number of attributes in %s' % attr_name) # depends on [control=['if'...
def is_instance_throughput_too_low(self, inst_id): """ Return whether the throughput of the master instance is greater than the acceptable threshold """ r = self.instance_throughput_ratio(inst_id) if r is None: logger.debug("{} instance {} throughput is not " ...
def function[is_instance_throughput_too_low, parameter[self, inst_id]]: constant[ Return whether the throughput of the master instance is greater than the acceptable threshold ] variable[r] assign[=] call[name[self].instance_throughput_ratio, parameter[name[inst_id]]] if ...
keyword[def] identifier[is_instance_throughput_too_low] ( identifier[self] , identifier[inst_id] ): literal[string] identifier[r] = identifier[self] . identifier[instance_throughput_ratio] ( identifier[inst_id] ) keyword[if] identifier[r] keyword[is] keyword[None] : identif...
def is_instance_throughput_too_low(self, inst_id): """ Return whether the throughput of the master instance is greater than the acceptable threshold """ r = self.instance_throughput_ratio(inst_id) if r is None: logger.debug('{} instance {} throughput is not measurable.'.forma...
def similar_items(self, itemid, N=10): """ Returns a list of the most similar other items """ if itemid >= self.similarity.shape[0]: return [] return sorted(list(nonzeros(self.similarity, itemid)), key=lambda x: -x[1])[:N]
def function[similar_items, parameter[self, itemid, N]]: constant[ Returns a list of the most similar other items ] if compare[name[itemid] greater_or_equal[>=] call[name[self].similarity.shape][constant[0]]] begin[:] return[list[[]]] return[call[call[name[sorted], parameter[call[name[list],...
keyword[def] identifier[similar_items] ( identifier[self] , identifier[itemid] , identifier[N] = literal[int] ): literal[string] keyword[if] identifier[itemid] >= identifier[self] . identifier[similarity] . identifier[shape] [ literal[int] ]: keyword[return] [] keyword[retur...
def similar_items(self, itemid, N=10): """ Returns a list of the most similar other items """ if itemid >= self.similarity.shape[0]: return [] # depends on [control=['if'], data=[]] return sorted(list(nonzeros(self.similarity, itemid)), key=lambda x: -x[1])[:N]
def get_message_actions(current): """ Returns applicable actions for current user for given message key .. code-block:: python # request: { 'view':'_zops_get_message_actions', 'key': key, } # response: { 'actions':[('name_stri...
def function[get_message_actions, parameter[current]]: constant[ Returns applicable actions for current user for given message key .. code-block:: python # request: { 'view':'_zops_get_message_actions', 'key': key, } # response: { ...
keyword[def] identifier[get_message_actions] ( identifier[current] ): literal[string] identifier[current] . identifier[output] ={ literal[string] : literal[string] , literal[string] : literal[int] , literal[string] : identifier[Message] . identifier[objects] . identifier[get] ( identifier[cu...
def get_message_actions(current): """ Returns applicable actions for current user for given message key .. code-block:: python # request: { 'view':'_zops_get_message_actions', 'key': key, } # response: { 'actions':[('name_stri...
def add_translations( self, module_name, translations_dir="translations", domain="messages" ): """Add translations from external module. For example:: babel.add_translations('abilian.core') Will add translations files from `abilian.core` module. """ mod...
def function[add_translations, parameter[self, module_name, translations_dir, domain]]: constant[Add translations from external module. For example:: babel.add_translations('abilian.core') Will add translations files from `abilian.core` module. ] variable[module] a...
keyword[def] identifier[add_translations] ( identifier[self] , identifier[module_name] , identifier[translations_dir] = literal[string] , identifier[domain] = literal[string] ): literal[string] identifier[module] = identifier[importlib] . identifier[import_module] ( identifier[module_name] ) ...
def add_translations(self, module_name, translations_dir='translations', domain='messages'): """Add translations from external module. For example:: babel.add_translations('abilian.core') Will add translations files from `abilian.core` module. """ module = importlib.import...
def fillzip(*l): """like zip (for things that have a length), but repeats the last element of all shorter lists such that the result is as long as the longest.""" maximum = max(len(el) for el in l) return zip(*[el + [el[-1]]*(maximum-len(el)) for el in l])
def function[fillzip, parameter[]]: constant[like zip (for things that have a length), but repeats the last element of all shorter lists such that the result is as long as the longest.] variable[maximum] assign[=] call[name[max], parameter[<ast.GeneratorExp object at 0x7da2054a5b10>]] return[call[na...
keyword[def] identifier[fillzip] (* identifier[l] ): literal[string] identifier[maximum] = identifier[max] ( identifier[len] ( identifier[el] ) keyword[for] identifier[el] keyword[in] identifier[l] ) keyword[return] identifier[zip] (*[ identifier[el] +[ identifier[el] [- literal[int] ]]*( identifi...
def fillzip(*l): """like zip (for things that have a length), but repeats the last element of all shorter lists such that the result is as long as the longest.""" maximum = max((len(el) for el in l)) return zip(*[el + [el[-1]] * (maximum - len(el)) for el in l])
def auth(nodes, pcsuser='hacluster', pcspasswd='hacluster', extra_args=None): ''' Authorize nodes to the cluster nodes a list of nodes which should be authorized to the cluster pcsuser user for communitcation with PCS (default: hacluster) pcspasswd password for pcsuser (defa...
def function[auth, parameter[nodes, pcsuser, pcspasswd, extra_args]]: constant[ Authorize nodes to the cluster nodes a list of nodes which should be authorized to the cluster pcsuser user for communitcation with PCS (default: hacluster) pcspasswd password for pcsuser (de...
keyword[def] identifier[auth] ( identifier[nodes] , identifier[pcsuser] = literal[string] , identifier[pcspasswd] = literal[string] , identifier[extra_args] = keyword[None] ): literal[string] identifier[cmd] =[ literal[string] , literal[string] , literal[string] ] keyword[if] identifier[pcsuser] : ...
def auth(nodes, pcsuser='hacluster', pcspasswd='hacluster', extra_args=None): """ Authorize nodes to the cluster nodes a list of nodes which should be authorized to the cluster pcsuser user for communitcation with PCS (default: hacluster) pcspasswd password for pcsuser (defa...
def stop(name): ''' stops a container ''' if not exists(name): raise ContainerNotExists("The container (%s) does not exist!" % name) cmd = ['lxc-stop', '-n', name] subprocess.check_call(cmd)
def function[stop, parameter[name]]: constant[ stops a container ] if <ast.UnaryOp object at 0x7da18dc048e0> begin[:] <ast.Raise object at 0x7da18dc06cb0> variable[cmd] assign[=] list[[<ast.Constant object at 0x7da20c6ab8b0>, <ast.Constant object at 0x7da20c6abb20>, <ast.Name obj...
keyword[def] identifier[stop] ( identifier[name] ): literal[string] keyword[if] keyword[not] identifier[exists] ( identifier[name] ): keyword[raise] identifier[ContainerNotExists] ( literal[string] % identifier[name] ) identifier[cmd] =[ literal[string] , literal[string] , identifier[n...
def stop(name): """ stops a container """ if not exists(name): raise ContainerNotExists('The container (%s) does not exist!' % name) # depends on [control=['if'], data=[]] cmd = ['lxc-stop', '-n', name] subprocess.check_call(cmd)
def get_annotation_tags(index_page): """ Return list of descriptions parsed from ``<meta>`` tags and dublin core inlined in ``<meta>`` tags. Args: index_page (str): HTML content of the page you wisht to analyze. Returns: list: List of ``SourceString`` objects. """ dom = dht...
def function[get_annotation_tags, parameter[index_page]]: constant[ Return list of descriptions parsed from ``<meta>`` tags and dublin core inlined in ``<meta>`` tags. Args: index_page (str): HTML content of the page you wisht to analyze. Returns: list: List of ``SourceString``...
keyword[def] identifier[get_annotation_tags] ( identifier[index_page] ): literal[string] identifier[dom] = identifier[dhtmlparser] . identifier[parseString] ( identifier[index_page] ) identifier[descriptions] =[ identifier[get_html_annotations] ( identifier[dom] ), identifier[get_dc_annotat...
def get_annotation_tags(index_page): """ Return list of descriptions parsed from ``<meta>`` tags and dublin core inlined in ``<meta>`` tags. Args: index_page (str): HTML content of the page you wisht to analyze. Returns: list: List of ``SourceString`` objects. """ dom = dht...
def check_manifest(source_tree='.', create=False, update=False, python=sys.executable): """Compare a generated source distribution with list of files in a VCS. Returns True if the manifest is fine. """ all_ok = True if os.path.sep in python: python = os.path.abspath(pytho...
def function[check_manifest, parameter[source_tree, create, update, python]]: constant[Compare a generated source distribution with list of files in a VCS. Returns True if the manifest is fine. ] variable[all_ok] assign[=] constant[True] if compare[name[os].path.sep in name[python]] beg...
keyword[def] identifier[check_manifest] ( identifier[source_tree] = literal[string] , identifier[create] = keyword[False] , identifier[update] = keyword[False] , identifier[python] = identifier[sys] . identifier[executable] ): literal[string] identifier[all_ok] = keyword[True] keyword[if] identifie...
def check_manifest(source_tree='.', create=False, update=False, python=sys.executable): """Compare a generated source distribution with list of files in a VCS. Returns True if the manifest is fine. """ all_ok = True if os.path.sep in python: python = os.path.abspath(python) # depends on [c...
def setup(app): """Install the plugin. :param app: Sphinx application context. """ app.info('Initializing GitHub plugin') app.add_role('ghissue', ghissue_role) app.add_role('ghpull', ghissue_role) app.add_role('ghuser', ghuser_role) app.add_role('ghcommit', ghcommit_role) app.ad...
def function[setup, parameter[app]]: constant[Install the plugin. :param app: Sphinx application context. ] call[name[app].info, parameter[constant[Initializing GitHub plugin]]] call[name[app].add_role, parameter[constant[ghissue], name[ghissue_role]]] call[name[app].add_rol...
keyword[def] identifier[setup] ( identifier[app] ): literal[string] identifier[app] . identifier[info] ( literal[string] ) identifier[app] . identifier[add_role] ( literal[string] , identifier[ghissue_role] ) identifier[app] . identifier[add_role] ( literal[string] , identifier[ghissue_role] ) ...
def setup(app): """Install the plugin. :param app: Sphinx application context. """ app.info('Initializing GitHub plugin') app.add_role('ghissue', ghissue_role) app.add_role('ghpull', ghissue_role) app.add_role('ghuser', ghuser_role) app.add_role('ghcommit', ghcommit_role) app.ad...
def init_centers_widths(self, R): """Initialize prior of centers and widths Returns ------- centers : 2D array, with shape [K, n_dim] Prior of factors' centers. widths : 1D array, with shape [K, 1] Prior of factors' widths. """ kmeans ...
def function[init_centers_widths, parameter[self, R]]: constant[Initialize prior of centers and widths Returns ------- centers : 2D array, with shape [K, n_dim] Prior of factors' centers. widths : 1D array, with shape [K, 1] Prior of factors' widths. ...
keyword[def] identifier[init_centers_widths] ( identifier[self] , identifier[R] ): literal[string] identifier[kmeans] = identifier[KMeans] ( identifier[init] = literal[string] , identifier[n_clusters] = identifier[self] . identifier[K] , identifier[n_init] = literal[int]...
def init_centers_widths(self, R): """Initialize prior of centers and widths Returns ------- centers : 2D array, with shape [K, n_dim] Prior of factors' centers. widths : 1D array, with shape [K, 1] Prior of factors' widths. """ kmeans = KMeans(...
def to_pfull_from_phalf(arr, pfull_coord): """Compute data at full pressure levels from values at half levels.""" phalf_top = arr.isel(**{internal_names.PHALF_STR: slice(1, None)}) phalf_top = replace_coord(phalf_top, internal_names.PHALF_STR, internal_names.PFULL_STR, pfull_co...
def function[to_pfull_from_phalf, parameter[arr, pfull_coord]]: constant[Compute data at full pressure levels from values at half levels.] variable[phalf_top] assign[=] call[name[arr].isel, parameter[]] variable[phalf_top] assign[=] call[name[replace_coord], parameter[name[phalf_top], name[inter...
keyword[def] identifier[to_pfull_from_phalf] ( identifier[arr] , identifier[pfull_coord] ): literal[string] identifier[phalf_top] = identifier[arr] . identifier[isel] (**{ identifier[internal_names] . identifier[PHALF_STR] : identifier[slice] ( literal[int] , keyword[None] )}) identifier[phalf_top] = ...
def to_pfull_from_phalf(arr, pfull_coord): """Compute data at full pressure levels from values at half levels.""" phalf_top = arr.isel(**{internal_names.PHALF_STR: slice(1, None)}) phalf_top = replace_coord(phalf_top, internal_names.PHALF_STR, internal_names.PFULL_STR, pfull_coord) phalf_bot = arr.isel(...
def add_project(project,**kwargs): """ Add a new project returns a project complexmodel """ user_id = kwargs.get('user_id') existing_proj = get_project_by_name(project.name,user_id=user_id) if len(existing_proj) > 0: raise HydraError("A Project with the name \"%s\" already ...
def function[add_project, parameter[project]]: constant[ Add a new project returns a project complexmodel ] variable[user_id] assign[=] call[name[kwargs].get, parameter[constant[user_id]]] variable[existing_proj] assign[=] call[name[get_project_by_name], parameter[name[projec...
keyword[def] identifier[add_project] ( identifier[project] ,** identifier[kwargs] ): literal[string] identifier[user_id] = identifier[kwargs] . identifier[get] ( literal[string] ) identifier[existing_proj] = identifier[get_project_by_name] ( identifier[project] . identifier[name] , identifier[user_id...
def add_project(project, **kwargs): """ Add a new project returns a project complexmodel """ user_id = kwargs.get('user_id') existing_proj = get_project_by_name(project.name, user_id=user_id) if len(existing_proj) > 0: raise HydraError('A Project with the name "%s" already ex...
def execute(self, query, args=None): '''Execute a query''' conn = self._get_db() while (yield self.nextset()): pass if PY2: # Use bytes on Python 2 always encoding = conn.encoding def ensure_bytes(x): if isinstance(x, unicode): ...
def function[execute, parameter[self, query, args]]: constant[Execute a query] variable[conn] assign[=] call[name[self]._get_db, parameter[]] while <ast.Yield object at 0x7da18f09cd60> begin[:] pass if name[PY2] begin[:] variable[encoding] assign[=] name[conn].enc...
keyword[def] identifier[execute] ( identifier[self] , identifier[query] , identifier[args] = keyword[None] ): literal[string] identifier[conn] = identifier[self] . identifier[_get_db] () keyword[while] ( keyword[yield] identifier[self] . identifier[nextset] ()): keyword[pass...
def execute(self, query, args=None): """Execute a query""" conn = self._get_db() while (yield self.nextset()): pass # depends on [control=['while'], data=[]] if PY2: # Use bytes on Python 2 always encoding = conn.encoding def ensure_bytes(x): if isinstance(x, unico...
def get_subnetid(vm_): ''' Returns the SubnetId to use ''' subnetid = config.get_cloud_config_value( 'subnetid', vm_, __opts__, search_global=False ) if subnetid: return subnetid subnetname = config.get_cloud_config_value( 'subnetname', vm_, __opts__, search_global=F...
def function[get_subnetid, parameter[vm_]]: constant[ Returns the SubnetId to use ] variable[subnetid] assign[=] call[name[config].get_cloud_config_value, parameter[constant[subnetid], name[vm_], name[__opts__]]] if name[subnetid] begin[:] return[name[subnetid]] variable[...
keyword[def] identifier[get_subnetid] ( identifier[vm_] ): literal[string] identifier[subnetid] = identifier[config] . identifier[get_cloud_config_value] ( literal[string] , identifier[vm_] , identifier[__opts__] , identifier[search_global] = keyword[False] ) keyword[if] identifier[subnetid...
def get_subnetid(vm_): """ Returns the SubnetId to use """ subnetid = config.get_cloud_config_value('subnetid', vm_, __opts__, search_global=False) if subnetid: return subnetid # depends on [control=['if'], data=[]] subnetname = config.get_cloud_config_value('subnetname', vm_, __opts__,...
def cli(ctx, settings, app): """Manage Morp application services""" if app is None and settings is None: print('Either --app or --settings must be supplied') ctx.ensure_object(dict) ctx.obj['app'] = app ctx.obj['settings'] = settings
def function[cli, parameter[ctx, settings, app]]: constant[Manage Morp application services] if <ast.BoolOp object at 0x7da204565120> begin[:] call[name[print], parameter[constant[Either --app or --settings must be supplied]]] call[name[ctx].ensure_object, parameter[name[dict]]] ...
keyword[def] identifier[cli] ( identifier[ctx] , identifier[settings] , identifier[app] ): literal[string] keyword[if] identifier[app] keyword[is] keyword[None] keyword[and] identifier[settings] keyword[is] keyword[None] : identifier[print] ( literal[string] ) identifier[ctx] . identif...
def cli(ctx, settings, app): """Manage Morp application services""" if app is None and settings is None: print('Either --app or --settings must be supplied') # depends on [control=['if'], data=[]] ctx.ensure_object(dict) ctx.obj['app'] = app ctx.obj['settings'] = settings
def which_users_can(self, name): """Which role can SendMail? """ _roles = self.which_roles_can(name) result = [self.get_role_members(i.get('role')) for i in _roles] return result
def function[which_users_can, parameter[self, name]]: constant[Which role can SendMail? ] variable[_roles] assign[=] call[name[self].which_roles_can, parameter[name[name]]] variable[result] assign[=] <ast.ListComp object at 0x7da1b0fdef20> return[name[result]]
keyword[def] identifier[which_users_can] ( identifier[self] , identifier[name] ): literal[string] identifier[_roles] = identifier[self] . identifier[which_roles_can] ( identifier[name] ) identifier[result] =[ identifier[self] . identifier[get_role_members] ( identifier[i] . identifier[get]...
def which_users_can(self, name): """Which role can SendMail? """ _roles = self.which_roles_can(name) result = [self.get_role_members(i.get('role')) for i in _roles] return result
def from_csv(input_csv_pattern, headers=None, schema_file=None): """Create a Metrics instance from csv file pattern. Args: input_csv_pattern: Path to Csv file pattern (with no header). Can be local or GCS path. headers: Csv headers. schema_file: Path to a JSON file containing BigQuery schema....
def function[from_csv, parameter[input_csv_pattern, headers, schema_file]]: constant[Create a Metrics instance from csv file pattern. Args: input_csv_pattern: Path to Csv file pattern (with no header). Can be local or GCS path. headers: Csv headers. schema_file: Path to a JSON file contai...
keyword[def] identifier[from_csv] ( identifier[input_csv_pattern] , identifier[headers] = keyword[None] , identifier[schema_file] = keyword[None] ): literal[string] keyword[if] identifier[headers] keyword[is] keyword[not] keyword[None] : identifier[names] = identifier[headers] keyword[eli...
def from_csv(input_csv_pattern, headers=None, schema_file=None): """Create a Metrics instance from csv file pattern. Args: input_csv_pattern: Path to Csv file pattern (with no header). Can be local or GCS path. headers: Csv headers. schema_file: Path to a JSON file containing BigQuery schema....
def set_legend(self, legend): """legend needs to be a list, tuple or None""" assert(isinstance(legend, list) or isinstance(legend, tuple) or legend is None) if legend: self.legend = [quote(a) for a in legend] else: self.legend = None
def function[set_legend, parameter[self, legend]]: constant[legend needs to be a list, tuple or None] assert[<ast.BoolOp object at 0x7da1b10e6e60>] if name[legend] begin[:] name[self].legend assign[=] <ast.ListComp object at 0x7da1b10e5480>
keyword[def] identifier[set_legend] ( identifier[self] , identifier[legend] ): literal[string] keyword[assert] ( identifier[isinstance] ( identifier[legend] , identifier[list] ) keyword[or] identifier[isinstance] ( identifier[legend] , identifier[tuple] ) keyword[or] identifier[legend] ...
def set_legend(self, legend): """legend needs to be a list, tuple or None""" assert isinstance(legend, list) or isinstance(legend, tuple) or legend is None if legend: self.legend = [quote(a) for a in legend] # depends on [control=['if'], data=[]] else: self.legend = None
def title_translations(self, key, value): """Populate the ``title_translations`` key.""" return { 'language': langdetect.detect(value.get('a')), 'source': value.get('9'), 'subtitle': value.get('b'), 'title': value.get('a'), }
def function[title_translations, parameter[self, key, value]]: constant[Populate the ``title_translations`` key.] return[dictionary[[<ast.Constant object at 0x7da20c6c4e20>, <ast.Constant object at 0x7da20c6c6fe0>, <ast.Constant object at 0x7da20c6c7310>, <ast.Constant object at 0x7da20c6c5240>], [<ast.Call...
keyword[def] identifier[title_translations] ( identifier[self] , identifier[key] , identifier[value] ): literal[string] keyword[return] { literal[string] : identifier[langdetect] . identifier[detect] ( identifier[value] . identifier[get] ( literal[string] )), literal[string] : identifier[value] ....
def title_translations(self, key, value): """Populate the ``title_translations`` key.""" return {'language': langdetect.detect(value.get('a')), 'source': value.get('9'), 'subtitle': value.get('b'), 'title': value.get('a')}
def unsubscribe(self, transform="", downlink=False): """Unsubscribes from a previously subscribed stream. Note that the same values of transform and downlink must be passed in order to do the correct unsubscribe:: s.subscribe(callback,transform="if last") s.unsubscribe(transform...
def function[unsubscribe, parameter[self, transform, downlink]]: constant[Unsubscribes from a previously subscribed stream. Note that the same values of transform and downlink must be passed in order to do the correct unsubscribe:: s.subscribe(callback,transform="if last") s.uns...
keyword[def] identifier[unsubscribe] ( identifier[self] , identifier[transform] = literal[string] , identifier[downlink] = keyword[False] ): literal[string] identifier[streampath] = identifier[self] . identifier[path] keyword[if] identifier[downlink] : identifier[streampath]...
def unsubscribe(self, transform='', downlink=False): """Unsubscribes from a previously subscribed stream. Note that the same values of transform and downlink must be passed in order to do the correct unsubscribe:: s.subscribe(callback,transform="if last") s.unsubscribe(transform="if...
def _get_auth_from_netrc(self, hostname): """Try to find login auth in ``~/.netrc``.""" try: hostauth = netrc(self.NETRC_FILE) except IOError as cause: if cause.errno != errno.ENOENT: raise return None except NetrcParseError as cause: ...
def function[_get_auth_from_netrc, parameter[self, hostname]]: constant[Try to find login auth in ``~/.netrc``.] <ast.Try object at 0x7da2043476d0> variable[auth] assign[=] call[name[hostauth].hosts.get, parameter[call[constant[{}@{}].format, parameter[<ast.BoolOp object at 0x7da204345510>, name[hos...
keyword[def] identifier[_get_auth_from_netrc] ( identifier[self] , identifier[hostname] ): literal[string] keyword[try] : identifier[hostauth] = identifier[netrc] ( identifier[self] . identifier[NETRC_FILE] ) keyword[except] identifier[IOError] keyword[as] identifier[cause]...
def _get_auth_from_netrc(self, hostname): """Try to find login auth in ``~/.netrc``.""" try: hostauth = netrc(self.NETRC_FILE) # depends on [control=['try'], data=[]] except IOError as cause: if cause.errno != errno.ENOENT: raise # depends on [control=['if'], data=[]] r...
def bulk_write(self, requests, ordered=True, bypass_document_validation=False): """Send a batch of write operations to the server. Requests are passed as a list of write operation instances ( :class:`~pymongo.operations.InsertOne`, :class:`~pymongo.operations.UpdateOn...
def function[bulk_write, parameter[self, requests, ordered, bypass_document_validation]]: constant[Send a batch of write operations to the server. Requests are passed as a list of write operation instances ( :class:`~pymongo.operations.InsertOne`, :class:`~pymongo.operations.UpdateOne`,...
keyword[def] identifier[bulk_write] ( identifier[self] , identifier[requests] , identifier[ordered] = keyword[True] , identifier[bypass_document_validation] = keyword[False] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[requests] , identifier[list] ): ...
def bulk_write(self, requests, ordered=True, bypass_document_validation=False): """Send a batch of write operations to the server. Requests are passed as a list of write operation instances ( :class:`~pymongo.operations.InsertOne`, :class:`~pymongo.operations.UpdateOne`, :class:`~py...
def do_show(self, repo): ''' List repo attributes ''' self.abort_on_nonexisting_effective_repo(repo, 'show') repo = self.network.get_repo(repo) repo.print_attributes()
def function[do_show, parameter[self, repo]]: constant[ List repo attributes ] call[name[self].abort_on_nonexisting_effective_repo, parameter[name[repo], constant[show]]] variable[repo] assign[=] call[name[self].network.get_repo, parameter[name[repo]]] call[name[repo].pri...
keyword[def] identifier[do_show] ( identifier[self] , identifier[repo] ): literal[string] identifier[self] . identifier[abort_on_nonexisting_effective_repo] ( identifier[repo] , literal[string] ) identifier[repo] = identifier[self] . identifier[network] . identifier[get_repo] ( identifier...
def do_show(self, repo): """ List repo attributes """ self.abort_on_nonexisting_effective_repo(repo, 'show') repo = self.network.get_repo(repo) repo.print_attributes()
def update(self, data, default=False): """Update this :attr:`Config` with ``data``. :param data: must be a ``Mapping`` like object exposing the ``item`` method for iterating through key-value pairs. :param default: if ``True`` the updated :attr:`settings` will also set t...
def function[update, parameter[self, data, default]]: constant[Update this :attr:`Config` with ``data``. :param data: must be a ``Mapping`` like object exposing the ``item`` method for iterating through key-value pairs. :param default: if ``True`` the updated :attr:`settings` will a...
keyword[def] identifier[update] ( identifier[self] , identifier[data] , identifier[default] = keyword[False] ): literal[string] keyword[for] identifier[name] , identifier[value] keyword[in] identifier[data] . identifier[items] (): keyword[if] identifier[value] keyword[is] keyword...
def update(self, data, default=False): """Update this :attr:`Config` with ``data``. :param data: must be a ``Mapping`` like object exposing the ``item`` method for iterating through key-value pairs. :param default: if ``True`` the updated :attr:`settings` will also set their...
def balance(self, as_of=None, raw=False, leg_query=None, **kwargs): """Get the balance for this account, including child accounts Args: as_of (Date): Only include transactions on or before this date raw (bool): If true the returned balance should not have its sign ...
def function[balance, parameter[self, as_of, raw, leg_query]]: constant[Get the balance for this account, including child accounts Args: as_of (Date): Only include transactions on or before this date raw (bool): If true the returned balance should not have its sign ...
keyword[def] identifier[balance] ( identifier[self] , identifier[as_of] = keyword[None] , identifier[raw] = keyword[False] , identifier[leg_query] = keyword[None] ,** identifier[kwargs] ): literal[string] identifier[balances] =[ identifier[account] . identifier[simple_balance] ( identifier...
def balance(self, as_of=None, raw=False, leg_query=None, **kwargs): """Get the balance for this account, including child accounts Args: as_of (Date): Only include transactions on or before this date raw (bool): If true the returned balance should not have its sign ...
def match(self, category, pattern): """Match the category.""" return fnmatch.fnmatch(category, pattern, flags=self.FNMATCH_FLAGS)
def function[match, parameter[self, category, pattern]]: constant[Match the category.] return[call[name[fnmatch].fnmatch, parameter[name[category], name[pattern]]]]
keyword[def] identifier[match] ( identifier[self] , identifier[category] , identifier[pattern] ): literal[string] keyword[return] identifier[fnmatch] . identifier[fnmatch] ( identifier[category] , identifier[pattern] , identifier[flags] = identifier[self] . identifier[FNMATCH_FLAGS] )
def match(self, category, pattern): """Match the category.""" return fnmatch.fnmatch(category, pattern, flags=self.FNMATCH_FLAGS)
def uriunsplit(uri): """ Reverse of urisplit() >>> uriunsplit(('scheme','authority','path','query','fragment')) "scheme://authority/path?query#fragment" """ (scheme, authority, path, query, fragment) = uri result = '' if scheme: result += scheme + ':' if authority: ...
def function[uriunsplit, parameter[uri]]: constant[ Reverse of urisplit() >>> uriunsplit(('scheme','authority','path','query','fragment')) "scheme://authority/path?query#fragment" ] <ast.Tuple object at 0x7da18f00e200> assign[=] name[uri] variable[result] assign[=] cons...
keyword[def] identifier[uriunsplit] ( identifier[uri] ): literal[string] ( identifier[scheme] , identifier[authority] , identifier[path] , identifier[query] , identifier[fragment] )= identifier[uri] identifier[result] = literal[string] keyword[if] identifier[scheme] : identifier[result...
def uriunsplit(uri): """ Reverse of urisplit() >>> uriunsplit(('scheme','authority','path','query','fragment')) "scheme://authority/path?query#fragment" """ (scheme, authority, path, query, fragment) = uri result = '' if scheme: result += scheme + ':' # depends on [con...
def red_ext(request, message=None): ''' The external landing. Also a convenience function for redirecting users who don't have site access to the external page. Parameters: request - the request in the calling function message - a message from the caller function ''' if message: ...
def function[red_ext, parameter[request, message]]: constant[ The external landing. Also a convenience function for redirecting users who don't have site access to the external page. Parameters: request - the request in the calling function message - a message from the caller functio...
keyword[def] identifier[red_ext] ( identifier[request] , identifier[message] = keyword[None] ): literal[string] keyword[if] identifier[message] : identifier[messages] . identifier[add_message] ( identifier[request] , identifier[messages] . identifier[ERROR] , identifier[message] ) keyword[re...
def red_ext(request, message=None): """ The external landing. Also a convenience function for redirecting users who don't have site access to the external page. Parameters: request - the request in the calling function message - a message from the caller function """ if message: ...
def _reqs(self, tag): """ Grab all the pull requests """ return [ (tag, i) for i in self.client.get_pulls(*tag.split('/')) ]
def function[_reqs, parameter[self, tag]]: constant[ Grab all the pull requests ] return[<ast.ListComp object at 0x7da1b025aa40>]
keyword[def] identifier[_reqs] ( identifier[self] , identifier[tag] ): literal[string] keyword[return] [ ( identifier[tag] , identifier[i] ) keyword[for] identifier[i] keyword[in] identifier[self] . identifier[client] . identifier[get_pulls] (* identifier[tag] . identifier[split...
def _reqs(self, tag): """ Grab all the pull requests """ return [(tag, i) for i in self.client.get_pulls(*tag.split('/'))]
def _find_first_transactions( transactions, customer_id_col, datetime_col, monetary_value_col=None, datetime_format=None, observation_period_end=None, freq="D", ): """ Return dataframe with first transactions. This takes a DataFrame of transaction data of the form: custo...
def function[_find_first_transactions, parameter[transactions, customer_id_col, datetime_col, monetary_value_col, datetime_format, observation_period_end, freq]]: constant[ Return dataframe with first transactions. This takes a DataFrame of transaction data of the form: customer_id, datetime [,...
keyword[def] identifier[_find_first_transactions] ( identifier[transactions] , identifier[customer_id_col] , identifier[datetime_col] , identifier[monetary_value_col] = keyword[None] , identifier[datetime_format] = keyword[None] , identifier[observation_period_end] = keyword[None] , identifier[freq] = literal[...
def _find_first_transactions(transactions, customer_id_col, datetime_col, monetary_value_col=None, datetime_format=None, observation_period_end=None, freq='D'): """ Return dataframe with first transactions. This takes a DataFrame of transaction data of the form: customer_id, datetime [, monetary_va...
def print_diff(self, summary1=None, summary2=None): """Compute diff between to summaries and print it. If no summary is provided, the diff from the last to the current summary is used. If summary1 is provided the diff from summary1 to the current summary is used. If summary1 and summary...
def function[print_diff, parameter[self, summary1, summary2]]: constant[Compute diff between to summaries and print it. If no summary is provided, the diff from the last to the current summary is used. If summary1 is provided the diff from summary1 to the current summary is used. If sum...
keyword[def] identifier[print_diff] ( identifier[self] , identifier[summary1] = keyword[None] , identifier[summary2] = keyword[None] ): literal[string] identifier[summary] . identifier[print_] ( identifier[self] . identifier[diff] ( identifier[summary1] = identifier[summary1] , identifier[summary2]...
def print_diff(self, summary1=None, summary2=None): """Compute diff between to summaries and print it. If no summary is provided, the diff from the last to the current summary is used. If summary1 is provided the diff from summary1 to the current summary is used. If summary1 and summary2 ar...
def diff_dumps(ih1, ih2, tofile=None, name1="a", name2="b", n_context=3): """Diff 2 IntelHex objects and produce unified diff output for their hex dumps. @param ih1 first IntelHex object to compare @param ih2 second IntelHex object to compare @param tofile file-like object to writ...
def function[diff_dumps, parameter[ih1, ih2, tofile, name1, name2, n_context]]: constant[Diff 2 IntelHex objects and produce unified diff output for their hex dumps. @param ih1 first IntelHex object to compare @param ih2 second IntelHex object to compare @param tofile file-lik...
keyword[def] identifier[diff_dumps] ( identifier[ih1] , identifier[ih2] , identifier[tofile] = keyword[None] , identifier[name1] = literal[string] , identifier[name2] = literal[string] , identifier[n_context] = literal[int] ): literal[string] keyword[def] identifier[prepare_lines] ( identifier[ih] ): ...
def diff_dumps(ih1, ih2, tofile=None, name1='a', name2='b', n_context=3): """Diff 2 IntelHex objects and produce unified diff output for their hex dumps. @param ih1 first IntelHex object to compare @param ih2 second IntelHex object to compare @param tofile file-like object to writ...
def delete_file(self, project_name, remote_path): """ Delete a file or folder from a project :param project_name: str: name of the project containing a file we will delete :param remote_path: str: remote path specifying file to delete """ project = self._get_or_create_pro...
def function[delete_file, parameter[self, project_name, remote_path]]: constant[ Delete a file or folder from a project :param project_name: str: name of the project containing a file we will delete :param remote_path: str: remote path specifying file to delete ] variable...
keyword[def] identifier[delete_file] ( identifier[self] , identifier[project_name] , identifier[remote_path] ): literal[string] identifier[project] = identifier[self] . identifier[_get_or_create_project] ( identifier[project_name] ) identifier[remote_file] = identifier[project] . identifie...
def delete_file(self, project_name, remote_path): """ Delete a file or folder from a project :param project_name: str: name of the project containing a file we will delete :param remote_path: str: remote path specifying file to delete """ project = self._get_or_create_project(pro...
def can_infect(self, event): """ Whether the spreading stop can infect using this event. """ if event.from_stop_I != self.stop_I: return False if not self.has_been_visited(): return False else: time_sep = event.dep_time_ut-self.get_min...
def function[can_infect, parameter[self, event]]: constant[ Whether the spreading stop can infect using this event. ] if compare[name[event].from_stop_I not_equal[!=] name[self].stop_I] begin[:] return[constant[False]] if <ast.UnaryOp object at 0x7da1b0140070> begin[:] ...
keyword[def] identifier[can_infect] ( identifier[self] , identifier[event] ): literal[string] keyword[if] identifier[event] . identifier[from_stop_I] != identifier[self] . identifier[stop_I] : keyword[return] keyword[False] keyword[if] keyword[not] identifier[self] . ide...
def can_infect(self, event): """ Whether the spreading stop can infect using this event. """ if event.from_stop_I != self.stop_I: return False # depends on [control=['if'], data=[]] if not self.has_been_visited(): return False # depends on [control=['if'], data=[]] else...
def create(name): ''' Create a basic chroot environment. Note that this environment is not functional. The caller needs to install the minimal required binaries, including Python if chroot.call is called. name Path to the chroot environment CLI Example: .. code-block:: bash ...
def function[create, parameter[name]]: constant[ Create a basic chroot environment. Note that this environment is not functional. The caller needs to install the minimal required binaries, including Python if chroot.call is called. name Path to the chroot environment CLI Examp...
keyword[def] identifier[create] ( identifier[name] ): literal[string] keyword[if] keyword[not] identifier[exist] ( identifier[name] ): identifier[dev] = identifier[os] . identifier[path] . identifier[join] ( identifier[name] , literal[string] ) identifier[proc] = identifier[os] . identi...
def create(name): """ Create a basic chroot environment. Note that this environment is not functional. The caller needs to install the minimal required binaries, including Python if chroot.call is called. name Path to the chroot environment CLI Example: .. code-block:: bash ...
def _storestr(ins): """ Stores a string value into a memory address. It copies content of 2nd operand (string), into 1st, reallocating dynamic memory for the 1st str. These instruction DOES ALLOW inmediate strings for the 2nd parameter, starting with '#'. Must prepend '#' (immediate sigil) to 1st o...
def function[_storestr, parameter[ins]]: constant[ Stores a string value into a memory address. It copies content of 2nd operand (string), into 1st, reallocating dynamic memory for the 1st str. These instruction DOES ALLOW inmediate strings for the 2nd parameter, starting with '#'. Must prepend...
keyword[def] identifier[_storestr] ( identifier[ins] ): literal[string] identifier[op1] = identifier[ins] . identifier[quad] [ literal[int] ] identifier[indirect] = identifier[op1] [ literal[int] ]== literal[string] keyword[if] identifier[indirect] : identifier[op1] = identifier[op1] [...
def _storestr(ins): """ Stores a string value into a memory address. It copies content of 2nd operand (string), into 1st, reallocating dynamic memory for the 1st str. These instruction DOES ALLOW inmediate strings for the 2nd parameter, starting with '#'. Must prepend '#' (immediate sigil) to 1st o...
def view_show(self, id, **kwargs): "https://developer.zendesk.com/rest_api/docs/core/views#show-view" api_path = "/api/v2/views/{id}.json" api_path = api_path.format(id=id) return self.call(api_path, **kwargs)
def function[view_show, parameter[self, id]]: constant[https://developer.zendesk.com/rest_api/docs/core/views#show-view] variable[api_path] assign[=] constant[/api/v2/views/{id}.json] variable[api_path] assign[=] call[name[api_path].format, parameter[]] return[call[name[self].call, parameter...
keyword[def] identifier[view_show] ( identifier[self] , identifier[id] ,** identifier[kwargs] ): literal[string] identifier[api_path] = literal[string] identifier[api_path] = identifier[api_path] . identifier[format] ( identifier[id] = identifier[id] ) keyword[return] identifier...
def view_show(self, id, **kwargs): """https://developer.zendesk.com/rest_api/docs/core/views#show-view""" api_path = '/api/v2/views/{id}.json' api_path = api_path.format(id=id) return self.call(api_path, **kwargs)
def plot_graph_route(G, route, bbox=None, fig_height=6, fig_width=None, margin=0.02, bgcolor='w', axis_off=True, show=True, save=False, close=True, file_format='png', filename='temp', dpi=300, annotate=False, node_color='#999999', node_...
def function[plot_graph_route, parameter[G, route, bbox, fig_height, fig_width, margin, bgcolor, axis_off, show, save, close, file_format, filename, dpi, annotate, node_color, node_size, node_alpha, node_edgecolor, node_zorder, edge_color, edge_linewidth, edge_alpha, use_geom, origin_point, destination_point, route_col...
keyword[def] identifier[plot_graph_route] ( identifier[G] , identifier[route] , identifier[bbox] = keyword[None] , identifier[fig_height] = literal[int] , identifier[fig_width] = keyword[None] , identifier[margin] = literal[int] , identifier[bgcolor] = literal[string] , identifier[axis_off] = keyword[True] , identif...
def plot_graph_route(G, route, bbox=None, fig_height=6, fig_width=None, margin=0.02, bgcolor='w', axis_off=True, show=True, save=False, close=True, file_format='png', filename='temp', dpi=300, annotate=False, node_color='#999999', node_size=15, node_alpha=1, node_edgecolor='none', node_zorder=1, edge_color='#999999', e...
def put(self, template_name): """Update a template""" self.reqparse.add_argument('template', type=str, required=True) args = self.reqparse.parse_args() template = db.Template.find_one(template_name=template_name) if not template: return self.make_response('No such t...
def function[put, parameter[self, template_name]]: constant[Update a template] call[name[self].reqparse.add_argument, parameter[constant[template]]] variable[args] assign[=] call[name[self].reqparse.parse_args, parameter[]] variable[template] assign[=] call[name[db].Template.find_one, pa...
keyword[def] identifier[put] ( identifier[self] , identifier[template_name] ): literal[string] identifier[self] . identifier[reqparse] . identifier[add_argument] ( literal[string] , identifier[type] = identifier[str] , identifier[required] = keyword[True] ) identifier[args] = identifier[se...
def put(self, template_name): """Update a template""" self.reqparse.add_argument('template', type=str, required=True) args = self.reqparse.parse_args() template = db.Template.find_one(template_name=template_name) if not template: return self.make_response('No such template found', HTTP.NOT_F...
def calc_remotefailure_v1(self): """Estimate the shortfall of actual discharge under the required discharge of a cross section far downstream. Required control parameters: |NmbLogEntries| |RemoteDischargeMinimum| Required derived parameters: |dam_derived.TOY| Required log sequen...
def function[calc_remotefailure_v1, parameter[self]]: constant[Estimate the shortfall of actual discharge under the required discharge of a cross section far downstream. Required control parameters: |NmbLogEntries| |RemoteDischargeMinimum| Required derived parameters: |dam_derive...
keyword[def] identifier[calc_remotefailure_v1] ( identifier[self] ): literal[string] identifier[con] = identifier[self] . identifier[parameters] . identifier[control] . identifier[fastaccess] identifier[der] = identifier[self] . identifier[parameters] . identifier[derived] . identifier[fastaccess] ...
def calc_remotefailure_v1(self): """Estimate the shortfall of actual discharge under the required discharge of a cross section far downstream. Required control parameters: |NmbLogEntries| |RemoteDischargeMinimum| Required derived parameters: |dam_derived.TOY| Required log sequen...