code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def get_filter_value(self, filter_name): """ API Version 2015-10-01 defines the following filters for DescribeDhcpOptions: * dhcp-options-id * key * value * tag:key=value * tag-key * tag-value Taken from: http://docs.aws.amazon.com/AWSEC2/latest/...
def function[get_filter_value, parameter[self, filter_name]]: constant[ API Version 2015-10-01 defines the following filters for DescribeDhcpOptions: * dhcp-options-id * key * value * tag:key=value * tag-key * tag-value Taken from: http://docs.aw...
keyword[def] identifier[get_filter_value] ( identifier[self] , identifier[filter_name] ): literal[string] keyword[if] identifier[filter_name] == literal[string] : keyword[return] identifier[self] . identifier[id] keyword[elif] identifier[filter_name] == literal[string] : ...
def get_filter_value(self, filter_name): """ API Version 2015-10-01 defines the following filters for DescribeDhcpOptions: * dhcp-options-id * key * value * tag:key=value * tag-key * tag-value Taken from: http://docs.aws.amazon.com/AWSEC2/latest/APIR...
def _graphite_url(self, query, raw_data=False, graphite_url=None): """Build Graphite URL.""" query = escape.url_escape(query) graphite_url = graphite_url or self.reactor.options.get('public_graphite_url') url = "{base}/render/?target={query}&from=-{from_time}&until=-{until}".format( ...
def function[_graphite_url, parameter[self, query, raw_data, graphite_url]]: constant[Build Graphite URL.] variable[query] assign[=] call[name[escape].url_escape, parameter[name[query]]] variable[graphite_url] assign[=] <ast.BoolOp object at 0x7da1b0e9c340> variable[url] assign[=] call[c...
keyword[def] identifier[_graphite_url] ( identifier[self] , identifier[query] , identifier[raw_data] = keyword[False] , identifier[graphite_url] = keyword[None] ): literal[string] identifier[query] = identifier[escape] . identifier[url_escape] ( identifier[query] ) identifier[graphite_url]...
def _graphite_url(self, query, raw_data=False, graphite_url=None): """Build Graphite URL.""" query = escape.url_escape(query) graphite_url = graphite_url or self.reactor.options.get('public_graphite_url') url = '{base}/render/?target={query}&from=-{from_time}&until=-{until}'.format(base=graphite_url, qu...
def extend_webfont_settings(webfont_settings): """ Validate a webfont settings and optionally fill missing ``csspart_path`` option. Args: webfont_settings (dict): Webfont settings (an item value from ``settings.ICOMOON_WEBFONTS``). Returns: dict: Webfont settings ""...
def function[extend_webfont_settings, parameter[webfont_settings]]: constant[ Validate a webfont settings and optionally fill missing ``csspart_path`` option. Args: webfont_settings (dict): Webfont settings (an item value from ``settings.ICOMOON_WEBFONTS``). Returns: ...
keyword[def] identifier[extend_webfont_settings] ( identifier[webfont_settings] ): literal[string] keyword[if] keyword[not] identifier[webfont_settings] . identifier[get] ( literal[string] , keyword[False] ): keyword[raise] identifier[IcomoonSettingsError] (( literal[string] literal[s...
def extend_webfont_settings(webfont_settings): """ Validate a webfont settings and optionally fill missing ``csspart_path`` option. Args: webfont_settings (dict): Webfont settings (an item value from ``settings.ICOMOON_WEBFONTS``). Returns: dict: Webfont settings ""...
def update(self, campaign_id, search_channels, nonsearch_channels, outside_discount, nick=None): '''xxxxx.xxxxx.campaign.platform.update =================================== 取得一个推广计划的投放平台设置''' request = TOPRequest('xxxxx.xxxxx.campaign.platform.update') request['campaign_id'] = ca...
def function[update, parameter[self, campaign_id, search_channels, nonsearch_channels, outside_discount, nick]]: constant[xxxxx.xxxxx.campaign.platform.update =================================== 取得一个推广计划的投放平台设置] variable[request] assign[=] call[name[TOPRequest], parameter[constant[xxxxx....
keyword[def] identifier[update] ( identifier[self] , identifier[campaign_id] , identifier[search_channels] , identifier[nonsearch_channels] , identifier[outside_discount] , identifier[nick] = keyword[None] ): literal[string] identifier[request] = identifier[TOPRequest] ( literal[string] ) ...
def update(self, campaign_id, search_channels, nonsearch_channels, outside_discount, nick=None): """xxxxx.xxxxx.campaign.platform.update =================================== 取得一个推广计划的投放平台设置""" request = TOPRequest('xxxxx.xxxxx.campaign.platform.update') request['campaign_id'] = campaign_id ...
def to_hsl(self): ''' Return a corresponding HSL color for this RGB color. Returns: :class:`~bokeh.colors.rgb.RGB` ''' from .hsl import HSL # prevent circular import h, l, s = colorsys.rgb_to_hls(float(self.r)/255, float(self.g)/255, float(self.b)/255) retur...
def function[to_hsl, parameter[self]]: constant[ Return a corresponding HSL color for this RGB color. Returns: :class:`~bokeh.colors.rgb.RGB` ] from relative_module[hsl] import module[HSL] <ast.Tuple object at 0x7da1b1f1b6d0> assign[=] call[name[colorsys].rgb_to_hls, pa...
keyword[def] identifier[to_hsl] ( identifier[self] ): literal[string] keyword[from] . identifier[hsl] keyword[import] identifier[HSL] identifier[h] , identifier[l] , identifier[s] = identifier[colorsys] . identifier[rgb_to_hls] ( identifier[float] ( identifier[self] . identifier[r] )/ l...
def to_hsl(self): """ Return a corresponding HSL color for this RGB color. Returns: :class:`~bokeh.colors.rgb.RGB` """ from .hsl import HSL # prevent circular import (h, l, s) = colorsys.rgb_to_hls(float(self.r) / 255, float(self.g) / 255, float(self.b) / 255) return HSL(r...
def paint(self, painter, option, widget): """ Overloads the paint method from QGraphicsPathItem to \ handle custom drawing of the path using this items \ pens and polygons. :param painter <QPainter> :param option <QGraphicsItemStyleOption> ...
def function[paint, parameter[self, painter, option, widget]]: constant[ Overloads the paint method from QGraphicsPathItem to handle custom drawing of the path using this items pens and polygons. :param painter <QPainter> :param option <QGraphi...
keyword[def] identifier[paint] ( identifier[self] , identifier[painter] , identifier[option] , identifier[widget] ): literal[string] identifier[painter] . identifier[setOpacity] ( identifier[self] . identifier[opacity] ()) keyword[if] keyword[not] identifier[...
def paint(self, painter, option, widget): """ Overloads the paint method from QGraphicsPathItem to handle custom drawing of the path using this items pens and polygons. :param painter <QPainter> :param option <QGraphicsItemStyleOption> :par...
def get_entries(self, user_scope, key=None): """GetEntries. [Preview API] Get all setting entries for the given user/all-users scope :param str user_scope: User-Scope at which to get the value. Should be "me" for the current user or "host" for all users. :param str key: Optional key unde...
def function[get_entries, parameter[self, user_scope, key]]: constant[GetEntries. [Preview API] Get all setting entries for the given user/all-users scope :param str user_scope: User-Scope at which to get the value. Should be "me" for the current user or "host" for all users. :param str ...
keyword[def] identifier[get_entries] ( identifier[self] , identifier[user_scope] , identifier[key] = keyword[None] ): literal[string] identifier[route_values] ={} keyword[if] identifier[user_scope] keyword[is] keyword[not] keyword[None] : identifier[route_values] [ literal...
def get_entries(self, user_scope, key=None): """GetEntries. [Preview API] Get all setting entries for the given user/all-users scope :param str user_scope: User-Scope at which to get the value. Should be "me" for the current user or "host" for all users. :param str key: Optional key under wh...
def _create_config(cls): """ Creates an ApphookConfig instance ``AutoCMSAppMixin.auto_setup['config_fields']`` is used to fill in the data of the instance. :return: ApphookConfig instance """ return cls.app_config.objects.create( namespace=cls.auto_s...
def function[_create_config, parameter[cls]]: constant[ Creates an ApphookConfig instance ``AutoCMSAppMixin.auto_setup['config_fields']`` is used to fill in the data of the instance. :return: ApphookConfig instance ] return[call[name[cls].app_config.objects.create, ...
keyword[def] identifier[_create_config] ( identifier[cls] ): literal[string] keyword[return] identifier[cls] . identifier[app_config] . identifier[objects] . identifier[create] ( identifier[namespace] = identifier[cls] . identifier[auto_setup] [ literal[string] ],** identifier[cls] . iden...
def _create_config(cls): """ Creates an ApphookConfig instance ``AutoCMSAppMixin.auto_setup['config_fields']`` is used to fill in the data of the instance. :return: ApphookConfig instance """ return cls.app_config.objects.create(namespace=cls.auto_setup['namespace'], **...
def t_measures(dirname, time_func, measure_func): """Calculate a measure over time for a single output directory, and its uncertainty. Parameters ---------- dirname: str Path to a model output directory. time_func: function Function which takes a :class:`Model` instance as a sin...
def function[t_measures, parameter[dirname, time_func, measure_func]]: constant[Calculate a measure over time for a single output directory, and its uncertainty. Parameters ---------- dirname: str Path to a model output directory. time_func: function Function which takes a :...
keyword[def] identifier[t_measures] ( identifier[dirname] , identifier[time_func] , identifier[measure_func] ): literal[string] identifier[ts] , identifier[measures] , identifier[measure_errs] =[],[],[] keyword[for] identifier[fname] keyword[in] identifier[get_filenames] ( identifier[dirname] ): ...
def t_measures(dirname, time_func, measure_func): """Calculate a measure over time for a single output directory, and its uncertainty. Parameters ---------- dirname: str Path to a model output directory. time_func: function Function which takes a :class:`Model` instance as a sin...
def scan(self, t, dt=None, aggfunc=None): """ Returns the spectrum from a specific time or range of times. """ return self.data.scan(t, dt, aggfunc)
def function[scan, parameter[self, t, dt, aggfunc]]: constant[ Returns the spectrum from a specific time or range of times. ] return[call[name[self].data.scan, parameter[name[t], name[dt], name[aggfunc]]]]
keyword[def] identifier[scan] ( identifier[self] , identifier[t] , identifier[dt] = keyword[None] , identifier[aggfunc] = keyword[None] ): literal[string] keyword[return] identifier[self] . identifier[data] . identifier[scan] ( identifier[t] , identifier[dt] , identifier[aggfunc] )
def scan(self, t, dt=None, aggfunc=None): """ Returns the spectrum from a specific time or range of times. """ return self.data.scan(t, dt, aggfunc)
def grav_pot(self, x, y, rho0, Ra, Rs, center_x=0, center_y=0): """ gravitational potential (modulo 4 pi G and rho0 in appropriate units) :param x: :param y: :param rho0: :param Ra: :param Rs: :param center_x: :param center_y: :return: ...
def function[grav_pot, parameter[self, x, y, rho0, Ra, Rs, center_x, center_y]]: constant[ gravitational potential (modulo 4 pi G and rho0 in appropriate units) :param x: :param y: :param rho0: :param Ra: :param Rs: :param center_x: :param center_y...
keyword[def] identifier[grav_pot] ( identifier[self] , identifier[x] , identifier[y] , identifier[rho0] , identifier[Ra] , identifier[Rs] , identifier[center_x] = literal[int] , identifier[center_y] = literal[int] ): literal[string] identifier[Ra] , identifier[Rs] = identifier[self] . identifier[_s...
def grav_pot(self, x, y, rho0, Ra, Rs, center_x=0, center_y=0): """ gravitational potential (modulo 4 pi G and rho0 in appropriate units) :param x: :param y: :param rho0: :param Ra: :param Rs: :param center_x: :param center_y: :return: ...
def verify_checksum(self): """ Verify the checksum in the header for this HDU. """ res = self._FITS.verify_checksum(self._ext+1) if res['dataok'] != 1: raise ValueError("data checksum failed") if res['hduok'] != 1: raise ValueError("hdu checksum fa...
def function[verify_checksum, parameter[self]]: constant[ Verify the checksum in the header for this HDU. ] variable[res] assign[=] call[name[self]._FITS.verify_checksum, parameter[binary_operation[name[self]._ext + constant[1]]]] if compare[call[name[res]][constant[dataok]] not_...
keyword[def] identifier[verify_checksum] ( identifier[self] ): literal[string] identifier[res] = identifier[self] . identifier[_FITS] . identifier[verify_checksum] ( identifier[self] . identifier[_ext] + literal[int] ) keyword[if] identifier[res] [ literal[string] ]!= literal[int] : ...
def verify_checksum(self): """ Verify the checksum in the header for this HDU. """ res = self._FITS.verify_checksum(self._ext + 1) if res['dataok'] != 1: raise ValueError('data checksum failed') # depends on [control=['if'], data=[]] if res['hduok'] != 1: raise ValueErro...
def search( self, token: dict = None, query: str = "", bbox: list = None, poly: str = None, georel: str = None, order_by: str = "_created", order_dir: str = "desc", page_size: int = 100, offset: int = 0, share: str = None, s...
def function[search, parameter[self, token, query, bbox, poly, georel, order_by, order_dir, page_size, offset, share, specific_md, include, whole_share, check, augment, tags_as_dicts, prot]]: constant[Search within the resources shared to the application. It's the main method to use. :param st...
keyword[def] identifier[search] ( identifier[self] , identifier[token] : identifier[dict] = keyword[None] , identifier[query] : identifier[str] = literal[string] , identifier[bbox] : identifier[list] = keyword[None] , identifier[poly] : identifier[str] = keyword[None] , identifier[georel] : identifier[str] = ke...
def search(self, token: dict=None, query: str='', bbox: list=None, poly: str=None, georel: str=None, order_by: str='_created', order_dir: str='desc', page_size: int=100, offset: int=0, share: str=None, specific_md: list=[], include: list=[], whole_share: bool=True, check: bool=True, augment: bool=False, tags_as_dicts: ...
def load_params( self, f=None, f_params=None, f_optimizer=None, f_history=None, checkpoint=None): """Loads the the module's parameters, history, and optimizer, not the whole object. To save and load the whole object, use pickle. ``f_params`` and ``f_optimizer`` ...
def function[load_params, parameter[self, f, f_params, f_optimizer, f_history, checkpoint]]: constant[Loads the the module's parameters, history, and optimizer, not the whole object. To save and load the whole object, use pickle. ``f_params`` and ``f_optimizer`` uses PyTorchs' ...
keyword[def] identifier[load_params] ( identifier[self] , identifier[f] = keyword[None] , identifier[f_params] = keyword[None] , identifier[f_optimizer] = keyword[None] , identifier[f_history] = keyword[None] , identifier[checkpoint] = keyword[None] ): literal[string] keyword[def] identifier[_ge...
def load_params(self, f=None, f_params=None, f_optimizer=None, f_history=None, checkpoint=None): """Loads the the module's parameters, history, and optimizer, not the whole object. To save and load the whole object, use pickle. ``f_params`` and ``f_optimizer`` uses PyTorchs' :func:...
def DCM_update(IMU, ATT, MAG, GPS): '''implement full DCM system''' global dcm_state if dcm_state is None: dcm_state = DCM_State(ATT.Roll, ATT.Pitch, ATT.Yaw) mag = Vector3(MAG.MagX, MAG.MagY, MAG.MagZ) gyro = Vector3(IMU.GyrX, IMU.GyrY, IMU.GyrZ) accel = Vector3(IMU.AccX, IMU.AccY, ...
def function[DCM_update, parameter[IMU, ATT, MAG, GPS]]: constant[implement full DCM system] <ast.Global object at 0x7da20c991180> if compare[name[dcm_state] is constant[None]] begin[:] variable[dcm_state] assign[=] call[name[DCM_State], parameter[name[ATT].Roll, name[ATT].Pitch, nam...
keyword[def] identifier[DCM_update] ( identifier[IMU] , identifier[ATT] , identifier[MAG] , identifier[GPS] ): literal[string] keyword[global] identifier[dcm_state] keyword[if] identifier[dcm_state] keyword[is] keyword[None] : identifier[dcm_state] = identifier[DCM_State] ( identifier[AT...
def DCM_update(IMU, ATT, MAG, GPS): """implement full DCM system""" global dcm_state if dcm_state is None: dcm_state = DCM_State(ATT.Roll, ATT.Pitch, ATT.Yaw) # depends on [control=['if'], data=['dcm_state']] mag = Vector3(MAG.MagX, MAG.MagY, MAG.MagZ) gyro = Vector3(IMU.GyrX, IMU.GyrY, IMU...
def enterbox(msg="Enter something." , title=" " , default="" , strip=True , image=None , root=None ): """ Show a box in which a user can enter some text. You may optionally specify some default text, which will appear in the enterbox when it is displayed. Returns the text t...
def function[enterbox, parameter[msg, title, default, strip, image, root]]: constant[ Show a box in which a user can enter some text. You may optionally specify some default text, which will appear in the enterbox when it is displayed. Returns the text that the user entered, or None if he canc...
keyword[def] identifier[enterbox] ( identifier[msg] = literal[string] , identifier[title] = literal[string] , identifier[default] = literal[string] , identifier[strip] = keyword[True] , identifier[image] = keyword[None] , identifier[root] = keyword[None] ): literal[string] identifier[result] = identi...
def enterbox(msg='Enter something.', title=' ', default='', strip=True, image=None, root=None): """ Show a box in which a user can enter some text. You may optionally specify some default text, which will appear in the enterbox when it is displayed. Returns the text that the user entered, or None ...
def initdict(self, fname): """create a blank dictionary""" if isinstance(fname, Idd): self.dt, self.dtls = fname.dt, fname.dtls return self.dt, self.dtls astr = mylib2.readfile(fname) nocom = removecomment(astr, '!') idfst = nocom alist = idfst.sp...
def function[initdict, parameter[self, fname]]: constant[create a blank dictionary] if call[name[isinstance], parameter[name[fname], name[Idd]]] begin[:] <ast.Tuple object at 0x7da1b11ed4e0> assign[=] tuple[[<ast.Attribute object at 0x7da1b11edfc0>, <ast.Attribute object at 0x7da1b11edea...
keyword[def] identifier[initdict] ( identifier[self] , identifier[fname] ): literal[string] keyword[if] identifier[isinstance] ( identifier[fname] , identifier[Idd] ): identifier[self] . identifier[dt] , identifier[self] . identifier[dtls] = identifier[fname] . identifier[dt] , identi...
def initdict(self, fname): """create a blank dictionary""" if isinstance(fname, Idd): (self.dt, self.dtls) = (fname.dt, fname.dtls) return (self.dt, self.dtls) # depends on [control=['if'], data=[]] astr = mylib2.readfile(fname) nocom = removecomment(astr, '!') idfst = nocom ali...
def _first_as_df(self): """Gets the first row as a Panda's DataFrame. Useful for functions like dtypes & ftypes""" columns = self._schema_rdd.columns df = pd.DataFrame.from_records( [self._schema_rdd.first()], columns=self._schema_rdd.columns) df = _update...
def function[_first_as_df, parameter[self]]: constant[Gets the first row as a Panda's DataFrame. Useful for functions like dtypes & ftypes] variable[columns] assign[=] name[self]._schema_rdd.columns variable[df] assign[=] call[name[pd].DataFrame.from_records, parameter[list[[<ast.Call ob...
keyword[def] identifier[_first_as_df] ( identifier[self] ): literal[string] identifier[columns] = identifier[self] . identifier[_schema_rdd] . identifier[columns] identifier[df] = identifier[pd] . identifier[DataFrame] . identifier[from_records] ( [ identifier[self] . identifier[_...
def _first_as_df(self): """Gets the first row as a Panda's DataFrame. Useful for functions like dtypes & ftypes""" columns = self._schema_rdd.columns df = pd.DataFrame.from_records([self._schema_rdd.first()], columns=self._schema_rdd.columns) df = _update_index_on_df(df, self._index_names) r...
def read(filename, data_wrapper=DataWrapper): '''Read an SWC file and return a tuple of data, format.''' data = np.loadtxt(filename) if len(np.shape(data)) == 1: data = np.reshape(data, (1, -1)) data = data[:, [X, Y, Z, R, TYPE, ID, P]] return data_wrapper(data, 'SWC', None)
def function[read, parameter[filename, data_wrapper]]: constant[Read an SWC file and return a tuple of data, format.] variable[data] assign[=] call[name[np].loadtxt, parameter[name[filename]]] if compare[call[name[len], parameter[call[name[np].shape, parameter[name[data]]]]] equal[==] constant[1...
keyword[def] identifier[read] ( identifier[filename] , identifier[data_wrapper] = identifier[DataWrapper] ): literal[string] identifier[data] = identifier[np] . identifier[loadtxt] ( identifier[filename] ) keyword[if] identifier[len] ( identifier[np] . identifier[shape] ( identifier[data] ))== litera...
def read(filename, data_wrapper=DataWrapper): """Read an SWC file and return a tuple of data, format.""" data = np.loadtxt(filename) if len(np.shape(data)) == 1: data = np.reshape(data, (1, -1)) # depends on [control=['if'], data=[]] data = data[:, [X, Y, Z, R, TYPE, ID, P]] return data_wra...
def checkTikaServer(scheme="http", serverHost=ServerHost, port=Port, tikaServerJar=TikaServerJar, classpath=None, config_path=None): ''' Check that tika-server is running. If not, download JAR file and start it up. :param scheme: e.g. http or https :param serverHost: :param port: :param tikaSer...
def function[checkTikaServer, parameter[scheme, serverHost, port, tikaServerJar, classpath, config_path]]: constant[ Check that tika-server is running. If not, download JAR file and start it up. :param scheme: e.g. http or https :param serverHost: :param port: :param tikaServerJar: :par...
keyword[def] identifier[checkTikaServer] ( identifier[scheme] = literal[string] , identifier[serverHost] = identifier[ServerHost] , identifier[port] = identifier[Port] , identifier[tikaServerJar] = identifier[TikaServerJar] , identifier[classpath] = keyword[None] , identifier[config_path] = keyword[None] ): lite...
def checkTikaServer(scheme='http', serverHost=ServerHost, port=Port, tikaServerJar=TikaServerJar, classpath=None, config_path=None): """ Check that tika-server is running. If not, download JAR file and start it up. :param scheme: e.g. http or https :param serverHost: :param port: :param tikaSer...
def CrearCertificacionCabecera(self, pto_emision=1, nro_orden=None, tipo_certificado=None, nro_planta=None, nro_ing_bruto_depositario=None, titular_grano=None, cuit_depositante=None, nro_ing_bruto_depositante=None, cuit_corredor=None, cod_grano=None, campania=None, ...
def function[CrearCertificacionCabecera, parameter[self, pto_emision, nro_orden, tipo_certificado, nro_planta, nro_ing_bruto_depositario, titular_grano, cuit_depositante, nro_ing_bruto_depositante, cuit_corredor, cod_grano, campania, datos_adicionales]]: constant[Inicializa los datos de una certificación de gra...
keyword[def] identifier[CrearCertificacionCabecera] ( identifier[self] , identifier[pto_emision] = literal[int] , identifier[nro_orden] = keyword[None] , identifier[tipo_certificado] = keyword[None] , identifier[nro_planta] = keyword[None] , identifier[nro_ing_bruto_depositario] = keyword[None] , identifier[titular...
def CrearCertificacionCabecera(self, pto_emision=1, nro_orden=None, tipo_certificado=None, nro_planta=None, nro_ing_bruto_depositario=None, titular_grano=None, cuit_depositante=None, nro_ing_bruto_depositante=None, cuit_corredor=None, cod_grano=None, campania=None, datos_adicionales=None, **kwargs): """Inicializa l...
def path(self): """ Absolute path to the directory on the camera's filesystem. """ if self.parent is None: return "/" else: return os.path.join(self.parent.path, self.name)
def function[path, parameter[self]]: constant[ Absolute path to the directory on the camera's filesystem. ] if compare[name[self].parent is constant[None]] begin[:] return[constant[/]]
keyword[def] identifier[path] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[parent] keyword[is] keyword[None] : keyword[return] literal[string] keyword[else] : keyword[return] identifier[os] . identifier[path] . identifier[j...
def path(self): """ Absolute path to the directory on the camera's filesystem. """ if self.parent is None: return '/' # depends on [control=['if'], data=[]] else: return os.path.join(self.parent.path, self.name)
def psnr(test, ref, mask=None): """Peak Signal-to-Noise Ratio (PSNR) Calculate the PSNR between a test image and a reference image. Parameters ---------- ref : np.ndarray the reference image test : np.ndarray the tested image mask : np.ndarray, optional the mask for...
def function[psnr, parameter[test, ref, mask]]: constant[Peak Signal-to-Noise Ratio (PSNR) Calculate the PSNR between a test image and a reference image. Parameters ---------- ref : np.ndarray the reference image test : np.ndarray the tested image mask : np.ndarray, opt...
keyword[def] identifier[psnr] ( identifier[test] , identifier[ref] , identifier[mask] = keyword[None] ): literal[string] identifier[test] , identifier[ref] , identifier[mask] = identifier[_preprocess_input] ( identifier[test] , identifier[ref] , identifier[mask] ) keyword[if] identifier[mask] keyw...
def psnr(test, ref, mask=None): """Peak Signal-to-Noise Ratio (PSNR) Calculate the PSNR between a test image and a reference image. Parameters ---------- ref : np.ndarray the reference image test : np.ndarray the tested image mask : np.ndarray, optional the mask for...
def create_component(self, name, description=None): """ Create a sub component in the business component. :param name: The new component's name. :param description: The new component's description. :returns: The created component. """ new_comp = Component(name,...
def function[create_component, parameter[self, name, description]]: constant[ Create a sub component in the business component. :param name: The new component's name. :param description: The new component's description. :returns: The created component. ] variabl...
keyword[def] identifier[create_component] ( identifier[self] , identifier[name] , identifier[description] = keyword[None] ): literal[string] identifier[new_comp] = identifier[Component] ( identifier[name] , identifier[self] . identifier[gl] , identifier[description] = identifier[description] ) ...
def create_component(self, name, description=None): """ Create a sub component in the business component. :param name: The new component's name. :param description: The new component's description. :returns: The created component. """ new_comp = Component(name, self.gl,...
def docx_process_simple_text(text: str, width: int) -> str: """ Word-wraps text. Args: text: text to process width: width to word-wrap to (or 0 to skip word wrapping) Returns: wrapped text """ if width: return '\n'.join(textwrap.wrap(text, width=width)) else...
def function[docx_process_simple_text, parameter[text, width]]: constant[ Word-wraps text. Args: text: text to process width: width to word-wrap to (or 0 to skip word wrapping) Returns: wrapped text ] if name[width] begin[:] return[call[constant[ ].join,...
keyword[def] identifier[docx_process_simple_text] ( identifier[text] : identifier[str] , identifier[width] : identifier[int] )-> identifier[str] : literal[string] keyword[if] identifier[width] : keyword[return] literal[string] . identifier[join] ( identifier[textwrap] . identifier[wrap] ( identi...
def docx_process_simple_text(text: str, width: int) -> str: """ Word-wraps text. Args: text: text to process width: width to word-wrap to (or 0 to skip word wrapping) Returns: wrapped text """ if width: return '\n'.join(textwrap.wrap(text, width=width)) # depen...
def get_stores(self, names=None, workspaces=None): ''' Returns a list of stores in the catalog. If workspaces is specified will only return stores in those workspaces. If names is specified, will only return stores that match. names can either be a comma delimited string or an arra...
def function[get_stores, parameter[self, names, workspaces]]: constant[ Returns a list of stores in the catalog. If workspaces is specified will only return stores in those workspaces. If names is specified, will only return stores that match. names can either be a comma delimited ...
keyword[def] identifier[get_stores] ( identifier[self] , identifier[names] = keyword[None] , identifier[workspaces] = keyword[None] ): literal[string] keyword[if] identifier[isinstance] ( identifier[workspaces] , identifier[Workspace] ): identifier[workspaces] =[ identifier[workspace...
def get_stores(self, names=None, workspaces=None): """ Returns a list of stores in the catalog. If workspaces is specified will only return stores in those workspaces. If names is specified, will only return stores that match. names can either be a comma delimited string or an array. ...
def append(self, other: 'List') -> 'List': """Append other list to this list.""" if self.null(): return other return (self.tail().append(other)).cons(self.head())
def function[append, parameter[self, other]]: constant[Append other list to this list.] if call[name[self].null, parameter[]] begin[:] return[name[other]] return[call[call[call[name[self].tail, parameter[]].append, parameter[name[other]]].cons, parameter[call[name[self].head, parameter[]]]]]
keyword[def] identifier[append] ( identifier[self] , identifier[other] : literal[string] )-> literal[string] : literal[string] keyword[if] identifier[self] . identifier[null] (): keyword[return] identifier[other] keyword[return] ( identifier[self] . identifier[tail] (). id...
def append(self, other: 'List') -> 'List': """Append other list to this list.""" if self.null(): return other # depends on [control=['if'], data=[]] return self.tail().append(other).cons(self.head())
def find_subdirs(startdir='.', recursion_depth=None): """Find all subdirectory of a directory. Inputs: startdir: directory to start with. Defaults to the current folder. recursion_depth: number of levels to traverse. None is infinite. Output: a list of absolute names of subfolders. Ex...
def function[find_subdirs, parameter[startdir, recursion_depth]]: constant[Find all subdirectory of a directory. Inputs: startdir: directory to start with. Defaults to the current folder. recursion_depth: number of levels to traverse. None is infinite. Output: a list of absolute names ...
keyword[def] identifier[find_subdirs] ( identifier[startdir] = literal[string] , identifier[recursion_depth] = keyword[None] ): literal[string] identifier[startdir] = identifier[os] . identifier[path] . identifier[expanduser] ( identifier[startdir] ) identifier[direct_subdirs] =[ identifier[os] . iden...
def find_subdirs(startdir='.', recursion_depth=None): """Find all subdirectory of a directory. Inputs: startdir: directory to start with. Defaults to the current folder. recursion_depth: number of levels to traverse. None is infinite. Output: a list of absolute names of subfolders. Ex...
def __add_parameter(self, param, path_parameters, params): """Adds all parameters in a field to a method parameters descriptor. Simple fields will only have one parameter, but a message field 'x' that corresponds to a message class with fields 'y' and 'z' will result in parameters 'x.y' and 'x.z', for ...
def function[__add_parameter, parameter[self, param, path_parameters, params]]: constant[Adds all parameters in a field to a method parameters descriptor. Simple fields will only have one parameter, but a message field 'x' that corresponds to a message class with fields 'y' and 'z' will result in p...
keyword[def] identifier[__add_parameter] ( identifier[self] , identifier[param] , identifier[path_parameters] , identifier[params] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[param] , identifier[messages] . identifier[MessageField] ): keyword[if] iden...
def __add_parameter(self, param, path_parameters, params): """Adds all parameters in a field to a method parameters descriptor. Simple fields will only have one parameter, but a message field 'x' that corresponds to a message class with fields 'y' and 'z' will result in parameters 'x.y' and 'x.z', for ...
def metadata(self): """Access process configuarion values as attributes. """ from ambry.metadata.schema import Top # cross-module import top = Top() top.build_from_db(self.dataset) return top
def function[metadata, parameter[self]]: constant[Access process configuarion values as attributes. ] from relative_module[ambry.metadata.schema] import module[Top] variable[top] assign[=] call[name[Top], parameter[]] call[name[top].build_from_db, parameter[name[self].dataset]] return[na...
keyword[def] identifier[metadata] ( identifier[self] ): literal[string] keyword[from] identifier[ambry] . identifier[metadata] . identifier[schema] keyword[import] identifier[Top] identifier[top] = identifier[Top] () identifier[top] . identifier[build_from_db] ( identifier[sel...
def metadata(self): """Access process configuarion values as attributes. """ from ambry.metadata.schema import Top # cross-module import top = Top() top.build_from_db(self.dataset) return top
def yield_once(iterator): """ Decorator to make an iterator returned by a method yield each result only once. >>> @yield_once ... def generate_list(foo): ... return foo >>> list(generate_list([1, 2, 1])) [1, 2] :param iterator: Any method that returns an iterator :return: ...
def function[yield_once, parameter[iterator]]: constant[ Decorator to make an iterator returned by a method yield each result only once. >>> @yield_once ... def generate_list(foo): ... return foo >>> list(generate_list([1, 2, 1])) [1, 2] :param iterator: Any method that ret...
keyword[def] identifier[yield_once] ( identifier[iterator] ): literal[string] @ identifier[wraps] ( identifier[iterator] ) keyword[def] identifier[yield_once_generator] (* identifier[args] ,** identifier[kwargs] ): identifier[yielded] = identifier[set] () keyword[for] identifier[ite...
def yield_once(iterator): """ Decorator to make an iterator returned by a method yield each result only once. >>> @yield_once ... def generate_list(foo): ... return foo >>> list(generate_list([1, 2, 1])) [1, 2] :param iterator: Any method that returns an iterator :return: ...
def com_google_fonts_check_contour_count(ttFont): """Check if each glyph has the recommended amount of contours. This check is useful to assure glyphs aren't incorrectly constructed. The desired_glyph_data module contains the 'recommended' countour count for encoded glyphs. The contour counts are derived from...
def function[com_google_fonts_check_contour_count, parameter[ttFont]]: constant[Check if each glyph has the recommended amount of contours. This check is useful to assure glyphs aren't incorrectly constructed. The desired_glyph_data module contains the 'recommended' countour count for encoded glyphs. Th...
keyword[def] identifier[com_google_fonts_check_contour_count] ( identifier[ttFont] ): literal[string] keyword[from] identifier[fontbakery] . identifier[glyphdata] keyword[import] identifier[desired_glyph_data] keyword[as] identifier[glyph_data] keyword[from] identifier[fontbakery] . identifier[utils]...
def com_google_fonts_check_contour_count(ttFont): """Check if each glyph has the recommended amount of contours. This check is useful to assure glyphs aren't incorrectly constructed. The desired_glyph_data module contains the 'recommended' countour count for encoded glyphs. The contour counts are derived fr...
def _compute_delta_beta(self, df, events, start, stop, weights): """ approximate change in betas as a result of excluding ith row""" score_residuals = self._compute_residuals(df, events, start, stop, weights) * weights[:, None] naive_var = inv(self._hessian_) delta_betas = -score_resid...
def function[_compute_delta_beta, parameter[self, df, events, start, stop, weights]]: constant[ approximate change in betas as a result of excluding ith row] variable[score_residuals] assign[=] binary_operation[call[name[self]._compute_residuals, parameter[name[df], name[events], name[start], name[stop]...
keyword[def] identifier[_compute_delta_beta] ( identifier[self] , identifier[df] , identifier[events] , identifier[start] , identifier[stop] , identifier[weights] ): literal[string] identifier[score_residuals] = identifier[self] . identifier[_compute_residuals] ( identifier[df] , identifier[events...
def _compute_delta_beta(self, df, events, start, stop, weights): """ approximate change in betas as a result of excluding ith row""" score_residuals = self._compute_residuals(df, events, start, stop, weights) * weights[:, None] naive_var = inv(self._hessian_) delta_betas = -score_residuals.dot(naive_var...
def delete_issue(self, issue_id, params=None): """Deletes an individual issue. If the issue has sub-tasks you must set the deleteSubtasks=true parameter to delete the issue. You cannot delete an issue without deleting its sub-tasks. Args: issue_id: params: ...
def function[delete_issue, parameter[self, issue_id, params]]: constant[Deletes an individual issue. If the issue has sub-tasks you must set the deleteSubtasks=true parameter to delete the issue. You cannot delete an issue without deleting its sub-tasks. Args: issue_id: ...
keyword[def] identifier[delete_issue] ( identifier[self] , identifier[issue_id] , identifier[params] = keyword[None] ): literal[string] keyword[return] identifier[self] . identifier[_delete] ( identifier[self] . identifier[API_URL] + literal[string] . identifier[format] ( identifier[issue_id] ), i...
def delete_issue(self, issue_id, params=None): """Deletes an individual issue. If the issue has sub-tasks you must set the deleteSubtasks=true parameter to delete the issue. You cannot delete an issue without deleting its sub-tasks. Args: issue_id: params: ...
def _get_width(self, width, max_width): """ Helper function to figure out the actual column width from the various options. :param width: The size of column requested :param max_width: The maximum width allowed for this widget. :return: the integer width of the column in charact...
def function[_get_width, parameter[self, width, max_width]]: constant[ Helper function to figure out the actual column width from the various options. :param width: The size of column requested :param max_width: The maximum width allowed for this widget. :return: the integer wid...
keyword[def] identifier[_get_width] ( identifier[self] , identifier[width] , identifier[max_width] ): literal[string] keyword[if] identifier[isinstance] ( identifier[width] , identifier[float] ): keyword[return] identifier[int] ( identifier[max_width] * identifier[width] ) k...
def _get_width(self, width, max_width): """ Helper function to figure out the actual column width from the various options. :param width: The size of column requested :param max_width: The maximum width allowed for this widget. :return: the integer width of the column in characters ...
def delete(self, username, type): """Delete an LDAP user.""" self.client.delete(self.__distinguished_name(type, username=username))
def function[delete, parameter[self, username, type]]: constant[Delete an LDAP user.] call[name[self].client.delete, parameter[call[name[self].__distinguished_name, parameter[name[type]]]]]
keyword[def] identifier[delete] ( identifier[self] , identifier[username] , identifier[type] ): literal[string] identifier[self] . identifier[client] . identifier[delete] ( identifier[self] . identifier[__distinguished_name] ( identifier[type] , identifier[username] = identifier[username] ))
def delete(self, username, type): """Delete an LDAP user.""" self.client.delete(self.__distinguished_name(type, username=username))
def run_healthchecks(self): """ Runs all registered healthchecks and returns a list of HealthcheckResponse. """ if not self._registry_loaded: self.load_healthchecks() def get_healthcheck_name(hc): if hasattr(hc, 'name'): return hc....
def function[run_healthchecks, parameter[self]]: constant[ Runs all registered healthchecks and returns a list of HealthcheckResponse. ] if <ast.UnaryOp object at 0x7da1b28dde70> begin[:] call[name[self].load_healthchecks, parameter[]] def function[get_hea...
keyword[def] identifier[run_healthchecks] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[_registry_loaded] : identifier[self] . identifier[load_healthchecks] () keyword[def] identifier[get_healthcheck_name] ( identifier[hc] ): ...
def run_healthchecks(self): """ Runs all registered healthchecks and returns a list of HealthcheckResponse. """ if not self._registry_loaded: self.load_healthchecks() # depends on [control=['if'], data=[]] def get_healthcheck_name(hc): if hasattr(hc, 'name'): ...
def message(self, pubnub, message): """ Called when a new message is recevied on one of the subscribed to channels. Proccess the message and call the channels callback function(s). """ try: json_data = json.dumps(message.message.get('data')) except Att...
def function[message, parameter[self, pubnub, message]]: constant[ Called when a new message is recevied on one of the subscribed to channels. Proccess the message and call the channels callback function(s). ] <ast.Try object at 0x7da20c76cc40> for taget[name[func]] i...
keyword[def] identifier[message] ( identifier[self] , identifier[pubnub] , identifier[message] ): literal[string] keyword[try] : identifier[json_data] = identifier[json] . identifier[dumps] ( identifier[message] . identifier[message] . identifier[get] ( literal[string] )) keyw...
def message(self, pubnub, message): """ Called when a new message is recevied on one of the subscribed to channels. Proccess the message and call the channels callback function(s). """ try: json_data = json.dumps(message.message.get('data')) # depends on [control=['try']...
def get_dev_folder(path=sys.prefix): """ :param str path: Path to examine :return str|None: Path to development build folder, such as .venv, .tox etc, if any """ if not path or len(path) <= 4: return None dirpath, basename = os.path.split(path) if basename in DEV_FOLDERS: ret...
def function[get_dev_folder, parameter[path]]: constant[ :param str path: Path to examine :return str|None: Path to development build folder, such as .venv, .tox etc, if any ] if <ast.BoolOp object at 0x7da1b2390430> begin[:] return[constant[None]] <ast.Tuple object at 0x7da1...
keyword[def] identifier[get_dev_folder] ( identifier[path] = identifier[sys] . identifier[prefix] ): literal[string] keyword[if] keyword[not] identifier[path] keyword[or] identifier[len] ( identifier[path] )<= literal[int] : keyword[return] keyword[None] identifier[dirpath] , identifier...
def get_dev_folder(path=sys.prefix): """ :param str path: Path to examine :return str|None: Path to development build folder, such as .venv, .tox etc, if any """ if not path or len(path) <= 4: return None # depends on [control=['if'], data=[]] (dirpath, basename) = os.path.split(path) ...
def detect_encoding(fp, default=None): """Detect the cahracter encoding of a file. :param fp: Open Python file pointer. :param default: Fallback encoding to use. :returns: The detected encoding. .. note:: The file pointer is returned at its original read position. """ init_pos = fp.tell() ...
def function[detect_encoding, parameter[fp, default]]: constant[Detect the cahracter encoding of a file. :param fp: Open Python file pointer. :param default: Fallback encoding to use. :returns: The detected encoding. .. note:: The file pointer is returned at its original read position. ] ...
keyword[def] identifier[detect_encoding] ( identifier[fp] , identifier[default] = keyword[None] ): literal[string] identifier[init_pos] = identifier[fp] . identifier[tell] () keyword[try] : identifier[sample] = identifier[fp] . identifier[read] ( identifier[current_app] . identifier[...
def detect_encoding(fp, default=None): """Detect the cahracter encoding of a file. :param fp: Open Python file pointer. :param default: Fallback encoding to use. :returns: The detected encoding. .. note:: The file pointer is returned at its original read position. """ init_pos = fp.tell() ...
def removeAllEntitlements(self, appId): """ This operation removes all entitlements from the portal for ArcGIS Pro or additional products such as Navigator for ArcGIS and revokes all entitlements assigned to users for the specified product. The portal is no longer a licensing por...
def function[removeAllEntitlements, parameter[self, appId]]: constant[ This operation removes all entitlements from the portal for ArcGIS Pro or additional products such as Navigator for ArcGIS and revokes all entitlements assigned to users for the specified product. The portal i...
keyword[def] identifier[removeAllEntitlements] ( identifier[self] , identifier[appId] ): literal[string] identifier[params] ={ literal[string] : literal[string] , literal[string] : identifier[appId] } identifier[url] = identifier[self] . identifier[_url] + litera...
def removeAllEntitlements(self, appId): """ This operation removes all entitlements from the portal for ArcGIS Pro or additional products such as Navigator for ArcGIS and revokes all entitlements assigned to users for the specified product. The portal is no longer a licensing portal ...
def match_multiline(self, text, delimiter, in_state, style): """Do highlighting of multi-line strings. ``delimiter`` should be a ``QRegExp`` for triple-single-quotes or triple-double-quotes, and ``in_state`` should be a unique integer to represent the corresponding state changes when...
def function[match_multiline, parameter[self, text, delimiter, in_state, style]]: constant[Do highlighting of multi-line strings. ``delimiter`` should be a ``QRegExp`` for triple-single-quotes or triple-double-quotes, and ``in_state`` should be a unique integer to represent the corresponding ...
keyword[def] identifier[match_multiline] ( identifier[self] , identifier[text] , identifier[delimiter] , identifier[in_state] , identifier[style] ): literal[string] keyword[if] identifier[self] . identifier[previousBlockState] ()== identifier[in_state] : identifier[start]...
def match_multiline(self, text, delimiter, in_state, style): """Do highlighting of multi-line strings. ``delimiter`` should be a ``QRegExp`` for triple-single-quotes or triple-double-quotes, and ``in_state`` should be a unique integer to represent the corresponding state changes when inside ...
def search(self, query=None, args=None): '''query a Singularity registry for a list of images. If query is None, collections are listed. EXAMPLE QUERIES: [empty] list all collections in registry vsoch do a general search for the expression "vsoch" vsoch/ ...
def function[search, parameter[self, query, args]]: constant[query a Singularity registry for a list of images. If query is None, collections are listed. EXAMPLE QUERIES: [empty] list all collections in registry vsoch do a general search for the expression "vsoch" ...
keyword[def] identifier[search] ( identifier[self] , identifier[query] = keyword[None] , identifier[args] = keyword[None] ): literal[string] keyword[if] identifier[query] keyword[is] keyword[not] keyword[None] : keyword[if] identifier[query] . identifier[endswith] ( literal[string] ): ...
def search(self, query=None, args=None): """query a Singularity registry for a list of images. If query is None, collections are listed. EXAMPLE QUERIES: [empty] list all collections in registry vsoch do a general search for the expression "vsoch" vsoch/ ...
def seek_previous_line(self): """ Seek previous line relative to the current file position. :return: Position of the line or -1 if previous line was not found. """ where = self.file.tell() offset = 0 while True: if offset == where: br...
def function[seek_previous_line, parameter[self]]: constant[ Seek previous line relative to the current file position. :return: Position of the line or -1 if previous line was not found. ] variable[where] assign[=] call[name[self].file.tell, parameter[]] variable[offset]...
keyword[def] identifier[seek_previous_line] ( identifier[self] ): literal[string] identifier[where] = identifier[self] . identifier[file] . identifier[tell] () identifier[offset] = literal[int] keyword[while] keyword[True] : keyword[if] identifier[offset] == ident...
def seek_previous_line(self): """ Seek previous line relative to the current file position. :return: Position of the line or -1 if previous line was not found. """ where = self.file.tell() offset = 0 while True: if offset == where: break # depends on [contro...
def verify(self, data): r"""Does the given `data` hash to the digest in this `Multihash`? >>> import hashlib >>> data = b'foo' >>> hash = hashlib.sha1(data) >>> mh = Multihash.from_hash(hash) >>> mh.verify(data) True >>> mh.verify(b'foobar') False...
def function[verify, parameter[self, data]]: constant[Does the given `data` hash to the digest in this `Multihash`? >>> import hashlib >>> data = b'foo' >>> hash = hashlib.sha1(data) >>> mh = Multihash.from_hash(hash) >>> mh.verify(data) True >>> mh.verif...
keyword[def] identifier[verify] ( identifier[self] , identifier[data] ): literal[string] identifier[digest] = identifier[_do_digest] ( identifier[data] , identifier[self] . identifier[func] ) keyword[return] identifier[digest] [: identifier[len] ( identifier[self] . identifier[digest] )]=...
def verify(self, data): """Does the given `data` hash to the digest in this `Multihash`? >>> import hashlib >>> data = b'foo' >>> hash = hashlib.sha1(data) >>> mh = Multihash.from_hash(hash) >>> mh.verify(data) True >>> mh.verify(b'foobar') False ...
def set_cache_policy(self, func): """Set the context cache policy function. Args: func: A function that accepts a Key instance as argument and returns a bool indicating if it should be cached. May be None. """ if func is None: func = self.default_cache_policy elif isinstance(fu...
def function[set_cache_policy, parameter[self, func]]: constant[Set the context cache policy function. Args: func: A function that accepts a Key instance as argument and returns a bool indicating if it should be cached. May be None. ] if compare[name[func] is constant[None]] begi...
keyword[def] identifier[set_cache_policy] ( identifier[self] , identifier[func] ): literal[string] keyword[if] identifier[func] keyword[is] keyword[None] : identifier[func] = identifier[self] . identifier[default_cache_policy] keyword[elif] identifier[isinstance] ( identifier[func] , ident...
def set_cache_policy(self, func): """Set the context cache policy function. Args: func: A function that accepts a Key instance as argument and returns a bool indicating if it should be cached. May be None. """ if func is None: func = self.default_cache_policy # depends on [contr...
def y_grid(self, grid=None): """The vertical lines that run accross the chart from the y-ticks. If a boolean value is given, these gridlines will be turned on or off. Otherwise, the method will return their current state. :param bool grid: Turns the gridlines on or off. :rtype:...
def function[y_grid, parameter[self, grid]]: constant[The vertical lines that run accross the chart from the y-ticks. If a boolean value is given, these gridlines will be turned on or off. Otherwise, the method will return their current state. :param bool grid: Turns the gridlines on o...
keyword[def] identifier[y_grid] ( identifier[self] , identifier[grid] = keyword[None] ): literal[string] keyword[if] identifier[grid] keyword[is] keyword[None] : keyword[return] identifier[self] . identifier[_y_grid] keyword[else] : keyword[if] keyword[not]...
def y_grid(self, grid=None): """The vertical lines that run accross the chart from the y-ticks. If a boolean value is given, these gridlines will be turned on or off. Otherwise, the method will return their current state. :param bool grid: Turns the gridlines on or off. :rtype: ``b...
def edit(self, id): """ Edit a pool. """ c.pool = Pool.get(int(id)) c.prefix_list = Prefix.list({ 'pool_id': c.pool.id }) c.prefix = '' # save changes to NIPAP if request.method == 'POST': c.pool.name = request.params['name'] c.pool.descr...
def function[edit, parameter[self, id]]: constant[ Edit a pool. ] name[c].pool assign[=] call[name[Pool].get, parameter[call[name[int], parameter[name[id]]]]] name[c].prefix_list assign[=] call[name[Prefix].list, parameter[dictionary[[<ast.Constant object at 0x7da1b2346bc0>], [<ast.Attri...
keyword[def] identifier[edit] ( identifier[self] , identifier[id] ): literal[string] identifier[c] . identifier[pool] = identifier[Pool] . identifier[get] ( identifier[int] ( identifier[id] )) identifier[c] . identifier[prefix_list] = identifier[Prefix] . identifier[list] ({ literal[strin...
def edit(self, id): """ Edit a pool. """ c.pool = Pool.get(int(id)) c.prefix_list = Prefix.list({'pool_id': c.pool.id}) c.prefix = '' # save changes to NIPAP if request.method == 'POST': c.pool.name = request.params['name'] c.pool.description = request.params['description...
def disconnect_async(self, conn_id, callback): """Asynchronously disconnect from a device that has previously been connected Args: conn_id (int): a unique identifier for this connection on the DeviceManager that owns this adapter. callback (callable): A function ...
def function[disconnect_async, parameter[self, conn_id, callback]]: constant[Asynchronously disconnect from a device that has previously been connected Args: conn_id (int): a unique identifier for this connection on the DeviceManager that owns this adapter. callb...
keyword[def] identifier[disconnect_async] ( identifier[self] , identifier[conn_id] , identifier[callback] ): literal[string] keyword[try] : identifier[context] = identifier[self] . identifier[conns] . identifier[get_context] ( identifier[conn_id] ) keyword[except] identifier...
def disconnect_async(self, conn_id, callback): """Asynchronously disconnect from a device that has previously been connected Args: conn_id (int): a unique identifier for this connection on the DeviceManager that owns this adapter. callback (callable): A function call...
def style_format(text, style): """ Wraps texts in terminal control sequences Style can be passed as either a collection or space delimited string. Valid styles can be found in the codes module. Invalid or unsuported styles will just be ignored. """ if not style: return text if isins...
def function[style_format, parameter[text, style]]: constant[ Wraps texts in terminal control sequences Style can be passed as either a collection or space delimited string. Valid styles can be found in the codes module. Invalid or unsuported styles will just be ignored. ] if <ast.Unary...
keyword[def] identifier[style_format] ( identifier[text] , identifier[style] ): literal[string] keyword[if] keyword[not] identifier[style] : keyword[return] identifier[text] keyword[if] identifier[isinstance] ( identifier[style] , identifier[str] ): identifier[style] = identifie...
def style_format(text, style): """ Wraps texts in terminal control sequences Style can be passed as either a collection or space delimited string. Valid styles can be found in the codes module. Invalid or unsuported styles will just be ignored. """ if not style: return text # depends o...
def getTaxCertURL(self, CorpNum, UserID): """ 공인인증서 등록 URL args CorpNum : 회원 사업자번호 UserID : 회원 팝빌아이디 return 30초 보안 토큰을 포함한 url raise PopbillException """ result = self._httpget('/?TG=CERT', CorpN...
def function[getTaxCertURL, parameter[self, CorpNum, UserID]]: constant[ 공인인증서 등록 URL args CorpNum : 회원 사업자번호 UserID : 회원 팝빌아이디 return 30초 보안 토큰을 포함한 url raise PopbillException ] variable[result]...
keyword[def] identifier[getTaxCertURL] ( identifier[self] , identifier[CorpNum] , identifier[UserID] ): literal[string] identifier[result] = identifier[self] . identifier[_httpget] ( literal[string] , identifier[CorpNum] , identifier[UserID] ) keyword[return] identifier[result] . identifi...
def getTaxCertURL(self, CorpNum, UserID): """ 공인인증서 등록 URL args CorpNum : 회원 사업자번호 UserID : 회원 팝빌아이디 return 30초 보안 토큰을 포함한 url raise PopbillException """ result = self._httpget('/?TG=CERT', CorpNum, User...
def has_requisite_content_models(self): ''':type: bool True when the current object has the expected content models for whatever subclass of :class:`DigitalObject` it was initialized as.''' for cmodel in getattr(self, 'CONTENT_MODELS', ()): if not self.has_model(cmod...
def function[has_requisite_content_models, parameter[self]]: constant[:type: bool True when the current object has the expected content models for whatever subclass of :class:`DigitalObject` it was initialized as.] for taget[name[cmodel]] in starred[call[name[getattr], parameter...
keyword[def] identifier[has_requisite_content_models] ( identifier[self] ): literal[string] keyword[for] identifier[cmodel] keyword[in] identifier[getattr] ( identifier[self] , literal[string] ,()): keyword[if] keyword[not] identifier[self] . identifier[has_model] ( identifier[cmo...
def has_requisite_content_models(self): """:type: bool True when the current object has the expected content models for whatever subclass of :class:`DigitalObject` it was initialized as.""" for cmodel in getattr(self, 'CONTENT_MODELS', ()): if not self.has_model(cmodel): ...
def linOriginRegression(points): """ computes a linear regression starting at zero """ j = sum([ i[0] for i in points ]) k = sum([ i[1] for i in points ]) if j != 0: return k/j, j, k return 1, j, k
def function[linOriginRegression, parameter[points]]: constant[ computes a linear regression starting at zero ] variable[j] assign[=] call[name[sum], parameter[<ast.ListComp object at 0x7da20e955b40>]] variable[k] assign[=] call[name[sum], parameter[<ast.ListComp object at 0x7da20e957250...
keyword[def] identifier[linOriginRegression] ( identifier[points] ): literal[string] identifier[j] = identifier[sum] ([ identifier[i] [ literal[int] ] keyword[for] identifier[i] keyword[in] identifier[points] ]) identifier[k] = identifier[sum] ([ identifier[i] [ literal[int] ] keyword[for] identif...
def linOriginRegression(points): """ computes a linear regression starting at zero """ j = sum([i[0] for i in points]) k = sum([i[1] for i in points]) if j != 0: return (k / j, j, k) # depends on [control=['if'], data=['j']] return (1, j, k)
def find_template_companion(template, extension='', check=True): """ Returns the first found template companion file """ if check and not os.path.isfile(template): yield '' return # May be '<stdin>' (click) template = os.path.abspath(template) template_dirname = os.path.dirname...
def function[find_template_companion, parameter[template, extension, check]]: constant[ Returns the first found template companion file ] if <ast.BoolOp object at 0x7da1b0be23b0> begin[:] <ast.Yield object at 0x7da1b0be1fc0> return[None] variable[template] assign[...
keyword[def] identifier[find_template_companion] ( identifier[template] , identifier[extension] = literal[string] , identifier[check] = keyword[True] ): literal[string] keyword[if] identifier[check] keyword[and] keyword[not] identifier[os] . identifier[path] . identifier[isfile] ( identifier[template]...
def find_template_companion(template, extension='', check=True): """ Returns the first found template companion file """ if check and (not os.path.isfile(template)): yield '' return # May be '<stdin>' (click) # depends on [control=['if'], data=[]] template = os.path.abspath(templat...
def start(self): """Start the timer.""" if not self._is_running: self._t_start = time() self._is_running = True self._t_last = time()
def function[start, parameter[self]]: constant[Start the timer.] if <ast.UnaryOp object at 0x7da1b0532a40> begin[:] name[self]._t_start assign[=] call[name[time], parameter[]] name[self]._is_running assign[=] constant[True] name[self]._t_last assign[=] call[name[t...
keyword[def] identifier[start] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[_is_running] : identifier[self] . identifier[_t_start] = identifier[time] () identifier[self] . identifier[_is_running] = keyword[True] i...
def start(self): """Start the timer.""" if not self._is_running: self._t_start = time() self._is_running = True # depends on [control=['if'], data=[]] self._t_last = time()
def generate_password_hash(password, salt, N=1 << 14, r=8, p=1, buflen=64): """ Generate password hash givin the password string and salt. Args: - ``password``: Password string. - ``salt`` : Random base64 encoded string. Optional args: - ``N`` : the CPU cost, must be a power of...
def function[generate_password_hash, parameter[password, salt, N, r, p, buflen]]: constant[ Generate password hash givin the password string and salt. Args: - ``password``: Password string. - ``salt`` : Random base64 encoded string. Optional args: - ``N`` : the CPU cost, mu...
keyword[def] identifier[generate_password_hash] ( identifier[password] , identifier[salt] , identifier[N] = literal[int] << literal[int] , identifier[r] = literal[int] , identifier[p] = literal[int] , identifier[buflen] = literal[int] ): literal[string] keyword[if] identifier[PYTHON2] : identifie...
def generate_password_hash(password, salt, N=1 << 14, r=8, p=1, buflen=64): """ Generate password hash givin the password string and salt. Args: - ``password``: Password string. - ``salt`` : Random base64 encoded string. Optional args: - ``N`` : the CPU cost, must be a power of...
def match(self, origin=None, rel=None, target=None, attrs=None, include_ids=False): ''' Iterator over relationship IDs that match a pattern of components origin - (optional) origin of the relationship (similar to an RDF subject). If omitted any origin will be matched. rel - (optional) t...
def function[match, parameter[self, origin, rel, target, attrs, include_ids]]: constant[ Iterator over relationship IDs that match a pattern of components origin - (optional) origin of the relationship (similar to an RDF subject). If omitted any origin will be matched. rel - (optional) ...
keyword[def] identifier[match] ( identifier[self] , identifier[origin] = keyword[None] , identifier[rel] = keyword[None] , identifier[target] = keyword[None] , identifier[attrs] = keyword[None] , identifier[include_ids] = keyword[False] ): literal[string] keyword[for] identifier[index] , ...
def match(self, origin=None, rel=None, target=None, attrs=None, include_ids=False): """ Iterator over relationship IDs that match a pattern of components origin - (optional) origin of the relationship (similar to an RDF subject). If omitted any origin will be matched. rel - (optional) type ...
def set_data(self, *args): """we cant to call set_data to manually update""" db = self.begining.get_data() or formats.DATE_DEFAULT df = self.end.get_data() or formats.DATE_DEFAULT jours = max((df - db).days + 1, 0) self.setText(str(jours) + (jours >= 2 and " jours" or " jour"))
def function[set_data, parameter[self]]: constant[we cant to call set_data to manually update] variable[db] assign[=] <ast.BoolOp object at 0x7da1b11e3670> variable[df] assign[=] <ast.BoolOp object at 0x7da1b11e32b0> variable[jours] assign[=] call[name[max], parameter[binary_operation[bi...
keyword[def] identifier[set_data] ( identifier[self] ,* identifier[args] ): literal[string] identifier[db] = identifier[self] . identifier[begining] . identifier[get_data] () keyword[or] identifier[formats] . identifier[DATE_DEFAULT] identifier[df] = identifier[self] . identifier[end] . ...
def set_data(self, *args): """we cant to call set_data to manually update""" db = self.begining.get_data() or formats.DATE_DEFAULT df = self.end.get_data() or formats.DATE_DEFAULT jours = max((df - db).days + 1, 0) self.setText(str(jours) + (jours >= 2 and ' jours' or ' jour'))
def change_keys(obj, convert): """ Recursively goes through the dictionary obj and replaces keys with the convert function. """ if isinstance(obj, (str, int, float)): return obj if isinstance(obj, dict): new = obj.__class__() for k, v in obj.items(): new[convert(k...
def function[change_keys, parameter[obj, convert]]: constant[ Recursively goes through the dictionary obj and replaces keys with the convert function. ] if call[name[isinstance], parameter[name[obj], tuple[[<ast.Name object at 0x7da20e9557e0>, <ast.Name object at 0x7da20e957e20>, <ast.Name objec...
keyword[def] identifier[change_keys] ( identifier[obj] , identifier[convert] ): literal[string] keyword[if] identifier[isinstance] ( identifier[obj] ,( identifier[str] , identifier[int] , identifier[float] )): keyword[return] identifier[obj] keyword[if] identifier[isinstance] ( identifier...
def change_keys(obj, convert): """ Recursively goes through the dictionary obj and replaces keys with the convert function. """ if isinstance(obj, (str, int, float)): return obj # depends on [control=['if'], data=[]] if isinstance(obj, dict): new = obj.__class__() for (k, v)...
def _get_logits_name(self): """ Looks for the name of the layer producing the logits. :return: name of layer producing the logits """ softmax_name = self._get_softmax_name() softmax_layer = self.model.get_layer(softmax_name) if not isinstance(softmax_layer, Activation): # In this case...
def function[_get_logits_name, parameter[self]]: constant[ Looks for the name of the layer producing the logits. :return: name of layer producing the logits ] variable[softmax_name] assign[=] call[name[self]._get_softmax_name, parameter[]] variable[softmax_layer] assign[=] call[name[...
keyword[def] identifier[_get_logits_name] ( identifier[self] ): literal[string] identifier[softmax_name] = identifier[self] . identifier[_get_softmax_name] () identifier[softmax_layer] = identifier[self] . identifier[model] . identifier[get_layer] ( identifier[softmax_name] ) keyword[if] keywor...
def _get_logits_name(self): """ Looks for the name of the layer producing the logits. :return: name of layer producing the logits """ softmax_name = self._get_softmax_name() softmax_layer = self.model.get_layer(softmax_name) if not isinstance(softmax_layer, Activation): # In this cas...
def cli(url, user_agent): """ Archives the provided URL using archive.is. """ kwargs = {} if user_agent: kwargs['user_agent'] = user_agent archive_url = capture(url, **kwargs) click.echo(archive_url)
def function[cli, parameter[url, user_agent]]: constant[ Archives the provided URL using archive.is. ] variable[kwargs] assign[=] dictionary[[], []] if name[user_agent] begin[:] call[name[kwargs]][constant[user_agent]] assign[=] name[user_agent] variable[archive_u...
keyword[def] identifier[cli] ( identifier[url] , identifier[user_agent] ): literal[string] identifier[kwargs] ={} keyword[if] identifier[user_agent] : identifier[kwargs] [ literal[string] ]= identifier[user_agent] identifier[archive_url] = identifier[capture] ( identifier[url] ,** iden...
def cli(url, user_agent): """ Archives the provided URL using archive.is. """ kwargs = {} if user_agent: kwargs['user_agent'] = user_agent # depends on [control=['if'], data=[]] archive_url = capture(url, **kwargs) click.echo(archive_url)
def append(self, symbol, metadata, start_time=None): """ Update metadata entry for `symbol` Parameters ---------- symbol : `str` symbol name for the item metadata : `dict` to be persisted start_time : `datetime.datetime` when m...
def function[append, parameter[self, symbol, metadata, start_time]]: constant[ Update metadata entry for `symbol` Parameters ---------- symbol : `str` symbol name for the item metadata : `dict` to be persisted start_time : `datetime.dateti...
keyword[def] identifier[append] ( identifier[self] , identifier[symbol] , identifier[metadata] , identifier[start_time] = keyword[None] ): literal[string] keyword[if] identifier[start_time] keyword[is] keyword[None] : identifier[start_time] = identifier[dt] . identifier[utcnow] () ...
def append(self, symbol, metadata, start_time=None): """ Update metadata entry for `symbol` Parameters ---------- symbol : `str` symbol name for the item metadata : `dict` to be persisted start_time : `datetime.datetime` when metad...
def get_agents(self, pool_id, agent_name=None, include_capabilities=None, include_assigned_request=None, include_last_completed_request=None, property_filters=None, demands=None): """GetAgents. [Preview API] Get a list of agents. :param int pool_id: The agent pool containing the agents :...
def function[get_agents, parameter[self, pool_id, agent_name, include_capabilities, include_assigned_request, include_last_completed_request, property_filters, demands]]: constant[GetAgents. [Preview API] Get a list of agents. :param int pool_id: The agent pool containing the agents :par...
keyword[def] identifier[get_agents] ( identifier[self] , identifier[pool_id] , identifier[agent_name] = keyword[None] , identifier[include_capabilities] = keyword[None] , identifier[include_assigned_request] = keyword[None] , identifier[include_last_completed_request] = keyword[None] , identifier[property_filters] = ...
def get_agents(self, pool_id, agent_name=None, include_capabilities=None, include_assigned_request=None, include_last_completed_request=None, property_filters=None, demands=None): """GetAgents. [Preview API] Get a list of agents. :param int pool_id: The agent pool containing the agents :para...
def left(self, speed=1): """ Make the robot turn left by running the right motor forward and left motor backward. :param float speed: Speed at which to drive the motors, as a value between 0 (stopped) and 1 (full speed). The default is 1. """ self...
def function[left, parameter[self, speed]]: constant[ Make the robot turn left by running the right motor forward and left motor backward. :param float speed: Speed at which to drive the motors, as a value between 0 (stopped) and 1 (full speed). The default is 1....
keyword[def] identifier[left] ( identifier[self] , identifier[speed] = literal[int] ): literal[string] identifier[self] . identifier[right_motor] . identifier[forward] ( identifier[speed] ) identifier[self] . identifier[left_motor] . identifier[backward] ( identifier[speed] )
def left(self, speed=1): """ Make the robot turn left by running the right motor forward and left motor backward. :param float speed: Speed at which to drive the motors, as a value between 0 (stopped) and 1 (full speed). The default is 1. """ self.right_m...
def install(name, link, path, priority): ''' Install new alternative for defined <name> name is the master name for this link group (e.g. pager) link is the symlink pointing to /etc/alternatives/<name>. (e.g. /usr/bin/pager) path is the location of the new ...
def function[install, parameter[name, link, path, priority]]: constant[ Install new alternative for defined <name> name is the master name for this link group (e.g. pager) link is the symlink pointing to /etc/alternatives/<name>. (e.g. /usr/bin/pager) path ...
keyword[def] identifier[install] ( identifier[name] , identifier[link] , identifier[path] , identifier[priority] ): literal[string] identifier[ret] ={ literal[string] : identifier[name] , literal[string] : identifier[link] , literal[string] : identifier[path] , literal[string] : identifier[p...
def install(name, link, path, priority): """ Install new alternative for defined <name> name is the master name for this link group (e.g. pager) link is the symlink pointing to /etc/alternatives/<name>. (e.g. /usr/bin/pager) path is the location of the new ...
def _set_env_from_extras(self, extras): """ Sets the environment variable `GOOGLE_APPLICATION_CREDENTIALS` with either: - The path to the keyfile from the specified connection id - A generated file's path if the user specified JSON in the connection id. The file is assumed t...
def function[_set_env_from_extras, parameter[self, extras]]: constant[ Sets the environment variable `GOOGLE_APPLICATION_CREDENTIALS` with either: - The path to the keyfile from the specified connection id - A generated file's path if the user specified JSON in the connection id. The ...
keyword[def] identifier[_set_env_from_extras] ( identifier[self] , identifier[extras] ): literal[string] identifier[key_path] = identifier[self] . identifier[_get_field] ( identifier[extras] , literal[string] , keyword[False] ) identifier[keyfile_json_str] = identifier[self] . identifier[_...
def _set_env_from_extras(self, extras): """ Sets the environment variable `GOOGLE_APPLICATION_CREDENTIALS` with either: - The path to the keyfile from the specified connection id - A generated file's path if the user specified JSON in the connection id. The file is assumed to be...
def _to_DOM(self): """ Dumps object data to a fully traversable DOM representation of the object. :returns: a ``xml.etree.Element`` object """ root_node = ET.Element("no2index") reference_time_node = ET.SubElement(root_node, "reference_time") reference_t...
def function[_to_DOM, parameter[self]]: constant[ Dumps object data to a fully traversable DOM representation of the object. :returns: a ``xml.etree.Element`` object ] variable[root_node] assign[=] call[name[ET].Element, parameter[constant[no2index]]] variable[r...
keyword[def] identifier[_to_DOM] ( identifier[self] ): literal[string] identifier[root_node] = identifier[ET] . identifier[Element] ( literal[string] ) identifier[reference_time_node] = identifier[ET] . identifier[SubElement] ( identifier[root_node] , literal[string] ) identifier[...
def _to_DOM(self): """ Dumps object data to a fully traversable DOM representation of the object. :returns: a ``xml.etree.Element`` object """ root_node = ET.Element('no2index') reference_time_node = ET.SubElement(root_node, 'reference_time') reference_time_node.text = ...
def append(self, other, ignore_meta_conflict=False, inplace=False, **kwargs): """Append any castable object to this IamDataFrame. Columns in `other.meta` that are not in `self.meta` are always merged, duplicate region-variable-unit-year rows raise a ValueError. Parameters...
def function[append, parameter[self, other, ignore_meta_conflict, inplace]]: constant[Append any castable object to this IamDataFrame. Columns in `other.meta` that are not in `self.meta` are always merged, duplicate region-variable-unit-year rows raise a ValueError. Parameters -...
keyword[def] identifier[append] ( identifier[self] , identifier[other] , identifier[ignore_meta_conflict] = keyword[False] , identifier[inplace] = keyword[False] , ** identifier[kwargs] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[other] , identifier[IamDataFram...
def append(self, other, ignore_meta_conflict=False, inplace=False, **kwargs): """Append any castable object to this IamDataFrame. Columns in `other.meta` that are not in `self.meta` are always merged, duplicate region-variable-unit-year rows raise a ValueError. Parameters ----------...
def update_ledger(self, ledger_id, description=None): """Update ledger info Arguments: ledger_id: Ledger id assigned by mCASH description: Description of the Ledger and it's usage """ arguments = {'description': description} ...
def function[update_ledger, parameter[self, ledger_id, description]]: constant[Update ledger info Arguments: ledger_id: Ledger id assigned by mCASH description: Description of the Ledger and it's usage ] variable[arguments] assign[...
keyword[def] identifier[update_ledger] ( identifier[self] , identifier[ledger_id] , identifier[description] = keyword[None] ): literal[string] identifier[arguments] ={ literal[string] : identifier[description] } keyword[return] identifier[self] . identifier[do_req] ( literal[string] , ...
def update_ledger(self, ledger_id, description=None): """Update ledger info Arguments: ledger_id: Ledger id assigned by mCASH description: Description of the Ledger and it's usage """ arguments = {'description': description} return sel...
def on_queue_declareok(self, method_frame): """Method invoked by pika when the Queue.Declare RPC call made in setup_queue has completed. In this method we will bind the queue and exchange together with the routing key by issuing the Queue.Bind RPC command. When this command is complete, ...
def function[on_queue_declareok, parameter[self, method_frame]]: constant[Method invoked by pika when the Queue.Declare RPC call made in setup_queue has completed. In this method we will bind the queue and exchange together with the routing key by issuing the Queue.Bind RPC command. When...
keyword[def] identifier[on_queue_declareok] ( identifier[self] , identifier[method_frame] ): literal[string] identifier[_logger] . identifier[info] ( literal[string] , identifier[self] . identifier[EXCHANGE] , identifier[self] . identifier[_queue] , identifier[self] . identifier[_routing_k...
def on_queue_declareok(self, method_frame): """Method invoked by pika when the Queue.Declare RPC call made in setup_queue has completed. In this method we will bind the queue and exchange together with the routing key by issuing the Queue.Bind RPC command. When this command is complete, the ...
async def wait_read(self, message=None, *, timeout=None): """ Awaits for the sent message to be read. Note that receiving a response doesn't imply the message was read, and this action will also trigger even without a response. """ start_time = time.time() future ...
<ast.AsyncFunctionDef object at 0x7da18f00c880>
keyword[async] keyword[def] identifier[wait_read] ( identifier[self] , identifier[message] = keyword[None] ,*, identifier[timeout] = keyword[None] ): literal[string] identifier[start_time] = identifier[time] . identifier[time] () identifier[future] = identifier[self] . identifier[_client]...
async def wait_read(self, message=None, *, timeout=None): """ Awaits for the sent message to be read. Note that receiving a response doesn't imply the message was read, and this action will also trigger even without a response. """ start_time = time.time() future = self._clie...
def get_groupname(taskfileinfo): """Return a suitable name for a groupname for the given taskfileinfo. :param taskfileinfo: the taskfile info for the file that needs a group when importing/referencing :type taskfileinfo: :class:`jukeboxcore.filesys.TaskFileInfo` :returns: None :rtype: None :rai...
def function[get_groupname, parameter[taskfileinfo]]: constant[Return a suitable name for a groupname for the given taskfileinfo. :param taskfileinfo: the taskfile info for the file that needs a group when importing/referencing :type taskfileinfo: :class:`jukeboxcore.filesys.TaskFileInfo` :returns:...
keyword[def] identifier[get_groupname] ( identifier[taskfileinfo] ): literal[string] identifier[element] = identifier[taskfileinfo] . identifier[task] . identifier[element] identifier[name] = identifier[element] . identifier[name] keyword[return] identifier[name] + literal[string]
def get_groupname(taskfileinfo): """Return a suitable name for a groupname for the given taskfileinfo. :param taskfileinfo: the taskfile info for the file that needs a group when importing/referencing :type taskfileinfo: :class:`jukeboxcore.filesys.TaskFileInfo` :returns: None :rtype: None :rai...
def delete(self, bridge): """ Delete a bridge by name :param bridge: bridge name :return: """ args = { 'name': bridge, } self._bridge_chk.check(args) return self._client.json('bridge.delete', args)
def function[delete, parameter[self, bridge]]: constant[ Delete a bridge by name :param bridge: bridge name :return: ] variable[args] assign[=] dictionary[[<ast.Constant object at 0x7da1b04cbb20>], [<ast.Name object at 0x7da1b04ca6b0>]] call[name[self]._bridge_ch...
keyword[def] identifier[delete] ( identifier[self] , identifier[bridge] ): literal[string] identifier[args] ={ literal[string] : identifier[bridge] , } identifier[self] . identifier[_bridge_chk] . identifier[check] ( identifier[args] ) keyword[return] identifie...
def delete(self, bridge): """ Delete a bridge by name :param bridge: bridge name :return: """ args = {'name': bridge} self._bridge_chk.check(args) return self._client.json('bridge.delete', args)
def read(self, input_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Read the data encoding the Create request payload and decode it into its constituent parts. Args: input_buffer (stream): A data buffer containing encoded object data, supporting a read...
def function[read, parameter[self, input_buffer, kmip_version]]: constant[ Read the data encoding the Create request payload and decode it into its constituent parts. Args: input_buffer (stream): A data buffer containing encoded object data, supporting a read...
keyword[def] identifier[read] ( identifier[self] , identifier[input_buffer] , identifier[kmip_version] = identifier[enums] . identifier[KMIPVersion] . identifier[KMIP_1_0] ): literal[string] identifier[super] ( identifier[CreateRequestPayload] , identifier[self] ). identifier[read] ( ident...
def read(self, input_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Read the data encoding the Create request payload and decode it into its constituent parts. Args: input_buffer (stream): A data buffer containing encoded object data, supporting a read met...
def as_set(obj): """ Convert obj into a set, returns None if obj is None. >>> assert as_set(None) is None and as_set(1) == set([1]) and as_set(range(1,3)) == set([1, 2]) """ if obj is None or isinstance(obj, collections.Set): return obj if not isinstance(obj, collections.Iterable): ...
def function[as_set, parameter[obj]]: constant[ Convert obj into a set, returns None if obj is None. >>> assert as_set(None) is None and as_set(1) == set([1]) and as_set(range(1,3)) == set([1, 2]) ] if <ast.BoolOp object at 0x7da1b13d20b0> begin[:] return[name[obj]] if <ast....
keyword[def] identifier[as_set] ( identifier[obj] ): literal[string] keyword[if] identifier[obj] keyword[is] keyword[None] keyword[or] identifier[isinstance] ( identifier[obj] , identifier[collections] . identifier[Set] ): keyword[return] identifier[obj] keyword[if] keyword[not] ide...
def as_set(obj): """ Convert obj into a set, returns None if obj is None. >>> assert as_set(None) is None and as_set(1) == set([1]) and as_set(range(1,3)) == set([1, 2]) """ if obj is None or isinstance(obj, collections.Set): return obj # depends on [control=['if'], data=[]] if not isi...
def generate_inverse_mapping(order): """Genereate a lambda entry -> PN order map. This function will generate the opposite of generate mapping. So where generate_mapping gives dict[key] = item this will give dict[item] = key. Valid PN orders are: {} Parameters ---------- order : string...
def function[generate_inverse_mapping, parameter[order]]: constant[Genereate a lambda entry -> PN order map. This function will generate the opposite of generate mapping. So where generate_mapping gives dict[key] = item this will give dict[item] = key. Valid PN orders are: {} Parameters ...
keyword[def] identifier[generate_inverse_mapping] ( identifier[order] ): literal[string] identifier[mapping] = identifier[generate_mapping] ( identifier[order] ) identifier[inv_mapping] ={} keyword[for] identifier[key] , identifier[value] keyword[in] identifier[mapping] . identifier[items] ():...
def generate_inverse_mapping(order): """Genereate a lambda entry -> PN order map. This function will generate the opposite of generate mapping. So where generate_mapping gives dict[key] = item this will give dict[item] = key. Valid PN orders are: {} Parameters ---------- order : string...
def get_sesames(email, password, device_ids=None, nicknames=None, timeout=5): """Return list of available Sesame objects.""" sesames = [] account = CandyHouseAccount(email, password, timeout=timeout) for sesame in account.sesames: if device_ids is not None and sesame['device_id'] not in device_...
def function[get_sesames, parameter[email, password, device_ids, nicknames, timeout]]: constant[Return list of available Sesame objects.] variable[sesames] assign[=] list[[]] variable[account] assign[=] call[name[CandyHouseAccount], parameter[name[email], name[password]]] for taget[name[...
keyword[def] identifier[get_sesames] ( identifier[email] , identifier[password] , identifier[device_ids] = keyword[None] , identifier[nicknames] = keyword[None] , identifier[timeout] = literal[int] ): literal[string] identifier[sesames] =[] identifier[account] = identifier[CandyHouseAccount] ( identif...
def get_sesames(email, password, device_ids=None, nicknames=None, timeout=5): """Return list of available Sesame objects.""" sesames = [] account = CandyHouseAccount(email, password, timeout=timeout) for sesame in account.sesames: if device_ids is not None and sesame['device_id'] not in device_i...
def main(*args): """Launch the main routine.""" parser = argparse.ArgumentParser() parser.add_argument("action", help="create, check, run, make-nb, or run-nb") parser.add_argument("--directory", "-dir", default=os.getcwd(), help="path to directory with a ....
def function[main, parameter[]]: constant[Launch the main routine.] variable[parser] assign[=] call[name[argparse].ArgumentParser, parameter[]] call[name[parser].add_argument, parameter[constant[action]]] call[name[parser].add_argument, parameter[constant[--directory], constant[-dir]]] ...
keyword[def] identifier[main] (* identifier[args] ): literal[string] identifier[parser] = identifier[argparse] . identifier[ArgumentParser] () identifier[parser] . identifier[add_argument] ( literal[string] , identifier[help] = literal[string] ) identifier[parser] . identifier[add_argument] ...
def main(*args): """Launch the main routine.""" parser = argparse.ArgumentParser() parser.add_argument('action', help='create, check, run, make-nb, or run-nb') parser.add_argument('--directory', '-dir', default=os.getcwd(), help='path to directory with a .sciunit file') parser.add_argument('--stop',...
def apply_encoding_options(self, min_token_count=1, limit_top_tokens=None): """Applies the given settings for subsequent calls to `encode_texts` and `decode_texts`. This allows you to play with different settings without having to re-run tokenization on the entire corpus. Args: min_...
def function[apply_encoding_options, parameter[self, min_token_count, limit_top_tokens]]: constant[Applies the given settings for subsequent calls to `encode_texts` and `decode_texts`. This allows you to play with different settings without having to re-run tokenization on the entire corpus. Ar...
keyword[def] identifier[apply_encoding_options] ( identifier[self] , identifier[min_token_count] = literal[int] , identifier[limit_top_tokens] = keyword[None] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[has_vocab] : keyword[raise] identifier[ValueError]...
def apply_encoding_options(self, min_token_count=1, limit_top_tokens=None): """Applies the given settings for subsequent calls to `encode_texts` and `decode_texts`. This allows you to play with different settings without having to re-run tokenization on the entire corpus. Args: min_toke...
async def migrate_redis1_to_redis2(storage1: RedisStorage, storage2: RedisStorage2): """ Helper for migrating from RedisStorage to RedisStorage2 :param storage1: instance of RedisStorage :param storage2: instance of RedisStorage2 :return: """ if not isinstance(storage1, RedisStorage): # be...
<ast.AsyncFunctionDef object at 0x7da1b18448e0>
keyword[async] keyword[def] identifier[migrate_redis1_to_redis2] ( identifier[storage1] : identifier[RedisStorage] , identifier[storage2] : identifier[RedisStorage2] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[storage1] , identifier[RedisStorage] ): keyword[r...
async def migrate_redis1_to_redis2(storage1: RedisStorage, storage2: RedisStorage2): """ Helper for migrating from RedisStorage to RedisStorage2 :param storage1: instance of RedisStorage :param storage2: instance of RedisStorage2 :return: """ if not isinstance(storage1, RedisStorage): # be...
def _expire_data(self): """ Remove all expired entries. """ expire_time_stamp = time.time() - self.expire_time self.timed_data = {d: t for d, t in self.timed_data.items() if t > expire_time_stamp}
def function[_expire_data, parameter[self]]: constant[ Remove all expired entries. ] variable[expire_time_stamp] assign[=] binary_operation[call[name[time].time, parameter[]] - name[self].expire_time] name[self].timed_data assign[=] <ast.DictComp object at 0x7da207f9b640>
keyword[def] identifier[_expire_data] ( identifier[self] ): literal[string] identifier[expire_time_stamp] = identifier[time] . identifier[time] ()- identifier[self] . identifier[expire_time] identifier[self] . identifier[timed_data] ={ identifier[d] : identifier[t] keyword[for] identifi...
def _expire_data(self): """ Remove all expired entries. """ expire_time_stamp = time.time() - self.expire_time self.timed_data = {d: t for (d, t) in self.timed_data.items() if t > expire_time_stamp}
def sample_poly(self, poly, penalty_strength=1.0, keep_penalty_variables=False, discard_unsatisfied=False, **parameters): """Sample from the given binary polynomial. Takes the given binary polynomial, introduces penalties, reduces the higher-order problem...
def function[sample_poly, parameter[self, poly, penalty_strength, keep_penalty_variables, discard_unsatisfied]]: constant[Sample from the given binary polynomial. Takes the given binary polynomial, introduces penalties, reduces the higher-order problem into a quadratic problem and sends it to i...
keyword[def] identifier[sample_poly] ( identifier[self] , identifier[poly] , identifier[penalty_strength] = literal[int] , identifier[keep_penalty_variables] = keyword[False] , identifier[discard_unsatisfied] = keyword[False] ,** identifier[parameters] ): literal[string] identifier[bqm] = identi...
def sample_poly(self, poly, penalty_strength=1.0, keep_penalty_variables=False, discard_unsatisfied=False, **parameters): """Sample from the given binary polynomial. Takes the given binary polynomial, introduces penalties, reduces the higher-order problem into a quadratic problem and sends it to it...
def parse_10qk(self, response): '''Parse 10-Q or 10-K XML report.''' loader = ReportItemLoader(response=response) item = loader.load_item() if 'doc_type' in item: doc_type = item['doc_type'] if doc_type in ('10-Q', '10-K'): return item re...
def function[parse_10qk, parameter[self, response]]: constant[Parse 10-Q or 10-K XML report.] variable[loader] assign[=] call[name[ReportItemLoader], parameter[]] variable[item] assign[=] call[name[loader].load_item, parameter[]] if compare[constant[doc_type] in name[item]] begin[:] ...
keyword[def] identifier[parse_10qk] ( identifier[self] , identifier[response] ): literal[string] identifier[loader] = identifier[ReportItemLoader] ( identifier[response] = identifier[response] ) identifier[item] = identifier[loader] . identifier[load_item] () keyword[if] literal...
def parse_10qk(self, response): """Parse 10-Q or 10-K XML report.""" loader = ReportItemLoader(response=response) item = loader.load_item() if 'doc_type' in item: doc_type = item['doc_type'] if doc_type in ('10-Q', '10-K'): return item # depends on [control=['if'], data=[]] ...
def ctrl_c_signal_handler(_, frame): """CTRL-c signal handler - enters a pause point if it can. """ global ctrl_c_calls ctrl_c_calls += 1 if ctrl_c_calls > 10: shutit_global.shutit_global_object.handle_exit(exit_code=1) shutit_frame = get_shutit_frame(frame) if in_ctrlc: msg = 'CTRL-C hit twice, quitting' ...
def function[ctrl_c_signal_handler, parameter[_, frame]]: constant[CTRL-c signal handler - enters a pause point if it can. ] <ast.Global object at 0x7da1b12cb6d0> <ast.AugAssign object at 0x7da1b12cb940> if compare[name[ctrl_c_calls] greater[>] constant[10]] begin[:] call[name[s...
keyword[def] identifier[ctrl_c_signal_handler] ( identifier[_] , identifier[frame] ): literal[string] keyword[global] identifier[ctrl_c_calls] identifier[ctrl_c_calls] += literal[int] keyword[if] identifier[ctrl_c_calls] > literal[int] : identifier[shutit_global] . identifier[shutit_global_object] . i...
def ctrl_c_signal_handler(_, frame): """CTRL-c signal handler - enters a pause point if it can. """ global ctrl_c_calls ctrl_c_calls += 1 if ctrl_c_calls > 10: shutit_global.shutit_global_object.handle_exit(exit_code=1) # depends on [control=['if'], data=[]] shutit_frame = get_shutit_frame...
def get_private_agents(): """Provides a list of hostnames / IPs that are private agents in the cluster""" agent_list = [] agents = __get_all_agents() for agent in agents: if(len(agent["reserved_resources"]) == 0): agent_list.append(agent["hostname"]) else: privat...
def function[get_private_agents, parameter[]]: constant[Provides a list of hostnames / IPs that are private agents in the cluster] variable[agent_list] assign[=] list[[]] variable[agents] assign[=] call[name[__get_all_agents], parameter[]] for taget[name[agent]] in starred[name[agents]] ...
keyword[def] identifier[get_private_agents] (): literal[string] identifier[agent_list] =[] identifier[agents] = identifier[__get_all_agents] () keyword[for] identifier[agent] keyword[in] identifier[agents] : keyword[if] ( identifier[len] ( identifier[agent] [ literal[string] ])== lit...
def get_private_agents(): """Provides a list of hostnames / IPs that are private agents in the cluster""" agent_list = [] agents = __get_all_agents() for agent in agents: if len(agent['reserved_resources']) == 0: agent_list.append(agent['hostname']) # depends on [control=['if'], dat...
def write(self, output_stream, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Write the data encoding the MACSignatureKeyInformation struct to a stream. Args: output_stream (stream): A data stream in which to encode object data, supporting a write method; usua...
def function[write, parameter[self, output_stream, kmip_version]]: constant[ Write the data encoding the MACSignatureKeyInformation struct to a stream. Args: output_stream (stream): A data stream in which to encode object data, supporting a write method; usua...
keyword[def] identifier[write] ( identifier[self] , identifier[output_stream] , identifier[kmip_version] = identifier[enums] . identifier[KMIPVersion] . identifier[KMIP_1_0] ): literal[string] identifier[local_stream] = identifier[BytearrayStream] () keyword[if] identifier[self] . identi...
def write(self, output_stream, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Write the data encoding the MACSignatureKeyInformation struct to a stream. Args: output_stream (stream): A data stream in which to encode object data, supporting a write method; usually ...
def update(self, w, e): """ This function make update according provided target and the last used input vector. **Args:** * `d` : target (float or 1-dimensional array). Size depends on number of MLP outputs. **Returns:** * `w` : weights of the laye...
def function[update, parameter[self, w, e]]: constant[ This function make update according provided target and the last used input vector. **Args:** * `d` : target (float or 1-dimensional array). Size depends on number of MLP outputs. **Returns:** ...
keyword[def] identifier[update] ( identifier[self] , identifier[w] , identifier[e] ): literal[string] keyword[if] identifier[len] ( identifier[w] . identifier[shape] )== literal[int] : identifier[e] = identifier[self] . identifier[activation] ( identifier[self] . identifier[y] , ident...
def update(self, w, e): """ This function make update according provided target and the last used input vector. **Args:** * `d` : target (float or 1-dimensional array). Size depends on number of MLP outputs. **Returns:** * `w` : weights of the layers (...
def write_dot(build_context, conf: Config, out_f): """Write build graph in dot format to `out_f` file-like object.""" not_buildenv_targets = get_not_buildenv_targets(build_context) prebuilt_targets = get_prebuilt_targets(build_context) out_f.write('strict digraph {\n') for node in build_context.tar...
def function[write_dot, parameter[build_context, conf, out_f]]: constant[Write build graph in dot format to `out_f` file-like object.] variable[not_buildenv_targets] assign[=] call[name[get_not_buildenv_targets], parameter[name[build_context]]] variable[prebuilt_targets] assign[=] call[name[get_...
keyword[def] identifier[write_dot] ( identifier[build_context] , identifier[conf] : identifier[Config] , identifier[out_f] ): literal[string] identifier[not_buildenv_targets] = identifier[get_not_buildenv_targets] ( identifier[build_context] ) identifier[prebuilt_targets] = identifier[get_prebuilt_tar...
def write_dot(build_context, conf: Config, out_f): """Write build graph in dot format to `out_f` file-like object.""" not_buildenv_targets = get_not_buildenv_targets(build_context) prebuilt_targets = get_prebuilt_targets(build_context) out_f.write('strict digraph {\n') for node in build_context.tar...
def add_data_file(data_files, target, source): """Add an entry to data_files""" for t, f in data_files: if t == target: break else: data_files.append((target, [])) f = data_files[-1][1] if source not in f: f.append(source)
def function[add_data_file, parameter[data_files, target, source]]: constant[Add an entry to data_files] for taget[tuple[[<ast.Name object at 0x7da1b1151420>, <ast.Name object at 0x7da1b11514b0>]]] in starred[name[data_files]] begin[:] if compare[name[t] equal[==] name[target]] begin[:] ...
keyword[def] identifier[add_data_file] ( identifier[data_files] , identifier[target] , identifier[source] ): literal[string] keyword[for] identifier[t] , identifier[f] keyword[in] identifier[data_files] : keyword[if] identifier[t] == identifier[target] : keyword[break] keywo...
def add_data_file(data_files, target, source): """Add an entry to data_files""" for (t, f) in data_files: if t == target: break # depends on [control=['if'], data=[]] # depends on [control=['for'], data=[]] else: data_files.append((target, [])) f = data_files[-1][1] ...
def get_tree(self, *page_numbers): """ Return lxml.etree.ElementTree for entire document, or page numbers given if any. """ cache_key = "_".join(map(str, _flatten(page_numbers))) tree = self._parse_tree_cacher.get(cache_key) if tree is None: ...
def function[get_tree, parameter[self]]: constant[ Return lxml.etree.ElementTree for entire document, or page numbers given if any. ] variable[cache_key] assign[=] call[constant[_].join, parameter[call[name[map], parameter[name[str], call[name[_flatten], parameter[name[pa...
keyword[def] identifier[get_tree] ( identifier[self] ,* identifier[page_numbers] ): literal[string] identifier[cache_key] = literal[string] . identifier[join] ( identifier[map] ( identifier[str] , identifier[_flatten] ( identifier[page_numbers] ))) identifier[tree] = identifier[self] . ...
def get_tree(self, *page_numbers): """ Return lxml.etree.ElementTree for entire document, or page numbers given if any. """ cache_key = '_'.join(map(str, _flatten(page_numbers))) tree = self._parse_tree_cacher.get(cache_key) if tree is None: # set up root root = ...
def _start_transport(self, chain_state: ChainState): """ Initialize the transport and related facilities. Note: The transport must not be started before the node has caught up with the blockchain through `AlarmTask.first_run()`. This synchronization includes the on-c...
def function[_start_transport, parameter[self, chain_state]]: constant[ Initialize the transport and related facilities. Note: The transport must not be started before the node has caught up with the blockchain through `AlarmTask.first_run()`. This synchronization in...
keyword[def] identifier[_start_transport] ( identifier[self] , identifier[chain_state] : identifier[ChainState] ): literal[string] keyword[assert] identifier[self] . identifier[alarm] . identifier[is_primed] (), literal[string] keyword[assert] identifier[self] . identifier[ready_to_proc...
def _start_transport(self, chain_state: ChainState): """ Initialize the transport and related facilities. Note: The transport must not be started before the node has caught up with the blockchain through `AlarmTask.first_run()`. This synchronization includes the on-chain...
def load_projects(self): """ Preload the list of projects from disk """ server_config = Config.instance().get_section_config("Server") projects_path = os.path.expanduser(server_config.get("projects_path", "~/GNS3/projects")) os.makedirs(projects_path, exist_ok=True) ...
def function[load_projects, parameter[self]]: constant[ Preload the list of projects from disk ] variable[server_config] assign[=] call[call[name[Config].instance, parameter[]].get_section_config, parameter[constant[Server]]] variable[projects_path] assign[=] call[name[os].path.e...
keyword[def] identifier[load_projects] ( identifier[self] ): literal[string] identifier[server_config] = identifier[Config] . identifier[instance] (). identifier[get_section_config] ( literal[string] ) identifier[projects_path] = identifier[os] . identifier[path] . identifier[expanduser] (...
def load_projects(self): """ Preload the list of projects from disk """ server_config = Config.instance().get_section_config('Server') projects_path = os.path.expanduser(server_config.get('projects_path', '~/GNS3/projects')) os.makedirs(projects_path, exist_ok=True) try: for ...
def load_new_labware(container_name): """ Load a labware in the new schema into a placeable. :raises KeyError: If the labware name is not found """ defn = new_labware.load_definition_by_name(container_name) labware_id = defn['otId'] saved_offset = _look_up_offsets(labware_id) container = Co...
def function[load_new_labware, parameter[container_name]]: constant[ Load a labware in the new schema into a placeable. :raises KeyError: If the labware name is not found ] variable[defn] assign[=] call[name[new_labware].load_definition_by_name, parameter[name[container_name]]] variable...
keyword[def] identifier[load_new_labware] ( identifier[container_name] ): literal[string] identifier[defn] = identifier[new_labware] . identifier[load_definition_by_name] ( identifier[container_name] ) identifier[labware_id] = identifier[defn] [ literal[string] ] identifier[saved_offset] = identi...
def load_new_labware(container_name): """ Load a labware in the new schema into a placeable. :raises KeyError: If the labware name is not found """ defn = new_labware.load_definition_by_name(container_name) labware_id = defn['otId'] saved_offset = _look_up_offsets(labware_id) container = Co...
def make_public(self, container, ttl=None): """ Enables CDN access for the specified container, and optionally sets the TTL for the container. """ return self._set_cdn_access(container, public=True, ttl=ttl)
def function[make_public, parameter[self, container, ttl]]: constant[ Enables CDN access for the specified container, and optionally sets the TTL for the container. ] return[call[name[self]._set_cdn_access, parameter[name[container]]]]
keyword[def] identifier[make_public] ( identifier[self] , identifier[container] , identifier[ttl] = keyword[None] ): literal[string] keyword[return] identifier[self] . identifier[_set_cdn_access] ( identifier[container] , identifier[public] = keyword[True] , identifier[ttl] = identifier[ttl] )
def make_public(self, container, ttl=None): """ Enables CDN access for the specified container, and optionally sets the TTL for the container. """ return self._set_cdn_access(container, public=True, ttl=ttl)
def _weight_opacity(weight, weight_range): # type: (float, float) -> str """ Return opacity value for given weight as a string. """ min_opacity = 0.8 if np.isclose(weight, 0) and np.isclose(weight_range, 0): rel_weight = 0.0 else: rel_weight = abs(weight) / weight_range retur...
def function[_weight_opacity, parameter[weight, weight_range]]: constant[ Return opacity value for given weight as a string. ] variable[min_opacity] assign[=] constant[0.8] if <ast.BoolOp object at 0x7da1b1c79210> begin[:] variable[rel_weight] assign[=] constant[0.0] retu...
keyword[def] identifier[_weight_opacity] ( identifier[weight] , identifier[weight_range] ): literal[string] identifier[min_opacity] = literal[int] keyword[if] identifier[np] . identifier[isclose] ( identifier[weight] , literal[int] ) keyword[and] identifier[np] . identifier[isclose] ( identifier[w...
def _weight_opacity(weight, weight_range): # type: (float, float) -> str ' Return opacity value for given weight as a string.\n ' min_opacity = 0.8 if np.isclose(weight, 0) and np.isclose(weight_range, 0): rel_weight = 0.0 # depends on [control=['if'], data=[]] else: rel_weight =...
def __parameter_default(self, field): """Returns default value of field if it has one. Args: field: A simple field. Returns: The default value of the field, if any exists, with the exception of an enum field, which will have its value cast to a string. """ if field.default: ...
def function[__parameter_default, parameter[self, field]]: constant[Returns default value of field if it has one. Args: field: A simple field. Returns: The default value of the field, if any exists, with the exception of an enum field, which will have its value cast to a string. ...
keyword[def] identifier[__parameter_default] ( identifier[self] , identifier[field] ): literal[string] keyword[if] identifier[field] . identifier[default] : keyword[if] identifier[isinstance] ( identifier[field] , identifier[messages] . identifier[EnumField] ): keyword[return] identifier...
def __parameter_default(self, field): """Returns default value of field if it has one. Args: field: A simple field. Returns: The default value of the field, if any exists, with the exception of an enum field, which will have its value cast to a string. """ if field.default: ...
def noinject(module_name=None, module_prefix='[???]', DEBUG=False, module=None, N=0, via=None): """ Use in modules that do not have inject in them Does not inject anything into the module. Just lets utool know that a module is being imported so the import order can be debuged """ if PRINT_INJEC...
def function[noinject, parameter[module_name, module_prefix, DEBUG, module, N, via]]: constant[ Use in modules that do not have inject in them Does not inject anything into the module. Just lets utool know that a module is being imported so the import order can be debuged ] if name[PRIN...
keyword[def] identifier[noinject] ( identifier[module_name] = keyword[None] , identifier[module_prefix] = literal[string] , identifier[DEBUG] = keyword[False] , identifier[module] = keyword[None] , identifier[N] = literal[int] , identifier[via] = keyword[None] ): literal[string] keyword[if] identifier[PRI...
def noinject(module_name=None, module_prefix='[???]', DEBUG=False, module=None, N=0, via=None): """ Use in modules that do not have inject in them Does not inject anything into the module. Just lets utool know that a module is being imported so the import order can be debuged """ if PRINT_INJEC...
def generate_samples(order, domain=1, rule="R", antithetic=None): """ Sample generator. Args: order (int): Sample order. Determines the number of samples to create. domain (Dist, int, numpy.ndarray): Defines the space where the samples are generated. If integer is ...
def function[generate_samples, parameter[order, domain, rule, antithetic]]: constant[ Sample generator. Args: order (int): Sample order. Determines the number of samples to create. domain (Dist, int, numpy.ndarray): Defines the space where the samples are generat...
keyword[def] identifier[generate_samples] ( identifier[order] , identifier[domain] = literal[int] , identifier[rule] = literal[string] , identifier[antithetic] = keyword[None] ): literal[string] identifier[logger] = identifier[logging] . identifier[getLogger] ( identifier[__name__] ) identifier[logger...
def generate_samples(order, domain=1, rule='R', antithetic=None): """ Sample generator. Args: order (int): Sample order. Determines the number of samples to create. domain (Dist, int, numpy.ndarray): Defines the space where the samples are generated. If integer is ...
def print_devices(): """ Simple test function which prints out all devices found by evdev """ def device_verbose_info(device: InputDevice) -> {}: """ Gather and format as much info as possible about the supplied InputDevice. Used mostly for debugging at this point. :param devic...
def function[print_devices, parameter[]]: constant[ Simple test function which prints out all devices found by evdev ] def function[device_verbose_info, parameter[device]]: constant[ Gather and format as much info as possible about the supplied InputDevice. Used mostly fo...
keyword[def] identifier[print_devices] (): literal[string] keyword[def] identifier[device_verbose_info] ( identifier[device] : identifier[InputDevice] )->{}: literal[string] keyword[def] identifier[axis_name] ( identifier[axis_code] ): keyword[try] : key...
def print_devices(): """ Simple test function which prints out all devices found by evdev """ def device_verbose_info(device: InputDevice) -> {}: """ Gather and format as much info as possible about the supplied InputDevice. Used mostly for debugging at this point. :param devic...
def dir_type(arg): """An argparse type representing a valid directory.""" if not os.path.isdir(arg): raise argparse.ArgumentTypeError("{0} is not a valid directory".format(repr(arg))) return arg
def function[dir_type, parameter[arg]]: constant[An argparse type representing a valid directory.] if <ast.UnaryOp object at 0x7da2054a6da0> begin[:] <ast.Raise object at 0x7da2054a5b10> return[name[arg]]
keyword[def] identifier[dir_type] ( identifier[arg] ): literal[string] keyword[if] keyword[not] identifier[os] . identifier[path] . identifier[isdir] ( identifier[arg] ): keyword[raise] identifier[argparse] . identifier[ArgumentTypeError] ( literal[string] . identifier[format] ( identifier[repr] ( identifi...
def dir_type(arg): """An argparse type representing a valid directory.""" if not os.path.isdir(arg): raise argparse.ArgumentTypeError('{0} is not a valid directory'.format(repr(arg))) # depends on [control=['if'], data=[]] return arg