text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def _set_redistribute_ospf(self, v, load=False):
"""
Setter method for redistribute_ospf, mapped from YANG variable /rbridge_id/ipv6/router/ospf/redistribute/redistribute_ospf (container)
If this variable is read-only (config: false) in the
source YANG file, then _set_redistribute_ospf is considered as ... | 0.005637 |
def _extract_variable_parts(variable_key, variable):
"""Matches a variable to individual parts.
Args:
variable_key: String identifier of the variable in the module scope.
variable: Variable tensor.
Returns:
partitioned: Whether the variable is partitioned.
name: Name of the variable up to the pa... | 0.008753 |
def define_density_matrix(Ne, explicitly_hermitian=False, normalized=False,
variables=None):
r"""Return a symbolic density matrix.
The arguments are
Ne (integer):
The number of atomic states.
explicitly_hermitian (boolean):
Whether to make $\rho_{ij}=\bar{\rho... | 0.0004 |
def nodes(self, nodes):
"""Specify the set of nodes and associated data.
Must include any nodes referenced in the edge list.
:param nodes: Nodes and their attributes.
:type point_size: Pandas dataframe
:returns: Plotter.
:rtype: Plotter.
**Example**
... | 0.003769 |
def sscan(self, name, cursor=0, match=None, count=None):
"""
Incrementally return lists of elements in a set. Also return a cursor
indicating the scan position.
``match`` allows for filtering the keys by pattern
``count`` allows for hint the minimum number of returns
""... | 0.003396 |
def _to_star(self):
"""Save :class:`~nmrstarlib.nmrstarlib.StarFile` into NMR-STAR or CIF formatted string.
:return: NMR-STAR string.
:rtype: :py:class:`str`
"""
star_str = io.StringIO()
self.print_file(star_str)
return star_str.getvalue() | 0.010135 |
def internal_state():
'''Serve a json representation of internal agentstate as meta data
'''
data = {'services': {
'capture': ServiceStatus.str(get_service_status(Service.CAPTURE)),
'ingest': ServiceStatus.str(get_service_status(Service.INGEST)),
'schedule': ServiceStatus.str(get_ser... | 0.002012 |
def set_color(self, red, green, blue):
"""Set backlight color to provided red, green, and blue values. If PWM
is enabled then color components can be values from 0.0 to 1.0, otherwise
components should be zero for off and non-zero for on.
"""
if self._pwm_enabled:
# ... | 0.008395 |
def can_update_repositories(self):
"""Tests if this user can update ``Repositories``.
A return of true does not guarantee successful authorization. A
return of false indicates that it is known updating a
``Repository`` will result in a ``PermissionDenied``. This is
intended as a... | 0.003672 |
def shelve(self):
"""Return an opened shelve object.
"""
logger.info('creating shelve data')
fname = str(self.create_path.absolute())
inst = sh.open(fname, writeback=self.writeback)
self.is_open = True
return inst | 0.007407 |
def parse_as_header(class_, f):
"""
Parse the Block header from the file-like object
"""
version, previous_block_hash, merkle_root, height = parse_struct("L##L", f)
# https://github.com/BTCGPU/BTCGPU/wiki/Technical-Spec
f.read(28) # reserved area
(timestamp, diff... | 0.005941 |
def update(self, user, **kwargs):
"""If parent resource is not an editable state, should not be able to update"""
yield self.get_parent()
if not self.parent.editable:
err = 'Cannot update child of {} resource'.format(self.parent.state.name)
raise exceptions.Unauthorized(... | 0.010336 |
async def srandmember(self, name, number=None):
"""
If ``number`` is None, returns a random member of set ``name``.
If ``number`` is supplied, returns a list of ``number`` random
memebers of set ``name``. Note this is only available when running
Redis 2.6+.
"""
a... | 0.004751 |
def sql_context(self, application_name):
"""Create a spark context given the parameters configured in this class.
The caller is responsible for calling ``.close`` on the resulting spark context
Parameters
----------
application_name : string
Returns
-------
... | 0.007952 |
def priorities(self):
"""Get a list of priority Resources from the server.
:rtype: List[Priority]
"""
r_json = self._get_json('priority')
priorities = [Priority(
self._options, self._session, raw_priority_json) for raw_priority_json in r_json]
return priorit... | 0.009288 |
def add_file_handler(logger=None, file_path="out.log", level=logging.INFO,
log_format=log_formats.easy_read):
"""
Addes a newly created file handler to the specified logger
:param logger: logging name or object to modify, defaults to root logger
:param file_path: path to file to lo... | 0.001715 |
def represent_as(self, new_pos, new_vel=None):
"""
Represent the position and velocity of the orbit in an alternate
coordinate system. Supports any of the Astropy coordinates
representation classes.
Parameters
----------
new_pos : :class:`~astropy.coordinates.Bas... | 0.001653 |
def GetEmail(prompt):
"""Prompts the user for their email address and returns it.
The last used email address is saved to a file and offered up as a suggestion
to the user. If the user presses enter without typing in anything the last
used email address is used. If the user enters a new address, it is saved
for n... | 0.030075 |
def _bp_static_url(blueprint):
""" builds the absolute url path for a blueprint's static folder """
u = six.u('%s%s' % (blueprint.url_prefix or '', blueprint.static_url_path or ''))
return u | 0.009901 |
def update_task_ids(self, encoder_vocab_size):
"""Generate task_ids for each problem.
These ids correspond to the index of the task in the task_list.
Args:
encoder_vocab_size: the size of the vocab which is used to compute
the index offset.
"""
for idx, task in enumerate(self.task_li... | 0.006289 |
def find_metadata(model):
"""
:param model: Model instance
"""
engine_name = model.get_engine_name()
engine = engine_manager[engine_name]
return engine.metadata | 0.005435 |
def for_app(*app_names, **kwargs):
"""Specifies that matching script is for on of app names."""
def _for_app(fn, command):
if is_app(command, *app_names, **kwargs):
return fn(command)
else:
return False
return decorator(_for_app) | 0.003546 |
def FileFinderOSFromClient(args):
"""This function expands paths from the args and returns related stat entries.
Args:
args: An `rdf_file_finder.FileFinderArgs` object.
Yields:
`rdf_paths.PathSpec` instances.
"""
stat_cache = filesystem.StatCache()
opts = args.action.stat
for path in GetExpand... | 0.015924 |
def Cvg(self):
r'''Gas-phase ideal-gas contant-volume heat capacity of the chemical at
its current temperature, in units of [J/kg/K]. Subtracts R from
the ideal-gas heat capacity; does not include pressure-compensation
from an equation of state.
Examples
--------
... | 0.003781 |
def iri_to_uri(value, normalize=False):
"""
Encodes a unicode IRI into an ASCII byte string URI
:param value:
A unicode string of an IRI
:param normalize:
A bool that controls URI normalization
:return:
A byte string of the ASCII-encoded URI
"""
if not isinstance(... | 0.001813 |
def is_sqlatype_string(coltype: Union[TypeEngine, VisitableType]) -> bool:
"""
Is the SQLAlchemy column type a string type?
"""
coltype = _coltype_to_typeengine(coltype)
return isinstance(coltype, sqltypes.String) | 0.004292 |
def isfile(path, **kwargs):
"""Check if *path* is a file"""
import os.path
return os.path.isfile(path, **kwargs) | 0.008065 |
def bad_signatures(self): # pragma: no cover
"""
A generator yielding namedtuples of all signatures that were not verified
in the operation that returned this instance. The namedtuple has the following attributes:
``sigsubj.verified`` - ``bool`` of whether the signature verified succes... | 0.014451 |
def lastmod(self, tag):
"""Return the last modification of the entry."""
lastitems = EntryModel.objects.published().order_by('-modification_date').filter(tags=tag).only('modification_date')
return lastitems[0].modification_date | 0.011952 |
def os_walk_pre_35(top, topdown=True, onerror=None, followlinks=False):
"""Pre Python 3.5 implementation of os.walk() that doesn't use scandir."""
islink, join, isdir = os.path.islink, os.path.join, os.path.isdir
try:
names = os.listdir(top)
except OSError as err:
if onerror is not None... | 0.001199 |
def convert(self, newstart: str) -> None:
"""Convert to another list type by replacing starting pattern."""
match = self._match
ms = match.start()
for s, e in reversed(match.spans('pattern')):
self[s - ms:e - ms] = newstart
self.pattern = escape(newstart) | 0.006515 |
def write_epw(self):
""" Section 8 - Writing new EPW file
"""
epw_prec = self.epw_precision # precision of epw file input
for iJ in range(len(self.UCMData)):
# [iJ+self.simTime.timeInitial-8] = increments along every weather timestep in epw
# [6 to 21] ... | 0.004953 |
def listDF(option='mostactive', token='', version=''):
'''Returns an array of quotes for the top 10 symbols in a specified list.
https://iexcloud.io/docs/api/#list
Updated intraday
Args:
option (string); Option to query
token (string); Access token
version (string); API versio... | 0.002075 |
def unframe(packet):
"""
Strip leading DLE and trailing DLE/ETX from packet.
:param packet: TSIP packet with leading DLE and trailing DLE/ETX.
:type packet: Binary string.
:return: TSIP packet with leading DLE and trailing DLE/ETX removed.
:raise: ``ValueError`` if `packet` does not start with ... | 0.005505 |
def escape_ampersand(string):
"""
Quick convert unicode ampersand characters not associated with
a numbered entity or not starting with allowed characters to a plain &
"""
if not string:
return string
start_with_match = r"(\#x(....);|lt;|gt;|amp;)"
# The pattern below is match & ... | 0.002242 |
def Qk(self, k):
"""
function (k). Returns noise matrix of dynamic model on iteration k.
k (iteration number). starts at 0
"""
return self.Q[:, :, self.index[self.Q_time_var_index, k]] | 0.008621 |
def _get_observed_mmax(catalogue, config):
'''Check see if observed mmax values are input, if not then take
from the catalogue'''
if config['input_mmax']:
obsmax = config['input_mmax']
if config['input_mmax_uncertainty']:
return config['input_mmax'], config['input_mmax_uncertaint... | 0.000806 |
def get_hla_truthset(data):
"""Retrieve expected truth calls for annotating HLA called output.
"""
val_csv = tz.get_in(["config", "algorithm", "hlavalidate"], data)
out = {}
if val_csv and utils.file_exists(val_csv):
with open(val_csv) as in_handle:
reader = csv.reader(in_handle)... | 0.007339 |
def stop_capture(self, slot_number, port_number):
"""
Stops a packet capture.
:param slot_number: slot number
:param port_number: port number
"""
try:
adapter = self._slots[slot_number]
except IndexError:
raise DynamipsError('Slot {slot_n... | 0.007287 |
def fso_mkdir(self, path, mode=None):
'overlays os.mkdir()'
path = self.deref(path, to_parent=True)
if self._lexists(path):
raise OSError(17, 'File exists', path)
self._addentry(OverlayEntry(self, path, stat.S_IFDIR)) | 0.008368 |
def find_page_of_state_m(self, state_m):
"""Return the identifier and page of a given state model
:param state_m: The state model to be searched
:return: page containing the state and the state_identifier
"""
for state_identifier, page_info in list(self.tabs.items()):
... | 0.004525 |
def trim(args):
"""
%prog trim fasta.screen newfasta
take the screen output from `cross_match` (against a vector db, for
example), then trim the sequences to remove X's. Will also perform quality
trim if fasta.screen.qual is found. The trimming algorithm is based on
finding the subarray that ma... | 0.004975 |
def _canonicalize_fraction(cls, non_repeating, repeating):
"""
If the same fractional value can be represented by stripping repeating
part from ``non_repeating``, do it.
:param non_repeating: non repeating part of fraction
:type non_repeating: list of int
:param repeatin... | 0.003369 |
def Transformer(source_vocab_size,
target_vocab_size,
mode='train',
num_layers=6,
feature_depth=512,
feedforward_depth=2048,
num_heads=8,
dropout=0.1,
shared_embedding=True,
ma... | 0.004736 |
def _acquire_lock(self, identifier, atime=30, ltime=5):
'''Acquire a lock for a given identifier.
If the lock cannot be obtained immediately, keep trying at random
intervals, up to 3 seconds, until `atime` has passed. Once the
lock has been obtained, continue to hold it for `ltime`.
... | 0.001805 |
def loadNiiData(lstNiiFls,
strPathNiiMask=None,
strPathNiiFunc=None):
"""load nii data.
Parameters
----------
lstNiiFls : list, list of str with nii file names
strPathNiiMask : str, path to nii file with mask (optional)
strPathNiiFunc : str, p... | 0.001479 |
def as_existing_file(self, filepath):
"""Return the file class for existing files only"""
if os.path.isfile(filepath) and hasattr(self, '__file_class__'):
return self.__file_class__(filepath) # pylint: disable=no-member
return self.__class__(filepath) | 0.006944 |
def collapse_segments (path):
"""Remove all redundant segments from the given URL path.
Precondition: path is an unquoted url path"""
# replace backslashes
# note: this is _against_ the specification (which would require
# backslashes to be left alone, and finally quoted with '%5C')
# But replac... | 0.001439 |
def find_comprehension_as_statement(node):
"""Finds a comprehension as a statement"""
return (
isinstance(node, ast.Expr)
and isinstance(node.value, (ast.ListComp,
ast.DictComp,
ast.SetComp))
) | 0.003413 |
def eci2aer(eci: Tuple[float, float, float],
lat0: float, lon0: float, h0: float,
t: datetime,
useastropy: bool = True) -> Tuple[float, float, float]:
"""
takes ECI coordinates of point and gives az, el, slant range from Observer
Parameters
----------
eci : tupl... | 0.001103 |
def p_state(self, state):
'''state : STATE opttexts'''
state[0] = State(state[1][0], state[1][1], state[1][2], state[1][3], state[2]) | 0.020134 |
def process_core(self):
"""
The method deals with a core found previously in
:func:`get_core`. Clause selectors ``self.core_sels`` and
sum assumptions involved in the core are treated
separately of each other. This is handled by calling
methods :func:`... | 0.001016 |
def call_local_plugin_method(self, chname, plugin_name, method_name,
args, kwargs):
"""
Parameters
----------
chname : str
The name of the channel containing the plugin.
plugin_name : str
The name of the local plugin conta... | 0.00339 |
def const_shuffle(arr, seed=23980):
""" Shuffle an array in-place with a fixed seed.
"""
old_seed = np.random.seed()
np.random.seed(seed)
np.random.shuffle(arr)
np.random.seed(old_seed) | 0.004785 |
def wait(self, timeout=None):
"""Block until the internal flag is true.
If the internal flag is true on entry, return immediately. Otherwise,
block until another thread calls set() to set the flag to true, or until
the optional timeout occurs.
When the timeout argument is prese... | 0.003953 |
def overlay_gateway_site_name(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
overlay_gateway = ET.SubElement(config, "overlay-gateway", xmlns="urn:brocade.com:mgmt:brocade-tunnels")
name_key = ET.SubElement(overlay_gateway, "name")
name_key.text... | 0.005282 |
def parse_int(self, buff, start, end):
'''
parse an integer from the buffer given the interval of bytes
:param buff:
:param start:
:param end:
'''
# num = self.parse_uint(buff, start, end)
# l = (end - start)
# return self.twos_comp(num, l * 8)... | 0.005013 |
def list(self, page=1, per_page=10):
"""List a page of chats.
:param int page: which page
:param int per_page: how many chats per page
:return: chats with other users
:rtype: :class:`~groupy.pagers.ChatList`
"""
return pagers.ChatList(self, self._raw_list, per_pa... | 0.005348 |
def raw_iter(self, stream=False):
"""https://github.com/frictionlessdata/datapackage-py#resource
"""
# Error for inline
if self.inline:
message = 'Methods raw_iter/raw_read are not supported for inline data'
raise exceptions.DataPackageException(message)
... | 0.003356 |
def _file_type(self, field):
""" Returns file type for given file field.
Args:
field (str): File field
Returns:
string. File type
"""
type = mimetypes.guess_type(self._files[field])[0]
return type.encode("utf-8") if isinstance(type, unico... | 0.008876 |
def _tsne(self, P, degrees_of_freedom, n_samples, random_state, X_embedded,
neighbors=None, skip_num_points=0):
"""Runs t-SNE."""
# t-SNE minimizes the Kullback-Leiber divergence of the Gaussians P
# and the Student's t-distributions Q. The optimization algorithm that
# we ... | 0.001066 |
def concat(self, formatted_text):
""":type formatted_text: FormattedText"""
assert self._is_compatible(formatted_text), "Cannot concat text with different modes"
self.text += formatted_text.text
return self | 0.012605 |
def set_basic_params(
self, workers=None, zerg_server=None, fallback_node=None, concurrent_events=None,
cheap_mode=None, stats_server=None, quiet=None, buffer_size=None,
keepalive=None, resubscribe_addresses=None):
"""
:param int workers: Number of worker processes to... | 0.006218 |
def dump2json(self, obj, filepath, override=False, **kwargs):
"""
Dump a dictionary into a JSON dictionary.
Uses the json.dump() function.
Parameters
----------
obj : :class:`dict`
A dictionary to be dumpped as JSON file.
filepath : :class:`str`
... | 0.001273 |
def get_identity(user):
"""Create an identity for a given user instance.
Primarily useful for testing.
"""
identity = Identity(user.id)
if hasattr(user, 'id'):
identity.provides.add(UserNeed(user.id))
for role in getattr(user, 'roles', []):
identity.provides.add(RoleNeed(role.... | 0.002688 |
def mod(cmd, params):
"""
Mod management command
rqalpha mod list \n
rqalpha mod install xxx \n
rqalpha mod uninstall xxx \n
rqalpha mod enable xxx \n
rqalpha mod disable xxx \n
"""
def list(params):
"""
List all mod configuration
"""
from tabulate i... | 0.00122 |
def _function_handler(function, args, kwargs, pipe):
"""Runs the actual function in separate process and returns its result."""
signal.signal(signal.SIGINT, signal.SIG_IGN)
result = process_execute(function, *args, **kwargs)
send_result(pipe, result) | 0.003731 |
def _copy_if_necessary(self, local_path, overwrite):
"""
Return cached path to local file, copying it to the cache if necessary.
"""
local_path = abspath(local_path)
if not exists(local_path):
raise MissingLocalFile(local_path)
elif not self.copy_local_files_t... | 0.00339 |
def _getattr(self, attri, fname=None, numtype='cycNum'):
''' Private method for getting an attribute, called from get.'''
if str(fname.__class__)=="<type 'list'>":
isList=True
else:
isList=False
data=[]
if fname==None:
fname=self.files
... | 0.019986 |
def select_army(self, shift):
"""Select the entire army."""
action = sc_pb.Action()
action.action_ui.select_army.selection_add = shift
return action | 0.006098 |
def parse_root(raw):
"Efficiently parses the root element of a *raw* XML document, returning a tuple of its qualified name and attribute dictionary."
if sys.version < '3':
fp = StringIO(raw)
else:
fp = BytesIO(raw.encode('UTF-8'))
for event, element in etree.iterparse(fp, events=('start'... | 0.00542 |
def encode_multipart_formdata(self, fields, files, baseName, verbose=False):
"""
Fields is a sequence of (name, value) elements for regular form fields.
Files is a sequence of (name, filename, value) elements for data
to be uploaded as files
Returns: (content_type, body) ready f... | 0.002266 |
def find_image_position(origin='origin.png', query='query.png', outfile=None):
'''
find all image positions
@return None if not found else a tuple: (origin.shape, query.shape, postions)
might raise Exception
'''
img1 = cv2.imread(query, 0) # query image(small)
img2 = cv2.imread(origin, 0) # ... | 0.009164 |
def make_log_metric(level=logging.INFO, msg="%d items in %.2f seconds"):
"""Make a new metric function that logs at the given level
:arg int level: logging level, defaults to ``logging.INFO``
:arg string msg: logging message format string, taking ``count`` and ``elapsed``
:rtype: function
"""
d... | 0.003846 |
def ensure_sink(self):
"""Ensure the log sink and its pub sub topic exist."""
topic_info = self.pubsub.ensure_topic()
scope, sink_path, sink_info = self.get_sink(topic_info)
client = self.session.client('logging', 'v2', '%s.sinks' % scope)
try:
sink = client.execute_c... | 0.002075 |
def assign(self, dst_addr_ast):
"""
Assign a new region for under-constrained symbolic execution.
:param dst_addr_ast: the symbolic AST which address of the new allocated region will be assigned to.
:return: as ast of memory address that points to a new region
"""
if ds... | 0.00783 |
def deprecated(replacement_description):
"""States that method is deprecated.
:param replacement_description: Describes what must be used instead.
:return: the original method with modified docstring.
"""
def decorate(fn_or_class):
if isinstance(fn_or_class, type):
pass # Can... | 0.002809 |
def receive(self, diff, paths):
""" Return Context Manager for a file-like (stream) object to store a diff. """
path = self.selectReceivePath(paths)
keyName = self._keyName(diff.toUUID, diff.fromUUID, path)
if self._skipDryRun(logger)("receive %s in %s", keyName, self):
retu... | 0.008547 |
def calculate2d(self, force=True):
"""
recalculate 2d coordinates. currently rings can be calculated badly.
:param force: ignore existing coordinates of atoms
"""
for ml in (self.__reagents, self.__reactants, self.__products):
for m in ml:
m.calculate... | 0.005587 |
def _jx_expression(expr, lang):
"""
WRAP A JSON EXPRESSION WITH OBJECT REPRESENTATION
"""
if is_expression(expr):
# CONVERT TO lang
new_op = lang[expr.id]
if not new_op:
# CAN NOT BE FOUND, TRY SOME PARTIAL EVAL
return language[expr.id].partial_eval()
... | 0.004334 |
def illum(target, et, abcorr, obsrvr, spoint):
"""
Deprecated: This routine has been superseded by the CSPICE
routine ilumin. This routine is supported for purposes of
backward compatibility only.
Find the illumination angles at a specified surface point of a
target body.
http://naif.jpl.n... | 0.000717 |
def _do_resumable_upload(
self, client, stream, content_type, size, num_retries, predefined_acl
):
"""Perform a resumable upload.
Assumes ``chunk_size`` is not :data:`None` on the current blob.
The content type of the upload will be determined in order
of precedence:
... | 0.001531 |
def post(self, uri, data, **kwargs):
"""POST the provided data to the specified path
See :meth:`request` for additional details. The `data` parameter here is
expected to be a string type.
"""
return self.request("POST", uri, data=data, **kwargs) | 0.010453 |
def data(self, filtered=False, no_empty=False):
r"""
Return (filtered) file data.
The returned object is a list, each item is a sub-list corresponding
to a row of data; each item in the sub-lists contains data
corresponding to a particular column
:param filtered: Fi... | 0.00209 |
def get_host(self, host_id, **kwargs):
"""Get details about a dedicated host.
:param integer : the host ID
:returns: A dictionary containing host information.
Example::
# Print out host ID 12345.
dh = mgr.get_host(12345)
print dh
# Prin... | 0.001155 |
def community_post_subscriptions(self, post_id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/help_center/subscriptions#list-post-subscriptions"
api_path = "/api/v2/community/posts/{post_id}/subscriptions.json"
api_path = api_path.format(post_id=post_id)
return self.call(api_pa... | 0.009009 |
def _describe_fields(cls):
"""
Return a dictionary for the class fields description.
Fields should NOT be wrapped by _precomputed_field, if necessary
"""
dispatch_table = {
'ShortestPathModel': 'sssp',
'GraphColoringModel': 'graph_coloring',
'P... | 0.004343 |
def got_arbiter_module_type_defined(self, module_type):
"""Check if a module type is defined in one of the arbiters
Also check the module name
:param module_type: module type to search for
:type module_type: str
:return: True if mod_type is found else False
:rtype: bool
... | 0.00277 |
def compress_histogram_proto(histo, bps=NORMAL_HISTOGRAM_BPS):
"""Creates fixed size histogram by adding compression to accumulated state.
This routine transforms a histogram at a particular step by interpolating its
variable number of buckets to represent their cumulative weight at a constant
number of compre... | 0.012842 |
def clean_list_of_twitter_list(list_of_twitter_lists,
sent_tokenize, _treebank_word_tokenize,
tagger, lemmatizer, lemmatize, stopset,
first_cap_re, all_cap_re, digits_punctuation_whitespace_re,
po... | 0.005441 |
def contained(self, key, include_self=True, exclusive=False, biggest_first=True, only=None):
"""Get all locations that are completely within this location.
If the ``resolved_row`` context manager is not used, ``RoW`` doesn't have a spatial definition. Therefore, ``.contained("RoW")`` returns a list wit... | 0.006689 |
def addInputPort(self, node, name,
i: Union[Value, RtlSignalBase],
side=PortSide.WEST):
"""
Add and connect input port on subnode
:param node: node where to add input port
:param name: name of newly added port
:param i: input value
... | 0.00253 |
def get_provider_fn_decorations(provider_fn, default_arg_names):
"""Retrieves the provider method-relevant info set by decorators.
If any info wasn't set by decorators, then defaults are returned.
Args:
provider_fn: a (possibly decorated) provider function
default_arg_names: the (possibly empt... | 0.000568 |
def output_spectrum(self, spectrum, filepath, header={}):
"""
Prints a file of the given spectrum to an ascii file with specified filepath.
Parameters
----------
spectrum: int, sequence
The id from the SPECTRA table or a [w,f,e] sequence
filepath: str
... | 0.005551 |
def get_rate(self, currency, date):
"""Get the exchange rate for ``currency`` against ``_INTERNAL_CURRENCY``
If implementing your own backend, you should probably override :meth:`_get_rate()`
rather than this.
"""
if str(currency) == defaults.INTERNAL_CURRENCY:
retur... | 0.006969 |
def logoff_session(session_id):
'''
Initiate the logoff of a session.
.. versionadded:: 2016.11.0
:param session_id: The numeric Id of the session.
:return: A boolean representing whether the logoff succeeded.
CLI Example:
.. code-block:: bash
salt '*' rdp.logoff_session session... | 0.003339 |
def get_verb_function(data, verb):
"""
Return function that implements the verb for given data type
"""
try:
module = type_lookup[type(data)]
except KeyError:
# Some guess work for subclasses
for type_, mod in type_lookup.items():
if isinstance(data, type_):
... | 0.001792 |
def find(self, name, menu=None):
"""
Finds a menu item by name and returns it.
:param name:
The menu item name.
"""
menu = menu or self.menu
for i in menu:
if i.name == name:
return i
else:
i... | 0.004292 |
def ParserUnparserFactory(module_name, *unparser_names):
"""
Produce a new parser/unparser object from the names provided.
"""
parse_callable = import_module(PKGNAME + '.parsers.' + module_name).parse
unparser_module = import_module(PKGNAME + '.unparsers.' + module_name)
return RawParserUnparse... | 0.002336 |
def _register_bindings(self, data):
"""
connection_handler method which is called when we connect to pusher.
Responsible for binding callbacks to channels before we connect.
:return:
"""
self._register_diff_order_book_channels()
self._register_live_orders_channels... | 0.004843 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.