text
stringlengths
78
104k
score
float64
0
0.18
def galcenrect_to_vxvyvz(vXg,vYg,vZg,vsun=[0.,1.,0.],Xsun=1.,Zsun=0., _extra_rot=True): """ NAME: galcenrect_to_vxvyvz PURPOSE: transform rectangular Galactocentric coordinates to XYZ coordinates (wrt Sun) for velocities INPUT: vXg - Galactocentric x-ve...
0.020632
def _import_genos_from_oedb(network): """Import generator data from the Open Energy Database (OEDB). The importer uses SQLAlchemy ORM objects. These are defined in ego.io, see https://github.com/openego/ego.io/tree/dev/egoio/db_tables Parameters ---------- network: :class:`~.grid.network.N...
0.002985
def daemon_connection_init(self, s_link, set_wait_new_conf=False): """Initialize a connection with the daemon for the provided satellite link Initialize the connection (HTTP client) to the daemon and get its running identifier. Returns True if it succeeds else if any error occur or the daemon i...
0.006321
def _get_daily_message(self, dt, algo, metrics_tracker): """ Get a perf message for the given datetime. """ perf_message = metrics_tracker.handle_market_close( dt, self.data_portal, ) perf_message['daily_perf']['recorded_vars'] = algo.recorded_vars...
0.005747
def _connect_uncached(self): ''' activates the connection object ''' if not HAVE_PARAMIKO: raise errors.AnsibleError("paramiko is not installed") user = self.runner.remote_user vvv("ESTABLISH CONNECTION FOR USER: %s on PORT %s TO %s" % (user, self.port, self.host), host=se...
0.008806
def workflow_aggregate(graph: BELGraph, node: BaseEntity, key: Optional[str] = None, tag: Optional[str] = None, default_score: Optional[float] = None, runs: Optional[int] = None, agg...
0.005461
def start_step(self, step_name): """ Start a step. """ if self.finished is not None: raise AlreadyFinished() step_data = self._get_step(step_name) if step_data is not None: if 'stop' in step_data: raise StepAlreadyFinished() else: ...
0.003724
def _parse_ports(self, ports): """Parse ports string into the list :param str ports: :rtype: list[tuple[str, str]] """ if not ports: return [] return [tuple(port_pair.split("::")) for port_pair in ports.strip(";").split(";")]
0.010453
def get(self, *args, **kwargs): """Handle reading of the model :param args: :param kwargs: """ # Create the model and fetch its data self.model = self.get_model(kwargs.get('id')) result = yield self.model.fetch() # If model is not found, return 404 ...
0.002706
def _update_id(record, new_id): """ Update a record id to new_id, also modifying the ID in record.description """ old_id = record.id record.id = new_id # At least for FASTA, record ID starts the description record.description = re.sub('^' + re.escape(old_id), new_id, record.description) ...
0.005988
def has_role(user, *roles, **kwargs): """ Judge is the user belongs to the role, and if does, then return the role object if not then return False. kwargs will be passed to role_func. """ Role = get_model('role') if isinstance(user, (unicode, str)): User = get_model('user') ...
0.007765
def set_handler(self, handler): """ Connect with a coroutine, which is scheduled when connection is made. This function will create a task, and when connection is closed, the task will be canceled. :param handler: :return: None """ if self._handler: ...
0.004405
def authorizeClientRequest(self, request): """ Checks the authorization permissions of the bearer token passed, and determines whether the sender is permitted to make the request housed in the payload. Usage: request = The header object from pfioh, or the whole request from pman. Thi...
0.005556
def combine(line, left, intersect, right): """Zip borders between items in `line`. e.g. ('l', '1', 'c', '2', 'c', '3', 'r') :param iter line: List to iterate. :param left: Left border. :param intersect: Column separator. :param right: Right border. :return: Yields combined objects. ""...
0.000856
def statfs(self, path): "Return a statvfs(3) structure, for stat and df and friends" # from fuse.py source code: # # class c_statvfs(Structure): # _fields_ = [ # ('f_bsize', c_ulong), # preferred size of file blocks, in bytes # ('f_frsize', c_ulong), # fundamental...
0.003906
def eq_central_moments(n_counter, k_counter, dmu_over_dt, species, propensities, stoichiometry_matrix, max_order): r""" Function used to calculate the terms required for use in equations giving the time dependence of central moments. The function returns the list Containing the sum of the following terms i...
0.006392
def _get_receivers(self, sender): ''' filter only receiver functions which correspond to the provided sender ''' key = _make_id(sender) receivers = [] for (receiver_key, sender_key), receiver in self.receivers.items(): if sender_key == key: receivers.append(re...
0.008523
def last(symbols=None, token='', version=''): '''Last provides trade data for executions on IEX. It is a near real time, intraday API that provides IEX last sale price, size and time. Last is ideal for developers that need a lightweight stock quote. https://iexcloud.io/docs/api/#last Args: sym...
0.004559
def _(s: Influence) -> bool: """ Check if an Influence statement is grounded """ return is_grounded(s.subj) and is_grounded(s.obj)
0.007246
def _find_home_or_away(self, row): """ Determine whether the player is on the home or away team. Next to every player is their school's name. This name can be matched with the previously parsed home team's name to determine if the player is a member of the home or away team. ...
0.002401
def delete_invalid_route(self): """ Delete any invalid routes for this interface. An invalid route is a left over when an interface is changed to a different network. :return: None """ try: routing = self._engine.routing.get(self.interface_id) ...
0.007634
def onboarding_message(**payload): """Create and send an onboarding welcome message to new users. Save the time stamp of this message so we can update this message in the future. """ # Get WebClient so you can communicate back to Slack. web_client = payload["web_client"] # Get the id of the Sla...
0.001634
def update_alias(self): """Update lambda alias to point to $LATEST.""" LOG.info('Updating alias %s to point to $LATEST', self.env) try: self.lambda_client.update_alias(FunctionName=self.app_name, Name=self.env, FunctionVersion='$LATEST') except boto3.exceptions.botocore.exce...
0.006276
def help_center_article_translations(self, article_id, **kwargs): "https://developer.zendesk.com/rest_api/docs/help_center/translations#list-translations" api_path = "/api/v2/help_center/articles/{article_id}/translations.json" api_path = api_path.format(article_id=article_id) return sel...
0.011561
def persist_booking(booking, user): """ Ties an in-progress booking from a session to a user when the user logs in. If we don't do this, the booking will be lost, because on a login, the old session will be deleted and a new one will be created. Since the booking has a FK to the session, it would b...
0.000873
def stalta_pick(stream, stalen, ltalen, trig_on, trig_off, freqmin=False, freqmax=False, debug=0, show=False): """ Basic sta/lta picker, suggest using alternative in obspy. Simple sta/lta (short-term average/long-term average) picker, using obspy's :func:`obspy.signal.trigger.classic_st...
0.000214
def compilevcf(args): """ %prog compilevcf samples.csv Compile vcf results into master spreadsheet. """ p = OptionParser(compilevcf.__doc__) p.add_option("--db", default="hg38", help="Use these lobSTR db") p.add_option("--nofilter", default=False, action="store_true", help=...
0.00065
def get_level_str(self): ''' format level str ''' if self.is_relative: level_str = str(self.level) + "%" else: level_str = self.level return level_str
0.009709
def flush(signal_names, exclude, wait): """Send pending signals over the message bus. If a list of SIGNAL_NAMES is specified, flushes only those signals. If no SIGNAL_NAMES are specified, flushes all signals. """ signalbus = current_app.extensions['signalbus'] signal_names = set(signal_names)...
0.004502
def make_preprocessing_fn(output_dir, features, keep_target): """Makes a preprocessing function. Args: output_dir: folder path that contains the vocab and stats files. features: the features dict Returns: a function that takes a dict of input tensors """ def preprocessing_fn(inputs): """Prep...
0.008696
def great_circle(**kwargs): """ Named arguments: distance = distance to travel, or numpy array of distances azimuth = angle, in DEGREES of HEADING from NORTH, or numpy array of azimuths latitude = latitude, in DECIMAL DEGREES, or numpy array of latitudes longitude = longi...
0.005195
def spectrodir(self, filetype, **kwargs): """Returns :envvar:`SPECTRO_REDUX` or :envvar:`BOSS_SPECTRO_REDUX` depending on the value of `run2d`. Parameters ---------- filetype : str File type parameter. run2d : int or str 2D Reduction ID. ...
0.003284
def gen_random_float(minimum, maximum, decimals=2): """ 指定一个浮点数范围,随机生成并返回区间内的一个浮点数,区间为闭区间 受限于 random.random 精度限制,支持最大 15 位精度 :param: * minimum: (float) 浮点数最小取值 * maximum: (float) 浮点数最大取值 * decimals: (int) 小数位数,默认为 2 位 :return: * random_float: (float) 随机浮点数 举例如下...
0.002187
def reduce(self): """Removes results rows whose n-grams are contained in larger n-grams.""" self._logger.info('Reducing the n-grams') # This does not make use of any pandas functionality; it # probably could, and if so ought to. data = {} labels = {} # Der...
0.00103
def fromInputs(self, received): """ Convert some random strings received from a browser into structured data, using a list of parameters. @param received: a dict of lists of strings, i.e. the canonical Python form of web form post. @rtype: L{Deferred} @retur...
0.002581
def _get_association_classes(self, namespace): """ Return iterator of associator classes from the class repo Returns the classes that have associations qualifier. Does NOT copy so these are what is in repository. User functions MUST NOT modify these classes. Returns: Re...
0.00314
def extract_blocking(obj): """Extract index and watch from :class:`Blocking` Parameters: obj (Blocking): the blocking object Returns: tuple: index and watch """ if isinstance(obj, tuple): try: a, b = obj except: raise TypeError("Not a Blocking...
0.004878
def process_pair(self, key, value): """ Process a (key, value) pair """ old_key = key old_value = value # Create key intelligently keyparts = self.bspacere.split(key) # print keyparts strippable = False lastpart = keyparts[-1] if lastpart.find(...
0.00235
def _build(self, x, prev_state): """Connects the core to the graph. Args: x: Input `Tensor` of shape `(batch_size, input_size)`. prev_state: Previous state. This could be a `Tensor`, or a tuple of `Tensor`s. Returns: The tuple `(output, state)` for this core. Raises: ...
0.00104
def sp_msg(cmd, pipe=None, data=None): """Produces skypipe protocol multipart message""" msg = [SP_HEADER, cmd] if pipe is not None: msg.append(pipe) if data is not None: msg.append(data) return msg
0.004274
def _check_negatives(numbers): "Raise warning for negative numbers." negatives = filter(lambda x: x < 0, filter(None, numbers)) if any(negatives): neg_values = ', '.join(map(str, negatives)) msg = 'Found negative value(s): {0!s}. '.format(neg_values) msg += 'While not forbidden, the...
0.002653
def encode(url): """Encode URL.""" parts = extract(url) return construct(URL(parts.scheme, parts.username, parts.password, _idna_encode(parts.subdomain), _idna_encode(parts.domain), _...
0.001698
def list_service_certificates(self, service_name): ''' Lists all of the service certificates associated with the specified hosted service. service_name: Name of the hosted service. ''' _validate_not_none('service_name', service_name) return self._perf...
0.004211
def get_ladder_metadata(session, url): """Get ladder metadata.""" parsed = make_scrape_request(session, url) tag = parsed.find('a', href=re.compile(LADDER_ID_REGEX)) return { 'id': int(tag['href'].split('/')[-1]), 'slug': url.split('/')[-1], 'url': url }
0.003356
def run_actions(self, actions): """ Runs the given lists of attached actions and instance actions on the client. :param actions: Actions to apply. :type actions: list[dockermap.map.action.ItemAction] :return: Where the result is not ``None``, returns the output from the client. ...
0.004954
def InitAgeCheck(self): """make an interactive grid in which users can edit ages""" self.panel = wx.Panel(self, style=wx.SIMPLE_BORDER) text = """Step 6: Fill in or correct any cells with information about ages. The column for magic_method_codes can take multiple values in the form of a colon-d...
0.006674
def facts_refresh(): ''' Reload the facts dictionary from the device. Usually only needed if, the device configuration is changed by some other actor. This function will also refresh the facts stored in the salt grains. CLI Example: .. code-block:: bash salt 'device_name' junos.facts_...
0.001193
def read_file_bytes(input_file_path): """ Read the file at the given file path and return its contents as a byte string, or ``None`` if an error occurred. :param string input_file_path: the file path :rtype: bytes """ contents = None try: with io.open(input_file_path, "rb") ...
0.004762
def formfield(self, **kwargs): """ Returns a :class:`PlaceholderFormField` instance for this database Field. """ defaults = { 'label': capfirst(self.verbose_name), 'help_text': self.help_text, 'required': not self.blank, } defaults.upda...
0.009592
def resolve(self, geoid, id_only=False): ''' Resolve a GeoZone given a GeoID. The start date is resolved from the given GeoID, ie. it find there is a zone valid a the geoid validity, resolve the `latest` alias or use `latest` when no validity is given. If `id_on...
0.002621
def load(self): """Load a file in text mode""" self.meta.resolved_path = self.find_data(self.meta.path) if not self.meta.resolved_path: raise ImproperlyConfigured("Data file '{}' not found".format(self.meta.path)) print("Loading:", self.meta.path) with ope...
0.007732
def hamming_distance(s1, s2): """Return the Hamming distance between equal-length sequences""" # print(s1,s2) if len(s1) != len(s2): raise ValueError("Undefined for sequences of unequal length") return sum(el1 != el2 for el1, el2 in zip(s1.upper(), s2.upper()))
0.003509
def run(coro, loop=None): """ Convenient shortcut alias to ``loop.run_until_complete``. Arguments: coro (coroutine): coroutine object to schedule. loop (asyncio.BaseEventLoop): optional event loop to use. Defaults to: ``asyncio.get_event_loop()``. Returns: mixed: re...
0.001805
def w16_circuit() -> qf.Circuit: """ Return a circuit that prepares the the 16-qubit W state using\ sqrt(iswaps) and local gates, respecting linear topology """ gates = [ qf.X(7), qf.ISWAP(7, 8) ** 0.5, qf.S(8), qf.Z(8), qf.SWAP(7, 6), qf.SWAP(6, 5)...
0.000659
def latex(expr, cache=None, **settings): r"""Return a LaTeX representation of the given object / expression Args: expr: Expression to print cache (dict or None): dictionary to use for caching show_hs_label (bool or str): Whether to a label for the Hilbert space of `expr`. By...
0.000513
def _construct_retry(method_config, retry_codes, retry_params, retry_names): """Helper for ``construct_settings()``. Args: method_config (dict): A dictionary representing a single ``methods`` entry of the standard API client config file. (See ``construct_settings()`` for information on th...
0.000587
def _write_ccr(self, f, g, level: int): ''' Write a CCR to file "g" from file "f" with level "level". Currently, only handles gzip compression. Parameters: f : file Uncompressed file to read from g : file File to read the compresse...
0.003145
def call(symbol, **kwargs): """Calls/executes BGPS public API identified by given symbol and passes given kwargs as param. """ LOG.info("API method %s called with args: %s", symbol, str(kwargs)) # TODO(PH, JK) improve the way api function modules are loaded from . import all # noqa if not ...
0.001163
def close(self): """Cleanup client resources and disconnect from MongoDB. On MongoDB >= 3.6, end all server sessions created by this client by sending one or more endSessions commands. Close all sockets in the connection pools and stop the monitor threads. If this instance is u...
0.00224
def encode(self, payload): """ Returns an encoded token for the given payload dictionary. """ token = jwt.encode(payload, self.signing_key, algorithm=self.algorithm) return token.decode('utf-8')
0.008547
def layer_depth( lat, lon, layerID="LID-BOTTOM"): """Returns layer depth at lat / lon (degrees) where lat/lon may be arrays (of equal size). Depths are returned in metres. """ ## Must wrap longitude from 0 to 360 ... lon1 = np.array(lon)%360.0 lat1 = np.array(lat) # ## Must wrap longi...
0.01252
def get_my_moderation(self, *args, **kwargs): """Return a get_content generator of subreddits. The Subreddits generated are those where the session's user is a moderator. The additional parameters are passed directly into :meth:`.get_content`. Note: the `url` parameter cannot b...
0.004367
def QueryService(svc_name): """Query service and get its config.""" hscm = win32service.OpenSCManager(None, None, win32service.SC_MANAGER_ALL_ACCESS) result = None try: hs = win32serviceutil.SmartOpenService(hscm, svc_name, win32...
0.013834
def find_pad_index(self, array): """Find padding index. Args: array (list): integer list. Returns: idx: padding index. Examples: >>> array = [1, 2, 0] >>> self.find_pad_index(array) 2 """ try: r...
0.004808
def get_series_names(self, column_indices = [], column_names = []): '''Returns the series' names corresponding to column_indices and column_names. "names" here are: - strings for single-indexed dataframes; or - tuples for multi-indexed dataframes. If both param...
0.007743
def factorgraph_viz(d): """ Map the dictionary into factorgraph-viz format. See https://github.com/mbforbes/factorgraph-viz :param d: The dictionary :return: The formatted dictionary """ m = defaultdict(list) for node in d['nodes']: m['nodes'].append...
0.00325
def _get_impact_info(vcf_reader): """Retrieve impact parsing information from INFO header. """ ImpactInfo = collections.namedtuple("ImpactInfo", "header, gclass, id") KEY_2_CLASS = { 'CSQ': geneimpacts.VEP, 'ANN': geneimpacts.SnpEff, 'BCSQ': geneimpacts.BCFT} for l in (x.stri...
0.007092
def embeddable(self, path, variant): """Is the asset embeddable ?""" name, ext = os.path.splitext(path) font = ext in FONT_EXTS if not variant: return False if not (re.search(settings.EMBED_PATH, path.replace('\\', '/')) and self.storage.exists(path)): ret...
0.007648
def image(cam): """Extract first image of input stream to jpg file. Args: cam: Input stream of raw rosbag messages. Returns: File instance for first image of input stream. """ # Set output stream title and pull first message yield marv.set_header(title=cam.topic) msg = yiel...
0.001267
def get_arguments(self): """ Extracts the specific arguments of this CLI """ ApiCli.get_arguments(self) self._alarm_id = self.args.alarm_id if self.args.alarm_id is not None else None
0.013453
def init_i18n (loc=None): """Initialize i18n with the configured locale dir. The environment variable LOCPATH can also specify a locale dir. @return: None """ if 'LOCPATH' in os.environ: locdir = os.environ['LOCPATH'] else: locdir = os.path.join(get_install_data(), 'share', 'loc...
0.00246
def get_data(url, gallery_dir): """Persistent dictionary usage to retrieve the search indexes""" # shelve keys need to be str in python 2 if sys.version_info[0] == 2 and isinstance(url, unicode): url = url.encode('utf-8') cached_file = os.path.join(gallery_dir, 'searchindex') search_index ...
0.001916
def _on_connection_made(self): """ Gets called when the TCP connection to kik's servers is done and we are connected. Now we might initiate a login request or an auth request. """ if self.username is not None and self.password is not None and self.kik_node is not None: ...
0.007101
def forwards(self, orm): "Write your forwards methods here." for a in orm.Article.objects.all(): if a.updated: a.last_updated = a.updated a.save(force_update=True)
0.008969
def isUrl(urlString): """ Attempts to return whether a given URL string is valid by checking for the presence of the URL scheme and netloc using the urlparse module, and then using a regex. From http://stackoverflow.com/questions/7160737/ """ parsed = urlparse.urlparse(urlString) urlpar...
0.001252
def whereless(self, fieldname, value): """ Returns a new DataTable with rows only where the value at `fieldname` < `value`. """ return self.mask([elem < value for elem in self[fieldname]])
0.008772
def _filtering_result_checked(self, by_or): '''Check if post passes all / at_least_one (by_or parameter) filter(s). Filters are evaluated on only-if-necessary ("lazy") basis.''' filters, results = it.imap(set, ( self.feed.filters.all(), self.filtering_results.values_list('filter', flat=True) )) # Check if ...
0.02934
def set_desired_state(self, state): """Update the desired state of a unit. Args: state (str): The desired state for the unit, must be one of ``_STATES`` Returns: str: The updated state Raises: fleet.v1.errors.APIError: Fleet returned a response cod...
0.003922
def ParseOptions(cls, options, analysis_plugin): """Parses and validates options. Args: options (argparse.Namespace): parser options. analysis_plugin (VirusTotalAnalysisPlugin): analysis plugin to configure. Raises: BadConfigObject: when the output module object is of the wrong type. ...
0.003693
def vcsNodeState_originator_switch_info_switchIdentifier(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") vcsNodeState = ET.SubElement(config, "vcsNodeState", xmlns="urn:brocade.com:mgmt:brocade-vcs") originator_switch_info = ET.SubElement(vcsNodeState, "...
0.008576
def installUpdate(self): """ Install the newest version of Plex Media Server. """ # We can add this but dunno how useful this is since it sometimes # requires user action using a gui. part = '/updater/apply' release = self.check_for_update(force=True, download=True) if re...
0.004246
def parse_cookies(response, host): """ Sticks cookies to a response. """ cookie_pie = [] try: for cookie in response.headers['set-cookie']: cookie_jar = {} name_val, *rest = cookie.split(';') name, value = name_val.split('=', 1) cookie_jar['nam...
0.001155
def login_or_register( client: GMatrixClient, signer: Signer, prev_user_id: str = None, prev_access_token: str = None, ) -> User: """Login to a Raiden matrix server with password and displayname proof-of-keys - Username is in the format: 0x<eth_address>(.<suffix>)?, where the su...
0.002881
def opt_space(M_E, r=None, niter=50, tol=1e-6, print_out=False): ''' Implementation of the OptSpace matrix completion algorithm. An algorithm for Matrix Reconstruction from a partially revealed set. Sparse treatment of matrices are removed because of indexing problems in Python. Args: ...
0.001995
def load_with_scipy(file, data_name): import scipy.io """ Loads data from a netcdf file. Parameters ---------- file : string or file-like The name of the netcdf file to open. data_name : string The name of the data to extract from the netcdf file. Returns ------- ...
0.006676
def find_vulnerabilities( cfg_list, blackbox_mapping_file, sources_and_sinks_file, interactive=False, nosec_lines=defaultdict(set) ): """Find vulnerabilities in a list of CFGs from a trigger_word_file. Args: cfg_list(list[CFG]): the list of CFGs to scan. blackbox_mapping_fil...
0.001792
def decode_aes256(cipher, iv, data, encryption_key): """ Decrypt AES-256 bytes. Allowed ciphers are: :ecb, :cbc. If for :ecb iv is not used and should be set to "". """ if cipher == 'cbc': aes = AES.new(encryption_key, AES.MODE_CBC, iv) elif cipher == 'ecb': aes = AES.new(enc...
0.003534
def _bind_variables(self, instance, space): """ Bind related variables to the instance """ instance.api = self if space: instance.space = space return instance
0.009132
def load(self, read_tuple_name): """Load RNF values from a read tuple name. Args: read_tuple_name (str): Read tuple name which the values are taken from. """ self.prefix_width = 0 self.read_tuple_id_width = 0 self.genome_id_width = 0 self.chr_id_width = 0 self.coo...
0.008383
def list_permissions(self, group_name=None, resource=None, url_prefix=None, auth=None, session=None, send_opts=None): """List the permission sets for the logged in user Optionally filter by resource or group. Args: group_name (string): Name of group to filte...
0.004582
def mid_lvl_cmds_send(self, target, hCommand, uCommand, rCommand, force_mavlink1=False): ''' Mid Level commands sent from the GS to the autopilot. These are only sent when being operated in mid-level commands mode from the ground. target ...
0.009103
def get_common(self, filename): ''' Process lists of common name words ''' word_list = [] words = open(filename) for word in words.readlines(): word_list.append(word.strip()) return word_list
0.00823
def remainingDays(self, now=None): """ Based on the value of notBefore field, returns the number of days the certificate will still be valid. The date used for the comparison is the current and local date, as returned by time.localtime(), except if 'now' argument is provided ano...
0.004676
def get_window_name(self, win_id): """ Get a window's name, if any. """ window = window_t(win_id) name_ptr = ctypes.c_char_p() name_len = ctypes.c_int(0) name_type = ctypes.c_int(0) _libxdo.xdo_get_window_name( self._xdo, window, ctypes.byref(n...
0.003929
def permissions(self): """Return a set with all permissions granted to the user.""" perms = set() for g in self.groups: perms = perms | set(g.permissions) return perms
0.009479
def get_supported_languages( self, parent=None, display_language_code=None, model=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Returns a list of supported languages ...
0.002716
def parse_args(self, args = None, namespace = None, config_file_contents = None, env_vars = os.environ): """Supports all the same args as the ArgumentParser.parse_args(..), as well as the following additional args. Additional Args: args: a list of args as in argpa...
0.028721
def badge(left_text: str, right_text: str, left_link: Optional[str] = None, right_link: Optional[str] = None, whole_link: Optional[str] = None, logo: Optional[str] = None, left_color: str = '#555', right_color: str = '#007ec6', measurer: Optional[text_measurer.TextMeasurer] = Non...
0.000562
def process_rpc(self, rpc): """Process input and output parts of `rpc`.""" p = "/nc:rpc/" + self.qname(rpc) tmpl = self.xsl_template(p) inp = rpc.search_one("input") if inp is not None: ct = self.xsl_calltemplate("rpc-input", tmpl) self.xsl_withparam("nsid...
0.003752
def PopItem(self): """Pops an item off the queue. If no ZeroMQ socket has been created, one will be created the first time this method is called. Returns: object: item from the queue. Raises: KeyboardInterrupt: if the process is sent a KeyboardInterrupt while popping an item...
0.006612