text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def _useChunk(self, index) -> None:
"""
Switch to specific chunk
:param index:
"""
if self.currentChunk is not None:
if self.currentChunkIndex == index and \
not self.currentChunk.closed:
return
self.currentChunk.close... | 0.004292 |
def GetWindowsEnvironmentVariablesMap(knowledge_base):
"""Return a dictionary of environment variables and their values.
Implementation maps variables mentioned in
https://en.wikipedia.org/wiki/Environment_variable#Windows to known
KB definitions.
Args:
knowledge_base: A knowledgebase object.
Returns... | 0.008824 |
def get_worker_digests(self):
"""
If we are being called from an orchestrator build, collect the worker
node data and recreate the data locally.
"""
try:
builds = self.workflow.build_result.annotations['worker-builds']
except(TypeError, KeyError):
... | 0.00227 |
def merge_record_extra(record, target, reserved):
"""
Merges extra attributes from LogRecord object into target dictionary
:param record: logging.LogRecord
:param target: dict to update
:param reserved: dict or list with reserved keys to skip
"""
for key, value in record.__dict__.items():
... | 0.001855 |
def put_file(self, in_path, out_path):
''' transfer a file from local to local '''
vvv("PUT %s TO %s" % (in_path, out_path), host=self.host)
if not os.path.exists(in_path):
raise errors.AnsibleFileNotFound("file or module does not exist: %s" % in_path)
try:
shuti... | 0.007645 |
def track(self, thread_id, frame, frame_id_to_lineno, frame_custom_thread_id=None):
'''
:param thread_id:
The thread id to be used for this frame.
:param frame:
The topmost frame which is suspended at the given thread.
:param frame_id_to_lineno:
If a... | 0.006431 |
def abi_encode_args(method, args):
"encode args for method: method_id|data"
assert issubclass(method.im_class, NativeABIContract), method.im_class
m_abi = method.im_class._get_method_abi(method)
return zpad(encode_int(m_abi['id']), 4) + abi.encode_abi(m_abi['arg_types'], args) | 0.006826 |
async def process_events_async(self, context, messages):
"""
Called by the processor host when a batch of events has arrived.
This is where the real work of the event processor is done.
:param context: Information about the partition
:type context: ~azure.eventprocessorhost.Parti... | 0.003478 |
def set_ncbi_email():
"""Set contact email for NCBI."""
Entrez.email = args.email
logger.info("Set NCBI contact email to %s", args.email)
Entrez.tool = "genbank_get_genomes_by_taxon.py" | 0.004975 |
def categorize(
data, col_name: str = None, new_col_name: str = None,
categories: dict = None, max_categories: float = 0.15
):
"""
:param data:
:param col_name:
:param new_col_name:
:param categories:
:param max_categories: max proportion threshold of categories
:return: new categori... | 0.000568 |
def locale(self):
'''
Do a lookup for the locale code that is set for this layout.
NOTE: USB HID specifies only 35 different locales. If your layout does not fit, it should be set to Undefined/0
@return: Tuple (<USB HID locale code>, <name>)
'''
name = self.json_data['h... | 0.006036 |
def getValue(words):
"""Computes the sum of the values of the words."""
value = 0
for word in words:
for letter in word:
# shared.getConst will evaluate to the dictionary broadcasted by
# the root Future
value += shared.getConst('lettersValue')[letter]
return ... | 0.003077 |
def _set_status_flag(self, status):
"""
Configure state and files on disk to match current processing status.
:param str status: Name of new status designation for pipeline.
"""
# Remove previous status flag file.
flag_file_path = self._flag_file_path()
try:
... | 0.004278 |
def _fetch_features(self):
""" Retrieves a new page of features from Geopedia
"""
if self.next_page_url is None:
return
response = get_json(self.next_page_url, post_values=self.query, headers=self.gpd_session.session_headers)
self.features.extend(response['features'... | 0.006818 |
def p_decl(self, p):
'decl : sigtypes declnamelist SEMICOLON'
decllist = []
for rname, rlength in p[2]:
decllist.extend(self.create_decl(p[1], rname, length=rlength,
lineno=p.lineno(2)))
p[0] = Decl(tuple(decllist), lineno=p.lineno... | 0.00554 |
def _parse_trigger(self, trigger_clause):
"""Parse a named event or explicit stream trigger into a TriggerDefinition."""
cond = trigger_clause[0]
named_event = None
explicit_stream = None
explicit_trigger = None
# Identifier parse tree is Group(Identifier)
if c... | 0.004591 |
def send_message(self, message):
"""
Dispatch a message using 0mq
"""
with self._instance_lock:
if message is None:
Global.LOGGER.error("can't deliver a null messages")
return
if message.sender is None:
Global.LOGGE... | 0.003776 |
def algorithm(self):
"""
:return:
A unicode string of "rsa", "dsa" or "ec"
"""
if self._algorithm is None:
self._algorithm = self['private_key_algorithm']['algorithm'].native
return self._algorithm | 0.007634 |
def set_timestamp_to_current(self):
"""
Set timestamp to current time utc
:rtype: None
"""
# Good form to add tzinfo
self.timestamp = pytz.UTC.localize(datetime.datetime.utcnow()) | 0.008772 |
def _find_alias(FunctionName, Name, FunctionVersion=None,
region=None, key=None, keyid=None, profile=None):
'''
Given function name and alias name, find and return matching alias information.
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
args = {
... | 0.00315 |
def redirect(location=None, internal=False, code=None, headers={},
add_slash=False, request=None):
'''
Perform a redirect, either internal or external. An internal redirect
performs the redirect server-side, while the external redirect utilizes
an HTTP 302 status code.
:param location:... | 0.000637 |
def get_alarms(username, auth, url):
"""Takes in no param as input to fetch RealTime Alarms from HP IMC RESTFUL API
:param username OpeatorName, String type. Required. Default Value "admin". Checks the operator
has the privileges to view the Real-Time Alarms.
:param auth: requests auth object #usuall... | 0.004828 |
def __get_ssh_credentials(vm_):
'''
Get configured SSH credentials.
'''
ssh_user = config.get_cloud_config_value(
'ssh_username', vm_, __opts__, default=os.getenv('USER'))
ssh_key = config.get_cloud_config_value(
'ssh_keyfile', vm_, __opts__,
default=os.path.expanduser('~/.ss... | 0.002667 |
def spectra(self, alpha=None, nmax=None, convention='power', unit='per_l',
base=10.):
"""
Return the spectra of one or more Slepian functions.
Usage
-----
spectra = x.spectra([alpha, nmax, convention, unit, base])
Returns
-------
spectra ... | 0.000798 |
def create_result(self, local_path, container_path, permissions, meta, val, dividers):
"""Default permissions to rw"""
if permissions is NotSpecified:
permissions = 'rw'
return Mount(local_path, container_path, permissions) | 0.011583 |
def merge_accounts(self, request):
"""
Attach NetID account to regular django
account and then redirect user. In this situation
user dont have to fill extra fields because he filled
them when first account (request.user) was created.
Note that self.indentity must be alre... | 0.005794 |
def memory_usage_psutil():
"""Return the current process memory usage in MB.
"""
process = psutil.Process(os.getpid())
mem = process.memory_info()[0] / float(2 ** 20)
mem_vms = process.memory_info()[1] / float(2 ** 20)
return mem, mem_vms | 0.003817 |
def export(self, nidm_version, export_dir):
"""
Create prov graph.
"""
self.stat = None
if isinstance(self.stat_type, QualifiedName):
stat = self.stat_type
elif self.stat_type is not None:
if self.stat_type.lower() == "t":
stat = ST... | 0.002217 |
def month_to_year(timeperiod):
""":param timeperiod: as string in YYYYMM0000 format
:return string in YYYY000000 format"""
t = datetime.strptime(timeperiod, SYNERGY_MONTHLY_PATTERN)
return t.strftime(SYNERGY_YEARLY_PATTERN) | 0.004184 |
def get_xpath_branch(xroot, xpath):
""" :return: the relative part of an XPATH: that which extends past the root provided """
if xroot and xpath and xpath.startswith(xroot):
xpath = xpath[len(xroot):]
xpath = xpath.lstrip(XPATH_DELIM)
return xpath | 0.00722 |
def doublewell(theta):
"""Pointwise minimum of two quadratic bowls"""
k0, k1, depth = 0.01, 100, 0.5
shallow = 0.5 * k0 * theta ** 2 + depth
deep = 0.5 * k1 * theta ** 2
obj = float(np.minimum(shallow, deep))
grad = np.where(deep < shallow, k1 * theta, k0 * theta)
return obj, grad | 0.003236 |
def kill(self) -> None:
"""Kill ffmpeg job."""
self._proc.kill()
self._loop.run_in_executor(None, self._proc.communicate) | 0.013793 |
def as_integer_type(ary):
'''
Returns argument as an integer array, converting floats if convertable.
Raises ValueError if it's a float array with nonintegral values.
'''
ary = np.asanyarray(ary)
if is_integer_type(ary):
return ary
rounded = np.rint(ary)
if np.any(rounded != ary)... | 0.00237 |
def get_datetime(epoch):
'''
get datetime from an epoch timestamp
>>> get_datetime(1432188772)
datetime.datetime(2015, 5, 21, 6, 12, 52)
'''
t = time.gmtime(epoch)
dt = datetime.datetime(*t[:6])
return dt | 0.004184 |
def _get_vnet(self, adapter_number):
"""
Return the vnet will use in ubridge
"""
vnet = "ethernet{}.vnet".format(adapter_number)
if vnet not in self._vmx_pairs:
raise VMwareError("vnet {} not in VMX file".format(vnet))
return vnet | 0.006897 |
def get_mapreduce_yaml(parse=parse_mapreduce_yaml):
"""Locates mapreduce.yaml, loads and parses its info.
Args:
parse: Used for testing.
Returns:
MapReduceYaml object.
Raises:
errors.BadYamlError: when contents is not a valid mapreduce.yaml file or the
file is missing.
"""
mr_yaml_path = ... | 0.015474 |
def determine_keymap(qteMain=None):
"""
Return the conversion from keys and modifiers to Qt constants.
This mapping depends on the used OS and keyboard layout.
.. warning :: This method is currently only a dummy that always
returns the same mapping from characters to keys. It works fine
... | 0.001037 |
def list_networks(kwargs=None, call=None):
'''
List all the standard networks for this VMware environment
CLI Example:
.. code-block:: bash
salt-cloud -f list_networks my-vmware-config
'''
if call != 'function':
raise SaltCloudSystemExit(
'The list_networks functio... | 0.002203 |
def subvol_create(self, path):
"""
Create a btrfs subvolume in the specified path
:param path: path to create
"""
args = {
'path': path
}
self._subvol_chk.check(args)
self._client.sync('btrfs.subvol_create', args) | 0.00692 |
def set_endTimestamp(self,etimestamp=None):
"""
Set the end timestamp of the linguistic processor, set to None for the current time
@type etimestamp: string
@param etimestamp: version of the linguistic processor
"""
if etimestamp is None:
import time
... | 0.011876 |
def suggest_terms(self, fields, prefix, handler='terms', **kwargs):
"""
Accepts a list of field names and a prefix
Returns a dictionary keyed on field name containing a list of
``(term, count)`` pairs
Requires Solr 1.4+.
"""
params = {
'terms.fl': fi... | 0.002408 |
def lock_input_target_config_target_candidate_candidate(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
lock = ET.Element("lock")
config = lock
input = ET.SubElement(lock, "input")
target = ET.SubElement(input, "target")
config_ta... | 0.003472 |
def _dash_escape_text(text: str) -> str:
"""
Add dash '-' (0x2D) and space ' ' (0x20) as prefix on each line
:param text: Text to dash-escape
:return:
"""
dash_escaped_text = str()
for line in text.splitlines(True):
# add dash '-' (0x2D) and space ' ... | 0.00464 |
def validate_account_number(self, account):
"""
Check whether **account** is a valid account number
:param account: Account number to check
:type account: str
:raises: :py:exc:`nano.rpc.RPCException`
>>> rpc.validate_account_number(
... account="xrb_3e3j5tk... | 0.00491 |
def isItemAllowed(self, obj):
"""Returns true if the current analysis to be rendered has a slot
assigned for the current layout.
:param obj: analysis to be rendered as a row in the list
:type obj: ATContentType/DexterityContentType
:return: True if the obj has an slot assigned. ... | 0.003448 |
def add_star(self, nodes, t=None):
"""Add a star at time t.
The first node in nodes is the middle of the star. It is connected
to all other nodes.
Parameters
----------
nodes : iterable container
A container of nodes.
t : snapshot id (default=None)
... | 0.003086 |
def sample_upper_hull(upper_hull, random_stream):
"""
Return a single value randomly sampled from
the given `upper_hull`.
Parameters
----------
upper_hull : List[pyars.hull.HullNode]
Upper hull to evaluate.
random_stream : numpy.random.RandomState
(Seeded) stream of random ... | 0.001787 |
def _take_bits(buf, count):
"""Return the booleans that were packed into bytes."""
# TODO: Verify output
bytes_count = (count + 7) // 8
bytes_mod = count % 8
data = _unpack_from(buf, 'B', bytes_count)
values = []
for i, byte in enumerate(data):
for _ in range(8 if i != bytes_count -... | 0.002132 |
def create_weight_stops(breaks):
"""Convert data breaks into a heatmap-weight ramp
"""
num_breaks = len(breaks)
weight_breaks = scale_between(0, 1, num_breaks)
stops = []
for i, b in enumerate(breaks):
stops.append([b, weight_breaks[i]])
return stops | 0.003484 |
def get_option_parser():
"""
Build an ``optparse.OptionParser`` for pyrpo commandline use
"""
import optparse
prs = optparse.OptionParser(
usage=(
"$0 pyrpo [-h] [-v] [-q] [-s .] "
"[-r <report>] [--thg]"))
prs.add_option('-s', '--scan',
dest=... | 0.000775 |
def _load_audio_file(self):
"""
Load audio in memory.
:rtype: :class:`~aeneas.audiofile.AudioFile`
"""
self._step_begin(u"load audio file")
# NOTE file_format=None forces conversion to
# PCM16 mono WAVE with default sample rate
audio_file = AudioFile... | 0.003478 |
def _join_all_filenames_and_text(
self):
"""
*join all file names, driectory names and text content together*
"""
self.log.info('starting the ``_join_all_filenames_and_text`` method')
contentString = u""
for i in self.directoryContents:
contentStr... | 0.002235 |
def duplicate_sheet(
self,
source_sheet_id,
insert_sheet_index=None,
new_sheet_id=None,
new_sheet_name=None
):
"""Duplicates the contents of a sheet.
:param int source_sheet_id: The sheet ID to duplicate.
:param int insert_sheet_index: (optional) The ... | 0.001845 |
def SegmentMean(a, ids):
"""
Segmented mean op.
"""
func = lambda idxs: np.mean(a[idxs], axis=0)
return seg_map(func, a, ids), | 0.013699 |
def workspace_backup_add(ctx):
"""
Create a new backup
"""
backup_manager = WorkspaceBackupManager(Workspace(ctx.resolver, directory=ctx.directory, mets_basename=ctx.mets_basename, automatic_backup=ctx.automatic_backup))
backup_manager.add() | 0.007663 |
def get_past_events(self):
"""
Get past PythonKC meetup events.
Returns
-------
List of ``pythonkc_meetups.types.MeetupEvent``, ordered by event time,
descending.
Exceptions
----------
* PythonKCMeetupsBadJson
* PythonKCMeetupsBadResponse... | 0.001379 |
def de_casteljau_one_round(nodes, lambda1, lambda2):
"""Perform one round of de Casteljau's algorithm.
.. note::
This is a helper for :func:`_specialize_curve`. It does not have a
Fortran speedup because it is **only** used by a function which has
a Fortran speedup.
The weights ar... | 0.001383 |
def get_method_returning_field_value(self, field_name):
"""
Field values can be obtained from view or core.
"""
return (
super().get_method_returning_field_value(field_name)
or self.core.get_method_returning_field_value(field_name)
) | 0.006734 |
def start(self):
'''
Starts execution of the script
'''
# invoke the appropriate sub-command as requested from command-line
try:
self.args.func()
except SystemExit as e:
if e.code != 0:
raise
except KeyboardInterrupt:
... | 0.003947 |
def system_properties_present(server=None, **kwargs):
'''
Ensures that the system properties are present
properties
The system properties
'''
ret = {'name': '', 'result': None, 'comment': None, 'changes': {}}
del kwargs['name']
try:
data = __salt__['glassfish.get_system_pro... | 0.001408 |
def readlines(self, sizehint=-1):
"""
readlines([size]) -> list of strings, each a line from the file.
Call readline() repeatedly and return a list of the lines so read.
The optional size argument, if given, is an approximate bound on the
total number of bytes in the lines retur... | 0.00274 |
def css_text(self, path, default=NULL, smart=False, normalize_space=True):
"""
Get normalized text of node which matches the css path.
"""
try:
return get_node_text(self.css_one(path), smart=smart,
normalize_space=normalize_space)
exc... | 0.004566 |
def validate(self, value):
"""Make sure that value is of the right type """
if not isinstance(value, self.nested_klass):
self.raise_error('NestedClass is of the wrong type: {0} vs expected {1}'
.format(value.__class__.__name__, self.nested_klass.__name__))
... | 0.010811 |
def dragMouseButtonLeft(self, coord, dest_coord, interval=0.5):
"""Drag the left mouse button without modifiers pressed.
Parameters: coordinates to click on screen (tuple (x, y))
dest coordinates to drag to (tuple (x, y))
interval to send event of btn down, drag ... | 0.003565 |
def _archive_self(self, logfile, key=JobDetails.topkey, status=JobStatus.unknown):
"""Write info about a job run by this `Link` to the job archive"""
self._register_self(logfile, key, status)
if self._job_archive is None:
return
self._job_archive.register_jobs(self.get_jobs()... | 0.009346 |
def parse_json(self, page):
'''Returns json feed.'''
if not isinstance(page, basestring):
page = util.decode_page(page)
self.doc = json.loads(page)
results = self.doc.get(self.result_name, [])
if not results:
self.check_status(self.doc.ge... | 0.017284 |
def myFunc(parameter):
"""This function will be executed on the remote host even if it was not
available at launch."""
print('Hello World from {0}!'.format(scoop.worker))
# It is possible to get a constant anywhere
print(shared.getConst('myVar')[2])
# Parameters are handled as usual
ret... | 0.002967 |
def download_dxfile(dxid, filename, chunksize=dxfile.DEFAULT_BUFFER_SIZE, append=False, show_progress=False,
project=None, describe_output=None, **kwargs):
'''
:param dxid: DNAnexus file ID or DXFile (file handler) object
:type dxid: string or DXFile
:param filename: Local filename
... | 0.003688 |
def paged_search_ext_s(self, base, scope, filterstr='(objectClass=*)', attrlist=None, attrsonly=0,
serverctrls=None, clientctrls=None, timeout=-1, sizelimit=0):
"""
Behaves exactly like LDAPObject.search_ext_s() but internally uses the
simple paged results control to r... | 0.007018 |
def fromordinal(cls, n):
"""Contruct a date from a proleptic Gregorian ordinal.
January 1 of year 1 is day 1. Only the year, month and day are
non-zero in the result.
"""
y, m, d = _ord2ymd(n)
return cls(y, m, d) | 0.007634 |
def unblockqueue(self, queue):
'''
Remove blocked events from the queue and all subqueues. Usually used after queue clear/unblockall to prevent leak.
:returns: the cleared events
'''
subqueues = set()
def allSubqueues(q):
subqueues.add(q)
... | 0.009231 |
def split_levels(fields):
"""
Convert dot-notation such as ['a', 'a.b', 'a.d', 'c'] into
current-level fields ['a', 'c'] and next-level fields
{'a': ['b', 'd']}.
"""
first_level_fields = []
next_level_fields = {}
if not fields:
return first_level_fields, next_level_f... | 0.001225 |
def add_sql_operation(self, app_label, sql_name, operation, dependencies):
"""
Add SQL operation and register it to be used as dependency for further
sequential operations.
"""
deps = [(dp[0], SQL_BLOB, dp[1], self._sql_operations.get(dp)) for dp in dependencies]
self.ad... | 0.006881 |
def stack_hist(ax, stacked_data, sty_cycle, bottoms=None,
hist_func=None, labels=None,
plot_func=None, plot_kwargs=None):
"""
ax : axes.Axes
The axes to add artists too
stacked_data : array or Mapping
A (N, M) shaped array. The first dimension will be iterated... | 0.000338 |
def install_json(self):
"""Return install.json contents."""
file_fqpn = os.path.join(self.app_path, 'install.json')
if self._install_json is None:
if os.path.isfile(file_fqpn):
try:
with open(file_fqpn, 'r') as fh:
self._ins... | 0.006504 |
def unix_install():
"""
Edits or creates .bashrc, .bash_profile, and .profile files in the users
HOME directory in order to add your current directory (hopefully your
PmagPy directory) and assorted lower directories in the PmagPy/programs
directory to your PATH environment variable. It also adds the... | 0.002245 |
def dump_links(self, o):
"""Dump links."""
params = {'versionId': o.version_id}
data = {
'self': url_for(
'.object_api',
bucket_id=o.bucket_id,
key=o.key,
_external=True,
**(params if not o.is_head or o.d... | 0.002421 |
def case_insensitive(self):
"""Matching packages distinguish between uppercase and
lowercase
"""
if "--case-ins" in self.flag:
data = []
data = Utils().package_name(self.PACKAGES_TXT)
data_dict = Utils().case_sensitive(data)
for pkg in self... | 0.003759 |
def find(self, node, list):
"""
Traverse the tree looking for matches.
@param node: A node to match on.
@type node: L{SchemaObject}
@param list: A list to fill.
@type list: list
"""
if self.matcher.match(node):
list.append(node)
sel... | 0.004228 |
def get_signing_key(self, key_type="", owner="", kid=None, **kwargs):
"""
Shortcut to use for signing keys only.
:param key_type: Type of key (rsa, ec, oct, ..)
:param owner: Who is the owner of the keys, "" == me (default)
:param kid: A Key Identifier
:param kwargs: Ext... | 0.00432 |
def update_summary(self, w):
"""Update summary.
The new summary is a weighted average of reviews i.e.
.. math::
\\frac{\\sum_{r \\in R} \\mbox{weight}(r) \\times \\mbox{review}(r)}
{\\sum_{r \\in R} \\mbox{weight}(r)},
where :math:`R` is a set of reviewers... | 0.00275 |
def _fusion_to_dsl(tokens) -> FusionBase:
"""Convert a PyParsing data dictionary to a PyBEL fusion data dictionary.
:param tokens: A PyParsing data dictionary representing a fusion
:type tokens: ParseResult
"""
func = tokens[FUNCTION]
fusion_dsl = FUNC_TO_FUSION_DSL[func]
member_dsl = FUNC_... | 0.001135 |
def show_parser_results(self, parsed_list, unparsed_list):
"""Compile a formatted list of un/successfully parsed files.
:param parsed_list: A list of files that were parsed successfully.
:type parsed_list: list(str)
:param unparsed_list: A list of files that were not parsable.
... | 0.001802 |
def stillRecording(self, deviceId, dataCount):
"""
For a device that is recording, updates the last timestamp so we now when we last received data.
:param deviceId: the device id.
:param dataCount: the no of items of data recorded in this batch.
:return:
"""
statu... | 0.006645 |
def add_vertex(self, x, y, z):
"""
Add a ``VEC3`` of ``floats`` to the ``vert_data`` buffer
"""
self.vert_data.write(
struct.pack('<f', x) +
struct.pack('<f', y) +
struct.pack('<f', z)
)
# retain min/max values
self.vert_min = ... | 0.004796 |
def _get_detail_value(var, attr):
"""
Given a variable and one of its attributes that are available inside of
a template, return its 'method' if it is a callable, its class name if it
is a model manager, otherwise return its value
"""
value = getattr(var, attr)
# Rename common Django class n... | 0.001825 |
def getModelSummaryAsKml(self, session, path=None, documentName=None, withStreamNetwork=True, withNodes=False, styles={}):
"""
Retrieve a KML representation of the model. Includes polygonized mask map and vector stream network.
Args:
session (:mod:`sqlalchemy.orm.session.Session`): ... | 0.00381 |
def tags_with_text(xml, tags=None):
"""Return a list of tags that contain text retrieved recursively from an
XML tree."""
if tags is None:
tags = []
for element in xml:
if element.text is not None:
tags.append(element)
elif len(element) > 0: # pylint: disable=len-as-... | 0.00198 |
def create_empty(self, name=None, renderers=None, RootNetworkList=None, verbose=False):
"""
Create a new, empty network. The new network may be created as part of
an existing network collection or a new network collection.
:param name (string, optional): Enter the name of the new networ... | 0.014585 |
def calculate_hash(options):
"""returns an option_collection_hash given a list of options"""
options = sorted(list(options))
sha_hash = sha1()
# equivalent to loop over the options and call sha_hash.update()
sha_hash.update(''.join(options).encode('utf-8'))
return sha_has... | 0.006006 |
def standard_parser(cls, verbose=True,
interactive=False,
no_interactive=False,
simulate=False,
quiet=False,
overwrite=False):
"""
Create a standard ``OptionParser`` instance.
... | 0.004126 |
def normalize_code_coicop(code):
'''Normalize_coicop est function d'harmonisation de la colonne d'entiers posteCOICOP de la table
matrice_passage_data_frame en la transformant en une chaine de 5 caractères afin de pouvoir par la suite agréger les postes
COICOP selon les 12 postes agrégés de la nomenclature de la co... | 0.00514 |
def do_login(self, http_session):
"""Do vk login
:param http_session: vk_requests.utils.VerboseHTTPSession: http session
"""
response = http_session.get(self.LOGIN_URL)
action_url = parse_form_action_url(response.text)
# Stop login it action url is not found
if... | 0.001044 |
async def service_messages(self, msg, _context):
"""Get all messages for a service."""
msgs = self.service_manager.service_messages(msg.get('name'))
return [x.to_dict() for x in msgs] | 0.009615 |
def parent_of(self, node):
"""Check if this node is the parent of the given node.
:param node: The node to check if it is the child.
:type node: NodeNG
:returns: True if this node is the parent of the given node,
False otherwise.
:rtype: bool
"""
par... | 0.004115 |
def get_bank_hierarchy_session(self):
"""Gets the session traversing bank hierarchies.
return: (osid.assessment.BankHierarchySession) - a
``BankHierarchySession``
raise: OperationFailed - unable to complete request
raise: Unimplemented - ``supports_bank_hierarchy() is ... | 0.003086 |
def createEncoder():
"""Create the encoder instance for our test and return it."""
consumption_encoder = ScalarEncoder(21, 0.0, 100.0, n=50, name="consumption",
clipInput=True)
time_encoder = DateEncoder(timeOfDay=(21, 9.5), name="timestamp_timeOfDay")
encoder = MultiEncoder()
encoder.addEncoder("consu... | 0.021687 |
def get_image_tags(self):
"""
Fetches image labels (repository / tags) from Docker.
:return: A dictionary, with image name and tags as the key and the image id as value.
:rtype: dict
"""
current_images = self.images()
tags = {tag: i['Id'] for i in current_images ... | 0.008219 |
def min_zoom(self):
"""
Get the minimal zoom level of all layers.
Returns:
int: the minimum of all zoom levels of all layers
Raises:
ValueError: if no layers exist
"""
zoom_levels = [map_layer.min_zoom for map_layer in self.layers]
retur... | 0.005917 |
def update(self):
"""Delete the coefficients of the pure MA model and also all MA and
AR coefficients of the ARMA model. Also calculate or delete the values
of all secondary iuh parameters, depending on the completeness of the
values of the primary parameters.
"""
del se... | 0.003333 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.