code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def put(self, iocb): """Add an IOCB to a queue. This is usually called by the function that filters requests and passes them out to the correct processing thread.""" if _debug: IOQueue._debug("put %r", iocb) # requests should be pending before being queued if iocb.ioSta...
def function[put, parameter[self, iocb]]: constant[Add an IOCB to a queue. This is usually called by the function that filters requests and passes them out to the correct processing thread.] if name[_debug] begin[:] call[name[IOQueue]._debug, parameter[constant[put %r], ...
keyword[def] identifier[put] ( identifier[self] , identifier[iocb] ): literal[string] keyword[if] identifier[_debug] : identifier[IOQueue] . identifier[_debug] ( literal[string] , identifier[iocb] ) keyword[if] identifier[iocb] . identifier[ioState] != identifier[PENDING] : ...
def put(self, iocb): """Add an IOCB to a queue. This is usually called by the function that filters requests and passes them out to the correct processing thread.""" if _debug: IOQueue._debug('put %r', iocb) # depends on [control=['if'], data=[]] # requests should be pending before...
def get_geo_info(filename, band=1): ''' Gets information from a Raster data set ''' sourceds = gdal.Open(filename, GA_ReadOnly) ndv = sourceds.GetRasterBand(band).GetNoDataValue() xsize = sourceds.RasterXSize ysize = sourceds.RasterYSize geot = sourceds.GetGeoTransform() projection = osr...
def function[get_geo_info, parameter[filename, band]]: constant[ Gets information from a Raster data set ] variable[sourceds] assign[=] call[name[gdal].Open, parameter[name[filename], name[GA_ReadOnly]]] variable[ndv] assign[=] call[call[name[sourceds].GetRasterBand, parameter[name[band]]].G...
keyword[def] identifier[get_geo_info] ( identifier[filename] , identifier[band] = literal[int] ): literal[string] identifier[sourceds] = identifier[gdal] . identifier[Open] ( identifier[filename] , identifier[GA_ReadOnly] ) identifier[ndv] = identifier[sourceds] . identifier[GetRasterBand] ( identifie...
def get_geo_info(filename, band=1): """ Gets information from a Raster data set """ sourceds = gdal.Open(filename, GA_ReadOnly) ndv = sourceds.GetRasterBand(band).GetNoDataValue() xsize = sourceds.RasterXSize ysize = sourceds.RasterYSize geot = sourceds.GetGeoTransform() projection = osr...
def target_internal_dependencies(target): """Returns internal Jarable dependencies that were "directly" declared. Directly declared deps are those that are explicitly listed in the definition of a target, rather than being depended on transitively. But in order to walk through aggregator targets such as `targe...
def function[target_internal_dependencies, parameter[target]]: constant[Returns internal Jarable dependencies that were "directly" declared. Directly declared deps are those that are explicitly listed in the definition of a target, rather than being depended on transitively. But in order to walk through ...
keyword[def] identifier[target_internal_dependencies] ( identifier[target] ): literal[string] keyword[for] identifier[dep] keyword[in] identifier[target] . identifier[dependencies] : keyword[if] identifier[isinstance] ( identifier[dep] , identifier[Jarable] ): keyword[yield] identifier[dep] ...
def target_internal_dependencies(target): """Returns internal Jarable dependencies that were "directly" declared. Directly declared deps are those that are explicitly listed in the definition of a target, rather than being depended on transitively. But in order to walk through aggregator targets such as `tar...
def add_request_handler_chain(self, request_handler_chain): # type: (GenericRequestHandlerChain) -> None """Checks the type before adding it to the request_handler_chains instance variable. :param request_handler_chain: Request Handler Chain instance. :type request_handler_chai...
def function[add_request_handler_chain, parameter[self, request_handler_chain]]: constant[Checks the type before adding it to the request_handler_chains instance variable. :param request_handler_chain: Request Handler Chain instance. :type request_handler_chain: RequestHandlerChain ...
keyword[def] identifier[add_request_handler_chain] ( identifier[self] , identifier[request_handler_chain] ): literal[string] keyword[if] identifier[request_handler_chain] keyword[is] keyword[None] keyword[or] keyword[not] identifier[isinstance] ( identifier[request_handler_chain] , ...
def add_request_handler_chain(self, request_handler_chain): # type: (GenericRequestHandlerChain) -> None 'Checks the type before adding it to the\n request_handler_chains instance variable.\n\n :param request_handler_chain: Request Handler Chain instance.\n :type request_handler_chain: Req...
def split_args(self, arg_dict): """ given a dictionary of arguments, split them into args and kwargs note: this destroys the arg_dict passed. if you need it, create a copy first. """ pos_args = [] for arg in self.args: pos_args.append(arg_dict...
def function[split_args, parameter[self, arg_dict]]: constant[ given a dictionary of arguments, split them into args and kwargs note: this destroys the arg_dict passed. if you need it, create a copy first. ] variable[pos_args] assign[=] list[[]] for taget...
keyword[def] identifier[split_args] ( identifier[self] , identifier[arg_dict] ): literal[string] identifier[pos_args] =[] keyword[for] identifier[arg] keyword[in] identifier[self] . identifier[args] : identifier[pos_args] . identifier[append] ( identifier[arg_dict] [ identi...
def split_args(self, arg_dict): """ given a dictionary of arguments, split them into args and kwargs note: this destroys the arg_dict passed. if you need it, create a copy first. """ pos_args = [] for arg in self.args: pos_args.append(arg_dict[arg.name]) ...
def get_access_token(client_id, client_secret): ''' Name: token Parameters: client_id, client_secret Return: dictionary ''' headers = {'Content-Type': 'application/x-www-form-urlencoded'} payload = { 'client_id': client_id, 'client_secret': client_secret } request = requests.post(token_url, data=payload,...
def function[get_access_token, parameter[client_id, client_secret]]: constant[ Name: token Parameters: client_id, client_secret Return: dictionary ] variable[headers] assign[=] dictionary[[<ast.Constant object at 0x7da20c6a97b0>], [<ast.Constant object at 0x7da20c6abbb0>]] variable[payload] ...
keyword[def] identifier[get_access_token] ( identifier[client_id] , identifier[client_secret] ): literal[string] identifier[headers] ={ literal[string] : literal[string] } identifier[payload] ={ literal[string] : identifier[client_id] , literal[string] : identifier[client_secret] } identifier[request...
def get_access_token(client_id, client_secret): """ Name: token Parameters: client_id, client_secret Return: dictionary """ headers = {'Content-Type': 'application/x-www-form-urlencoded'} payload = {'client_id': client_id, 'client_secret': client_secret} request = requests.post(token_url, data=paylo...
def is_zonefile_cached( zonefile_hash, zonefile_dir, validate=False): """ Do we have the cached zonefile? It's okay if it's a non-standard zonefile. if @validate is true, then check that the data in zonefile_dir_path/zonefile.txt matches zonefile_hash Return True if so Return False if not """ ...
def function[is_zonefile_cached, parameter[zonefile_hash, zonefile_dir, validate]]: constant[ Do we have the cached zonefile? It's okay if it's a non-standard zonefile. if @validate is true, then check that the data in zonefile_dir_path/zonefile.txt matches zonefile_hash Return True if so Retu...
keyword[def] identifier[is_zonefile_cached] ( identifier[zonefile_hash] , identifier[zonefile_dir] , identifier[validate] = keyword[False] ): literal[string] identifier[zonefile_path] = identifier[atlas_zonefile_path] ( identifier[zonefile_dir] , identifier[zonefile_hash] ) identifier[zonefile_path_le...
def is_zonefile_cached(zonefile_hash, zonefile_dir, validate=False): """ Do we have the cached zonefile? It's okay if it's a non-standard zonefile. if @validate is true, then check that the data in zonefile_dir_path/zonefile.txt matches zonefile_hash Return True if so Return False if not """ ...
def generate_model_name(raml_resource): """ Generate model name. :param raml_resource: Instance of ramlfications.raml.ResourceNode. """ resource_uri = get_resource_uri(raml_resource).strip('/') resource_uri = re.sub('\W', ' ', resource_uri) model_name = inflection.titleize(resource_uri) ret...
def function[generate_model_name, parameter[raml_resource]]: constant[ Generate model name. :param raml_resource: Instance of ramlfications.raml.ResourceNode. ] variable[resource_uri] assign[=] call[call[name[get_resource_uri], parameter[name[raml_resource]]].strip, parameter[constant[/]]] ...
keyword[def] identifier[generate_model_name] ( identifier[raml_resource] ): literal[string] identifier[resource_uri] = identifier[get_resource_uri] ( identifier[raml_resource] ). identifier[strip] ( literal[string] ) identifier[resource_uri] = identifier[re] . identifier[sub] ( literal[string] , liter...
def generate_model_name(raml_resource): """ Generate model name. :param raml_resource: Instance of ramlfications.raml.ResourceNode. """ resource_uri = get_resource_uri(raml_resource).strip('/') resource_uri = re.sub('\\W', ' ', resource_uri) model_name = inflection.titleize(resource_uri) re...
def accessible_to(self, user): """ returns all the items that are accessible to the specified user if user is not authenticated will return public items :param user: an user instance """ if user.is_superuser: try: queryset = self.get_q...
def function[accessible_to, parameter[self, user]]: constant[ returns all the items that are accessible to the specified user if user is not authenticated will return public items :param user: an user instance ] if name[user].is_superuser begin[:] <ast.Tr...
keyword[def] identifier[accessible_to] ( identifier[self] , identifier[user] ): literal[string] keyword[if] identifier[user] . identifier[is_superuser] : keyword[try] : identifier[queryset] = identifier[self] . identifier[get_queryset] () keyword[except] ...
def accessible_to(self, user): """ returns all the items that are accessible to the specified user if user is not authenticated will return public items :param user: an user instance """ if user.is_superuser: try: queryset = self.get_queryset() # dep...
def validate_python_version(config, actual_py_version=None): # type: (Config, Optional[str]) -> None """Validate configuration matches a specific python version. If the ``actual_py_version`` is not provided, it will default to the major/minor version of the currently running python interpreter. ...
def function[validate_python_version, parameter[config, actual_py_version]]: constant[Validate configuration matches a specific python version. If the ``actual_py_version`` is not provided, it will default to the major/minor version of the currently running python interpreter. :param actual_py...
keyword[def] identifier[validate_python_version] ( identifier[config] , identifier[actual_py_version] = keyword[None] ): literal[string] identifier[lambda_version] = identifier[config] . identifier[lambda_python_version] keyword[if] identifier[actual_py_version] keyword[is] keyword[None] : ...
def validate_python_version(config, actual_py_version=None): # type: (Config, Optional[str]) -> None 'Validate configuration matches a specific python version.\n\n If the ``actual_py_version`` is not provided, it will default\n to the major/minor version of the currently running python\n interpreter.\n...
def _completion_checker(async_id, context_id): """Check if all Async jobs within a Context have been run.""" if not context_id: logging.debug("Context for async %s does not exist", async_id) return context = FuriousContext.from_id(context_id) marker = FuriousCompletionMarker.get_by_id(...
def function[_completion_checker, parameter[async_id, context_id]]: constant[Check if all Async jobs within a Context have been run.] if <ast.UnaryOp object at 0x7da20c7ca710> begin[:] call[name[logging].debug, parameter[constant[Context for async %s does not exist], name[async_id]]] ...
keyword[def] identifier[_completion_checker] ( identifier[async_id] , identifier[context_id] ): literal[string] keyword[if] keyword[not] identifier[context_id] : identifier[logging] . identifier[debug] ( literal[string] , identifier[async_id] ) keyword[return] identifier[context...
def _completion_checker(async_id, context_id): """Check if all Async jobs within a Context have been run.""" if not context_id: logging.debug('Context for async %s does not exist', async_id) return # depends on [control=['if'], data=[]] context = FuriousContext.from_id(context_id) marke...
async def removeKeyPair(self, *args, **kwargs): """ Ensure a KeyPair for a given worker type does not exist Ensure that a keypair of a given name does not exist. This method is ``experimental`` """ return await self._makeApiCall(self.funcinfo["removeKeyPair"], *args, *...
<ast.AsyncFunctionDef object at 0x7da204961780>
keyword[async] keyword[def] identifier[removeKeyPair] ( identifier[self] ,* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[return] keyword[await] identifier[self] . identifier[_makeApiCall] ( identifier[self] . identifier[funcinfo] [ literal[string] ],* identifier[args] ,** ...
async def removeKeyPair(self, *args, **kwargs): """ Ensure a KeyPair for a given worker type does not exist Ensure that a keypair of a given name does not exist. This method is ``experimental`` """ return await self._makeApiCall(self.funcinfo['removeKeyPair'], *args, **kwargs)
def parse_host(parser, event, node): """Parse and return the host entity if that is the next entity <!ELEMENT HOST (#PCDATA)> """ #pylint: disable=unused-argument host = '' (next_event, next_node) = six.next(parser) if next_event == pulldom.CHARACTERS: host = next_node.nod...
def function[parse_host, parameter[parser, event, node]]: constant[Parse and return the host entity if that is the next entity <!ELEMENT HOST (#PCDATA)> ] variable[host] assign[=] constant[] <ast.Tuple object at 0x7da204567be0> assign[=] call[name[six].next, parameter[name[parser]...
keyword[def] identifier[parse_host] ( identifier[parser] , identifier[event] , identifier[node] ): literal[string] identifier[host] = literal[string] ( identifier[next_event] , identifier[next_node] )= identifier[six] . identifier[next] ( identifier[parser] ) keyword[if] identifier[next_...
def parse_host(parser, event, node): """Parse and return the host entity if that is the next entity <!ELEMENT HOST (#PCDATA)> """ #pylint: disable=unused-argument host = '' (next_event, next_node) = six.next(parser) if next_event == pulldom.CHARACTERS: host = next_node.nodeVal...
def slots(self): """Get all the slots for this node. :returns: The names of slots for this class. If the class doesn't define any slot, through the ``__slots__`` variable, then this function will return a None. Also, it will return None in the case the slots were not...
def function[slots, parameter[self]]: constant[Get all the slots for this node. :returns: The names of slots for this class. If the class doesn't define any slot, through the ``__slots__`` variable, then this function will return a None. Also, it will return None in ...
keyword[def] identifier[slots] ( identifier[self] ): literal[string] keyword[def] identifier[grouped_slots] (): keyword[for] identifier[cls] keyword[in] identifier[self] . identifier[mro] ()[:- literal[int] ]: keyword[try] : identifie...
def slots(self): """Get all the slots for this node. :returns: The names of slots for this class. If the class doesn't define any slot, through the ``__slots__`` variable, then this function will return a None. Also, it will return None in the case the slots were not inf...
def cast_to_subclass(self): """ Load the bundle file from the database to get the derived bundle class, then return a new bundle built on that class :return: """ self.import_lib() self.load_requirements() try: self.commit() # To ensure the r...
def function[cast_to_subclass, parameter[self]]: constant[ Load the bundle file from the database to get the derived bundle class, then return a new bundle built on that class :return: ] call[name[self].import_lib, parameter[]] call[name[self].load_requirements, ...
keyword[def] identifier[cast_to_subclass] ( identifier[self] ): literal[string] identifier[self] . identifier[import_lib] () identifier[self] . identifier[load_requirements] () keyword[try] : identifier[self] . identifier[commit] () identifier[bsf] = ide...
def cast_to_subclass(self): """ Load the bundle file from the database to get the derived bundle class, then return a new bundle built on that class :return: """ self.import_lib() self.load_requirements() try: self.commit() # To ensure the rollback() doesn't cle...
def convert_trees(self, ptb_trees, representation='basic', universal=True, include_punct=True, include_erased=False, **kwargs): """Convert a list of Penn Treebank formatted strings (ptb_trees) into Stanford Dependencies. The dependencies are represented as a list of sentenc...
def function[convert_trees, parameter[self, ptb_trees, representation, universal, include_punct, include_erased]]: constant[Convert a list of Penn Treebank formatted strings (ptb_trees) into Stanford Dependencies. The dependencies are represented as a list of sentences (CoNLL.Corpus), where each...
keyword[def] identifier[convert_trees] ( identifier[self] , identifier[ptb_trees] , identifier[representation] = literal[string] , identifier[universal] = keyword[True] , identifier[include_punct] = keyword[True] , identifier[include_erased] = keyword[False] ,** identifier[kwargs] ): literal[string] ...
def convert_trees(self, ptb_trees, representation='basic', universal=True, include_punct=True, include_erased=False, **kwargs): """Convert a list of Penn Treebank formatted strings (ptb_trees) into Stanford Dependencies. The dependencies are represented as a list of sentences (CoNLL.Corpus), where e...
def _pca_weights( weights, pc, threshold=None, label_threshold=None, label_weights=None, optimize_label_iter=OPTIMIZE_LABEL_ITER_DEFAULT, **kwargs ): """ :param weights: :param pc: :param threshold: :param label_threshold: :param label_...
def function[_pca_weights, parameter[weights, pc, threshold, label_threshold, label_weights, optimize_label_iter]]: constant[ :param weights: :param pc: :param threshold: :param label_threshold: :param label_weights: :param kwargs: :return: ] variable[fig] assign[=] call[...
keyword[def] identifier[_pca_weights] ( identifier[weights] , identifier[pc] , identifier[threshold] = keyword[None] , identifier[label_threshold] = keyword[None] , identifier[label_weights] = keyword[None] , identifier[optimize_label_iter] = identifier[OPTIMIZE_LABEL_ITER_DEFAULT] , ** identifier[kwargs] ): ...
def _pca_weights(weights, pc, threshold=None, label_threshold=None, label_weights=None, optimize_label_iter=OPTIMIZE_LABEL_ITER_DEFAULT, **kwargs): """ :param weights: :param pc: :param threshold: :param label_threshold: :param label_weights: :param kwargs: :return: """ fig = plt...
def mkdummy(name, **attrs): """Make a placeholder object that uses its own name for its repr""" return type( name, (), dict(__repr__=(lambda self: "<%s>" % name), **attrs) )()
def function[mkdummy, parameter[name]]: constant[Make a placeholder object that uses its own name for its repr] return[call[call[name[type], parameter[name[name], tuple[[]], call[name[dict], parameter[]]]], parameter[]]]
keyword[def] identifier[mkdummy] ( identifier[name] ,** identifier[attrs] ): literal[string] keyword[return] identifier[type] ( identifier[name] ,(), identifier[dict] ( identifier[__repr__] =( keyword[lambda] identifier[self] : literal[string] % identifier[name] ),** identifier[attrs] ) )()
def mkdummy(name, **attrs): """Make a placeholder object that uses its own name for its repr""" return type(name, (), dict(__repr__=lambda self: '<%s>' % name, **attrs))()
def paga_compare( adata, basis=None, edges=False, color=None, alpha=None, groups=None, components=None, projection='2d', legend_loc='on data', legend_fontsize=None, legend_fontweight='bold', color_map=None, palette=N...
def function[paga_compare, parameter[adata, basis, edges, color, alpha, groups, components, projection, legend_loc, legend_fontsize, legend_fontweight, color_map, palette, frameon, size, title, right_margin, left_margin, show, save, title_graph, groups_graph]]: constant[Scatter and PAGA graph side-by-side. ...
keyword[def] identifier[paga_compare] ( identifier[adata] , identifier[basis] = keyword[None] , identifier[edges] = keyword[False] , identifier[color] = keyword[None] , identifier[alpha] = keyword[None] , identifier[groups] = keyword[None] , identifier[components] = keyword[None] , identifier[projection] = li...
def paga_compare(adata, basis=None, edges=False, color=None, alpha=None, groups=None, components=None, projection='2d', legend_loc='on data', legend_fontsize=None, legend_fontweight='bold', color_map=None, palette=None, frameon=False, size=None, title=None, right_margin=None, left_margin=0.05, show=None, save=None, tit...
def _get_buckets_cache_filename(): ''' Return the filename of the cache for bucket contents. Create the path if it does not exist. ''' cache_dir = _get_cache_dir() if not os.path.exists(cache_dir): os.makedirs(cache_dir) return os.path.join(cache_dir, 'buckets_files.cache')
def function[_get_buckets_cache_filename, parameter[]]: constant[ Return the filename of the cache for bucket contents. Create the path if it does not exist. ] variable[cache_dir] assign[=] call[name[_get_cache_dir], parameter[]] if <ast.UnaryOp object at 0x7da1b2098a00> begin[:] ...
keyword[def] identifier[_get_buckets_cache_filename] (): literal[string] identifier[cache_dir] = identifier[_get_cache_dir] () keyword[if] keyword[not] identifier[os] . identifier[path] . identifier[exists] ( identifier[cache_dir] ): identifier[os] . identifier[makedirs] ( identifier[cache...
def _get_buckets_cache_filename(): """ Return the filename of the cache for bucket contents. Create the path if it does not exist. """ cache_dir = _get_cache_dir() if not os.path.exists(cache_dir): os.makedirs(cache_dir) # depends on [control=['if'], data=[]] return os.path.join(cac...
def zrange(self, name, start, end, desc=False, withscores=False, score_cast_func=float): """ Returns all the elements including between ``start`` (non included) and ``stop`` (included). :param name: str the name of the redis key :param start: :param en...
def function[zrange, parameter[self, name, start, end, desc, withscores, score_cast_func]]: constant[ Returns all the elements including between ``start`` (non included) and ``stop`` (included). :param name: str the name of the redis key :param start: :param end: ...
keyword[def] identifier[zrange] ( identifier[self] , identifier[name] , identifier[start] , identifier[end] , identifier[desc] = keyword[False] , identifier[withscores] = keyword[False] , identifier[score_cast_func] = identifier[float] ): literal[string] keyword[with] identifier[self] . identifie...
def zrange(self, name, start, end, desc=False, withscores=False, score_cast_func=float): """ Returns all the elements including between ``start`` (non included) and ``stop`` (included). :param name: str the name of the redis key :param start: :param end: :param d...
def from_timeseries(cls, timeSeries): """Create a new Matrix instance from a TimeSeries or MultiDimensionalTimeSeries :param TimeSeries timeSeries: The TimeSeries, which should be used to create a new Matrix. :return: A Matrix with the values of the timeSeries. Each row of ...
def function[from_timeseries, parameter[cls, timeSeries]]: constant[Create a new Matrix instance from a TimeSeries or MultiDimensionalTimeSeries :param TimeSeries timeSeries: The TimeSeries, which should be used to create a new Matrix. :return: A Matrix with the values of the...
keyword[def] identifier[from_timeseries] ( identifier[cls] , identifier[timeSeries] ): literal[string] identifier[width] = literal[int] keyword[if] identifier[isinstance] ( identifier[timeSeries] , identifier[MultiDimensionalTimeSeries] ): identifier[width] = identifier[tim...
def from_timeseries(cls, timeSeries): """Create a new Matrix instance from a TimeSeries or MultiDimensionalTimeSeries :param TimeSeries timeSeries: The TimeSeries, which should be used to create a new Matrix. :return: A Matrix with the values of the timeSeries. Each row of ...
def cmd_http_options(server, verbose): """Retrieve the available HTTP methods of a web server. Example: \b $ habu.http.options -v http://google.com { "allowed": "GET, HEAD" } """ if verbose: logging.basicConfig(level=logging.INFO, format='%(message)s') if verbose: ...
def function[cmd_http_options, parameter[server, verbose]]: constant[Retrieve the available HTTP methods of a web server. Example:  $ habu.http.options -v http://google.com { "allowed": "GET, HEAD" } ] if name[verbose] begin[:] call[name[logging].basicC...
keyword[def] identifier[cmd_http_options] ( identifier[server] , identifier[verbose] ): literal[string] keyword[if] identifier[verbose] : identifier[logging] . identifier[basicConfig] ( identifier[level] = identifier[logging] . identifier[INFO] , identifier[format] = literal[string] ) keywo...
def cmd_http_options(server, verbose): """Retrieve the available HTTP methods of a web server. Example: \x08 $ habu.http.options -v http://google.com { "allowed": "GET, HEAD" } """ if verbose: logging.basicConfig(level=logging.INFO, format='%(message)s') # depends on [...
def get_signalcheck(self, sar, **params): """get_signalcheck - perform a signal check. Parameters ---------- sar : dict signal-api-request specified as a dictionary of parameters. All of these parameters are optional. For details check https://api.po...
def function[get_signalcheck, parameter[self, sar]]: constant[get_signalcheck - perform a signal check. Parameters ---------- sar : dict signal-api-request specified as a dictionary of parameters. All of these parameters are optional. For details che...
keyword[def] identifier[get_signalcheck] ( identifier[self] , identifier[sar] ,** identifier[params] ): literal[string] identifier[params] = identifier[sar] identifier[endpoint] = literal[string] identifier[retValue] = identifier[self] . identifier[_A...
def get_signalcheck(self, sar, **params): """get_signalcheck - perform a signal check. Parameters ---------- sar : dict signal-api-request specified as a dictionary of parameters. All of these parameters are optional. For details check https://api.postco...
def get_scigraph_nodes(id_list)-> Iterator[Dict]: """ Queries scigraph neighbors to get a list of nodes back We use the scigraph neighbors function because ids can be sent in batch which is faster than iteratively querying solr search or the scigraph graph/id function :return: json decoded res...
def function[get_scigraph_nodes, parameter[id_list]]: constant[ Queries scigraph neighbors to get a list of nodes back We use the scigraph neighbors function because ids can be sent in batch which is faster than iteratively querying solr search or the scigraph graph/id function :return: js...
keyword[def] identifier[get_scigraph_nodes] ( identifier[id_list] )-> identifier[Iterator] [ identifier[Dict] ]: literal[string] identifier[scigraph] = identifier[OntologyFactory] (). identifier[create] ( literal[string] ) identifier[chunks] =[ identifier[id_list] [ identifier[i] : identifier[i] + li...
def get_scigraph_nodes(id_list) -> Iterator[Dict]: """ Queries scigraph neighbors to get a list of nodes back We use the scigraph neighbors function because ids can be sent in batch which is faster than iteratively querying solr search or the scigraph graph/id function :return: json decoded re...
def sanitize_for_archive(url, headers, payload): """Sanitize payload of a HTTP request by removing the token information before storing/retrieving archived items :param: url: HTTP url request :param: headers: HTTP headers request :param: payload: HTTP payload request :r...
def function[sanitize_for_archive, parameter[url, headers, payload]]: constant[Sanitize payload of a HTTP request by removing the token information before storing/retrieving archived items :param: url: HTTP url request :param: headers: HTTP headers request :param: payload: HTTP ...
keyword[def] identifier[sanitize_for_archive] ( identifier[url] , identifier[headers] , identifier[payload] ): literal[string] keyword[if] identifier[headers] keyword[and] literal[string] keyword[in] identifier[headers] : identifier[headers] . identifier[pop] ( literal[string] , k...
def sanitize_for_archive(url, headers, payload): """Sanitize payload of a HTTP request by removing the token information before storing/retrieving archived items :param: url: HTTP url request :param: headers: HTTP headers request :param: payload: HTTP payload request :retur...
def createKeyboardTab(self): ''' KEYBOARD ''' _keyboardList = [ 'KEYCODE_1', 'KEYCODE_2', 'KEYCODE_3', 'KEYCODE_4', 'KEYCODE_5', 'KEYCODE_6', 'KEYCODE_7', 'KEYCODE_8', 'KEYCODE_9', 'KEYCODE_0', 'KEYCODE_Q', 'KEYCODE_W', 'KEYCODE_E', 'KEYCODE_R', 'KEYCODE_T', 'KEYCODE_...
def function[createKeyboardTab, parameter[self]]: constant[ KEYBOARD ] variable[_keyboardList] assign[=] list[[<ast.Constant object at 0x7da1b1e67280>, <ast.Constant object at 0x7da1b1e67580>, <ast.Constant object at 0x7da1b1e66f20>, <ast.Constant object at 0x7da1b1e67190>, <ast.Constant object at 0x7da...
keyword[def] identifier[createKeyboardTab] ( identifier[self] ): literal[string] identifier[_keyboardList] =[ literal[string] , literal[string] , literal[string] , literal[string] , literal[string] , literal[string] , literal[string] , literal[string] , literal[string] , literal[s...
def createKeyboardTab(self): """ KEYBOARD """ _keyboardList = ['KEYCODE_1', 'KEYCODE_2', 'KEYCODE_3', 'KEYCODE_4', 'KEYCODE_5', 'KEYCODE_6', 'KEYCODE_7', 'KEYCODE_8', 'KEYCODE_9', 'KEYCODE_0', 'KEYCODE_Q', 'KEYCODE_W', 'KEYCODE_E', 'KEYCODE_R', 'KEYCODE_T', 'KEYCODE_Y', 'KEYCODE_U', 'KEYCODE_I', 'KEYCODE_O', 'K...
def _validate_config(self): """ Handle and check configuration. """ groups = dict( job=defaultdict(Bunch), httpd=defaultdict(Bunch), ) for key, val in config.torque.items(): # Auto-convert numbers and bools if val.isdigit(): ...
def function[_validate_config, parameter[self]]: constant[ Handle and check configuration. ] variable[groups] assign[=] call[name[dict], parameter[]] for taget[tuple[[<ast.Name object at 0x7da1b1112f20>, <ast.Name object at 0x7da1b1112a10>]]] in starred[call[name[config].torque.items, pa...
keyword[def] identifier[_validate_config] ( identifier[self] ): literal[string] identifier[groups] = identifier[dict] ( identifier[job] = identifier[defaultdict] ( identifier[Bunch] ), identifier[httpd] = identifier[defaultdict] ( identifier[Bunch] ), ) keyword[f...
def _validate_config(self): """ Handle and check configuration. """ groups = dict(job=defaultdict(Bunch), httpd=defaultdict(Bunch)) for (key, val) in config.torque.items(): # Auto-convert numbers and bools if val.isdigit(): config.torque[key] = val = int(val) # depends o...
def get_plaintext_citations(bibtex): """ Parse a BibTeX file to get a clean list of plaintext citations. :param bibtex: Either the path to the BibTeX file or the content of a \ BibTeX file. :returns: A list of cleaned plaintext citations. """ parser = BibTexParser() parser.cust...
def function[get_plaintext_citations, parameter[bibtex]]: constant[ Parse a BibTeX file to get a clean list of plaintext citations. :param bibtex: Either the path to the BibTeX file or the content of a BibTeX file. :returns: A list of cleaned plaintext citations. ] variable...
keyword[def] identifier[get_plaintext_citations] ( identifier[bibtex] ): literal[string] identifier[parser] = identifier[BibTexParser] () identifier[parser] . identifier[customization] = identifier[convert_to_unicode] keyword[if] identifier[os] . identifier[path] . identifier[isfile] ( ide...
def get_plaintext_citations(bibtex): """ Parse a BibTeX file to get a clean list of plaintext citations. :param bibtex: Either the path to the BibTeX file or the content of a BibTeX file. :returns: A list of cleaned plaintext citations. """ parser = BibTexParser() parser.custom...
def validate_IRkernel(venv_dir): """Validates that this env contains an IRkernel kernel and returns info to start it Returns: tuple (ARGV, language, resource_dir) """ r_exe_name = find_exe(venv_dir, "R") if r_exe_name is None: return [], None, None # check if this is really an...
def function[validate_IRkernel, parameter[venv_dir]]: constant[Validates that this env contains an IRkernel kernel and returns info to start it Returns: tuple (ARGV, language, resource_dir) ] variable[r_exe_name] assign[=] call[name[find_exe], parameter[name[venv_dir], constant[R]]] ...
keyword[def] identifier[validate_IRkernel] ( identifier[venv_dir] ): literal[string] identifier[r_exe_name] = identifier[find_exe] ( identifier[venv_dir] , literal[string] ) keyword[if] identifier[r_exe_name] keyword[is] keyword[None] : keyword[return] [], keyword[None] , keyword[None] ...
def validate_IRkernel(venv_dir): """Validates that this env contains an IRkernel kernel and returns info to start it Returns: tuple (ARGV, language, resource_dir) """ r_exe_name = find_exe(venv_dir, 'R') if r_exe_name is None: return ([], None, None) # depends on [control=['if'], ...
def prior_to_xarray(self): """Convert prior samples to xarray.""" prior = self.prior prior_model = self.prior_model # filter posterior_predictive and log_likelihood prior_predictive = self.prior_predictive if prior_predictive is None: prior_predictive =...
def function[prior_to_xarray, parameter[self]]: constant[Convert prior samples to xarray.] variable[prior] assign[=] name[self].prior variable[prior_model] assign[=] name[self].prior_model variable[prior_predictive] assign[=] name[self].prior_predictive if compare[name[prior_pred...
keyword[def] identifier[prior_to_xarray] ( identifier[self] ): literal[string] identifier[prior] = identifier[self] . identifier[prior] identifier[prior_model] = identifier[self] . identifier[prior_model] identifier[prior_predictive] = identifier[self] . identifier...
def prior_to_xarray(self): """Convert prior samples to xarray.""" prior = self.prior prior_model = self.prior_model # filter posterior_predictive and log_likelihood prior_predictive = self.prior_predictive if prior_predictive is None: prior_predictive = [] # depends on [control=['if'], dat...
def p_sum_lvl_1(self, p): """ sum_lvl_1 : script_lvl_1 | script_lvl_1 PLUS sum_lvl_1""" if len(p) == 4: p[3].append(p[1]) p[0] = p[3] else: p[0] = [p[1]]
def function[p_sum_lvl_1, parameter[self, p]]: constant[ sum_lvl_1 : script_lvl_1 | script_lvl_1 PLUS sum_lvl_1] if compare[call[name[len], parameter[name[p]]] equal[==] constant[4]] begin[:] call[call[name[p]][constant[3]].append, parameter[call[name[p]][constant[1]...
keyword[def] identifier[p_sum_lvl_1] ( identifier[self] , identifier[p] ): literal[string] keyword[if] identifier[len] ( identifier[p] )== literal[int] : identifier[p] [ literal[int] ]. identifier[append] ( identifier[p] [ literal[int] ]) identifier[p] [ literal[int] ]= i...
def p_sum_lvl_1(self, p): """ sum_lvl_1 : script_lvl_1 | script_lvl_1 PLUS sum_lvl_1""" if len(p) == 4: p[3].append(p[1]) p[0] = p[3] # depends on [control=['if'], data=[]] else: p[0] = [p[1]]
def create_container(self, container, **kwargs): """Create container :param container(string): container name (Container is equivalent to Bucket term in Amazon). :param **kwargs(dict): extend args for specific driver. """ try: LOG.de...
def function[create_container, parameter[self, container]]: constant[Create container :param container(string): container name (Container is equivalent to Bucket term in Amazon). :param **kwargs(dict): extend args for specific driver. ] <ast.Try obj...
keyword[def] identifier[create_container] ( identifier[self] , identifier[container] ,** identifier[kwargs] ): literal[string] keyword[try] : identifier[LOG] . identifier[debug] ( literal[string] , identifier[self] . identifier[driver] ) keyword[return] identifier[self] ....
def create_container(self, container, **kwargs): """Create container :param container(string): container name (Container is equivalent to Bucket term in Amazon). :param **kwargs(dict): extend args for specific driver. """ try: LOG.debug('create_...
def _GetSpecificationStore(cls, format_category): """Retrieves the specification store for specified format category. Args: format_category (str): format category. Returns: tuple[FormatSpecificationStore, list[AnalyzerHelper]]: a format specification store and remaining analyzer help...
def function[_GetSpecificationStore, parameter[cls, format_category]]: constant[Retrieves the specification store for specified format category. Args: format_category (str): format category. Returns: tuple[FormatSpecificationStore, list[AnalyzerHelper]]: a format specification st...
keyword[def] identifier[_GetSpecificationStore] ( identifier[cls] , identifier[format_category] ): literal[string] identifier[specification_store] = identifier[specification] . identifier[FormatSpecificationStore] () identifier[remainder_list] =[] keyword[for] identifier[analyzer_helper] keywo...
def _GetSpecificationStore(cls, format_category): """Retrieves the specification store for specified format category. Args: format_category (str): format category. Returns: tuple[FormatSpecificationStore, list[AnalyzerHelper]]: a format specification store and remaining analyzer help...
def is_integer(v): # type: (...) -> bool """Test whether a value is an integer (of any kind). Examples: >>> is_integer(1) True >>> is_integer(-0.123) False >>> is_integer(3.) False >>> is_integer(9223372036854775808) True >>> is_intege...
def function[is_integer, parameter[v]]: constant[Test whether a value is an integer (of any kind). Examples: >>> is_integer(1) True >>> is_integer(-0.123) False >>> is_integer(3.) False >>> is_integer(9223372036854775808) True >>> is_i...
keyword[def] identifier[is_integer] ( identifier[v] ): literal[string] keyword[try] : keyword[from] identifier[builtins] keyword[import] identifier[int] keyword[return] identifier[isinstance] ( identifier[v] , identifier[int] ) keyword[except] identifier[ImportError] : ...
def is_integer(v): # type: (...) -> bool "Test whether a value is an integer (of any kind).\n\n Examples:\n >>> is_integer(1)\n True\n >>> is_integer(-0.123)\n False\n >>> is_integer(3.)\n False\n >>> is_integer(9223372036854775808)\n True\n >>> ...
def update(self, request, *args, **kwargs): """ Run **PATCH** request against */api/price-list-items/<uuid>/* to update price list item. Only item_type, key value and units can be updated. Only customer owner and staff can update price items. """ return super(PriceListIte...
def function[update, parameter[self, request]]: constant[ Run **PATCH** request against */api/price-list-items/<uuid>/* to update price list item. Only item_type, key value and units can be updated. Only customer owner and staff can update price items. ] return[call[call[name...
keyword[def] identifier[update] ( identifier[self] , identifier[request] ,* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[return] identifier[super] ( identifier[PriceListItemViewSet] , identifier[self] ). identifier[update] ( identifier[request] ,* identifier[args] ,** identif...
def update(self, request, *args, **kwargs): """ Run **PATCH** request against */api/price-list-items/<uuid>/* to update price list item. Only item_type, key value and units can be updated. Only customer owner and staff can update price items. """ return super(PriceListItemViewSet...
def append_value(dictionary, key, item): """Append those items to the values for that key""" items = dictionary.get(key, []) items.append(item) dictionary[key] = items
def function[append_value, parameter[dictionary, key, item]]: constant[Append those items to the values for that key] variable[items] assign[=] call[name[dictionary].get, parameter[name[key], list[[]]]] call[name[items].append, parameter[name[item]]] call[name[dictionary]][name[key]] ass...
keyword[def] identifier[append_value] ( identifier[dictionary] , identifier[key] , identifier[item] ): literal[string] identifier[items] = identifier[dictionary] . identifier[get] ( identifier[key] ,[]) identifier[items] . identifier[append] ( identifier[item] ) identifier[dictionary] [ identifie...
def append_value(dictionary, key, item): """Append those items to the values for that key""" items = dictionary.get(key, []) items.append(item) dictionary[key] = items
def __get_delta_files(self): """Search for delta files and return a dict of Delta objects, keyed by directory names.""" files = [(d, f) for d in self.dirs for f in listdir(d) if isfile(join(d, f))] deltas = OrderedDict() for d, f in files: file_ = join(d, f) if ...
def function[__get_delta_files, parameter[self]]: constant[Search for delta files and return a dict of Delta objects, keyed by directory names.] variable[files] assign[=] <ast.ListComp object at 0x7da18f00dc60> variable[deltas] assign[=] call[name[OrderedDict], parameter[]] for taget[tup...
keyword[def] identifier[__get_delta_files] ( identifier[self] ): literal[string] identifier[files] =[( identifier[d] , identifier[f] ) keyword[for] identifier[d] keyword[in] identifier[self] . identifier[dirs] keyword[for] identifier[f] keyword[in] identifier[listdir] ( identifier[d] ) keywo...
def __get_delta_files(self): """Search for delta files and return a dict of Delta objects, keyed by directory names.""" files = [(d, f) for d in self.dirs for f in listdir(d) if isfile(join(d, f))] deltas = OrderedDict() for (d, f) in files: file_ = join(d, f) if not Delta.is_valid_delta...
def _proxy(self): """ Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context :returns: ShortCodeContext for this ShortCodeInstance :rtype: twilio.rest.proxy.v1.service.short_code.Short...
def function[_proxy, parameter[self]]: constant[ Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context :returns: ShortCodeContext for this ShortCodeInstance :rtype: twilio.rest.proxy....
keyword[def] identifier[_proxy] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_context] keyword[is] keyword[None] : identifier[self] . identifier[_context] = identifier[ShortCodeContext] ( identifier[self] . identifier[_version] , ...
def _proxy(self): """ Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context :returns: ShortCodeContext for this ShortCodeInstance :rtype: twilio.rest.proxy.v1.service.short_code.ShortCode...
def add_segments_bar(self, segments, ax=None, height=0.14, pad=0.1, sharex=True, location='bottom', **plotargs): """Add a segment bar `Plot` indicating state information. By default, segments are displayed in a thin horizontal set of Axes sitting immediately below the x...
def function[add_segments_bar, parameter[self, segments, ax, height, pad, sharex, location]]: constant[Add a segment bar `Plot` indicating state information. By default, segments are displayed in a thin horizontal set of Axes sitting immediately below the x-axis of the main, similarly t...
keyword[def] identifier[add_segments_bar] ( identifier[self] , identifier[segments] , identifier[ax] = keyword[None] , identifier[height] = literal[int] , identifier[pad] = literal[int] , identifier[sharex] = keyword[True] , identifier[location] = literal[string] ,** identifier[plotargs] ): literal[string] ...
def add_segments_bar(self, segments, ax=None, height=0.14, pad=0.1, sharex=True, location='bottom', **plotargs): """Add a segment bar `Plot` indicating state information. By default, segments are displayed in a thin horizontal set of Axes sitting immediately below the x-axis of the main, si...
def fitness(self, v): "Fitness function in the training set" base = self._base if base._classifier: if base._multiple_outputs: hy = SparseArray.argmax(v.hy) fit_func = base._fitness_function if fit_func == 'macro-F1' or fit_func == 'a_F...
def function[fitness, parameter[self, v]]: constant[Fitness function in the training set] variable[base] assign[=] name[self]._base if name[base]._classifier begin[:] if name[base]._multiple_outputs begin[:] variable[hy] assign[=] call[name[SparseArray].ar...
keyword[def] identifier[fitness] ( identifier[self] , identifier[v] ): literal[string] identifier[base] = identifier[self] . identifier[_base] keyword[if] identifier[base] . identifier[_classifier] : keyword[if] identifier[base] . identifier[_multiple_outputs] : ...
def fitness(self, v): """Fitness function in the training set""" base = self._base if base._classifier: if base._multiple_outputs: hy = SparseArray.argmax(v.hy) fit_func = base._fitness_function if fit_func == 'macro-F1' or fit_func == 'a_F1': f1_s...
def plot_plates(step, time, vrms_surface, trench, ridge, agetrench, topo, fids): """handle ploting stuff""" vphi = step.fields['v2'][0, :, :, 0] tempfld = step.fields['T'][0, :, :, 0] concfld = step.fields['c'][0, :, :, 0] timestep = step.isnap if step.sdat.par['boundaries']['ai...
def function[plot_plates, parameter[step, time, vrms_surface, trench, ridge, agetrench, topo, fids]]: constant[handle ploting stuff] variable[vphi] assign[=] call[call[name[step].fields][constant[v2]]][tuple[[<ast.Constant object at 0x7da1b182a2f0>, <ast.Slice object at 0x7da1b182a2c0>, <ast.Slice objec...
keyword[def] identifier[plot_plates] ( identifier[step] , identifier[time] , identifier[vrms_surface] , identifier[trench] , identifier[ridge] , identifier[agetrench] , identifier[topo] , identifier[fids] ): literal[string] identifier[vphi] = identifier[step] . identifier[fields] [ literal[string] ][ lite...
def plot_plates(step, time, vrms_surface, trench, ridge, agetrench, topo, fids): """handle ploting stuff""" vphi = step.fields['v2'][0, :, :, 0] tempfld = step.fields['T'][0, :, :, 0] concfld = step.fields['c'][0, :, :, 0] timestep = step.isnap if step.sdat.par['boundaries']['air_layer']: ...
def monolayer_vs_BE(self, plot_eads=False): """ Plots the binding energy energy as a function of monolayers (ML), i.e. the fractional area adsorbate density for all facets. For each facet at a specific monlayer, only plot the lowest binding energy. Args: plot...
def function[monolayer_vs_BE, parameter[self, plot_eads]]: constant[ Plots the binding energy energy as a function of monolayers (ML), i.e. the fractional area adsorbate density for all facets. For each facet at a specific monlayer, only plot the lowest binding energy. A...
keyword[def] identifier[monolayer_vs_BE] ( identifier[self] , identifier[plot_eads] = keyword[False] ): literal[string] identifier[plt] = identifier[pretty_plot] ( identifier[width] = literal[int] , identifier[height] = literal[int] ) keyword[for] identifier[hkl] keyword[in] identifier...
def monolayer_vs_BE(self, plot_eads=False): """ Plots the binding energy energy as a function of monolayers (ML), i.e. the fractional area adsorbate density for all facets. For each facet at a specific monlayer, only plot the lowest binding energy. Args: plot_ead...
def data_url_scheme(self): """Get svg in Data URL Scheme format. """ # TODO: move to web.app or make it function # remove #svg from dataframe encoded = base64.b64encode(self.contents().encode()) return "data:image/svg+xml;base64," + encoded.decode()
def function[data_url_scheme, parameter[self]]: constant[Get svg in Data URL Scheme format. ] variable[encoded] assign[=] call[name[base64].b64encode, parameter[call[call[name[self].contents, parameter[]].encode, parameter[]]]] return[binary_operation[constant[data:image/svg+xml;base64,] + c...
keyword[def] identifier[data_url_scheme] ( identifier[self] ): literal[string] identifier[encoded] = identifier[base64] . identifier[b64encode] ( identifier[self] . identifier[contents] (). identifier[encode] ()) keyword[return] literal[string] + identifier[encoded] . id...
def data_url_scheme(self): """Get svg in Data URL Scheme format. """ # TODO: move to web.app or make it function # remove #svg from dataframe encoded = base64.b64encode(self.contents().encode()) return 'data:image/svg+xml;base64,' + encoded.decode()
def get_season_points(self, season_key): """ Calling Season Points API. Arg: season_key: key of the season Return: json data """ season_points_url = self.api_path + "season/" + season_key + "/points/" response = self.get_response(season_poi...
def function[get_season_points, parameter[self, season_key]]: constant[ Calling Season Points API. Arg: season_key: key of the season Return: json data ] variable[season_points_url] assign[=] binary_operation[binary_operation[binary_operation[name[s...
keyword[def] identifier[get_season_points] ( identifier[self] , identifier[season_key] ): literal[string] identifier[season_points_url] = identifier[self] . identifier[api_path] + literal[string] + identifier[season_key] + literal[string] identifier[response] = identifier[self] . identif...
def get_season_points(self, season_key): """ Calling Season Points API. Arg: season_key: key of the season Return: json data """ season_points_url = self.api_path + 'season/' + season_key + '/points/' response = self.get_response(season_points_url) ...
def install(self, name=None, prefix=None, pkgs=None, dep=True, channels=None, token=None): """ Install a set of packages into an environment by name or path. If token is specified, the channels different from the defaults will get the token appended. """ ...
def function[install, parameter[self, name, prefix, pkgs, dep, channels, token]]: constant[ Install a set of packages into an environment by name or path. If token is specified, the channels different from the defaults will get the token appended. ] call[name[logger].deb...
keyword[def] identifier[install] ( identifier[self] , identifier[name] = keyword[None] , identifier[prefix] = keyword[None] , identifier[pkgs] = keyword[None] , identifier[dep] = keyword[True] , identifier[channels] = keyword[None] , identifier[token] = keyword[None] ): literal[string] identifier[...
def install(self, name=None, prefix=None, pkgs=None, dep=True, channels=None, token=None): """ Install a set of packages into an environment by name or path. If token is specified, the channels different from the defaults will get the token appended. """ logger.debug(str((prefix...
def getQuotes(symbols): ''' get real-time quotes (index, last trade price, last trade time, etc) for stocks, using google api: http://finance.google.com/finance/info?client=ig&q=symbols Unlike python package 'yahoo-finance' (15 min delay), There is no delay for NYSE and NASDAQ stocks in 'googlefinance' pac...
def function[getQuotes, parameter[symbols]]: constant[ get real-time quotes (index, last trade price, last trade time, etc) for stocks, using google api: http://finance.google.com/finance/info?client=ig&q=symbols Unlike python package 'yahoo-finance' (15 min delay), There is no delay for NYSE and NASDA...
keyword[def] identifier[getQuotes] ( identifier[symbols] ): literal[string] keyword[if] identifier[type] ( identifier[symbols] )== identifier[type] ( literal[string] ): identifier[symbols] =[ identifier[symbols] ] identifier[content] = identifier[json] . identifier[loads] ( identifier[reques...
def getQuotes(symbols): """ get real-time quotes (index, last trade price, last trade time, etc) for stocks, using google api: http://finance.google.com/finance/info?client=ig&q=symbols Unlike python package 'yahoo-finance' (15 min delay), There is no delay for NYSE and NASDAQ stocks in 'googlefinance' pac...
def get_instances(self, state_filter=None): """ Get all the instances filtered by state. @param state_filter: the state that the instance should be in (e.g. "running"), or None for all states """ instances = [] for instance in self._get_instances(self._get_cluster_group_name(), ...
def function[get_instances, parameter[self, state_filter]]: constant[ Get all the instances filtered by state. @param state_filter: the state that the instance should be in (e.g. "running"), or None for all states ] variable[instances] assign[=] list[[]] for taget[name[ins...
keyword[def] identifier[get_instances] ( identifier[self] , identifier[state_filter] = keyword[None] ): literal[string] identifier[instances] =[] keyword[for] identifier[instance] keyword[in] identifier[self] . identifier[_get_instances] ( identifier[self] . identifier[_get_cluster_group_name] (),...
def get_instances(self, state_filter=None): """ Get all the instances filtered by state. @param state_filter: the state that the instance should be in (e.g. "running"), or None for all states """ instances = [] for instance in self._get_instances(self._get_cluster_group_name(), state_...
def translate_bytes(val): ''' These values can be expressed as an integer number of bytes, or a string expression (i.e. 100mb, 1gb, etc.). ''' try: val = int(val) except (TypeError, ValueError): if not isinstance(val, six.string_types): val = six.text_type(val) re...
def function[translate_bytes, parameter[val]]: constant[ These values can be expressed as an integer number of bytes, or a string expression (i.e. 100mb, 1gb, etc.). ] <ast.Try object at 0x7da2041d9d20> return[name[val]]
keyword[def] identifier[translate_bytes] ( identifier[val] ): literal[string] keyword[try] : identifier[val] = identifier[int] ( identifier[val] ) keyword[except] ( identifier[TypeError] , identifier[ValueError] ): keyword[if] keyword[not] identifier[isinstance] ( identifier[val] ,...
def translate_bytes(val): """ These values can be expressed as an integer number of bytes, or a string expression (i.e. 100mb, 1gb, etc.). """ try: val = int(val) # depends on [control=['try'], data=[]] except (TypeError, ValueError): if not isinstance(val, six.string_types): ...
def get_artifact_url(context, task_id, path): """Get a TaskCluster artifact url. Args: context (scriptworker.context.Context): the scriptworker context task_id (str): the task id of the task that published the artifact path (str): the relative path of the artifact Returns: ...
def function[get_artifact_url, parameter[context, task_id, path]]: constant[Get a TaskCluster artifact url. Args: context (scriptworker.context.Context): the scriptworker context task_id (str): the task id of the task that published the artifact path (str): the relative path of the ...
keyword[def] identifier[get_artifact_url] ( identifier[context] , identifier[task_id] , identifier[path] ): literal[string] keyword[if] identifier[path] . identifier[startswith] ( literal[string] ): identifier[url] = identifier[context] . identifier[queue] . identifier[buildUrl] ( literal[string]...
def get_artifact_url(context, task_id, path): """Get a TaskCluster artifact url. Args: context (scriptworker.context.Context): the scriptworker context task_id (str): the task id of the task that published the artifact path (str): the relative path of the artifact Returns: ...
def read_csv(filename): """Reads a CSV file containing a tabular description of a transition function, as found in Sipser. Major difference: instead of multiple header rows, only a single header row whose entries might be tuples. """ with open(filename) as file: table = list(csv.re...
def function[read_csv, parameter[filename]]: constant[Reads a CSV file containing a tabular description of a transition function, as found in Sipser. Major difference: instead of multiple header rows, only a single header row whose entries might be tuples. ] with call[name[open], pa...
keyword[def] identifier[read_csv] ( identifier[filename] ): literal[string] keyword[with] identifier[open] ( identifier[filename] ) keyword[as] identifier[file] : identifier[table] = identifier[list] ( identifier[csv] . identifier[reader] ( identifier[file] )) identifier[m] = identifier[fr...
def read_csv(filename): """Reads a CSV file containing a tabular description of a transition function, as found in Sipser. Major difference: instead of multiple header rows, only a single header row whose entries might be tuples. """ with open(filename) as file: table = list(csv.rea...
def size(value): """ValueRef : number, area of the mark in pixels This is the total area of a symbol. For example, a value of 500 and a ``shape`` of ``'circle'`` would result in circles with an area of 500 square pixels. Only used if ``type`` is ``'symbol'``. """ if valu...
def function[size, parameter[value]]: constant[ValueRef : number, area of the mark in pixels This is the total area of a symbol. For example, a value of 500 and a ``shape`` of ``'circle'`` would result in circles with an area of 500 square pixels. Only used if ``type`` is ``'symbol'``. ...
keyword[def] identifier[size] ( identifier[value] ): literal[string] keyword[if] identifier[value] . identifier[value] : identifier[_assert_is_type] ( literal[string] , identifier[value] . identifier[value] , identifier[int] ) keyword[if] identifier[value] . identifier[v...
def size(value): """ValueRef : number, area of the mark in pixels This is the total area of a symbol. For example, a value of 500 and a ``shape`` of ``'circle'`` would result in circles with an area of 500 square pixels. Only used if ``type`` is ``'symbol'``. """ if value.value:...
def add_list_opt(self, opt, values): """ Add an option with a list of non-file parameters. """ self.add_opt(opt) for val in values: self.add_opt(val)
def function[add_list_opt, parameter[self, opt, values]]: constant[ Add an option with a list of non-file parameters. ] call[name[self].add_opt, parameter[name[opt]]] for taget[name[val]] in starred[name[values]] begin[:] call[name[self].add_opt, parameter[name[val]]]
keyword[def] identifier[add_list_opt] ( identifier[self] , identifier[opt] , identifier[values] ): literal[string] identifier[self] . identifier[add_opt] ( identifier[opt] ) keyword[for] identifier[val] keyword[in] identifier[values] : identifier[self] . identifier[add_opt]...
def add_list_opt(self, opt, values): """ Add an option with a list of non-file parameters. """ self.add_opt(opt) for val in values: self.add_opt(val) # depends on [control=['for'], data=['val']]
def _create_output_from_match(self, match_result): """As isort outputs full path, we change it to relative path.""" full_path = match_result['full_path'] path = self._get_relative_path(full_path) return LinterOutput(self.name, path, match_result['msg'])
def function[_create_output_from_match, parameter[self, match_result]]: constant[As isort outputs full path, we change it to relative path.] variable[full_path] assign[=] call[name[match_result]][constant[full_path]] variable[path] assign[=] call[name[self]._get_relative_path, parameter[name[ful...
keyword[def] identifier[_create_output_from_match] ( identifier[self] , identifier[match_result] ): literal[string] identifier[full_path] = identifier[match_result] [ literal[string] ] identifier[path] = identifier[self] . identifier[_get_relative_path] ( identifier[full_path] ) k...
def _create_output_from_match(self, match_result): """As isort outputs full path, we change it to relative path.""" full_path = match_result['full_path'] path = self._get_relative_path(full_path) return LinterOutput(self.name, path, match_result['msg'])
def new_term(self, term, value, **kwargs): """Create a new root-level term in this section""" tc = self.doc.get_term_class(term.lower()) t = tc(term, value, doc=self.doc, parent=None, section=self).new_children(**kwargs) self.doc.add_term(t) return t
def function[new_term, parameter[self, term, value]]: constant[Create a new root-level term in this section] variable[tc] assign[=] call[name[self].doc.get_term_class, parameter[call[name[term].lower, parameter[]]]] variable[t] assign[=] call[call[name[tc], parameter[name[term], name[value]]].ne...
keyword[def] identifier[new_term] ( identifier[self] , identifier[term] , identifier[value] ,** identifier[kwargs] ): literal[string] identifier[tc] = identifier[self] . identifier[doc] . identifier[get_term_class] ( identifier[term] . identifier[lower] ()) identifier[t] = identifier[tc]...
def new_term(self, term, value, **kwargs): """Create a new root-level term in this section""" tc = self.doc.get_term_class(term.lower()) t = tc(term, value, doc=self.doc, parent=None, section=self).new_children(**kwargs) self.doc.add_term(t) return t
def get(path, **kwargs): """requests.get wrapper""" token = os.environ.get(BE_GITHUB_API_TOKEN) if token: kwargs["headers"] = { "Authorization": "token %s" % token } try: response = requests.get(path, verify=False, **kwargs) if response.status_code == 403: ...
def function[get, parameter[path]]: constant[requests.get wrapper] variable[token] assign[=] call[name[os].environ.get, parameter[name[BE_GITHUB_API_TOKEN]]] if name[token] begin[:] call[name[kwargs]][constant[headers]] assign[=] dictionary[[<ast.Constant object at 0x7da1b11ed1b0...
keyword[def] identifier[get] ( identifier[path] ,** identifier[kwargs] ): literal[string] identifier[token] = identifier[os] . identifier[environ] . identifier[get] ( identifier[BE_GITHUB_API_TOKEN] ) keyword[if] identifier[token] : identifier[kwargs] [ literal[string] ]={ literal[s...
def get(path, **kwargs): """requests.get wrapper""" token = os.environ.get(BE_GITHUB_API_TOKEN) if token: kwargs['headers'] = {'Authorization': 'token %s' % token} # depends on [control=['if'], data=[]] try: response = requests.get(path, verify=False, **kwargs) if response.statu...
def split_pred_string(predstr): """ Split *predstr* and return the (lemma, pos, sense, suffix) components. Examples: >>> Pred.split_pred_string('_dog_n_1_rel') ('dog', 'n', '1', 'rel') >>> Pred.split_pred_string('quant_rel') ('quant', None, None, 'rel') """ predstr =...
def function[split_pred_string, parameter[predstr]]: constant[ Split *predstr* and return the (lemma, pos, sense, suffix) components. Examples: >>> Pred.split_pred_string('_dog_n_1_rel') ('dog', 'n', '1', 'rel') >>> Pred.split_pred_string('quant_rel') ('quant', None, Non...
keyword[def] identifier[split_pred_string] ( identifier[predstr] ): literal[string] identifier[predstr] = identifier[predstr] . identifier[strip] ( literal[string] ) identifier[rel_added] = keyword[False] keyword[if] keyword[not] identifier[predstr] . identifier[lower] (). identifier[endswith]...
def split_pred_string(predstr): """ Split *predstr* and return the (lemma, pos, sense, suffix) components. Examples: >>> Pred.split_pred_string('_dog_n_1_rel') ('dog', 'n', '1', 'rel') >>> Pred.split_pred_string('quant_rel') ('quant', None, None, 'rel') """ predstr =...
def stop(self): """Stop ZAP authentication""" if self.__task: self.__task.cancel() if self.__poller: self.__poller.unregister(self.zap_socket) self.__poller = None super().stop()
def function[stop, parameter[self]]: constant[Stop ZAP authentication] if name[self].__task begin[:] call[name[self].__task.cancel, parameter[]] if name[self].__poller begin[:] call[name[self].__poller.unregister, parameter[name[self].zap_socket]] ...
keyword[def] identifier[stop] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[__task] : identifier[self] . identifier[__task] . identifier[cancel] () keyword[if] identifier[self] . identifier[__poller] : identifier[self] . identif...
def stop(self): """Stop ZAP authentication""" if self.__task: self.__task.cancel() # depends on [control=['if'], data=[]] if self.__poller: self.__poller.unregister(self.zap_socket) self.__poller = None # depends on [control=['if'], data=[]] super().stop()
def unmet_expectations(self): ''' Assert that all expectations on the stub have been met. ''' unmet = [] for exp in self._expectations: if not exp.closed(with_counts=True): unmet.append(ExpectationNotSatisfied(exp)) return unmet
def function[unmet_expectations, parameter[self]]: constant[ Assert that all expectations on the stub have been met. ] variable[unmet] assign[=] list[[]] for taget[name[exp]] in starred[name[self]._expectations] begin[:] if <ast.UnaryOp object at 0x7da1b1b0d2d0> b...
keyword[def] identifier[unmet_expectations] ( identifier[self] ): literal[string] identifier[unmet] =[] keyword[for] identifier[exp] keyword[in] identifier[self] . identifier[_expectations] : keyword[if] keyword[not] identifier[exp] . identifier[closed] ( identifier[with_...
def unmet_expectations(self): """ Assert that all expectations on the stub have been met. """ unmet = [] for exp in self._expectations: if not exp.closed(with_counts=True): unmet.append(ExpectationNotSatisfied(exp)) # depends on [control=['if'], data=[]] # depends on [c...
def request(self, method, url, params=None, data=None, headers=None, auth=None, timeout=None, allow_redirects=False): """ Make a signed HTTP Request :param str method: The HTTP method to use :param str url: The URL to request :param dict params: Query parameters ...
def function[request, parameter[self, method, url, params, data, headers, auth, timeout, allow_redirects]]: constant[ Make a signed HTTP Request :param str method: The HTTP method to use :param str url: The URL to request :param dict params: Query parameters to append to the URL...
keyword[def] identifier[request] ( identifier[self] , identifier[method] , identifier[url] , identifier[params] = keyword[None] , identifier[data] = keyword[None] , identifier[headers] = keyword[None] , identifier[auth] = keyword[None] , identifier[timeout] = keyword[None] , identifier[allow_redirects] = keyword[Fal...
def request(self, method, url, params=None, data=None, headers=None, auth=None, timeout=None, allow_redirects=False): """ Make a signed HTTP Request :param str method: The HTTP method to use :param str url: The URL to request :param dict params: Query parameters to append to the URL...
def is_unitary(self, atol=None, rtol=None): """Return True if QuantumChannel is a unitary channel.""" try: op = self.to_operator() return op.is_unitary(atol=atol, rtol=rtol) except QiskitError: return False
def function[is_unitary, parameter[self, atol, rtol]]: constant[Return True if QuantumChannel is a unitary channel.] <ast.Try object at 0x7da1b03a5f90>
keyword[def] identifier[is_unitary] ( identifier[self] , identifier[atol] = keyword[None] , identifier[rtol] = keyword[None] ): literal[string] keyword[try] : identifier[op] = identifier[self] . identifier[to_operator] () keyword[return] identifier[op] . identifier[is_uni...
def is_unitary(self, atol=None, rtol=None): """Return True if QuantumChannel is a unitary channel.""" try: op = self.to_operator() return op.is_unitary(atol=atol, rtol=rtol) # depends on [control=['try'], data=[]] except QiskitError: return False # depends on [control=['except'], d...
def _members_changed( sender, instance, action, reverse, model, pk_set, **kwargs): """ Hook that executes whenever the group members are changed. """ if action == "post_add": if not reverse: group = instance for person in model.objects.filter(pk__in=pk_set): ...
def function[_members_changed, parameter[sender, instance, action, reverse, model, pk_set]]: constant[ Hook that executes whenever the group members are changed. ] if compare[name[action] equal[==] constant[post_add]] begin[:] if <ast.UnaryOp object at 0x7da18f721690> begin[:] ...
keyword[def] identifier[_members_changed] ( identifier[sender] , identifier[instance] , identifier[action] , identifier[reverse] , identifier[model] , identifier[pk_set] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[action] == literal[string] : keyword[if] keyword[not] ident...
def _members_changed(sender, instance, action, reverse, model, pk_set, **kwargs): """ Hook that executes whenever the group members are changed. """ if action == 'post_add': if not reverse: group = instance for person in model.objects.filter(pk__in=pk_set): ...
def _rnd_date(start, end): """Internal random date generator. """ return date.fromordinal(random.randint(start.toordinal(), end.toordinal()))
def function[_rnd_date, parameter[start, end]]: constant[Internal random date generator. ] return[call[name[date].fromordinal, parameter[call[name[random].randint, parameter[call[name[start].toordinal, parameter[]], call[name[end].toordinal, parameter[]]]]]]]
keyword[def] identifier[_rnd_date] ( identifier[start] , identifier[end] ): literal[string] keyword[return] identifier[date] . identifier[fromordinal] ( identifier[random] . identifier[randint] ( identifier[start] . identifier[toordinal] (), identifier[end] . identifier[toordinal] ()))
def _rnd_date(start, end): """Internal random date generator. """ return date.fromordinal(random.randint(start.toordinal(), end.toordinal()))
def set_data_filters(self, data_filter_set): """Sets the data filters (non indexed argument filters) Expects a set of tuples with the type and value, e.g.: (('uint256', [12345, 54321]), ('string', ('a-single-string',))) """ self.data_filter_set = data_filter_set if any(d...
def function[set_data_filters, parameter[self, data_filter_set]]: constant[Sets the data filters (non indexed argument filters) Expects a set of tuples with the type and value, e.g.: (('uint256', [12345, 54321]), ('string', ('a-single-string',))) ] name[self].data_filter_set ass...
keyword[def] identifier[set_data_filters] ( identifier[self] , identifier[data_filter_set] ): literal[string] identifier[self] . identifier[data_filter_set] = identifier[data_filter_set] keyword[if] identifier[any] ( identifier[data_filter_set] ): identifier[self] . identifi...
def set_data_filters(self, data_filter_set): """Sets the data filters (non indexed argument filters) Expects a set of tuples with the type and value, e.g.: (('uint256', [12345, 54321]), ('string', ('a-single-string',))) """ self.data_filter_set = data_filter_set if any(data_filter_s...
def get_compiler(compiler, **compiler_attrs): """get and customize a compiler""" if compiler is None or isinstance(compiler, str): cc = ccompiler.new_compiler(compiler=compiler, verbose=0) customize_compiler(cc) if cc.compiler_type == 'mingw32': customize_mingw(cc) else: ...
def function[get_compiler, parameter[compiler]]: constant[get and customize a compiler] if <ast.BoolOp object at 0x7da1b09ece80> begin[:] variable[cc] assign[=] call[name[ccompiler].new_compiler, parameter[]] call[name[customize_compiler], parameter[name[cc]]] ...
keyword[def] identifier[get_compiler] ( identifier[compiler] ,** identifier[compiler_attrs] ): literal[string] keyword[if] identifier[compiler] keyword[is] keyword[None] keyword[or] identifier[isinstance] ( identifier[compiler] , identifier[str] ): identifier[cc] = identifier[ccompiler] . ide...
def get_compiler(compiler, **compiler_attrs): """get and customize a compiler""" if compiler is None or isinstance(compiler, str): cc = ccompiler.new_compiler(compiler=compiler, verbose=0) customize_compiler(cc) if cc.compiler_type == 'mingw32': customize_mingw(cc) # depends...
def idle_connections(self): """Return a list of idle connections :rtype: list """ return [c for c in self.connections.values() if not c.busy and not c.closed]
def function[idle_connections, parameter[self]]: constant[Return a list of idle connections :rtype: list ] return[<ast.ListComp object at 0x7da204346f50>]
keyword[def] identifier[idle_connections] ( identifier[self] ): literal[string] keyword[return] [ identifier[c] keyword[for] identifier[c] keyword[in] identifier[self] . identifier[connections] . identifier[values] () keyword[if] keyword[not] identifier[c] . identifier[busy] keyword...
def idle_connections(self): """Return a list of idle connections :rtype: list """ return [c for c in self.connections.values() if not c.busy and (not c.closed)]
def register_views(*args): """ Registration view for each resource from config. """ config = args[0] settings = config.get_settings() pages_config = settings[CONFIG_MODELS] resources = resources_of_config(pages_config) for resource in resources: if hasattr(resource, '__table__')\ ...
def function[register_views, parameter[]]: constant[ Registration view for each resource from config. ] variable[config] assign[=] call[name[args]][constant[0]] variable[settings] assign[=] call[name[config].get_settings, parameter[]] variable[pages_config] assign[=] call[name[settin...
keyword[def] identifier[register_views] (* identifier[args] ): literal[string] identifier[config] = identifier[args] [ literal[int] ] identifier[settings] = identifier[config] . identifier[get_settings] () identifier[pages_config] = identifier[settings] [ identifier[CONFIG_MODELS] ] identifi...
def register_views(*args): """ Registration view for each resource from config. """ config = args[0] settings = config.get_settings() pages_config = settings[CONFIG_MODELS] resources = resources_of_config(pages_config) for resource in resources: if hasattr(resource, '__table__') and ...
def generate_wavelengths(minwave=500, maxwave=26000, num=10000, delta=None, log=True, wave_unit=u.AA): """Generate wavelength array to be used for spectrum sampling. .. math:: minwave \\le \\lambda < maxwave Parameters ---------- minwave, maxwave : float L...
def function[generate_wavelengths, parameter[minwave, maxwave, num, delta, log, wave_unit]]: constant[Generate wavelength array to be used for spectrum sampling. .. math:: minwave \le \lambda < maxwave Parameters ---------- minwave, maxwave : float Lower and upper limits of th...
keyword[def] identifier[generate_wavelengths] ( identifier[minwave] = literal[int] , identifier[maxwave] = literal[int] , identifier[num] = literal[int] , identifier[delta] = keyword[None] , identifier[log] = keyword[True] , identifier[wave_unit] = identifier[u] . identifier[AA] ): literal[string] identif...
def generate_wavelengths(minwave=500, maxwave=26000, num=10000, delta=None, log=True, wave_unit=u.AA): """Generate wavelength array to be used for spectrum sampling. .. math:: minwave \\le \\lambda < maxwave Parameters ---------- minwave, maxwave : float Lower and upper limits of ...
def ZIP(inputs, use_longest_length=None, defaults=None): """ Transposes an array of input arrays so that the first element of the output array would be an array containing, the first element of the first input array, the first element of the second input array, etc. See https://docs.mongodb.com/manu...
def function[ZIP, parameter[inputs, use_longest_length, defaults]]: constant[ Transposes an array of input arrays so that the first element of the output array would be an array containing, the first element of the first input array, the first element of the second input array, etc. See https://...
keyword[def] identifier[ZIP] ( identifier[inputs] , identifier[use_longest_length] = keyword[None] , identifier[defaults] = keyword[None] ): literal[string] identifier[res] ={ literal[string] : identifier[inputs] } keyword[if] identifier[use_longest_length] keyword[in] [ keyword[True] , keyword[Fals...
def ZIP(inputs, use_longest_length=None, defaults=None): """ Transposes an array of input arrays so that the first element of the output array would be an array containing, the first element of the first input array, the first element of the second input array, etc. See https://docs.mongodb.com/manu...
def shutdown_kernel(self): """Shutdown the kernel of the client.""" kernel_id = self.get_kernel_id() if kernel_id: delete_url = self.add_token(url_path_join(self.server_url, 'api/kernels/', ...
def function[shutdown_kernel, parameter[self]]: constant[Shutdown the kernel of the client.] variable[kernel_id] assign[=] call[name[self].get_kernel_id, parameter[]] if name[kernel_id] begin[:] variable[delete_url] assign[=] call[name[self].add_token, parameter[call[name[url_pat...
keyword[def] identifier[shutdown_kernel] ( identifier[self] ): literal[string] identifier[kernel_id] = identifier[self] . identifier[get_kernel_id] () keyword[if] identifier[kernel_id] : identifier[delete_url] = identifier[self] . identifier[add_token] ( identifier[url_path_...
def shutdown_kernel(self): """Shutdown the kernel of the client.""" kernel_id = self.get_kernel_id() if kernel_id: delete_url = self.add_token(url_path_join(self.server_url, 'api/kernels/', kernel_id)) delete_req = requests.delete(delete_url) if delete_req.status_code != 204: ...
def power(self): """:return: A power object modeled as a named tuple""" power = self._state['powerUsage'] return PowerUsage(power.get('avgDayValue'), power.get('avgValue'), power.get('dayCost'), power.get('dayUsage'), ...
def function[power, parameter[self]]: constant[:return: A power object modeled as a named tuple] variable[power] assign[=] call[name[self]._state][constant[powerUsage]] return[call[name[PowerUsage], parameter[call[name[power].get, parameter[constant[avgDayValue]]], call[name[power].get, parameter[co...
keyword[def] identifier[power] ( identifier[self] ): literal[string] identifier[power] = identifier[self] . identifier[_state] [ literal[string] ] keyword[return] identifier[PowerUsage] ( identifier[power] . identifier[get] ( literal[string] ), identifier[power] . identifier[get]...
def power(self): """:return: A power object modeled as a named tuple""" power = self._state['powerUsage'] return PowerUsage(power.get('avgDayValue'), power.get('avgValue'), power.get('dayCost'), power.get('dayUsage'), power.get('isSmart'), power.get('meterReading'), power.get('value'), power.get('meterReadi...
def tojson(self) -> str: """Serialize an Event into JSON. Returns ------- str JSON-serialized Event. """ return json.dumps({ 'event_id': str(self.id), 'event_type': self.type, 'schema_name': self.schema_name, '...
def function[tojson, parameter[self]]: constant[Serialize an Event into JSON. Returns ------- str JSON-serialized Event. ] return[call[name[json].dumps, parameter[dictionary[[<ast.Constant object at 0x7da18bc71270>, <ast.Constant object at 0x7da18bc73520>, <ast....
keyword[def] identifier[tojson] ( identifier[self] )-> identifier[str] : literal[string] keyword[return] identifier[json] . identifier[dumps] ({ literal[string] : identifier[str] ( identifier[self] . identifier[id] ), literal[string] : identifier[self] . identifier[type] , ...
def tojson(self) -> str: """Serialize an Event into JSON. Returns ------- str JSON-serialized Event. """ return json.dumps({'event_id': str(self.id), 'event_type': self.type, 'schema_name': self.schema_name, 'table_name': self.table_name, 'row_id': self.row_id})
async def finish_pairing(self, pin): """Finish pairing process.""" self.srp.step1(pin) pub_key, proof = self.srp.step2(self._atv_pub_key, self._atv_salt) msg = messages.crypto_pairing({ tlv8.TLV_SEQ_NO: b'\x03', tlv8.TLV_PUBLIC_KEY: pub_key, tlv8.TLV...
<ast.AsyncFunctionDef object at 0x7da18f7235e0>
keyword[async] keyword[def] identifier[finish_pairing] ( identifier[self] , identifier[pin] ): literal[string] identifier[self] . identifier[srp] . identifier[step1] ( identifier[pin] ) identifier[pub_key] , identifier[proof] = identifier[self] . identifier[srp] . identifier[step2] ( ide...
async def finish_pairing(self, pin): """Finish pairing process.""" self.srp.step1(pin) (pub_key, proof) = self.srp.step2(self._atv_pub_key, self._atv_salt) msg = messages.crypto_pairing({tlv8.TLV_SEQ_NO: b'\x03', tlv8.TLV_PUBLIC_KEY: pub_key, tlv8.TLV_PROOF: proof}) resp = await self.protocol.send_a...
def main(): """ Parse command line argument and output appropriate file type (csv or JSON) """ parser = ArgumentParser() parser.add_argument( "-c", "--clinvarfile", dest="clinvarfile", help="ClinVar VCF file (either this or -C must be specified)", metavar="CLINVARFILE") ...
def function[main, parameter[]]: constant[ Parse command line argument and output appropriate file type (csv or JSON) ] variable[parser] assign[=] call[name[ArgumentParser], parameter[]] call[name[parser].add_argument, parameter[constant[-c], constant[--clinvarfile]]] call[na...
keyword[def] identifier[main] (): literal[string] identifier[parser] = identifier[ArgumentParser] () identifier[parser] . identifier[add_argument] ( literal[string] , literal[string] , identifier[dest] = literal[string] , identifier[help] = literal[string] , identifier[metavar] = liter...
def main(): """ Parse command line argument and output appropriate file type (csv or JSON) """ parser = ArgumentParser() parser.add_argument('-c', '--clinvarfile', dest='clinvarfile', help='ClinVar VCF file (either this or -C must be specified)', metavar='CLINVARFILE') parser.add_argument('-...
def _apply_outputter(self, func, mod): ''' Apply the __outputter__ variable to the functions ''' if hasattr(mod, '__outputter__'): outp = mod.__outputter__ if func.__name__ in outp: func.__outputter__ = outp[func.__name__]
def function[_apply_outputter, parameter[self, func, mod]]: constant[ Apply the __outputter__ variable to the functions ] if call[name[hasattr], parameter[name[mod], constant[__outputter__]]] begin[:] variable[outp] assign[=] name[mod].__outputter__ if com...
keyword[def] identifier[_apply_outputter] ( identifier[self] , identifier[func] , identifier[mod] ): literal[string] keyword[if] identifier[hasattr] ( identifier[mod] , literal[string] ): identifier[outp] = identifier[mod] . identifier[__outputter__] keyword[if] identif...
def _apply_outputter(self, func, mod): """ Apply the __outputter__ variable to the functions """ if hasattr(mod, '__outputter__'): outp = mod.__outputter__ if func.__name__ in outp: func.__outputter__ = outp[func.__name__] # depends on [control=['if'], data=['outp']]...
def transform(self, X): ''' Transforms the time series data based on the provided function. Note this transformation must not change the number of samples in the data. Parameters ---------- X : array-like, shape [n_samples, ...] time series data and (optional...
def function[transform, parameter[self, X]]: constant[ Transforms the time series data based on the provided function. Note this transformation must not change the number of samples in the data. Parameters ---------- X : array-like, shape [n_samples, ...] tim...
keyword[def] identifier[transform] ( identifier[self] , identifier[X] ): literal[string] keyword[if] identifier[self] . identifier[func] keyword[is] keyword[None] : keyword[return] identifier[X] keyword[else] : identifier[Xt] , identifier[Xc] = identifier[get...
def transform(self, X): """ Transforms the time series data based on the provided function. Note this transformation must not change the number of samples in the data. Parameters ---------- X : array-like, shape [n_samples, ...] time series data and (optionally) ...
def channel_shift_multi(x, intensity, is_random=False, channel_index=2): """Shift the channels of images with the same arguments, randomly or non-randomly, see `numpy.rollaxis <https://docs.scipy.org/doc/numpy/reference/generated/numpy.rollaxis.html>`__. Usually be used for image segmentation which x=[X, Y], X ...
def function[channel_shift_multi, parameter[x, intensity, is_random, channel_index]]: constant[Shift the channels of images with the same arguments, randomly or non-randomly, see `numpy.rollaxis <https://docs.scipy.org/doc/numpy/reference/generated/numpy.rollaxis.html>`__. Usually be used for image segmenta...
keyword[def] identifier[channel_shift_multi] ( identifier[x] , identifier[intensity] , identifier[is_random] = keyword[False] , identifier[channel_index] = literal[int] ): literal[string] keyword[if] identifier[is_random] : identifier[factor] = identifier[np] . identifier[random] . identifier[uni...
def channel_shift_multi(x, intensity, is_random=False, channel_index=2): """Shift the channels of images with the same arguments, randomly or non-randomly, see `numpy.rollaxis <https://docs.scipy.org/doc/numpy/reference/generated/numpy.rollaxis.html>`__. Usually be used for image segmentation which x=[X, Y], X ...
def _evaluate_expression(self, expr): """Evaluate an :class:`.Expression` using :meth:`_get_value`.""" def cast_value(v): # Convert Decimal to Fraction to allow successful multiplication # by either float (most solvers) or Fraction (exact solver). # Multiplying Fracti...
def function[_evaluate_expression, parameter[self, expr]]: constant[Evaluate an :class:`.Expression` using :meth:`_get_value`.] def function[cast_value, parameter[v]]: if call[name[isinstance], parameter[name[v], name[Decimal]]] begin[:] return[call[name[Fraction], parameter[...
keyword[def] identifier[_evaluate_expression] ( identifier[self] , identifier[expr] ): literal[string] keyword[def] identifier[cast_value] ( identifier[v] ): keyword[if] identifier[isinstance] ( identifier[v] , identifier[Decimal] ): ...
def _evaluate_expression(self, expr): """Evaluate an :class:`.Expression` using :meth:`_get_value`.""" def cast_value(v): # Convert Decimal to Fraction to allow successful multiplication # by either float (most solvers) or Fraction (exact solver). # Multiplying Fraction and float result...
def __tokenize(self,string): """Split s into tokens and update the token buffer. __tokenize(string) New tokens are appended to the token buffer, discarding white space. Based on http://effbot.org/zone/xml-scanner.htm """ for m in self.dx_regex.finditer(string.strip()):...
def function[__tokenize, parameter[self, string]]: constant[Split s into tokens and update the token buffer. __tokenize(string) New tokens are appended to the token buffer, discarding white space. Based on http://effbot.org/zone/xml-scanner.htm ] for taget[name[m]] in ...
keyword[def] identifier[__tokenize] ( identifier[self] , identifier[string] ): literal[string] keyword[for] identifier[m] keyword[in] identifier[self] . identifier[dx_regex] . identifier[finditer] ( identifier[string] . identifier[strip] ()): identifier[code] = identifier[m] . ident...
def __tokenize(self, string): """Split s into tokens and update the token buffer. __tokenize(string) New tokens are appended to the token buffer, discarding white space. Based on http://effbot.org/zone/xml-scanner.htm """ for m in self.dx_regex.finditer(string.strip()): ...
def compute_similarity(a, b, margin=1.0, cutoff=10.0): """Compute the similarity between two molecules based on their descriptors Arguments: a -- the similarity measure of the first molecule b -- the similarity measure of the second molecule margin -- the sensitivity when co...
def function[compute_similarity, parameter[a, b, margin, cutoff]]: constant[Compute the similarity between two molecules based on their descriptors Arguments: a -- the similarity measure of the first molecule b -- the similarity measure of the second molecule margin -- t...
keyword[def] identifier[compute_similarity] ( identifier[a] , identifier[b] , identifier[margin] = literal[int] , identifier[cutoff] = literal[int] ): literal[string] keyword[return] identifier[similarity_measure] ( identifier[a] . identifier[table_labels] , identifier[a] . identifier[table_distances...
def compute_similarity(a, b, margin=1.0, cutoff=10.0): """Compute the similarity between two molecules based on their descriptors Arguments: a -- the similarity measure of the first molecule b -- the similarity measure of the second molecule margin -- the sensitivity when co...
def verify_data_signature(self, signature_url, data_url, data): """ Verify data against it's remote signature :type signature_url: str :param signature_url: remote path to signature for data_url :type data_url: str :param data_url: url from which data was fetched ...
def function[verify_data_signature, parameter[self, signature_url, data_url, data]]: constant[ Verify data against it's remote signature :type signature_url: str :param signature_url: remote path to signature for data_url :type data_url: str :param data_url: url from whi...
keyword[def] identifier[verify_data_signature] ( identifier[self] , identifier[signature_url] , identifier[data_url] , identifier[data] ): literal[string] identifier[req] = identifier[requests] . identifier[get] ( identifier[signature_url] ) keyword[if] identifier[req] . identifier[statu...
def verify_data_signature(self, signature_url, data_url, data): """ Verify data against it's remote signature :type signature_url: str :param signature_url: remote path to signature for data_url :type data_url: str :param data_url: url from which data was fetched :ty...
def _GetTripSequence(self, schedule=None): """Return a list of (trip, stop_sequence) for all trips visiting this stop. A trip may be in the list multiple times with different index. stop_sequence is an integer. Args: schedule: Deprecated, do not use. """ if schedule is None: schedu...
def function[_GetTripSequence, parameter[self, schedule]]: constant[Return a list of (trip, stop_sequence) for all trips visiting this stop. A trip may be in the list multiple times with different index. stop_sequence is an integer. Args: schedule: Deprecated, do not use. ] if co...
keyword[def] identifier[_GetTripSequence] ( identifier[self] , identifier[schedule] = keyword[None] ): literal[string] keyword[if] identifier[schedule] keyword[is] keyword[None] : identifier[schedule] = identifier[getattr] ( identifier[self] , literal[string] , keyword[None] ) keyword[if] i...
def _GetTripSequence(self, schedule=None): """Return a list of (trip, stop_sequence) for all trips visiting this stop. A trip may be in the list multiple times with different index. stop_sequence is an integer. Args: schedule: Deprecated, do not use. """ if schedule is None: sche...
def register_app_activity(): """ Create watchers for models defined in settings.py. Once created, they will be passed over Activity.objects.follow_model(), which lives in managers.py """ from django.conf import settings from django.contrib.contenttypes.models import ContentType from .mo...
def function[register_app_activity, parameter[]]: constant[ Create watchers for models defined in settings.py. Once created, they will be passed over Activity.objects.follow_model(), which lives in managers.py ] from relative_module[django.conf] import module[settings] from relative_modu...
keyword[def] identifier[register_app_activity] (): literal[string] keyword[from] identifier[django] . identifier[conf] keyword[import] identifier[settings] keyword[from] identifier[django] . identifier[contrib] . identifier[contenttypes] . identifier[models] keyword[import] identifier[ContentTy...
def register_app_activity(): """ Create watchers for models defined in settings.py. Once created, they will be passed over Activity.objects.follow_model(), which lives in managers.py """ from django.conf import settings from django.contrib.contenttypes.models import ContentType from .mod...
def add_columns(self, model, **fields): """Create new fields.""" for name, field in fields.items(): model._meta.add_field(name, field) self.ops.append(self.migrator.add_column( model._meta.table_name, field.column_name, field)) if field.unique: ...
def function[add_columns, parameter[self, model]]: constant[Create new fields.] for taget[tuple[[<ast.Name object at 0x7da20e9620e0>, <ast.Name object at 0x7da20e960ac0>]]] in starred[call[name[fields].items, parameter[]]] begin[:] call[name[model]._meta.add_field, parameter[name[name], ...
keyword[def] identifier[add_columns] ( identifier[self] , identifier[model] ,** identifier[fields] ): literal[string] keyword[for] identifier[name] , identifier[field] keyword[in] identifier[fields] . identifier[items] (): identifier[model] . identifier[_meta] . identifier[add_field...
def add_columns(self, model, **fields): """Create new fields.""" for (name, field) in fields.items(): model._meta.add_field(name, field) self.ops.append(self.migrator.add_column(model._meta.table_name, field.column_name, field)) if field.unique: self.ops.append(self.migrator....
def create(cls, tx_signers, recipients, metadata=None, asset=None): """A simple way to generate a `CREATE` transaction. Note: This method currently supports the following Cryptoconditions use cases: - Ed25519 - ThresholdSha256 ...
def function[create, parameter[cls, tx_signers, recipients, metadata, asset]]: constant[A simple way to generate a `CREATE` transaction. Note: This method currently supports the following Cryptoconditions use cases: - Ed25519 -...
keyword[def] identifier[create] ( identifier[cls] , identifier[tx_signers] , identifier[recipients] , identifier[metadata] = keyword[None] , identifier[asset] = keyword[None] ): literal[string] ( identifier[inputs] , identifier[outputs] )= identifier[cls] . identifier[validate_create] ( identifier[...
def create(cls, tx_signers, recipients, metadata=None, asset=None): """A simple way to generate a `CREATE` transaction. Note: This method currently supports the following Cryptoconditions use cases: - Ed25519 - ThresholdSha256 ...
def add(cls, model, commit=True): """Adds a model instance to session and commits the transaction. Args: model: The instance to add. Examples: >>> customer = Customer.new(name="hari", email="hari@gmail.com") >>> Customer.add(customer) ...
def function[add, parameter[cls, model, commit]]: constant[Adds a model instance to session and commits the transaction. Args: model: The instance to add. Examples: >>> customer = Customer.new(name="hari", email="hari@gmail.com") >>> Customer.add(...
keyword[def] identifier[add] ( identifier[cls] , identifier[model] , identifier[commit] = keyword[True] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[model] , identifier[cls] ): keyword[raise] identifier[ValueError] ( literal[string] %( identifier[m...
def add(cls, model, commit=True): """Adds a model instance to session and commits the transaction. Args: model: The instance to add. Examples: >>> customer = Customer.new(name="hari", email="hari@gmail.com") >>> Customer.add(customer) hari...
def covariance_matrix(self, data, background_rms=1, exposure_map=1, noise_map=None, verbose=False): """ returns a diagonal matrix for the covariance estimation which describes the error Notes: - the exposure map must be positive definite. Values that deviate too much from the mean expo...
def function[covariance_matrix, parameter[self, data, background_rms, exposure_map, noise_map, verbose]]: constant[ returns a diagonal matrix for the covariance estimation which describes the error Notes: - the exposure map must be positive definite. Values that deviate too much from t...
keyword[def] identifier[covariance_matrix] ( identifier[self] , identifier[data] , identifier[background_rms] = literal[int] , identifier[exposure_map] = literal[int] , identifier[noise_map] = keyword[None] , identifier[verbose] = keyword[False] ): literal[string] keyword[if] identifier[noise_map]...
def covariance_matrix(self, data, background_rms=1, exposure_map=1, noise_map=None, verbose=False): """ returns a diagonal matrix for the covariance estimation which describes the error Notes: - the exposure map must be positive definite. Values that deviate too much from the mean exposure...
def using_env(self, env, clean=True, silent=True, filename=None): """ This context manager allows the contextual use of a different env Example of settings.toml:: [development] message = 'This is in dev' [other] message = 'this is in other env' ...
def function[using_env, parameter[self, env, clean, silent, filename]]: constant[ This context manager allows the contextual use of a different env Example of settings.toml:: [development] message = 'This is in dev' [other] message = 'this is in o...
keyword[def] identifier[using_env] ( identifier[self] , identifier[env] , identifier[clean] = keyword[True] , identifier[silent] = keyword[True] , identifier[filename] = keyword[None] ): literal[string] keyword[try] : identifier[self] . identifier[setenv] ( identifier[env] , identifier...
def using_env(self, env, clean=True, silent=True, filename=None): """ This context manager allows the contextual use of a different env Example of settings.toml:: [development] message = 'This is in dev' [other] message = 'this is in other env' ...
def parse_params(args): """ Parse the params file args, create and return Assembly object.""" ## check that params.txt file is correctly formatted. try: with open(args.params) as paramsin: plines = paramsin.readlines() except IOError as _: sys.exit(" No params file found") ...
def function[parse_params, parameter[args]]: constant[ Parse the params file args, create and return Assembly object.] <ast.Try object at 0x7da18eb57a60> variable[legacy_version] assign[=] constant[0] <ast.Try object at 0x7da18eb56f50> if name[legacy_version] begin[:] pass ...
keyword[def] identifier[parse_params] ( identifier[args] ): literal[string] keyword[try] : keyword[with] identifier[open] ( identifier[args] . identifier[params] ) keyword[as] identifier[paramsin] : identifier[plines] = identifier[paramsin] . identifier[readlines] () keyw...
def parse_params(args): """ Parse the params file args, create and return Assembly object.""" ## check that params.txt file is correctly formatted. try: with open(args.params) as paramsin: plines = paramsin.readlines() # depends on [control=['with'], data=['paramsin']] # depends on [co...
def _setup_bonds(self): """Derive Bond objects from the record.""" self._bonds = {} if 'bonds' not in self.record: return # Create bonds aid1s = self.record['bonds']['aid1'] aid2s = self.record['bonds']['aid2'] orders = self.record['bonds']['order'] ...
def function[_setup_bonds, parameter[self]]: constant[Derive Bond objects from the record.] name[self]._bonds assign[=] dictionary[[], []] if compare[constant[bonds] <ast.NotIn object at 0x7da2590d7190> name[self].record] begin[:] return[None] variable[aid1s] assign[=] call[call[...
keyword[def] identifier[_setup_bonds] ( identifier[self] ): literal[string] identifier[self] . identifier[_bonds] ={} keyword[if] literal[string] keyword[not] keyword[in] identifier[self] . identifier[record] : keyword[return] identifier[aid1s] = ide...
def _setup_bonds(self): """Derive Bond objects from the record.""" self._bonds = {} if 'bonds' not in self.record: return # depends on [control=['if'], data=[]] # Create bonds aid1s = self.record['bonds']['aid1'] aid2s = self.record['bonds']['aid2'] orders = self.record['bonds']['or...
def _snat_subnet_for_ext_net(self, context, subnet, net): """Determine if an SNAT subnet is for this external network. This method determines if a given SNAT subnet is intended for the passed external network. For APIC ML2/Neutron workflow, SNAT subnets are created on a separat...
def function[_snat_subnet_for_ext_net, parameter[self, context, subnet, net]]: constant[Determine if an SNAT subnet is for this external network. This method determines if a given SNAT subnet is intended for the passed external network. For APIC ML2/Neutron workflow, SNAT subnets are c...
keyword[def] identifier[_snat_subnet_for_ext_net] ( identifier[self] , identifier[context] , identifier[subnet] , identifier[net] ): literal[string] keyword[if] identifier[subnet] [ literal[string] ]== identifier[net] [ literal[string] ]: keyword[return] keyword[True] iden...
def _snat_subnet_for_ext_net(self, context, subnet, net): """Determine if an SNAT subnet is for this external network. This method determines if a given SNAT subnet is intended for the passed external network. For APIC ML2/Neutron workflow, SNAT subnets are created on a separate ne...
def calcELAxi(R,vR,vT,pot,vc=1.,ro=1.): """ NAME: calcELAxi PURPOSE: calculate the energy and angular momentum INPUT: R - Galactocentric radius (/ro) vR - radial part of the velocity (/vc) vT - azimuthal part of the velocity (/vc) vc - circular velocity r...
def function[calcELAxi, parameter[R, vR, vT, pot, vc, ro]]: constant[ NAME: calcELAxi PURPOSE: calculate the energy and angular momentum INPUT: R - Galactocentric radius (/ro) vR - radial part of the velocity (/vc) vT - azimuthal part of the velocity (/vc) v...
keyword[def] identifier[calcELAxi] ( identifier[R] , identifier[vR] , identifier[vT] , identifier[pot] , identifier[vc] = literal[int] , identifier[ro] = literal[int] ): literal[string] keyword[return] ( identifier[potentialAxi] ( identifier[R] , identifier[pot] )+ identifier[vR] ** literal[int] / literal[...
def calcELAxi(R, vR, vT, pot, vc=1.0, ro=1.0): """ NAME: calcELAxi PURPOSE: calculate the energy and angular momentum INPUT: R - Galactocentric radius (/ro) vR - radial part of the velocity (/vc) vT - azimuthal part of the velocity (/vc) vc - circular velocity ...
def pseudo_cqt(y, sr=22050, hop_length=512, fmin=None, n_bins=84, bins_per_octave=12, tuning=0.0, filter_scale=1, norm=1, sparsity=0.01, window='hann', scale=True, pad_mode='reflect'): '''Compute the pseudo constant-Q transform of an audio signal. This uses a single...
def function[pseudo_cqt, parameter[y, sr, hop_length, fmin, n_bins, bins_per_octave, tuning, filter_scale, norm, sparsity, window, scale, pad_mode]]: constant[Compute the pseudo constant-Q transform of an audio signal. This uses a single fft size that is the smallest power of 2 that is greater than or ...
keyword[def] identifier[pseudo_cqt] ( identifier[y] , identifier[sr] = literal[int] , identifier[hop_length] = literal[int] , identifier[fmin] = keyword[None] , identifier[n_bins] = literal[int] , identifier[bins_per_octave] = literal[int] , identifier[tuning] = literal[int] , identifier[filter_scale] = literal[int]...
def pseudo_cqt(y, sr=22050, hop_length=512, fmin=None, n_bins=84, bins_per_octave=12, tuning=0.0, filter_scale=1, norm=1, sparsity=0.01, window='hann', scale=True, pad_mode='reflect'): """Compute the pseudo constant-Q transform of an audio signal. This uses a single fft size that is the smallest power of 2 tha...
def tree(self, in_tree): ''' assigns a tree to the internal self._tree variable. The tree is either loaded from file (if in_tree is str) or assigned (if in_tree is a Phylo.tree) ''' from os.path import isfile if isinstance(in_tree, Phylo.BaseTree.Tree): self....
def function[tree, parameter[self, in_tree]]: constant[ assigns a tree to the internal self._tree variable. The tree is either loaded from file (if in_tree is str) or assigned (if in_tree is a Phylo.tree) ] from relative_module[os.path] import module[isfile] if call[name[isin...
keyword[def] identifier[tree] ( identifier[self] , identifier[in_tree] ): literal[string] keyword[from] identifier[os] . identifier[path] keyword[import] identifier[isfile] keyword[if] identifier[isinstance] ( identifier[in_tree] , identifier[Phylo] . identifier[BaseTree] . identifie...
def tree(self, in_tree): """ assigns a tree to the internal self._tree variable. The tree is either loaded from file (if in_tree is str) or assigned (if in_tree is a Phylo.tree) """ from os.path import isfile if isinstance(in_tree, Phylo.BaseTree.Tree): self._tree = in_tree ...
def empty(shape, ctx=None, dtype=None, stype=None): """Returns a new array of given shape and type, without initializing entries. Parameters ---------- shape : int or tuple of int The shape of the empty array. ctx : Context, optional An optional device context (default is the curren...
def function[empty, parameter[shape, ctx, dtype, stype]]: constant[Returns a new array of given shape and type, without initializing entries. Parameters ---------- shape : int or tuple of int The shape of the empty array. ctx : Context, optional An optional device context (defau...
keyword[def] identifier[empty] ( identifier[shape] , identifier[ctx] = keyword[None] , identifier[dtype] = keyword[None] , identifier[stype] = keyword[None] ): literal[string] keyword[if] identifier[stype] keyword[is] keyword[None] keyword[or] identifier[stype] == literal[string] : keyword[re...
def empty(shape, ctx=None, dtype=None, stype=None): """Returns a new array of given shape and type, without initializing entries. Parameters ---------- shape : int or tuple of int The shape of the empty array. ctx : Context, optional An optional device context (default is the curren...
def send_course_enrollment_statement(lrs_configuration, course_enrollment): """ Send xAPI statement for course enrollment. Arguments: lrs_configuration (XAPILRSConfiguration): XAPILRSConfiguration instance where to send statements. course_enrollment (CourseEnrollment): Course enrollment o...
def function[send_course_enrollment_statement, parameter[lrs_configuration, course_enrollment]]: constant[ Send xAPI statement for course enrollment. Arguments: lrs_configuration (XAPILRSConfiguration): XAPILRSConfiguration instance where to send statements. course_enrollment (CourseE...
keyword[def] identifier[send_course_enrollment_statement] ( identifier[lrs_configuration] , identifier[course_enrollment] ): literal[string] identifier[user_details] = identifier[LearnerInfoSerializer] ( identifier[course_enrollment] . identifier[user] ) identifier[course_details] = identifier[CourseI...
def send_course_enrollment_statement(lrs_configuration, course_enrollment): """ Send xAPI statement for course enrollment. Arguments: lrs_configuration (XAPILRSConfiguration): XAPILRSConfiguration instance where to send statements. course_enrollment (CourseEnrollment): Course enrollment o...
def get_opus_maximum_of(self, author_cts_urn): """Return the author's opux maximum (None otherwise). Given the CTS URN of an author, this method returns its opus maximum. If not available returns None. :param author_cts_urn: the author's CTS URN. :return: an instance of `surfex...
def function[get_opus_maximum_of, parameter[self, author_cts_urn]]: constant[Return the author's opux maximum (None otherwise). Given the CTS URN of an author, this method returns its opus maximum. If not available returns None. :param author_cts_urn: the author's CTS URN. :ret...
keyword[def] identifier[get_opus_maximum_of] ( identifier[self] , identifier[author_cts_urn] ): literal[string] identifier[author] = identifier[self] . identifier[get_resource_by_urn] ( identifier[author_cts_urn] ) keyword[assert] identifier[author] keyword[is] keyword[not] keyword[Non...
def get_opus_maximum_of(self, author_cts_urn): """Return the author's opux maximum (None otherwise). Given the CTS URN of an author, this method returns its opus maximum. If not available returns None. :param author_cts_urn: the author's CTS URN. :return: an instance of `surfext.Hu...
def print_callback(val): """ Internal function. This function is called via a call back returning from IPC to Cython to Python. It tries to perform incremental printing to IPython Notebook or Jupyter Notebook and when all else fails, just prints locally. """ success = False try: ...
def function[print_callback, parameter[val]]: constant[ Internal function. This function is called via a call back returning from IPC to Cython to Python. It tries to perform incremental printing to IPython Notebook or Jupyter Notebook and when all else fails, just prints locally. ] ...
keyword[def] identifier[print_callback] ( identifier[val] ): literal[string] identifier[success] = keyword[False] keyword[try] : keyword[if] identifier[have_ipython] : keyword[if] identifier[InteractiveShell] . identifier[initialized] (): identi...
def print_callback(val): """ Internal function. This function is called via a call back returning from IPC to Cython to Python. It tries to perform incremental printing to IPython Notebook or Jupyter Notebook and when all else fails, just prints locally. """ success = False try: ...
def disarm(self, wait=True, timeout=None): '''Disarm the vehicle. If wait is True, wait for disarm operation to complete before returning. If timeout is nonzero, raise a TimeouTerror if the vehicle has not disarmed after timeout seconds. ''' self.armed = False ...
def function[disarm, parameter[self, wait, timeout]]: constant[Disarm the vehicle. If wait is True, wait for disarm operation to complete before returning. If timeout is nonzero, raise a TimeouTerror if the vehicle has not disarmed after timeout seconds. ] name[self].ar...
keyword[def] identifier[disarm] ( identifier[self] , identifier[wait] = keyword[True] , identifier[timeout] = keyword[None] ): literal[string] identifier[self] . identifier[armed] = keyword[False] keyword[if] identifier[wait] : identifier[self] . identifier[wait_for] ( keyw...
def disarm(self, wait=True, timeout=None): """Disarm the vehicle. If wait is True, wait for disarm operation to complete before returning. If timeout is nonzero, raise a TimeouTerror if the vehicle has not disarmed after timeout seconds. """ self.armed = False if wait: ...
def get_product(self, standard, key): """ 查询商品信息 详情请参考 http://mp.weixin.qq.com/wiki/15/7fa787701295b884410b5163e13313af.html :param standard: 商品编码标准 :param key: 商品编码内容 :return: 返回的 JSON 数据包 """ data = { 'keystandard': standard, ...
def function[get_product, parameter[self, standard, key]]: constant[ 查询商品信息 详情请参考 http://mp.weixin.qq.com/wiki/15/7fa787701295b884410b5163e13313af.html :param standard: 商品编码标准 :param key: 商品编码内容 :return: 返回的 JSON 数据包 ] variable[data] assign[=] di...
keyword[def] identifier[get_product] ( identifier[self] , identifier[standard] , identifier[key] ): literal[string] identifier[data] ={ literal[string] : identifier[standard] , literal[string] : identifier[key] , } keyword[return] identifier[self] . identifier[_p...
def get_product(self, standard, key): """ 查询商品信息 详情请参考 http://mp.weixin.qq.com/wiki/15/7fa787701295b884410b5163e13313af.html :param standard: 商品编码标准 :param key: 商品编码内容 :return: 返回的 JSON 数据包 """ data = {'keystandard': standard, 'keystr': key} return s...