text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def add_edge(self, x, y, label=None):
"""Add an edge from distribution *x* to distribution *y* with the given
*label*.
:type x: :class:`distutils2.database.InstalledDistribution` or
:class:`distutils2.database.EggInfoDistribution`
:type y: :class:`distutils2.database.In... | 0.003082 |
def set_delegate(address=None, pubkey=None, secret=None):
"""Set delegate parameters. Call set_delegate with no arguments to clear."""
c.DELEGATE['ADDRESS'] = address
c.DELEGATE['PUBKEY'] = pubkey
c.DELEGATE['PASSPHRASE'] = secret | 0.00813 |
def service_status(hostname=None, service=None, **kwargs):
'''
Check status of a particular service on a host on it in Nagios.
By default statuses are returned in a numeric format.
Parameters:
hostname
The hostname to check the status of the service in Nagios.
service
The serv... | 0.003453 |
def disconnect(self, name=None):
"""Clear internal Channel cache, allowing currently unused channels to be implictly closed.
:param str name: None, to clear the entire cache, or a name string to clear only a certain entry.
"""
if name is None:
self._channels = {}
els... | 0.009217 |
def _get_attribute(self, offset):
"""Determines attribute type at the offset and returns \
initialized attribute object.
Returns:
MftAttr: One of the attribute objects \
(eg. :class:`~.mft_attribute.MftAttrFilename`).
None: If atttribute type does not mach an... | 0.00319 |
def print_stats(correctness, confidence, name):
"""
Prints out accuracy, coverage, etc. statistics
:param correctness: ndarray
One bool per example specifying whether it was correctly classified
:param confidence: ndarray
The probability associated with each prediction
:param name: str
The name of... | 0.016416 |
def write_config(self, config_file_path=None, system_id=None):
"""
Write the ROUGE configuration file, which is basically a list
of system summary files and their matching model summary files.
This is a non-static version of write_config_file_static().
config_file_path: P... | 0.00165 |
def executemany(self, query, args):
"""Execute a multi-row query.
query -- string, query to execute on server
args
Sequence of sequences or mappings, parameters to use with
query.
Returns long integer rows affected, if any.
... | 0.006143 |
def set_start_location(self, new_location):
# type: (int) -> None
'''
A method to set the location of the start of the partition.
Parameters:
new_location - The new extent the UDF partition should start at.
Returns:
Nothing.
'''
if not self._ini... | 0.008264 |
def phase_step(z,Ns,p_step,Nstep):
"""
Create a one sample per symbol signal containing a phase rotation
step Nsymb into the waveform.
:param z: complex baseband signal after matched filter
:param Ns: number of sample per symbol
:param p_step: size in radians of the phase step
:param Nstep:... | 0.00753 |
def setData(self, index, value, role=Qt.DisplayRole):
"""Set the value to the index position depending on Qt::ItemDataRole and data type of the column
Args:
index (QtCore.QModelIndex): Index to define column and row.
value (object): new value.
role (Qt::ItemDataRole)... | 0.00321 |
def draw(self, mode="triangle_strip"):
""" Draw collection """
gl.glDepthMask(gl.GL_FALSE)
Collection.draw(self, mode)
gl.glDepthMask(gl.GL_TRUE) | 0.011236 |
def _is_collinear(self, lons, lats):
"""
Checks if first three points are collinear - in the spherical
case this corresponds to all points lying on a great circle
and, hence, all coordinate vectors being in a single plane.
"""
x, y, z = lonlat2xyz(lons[:3], lats[:3])
... | 0.004545 |
def alter(self, interfaces):
"""
Used to provide the ability to alter the interfaces dictionary before
it is returned from self.parse().
Required Arguments:
interfaces
The interfaces dictionary.
Returns: interfaces dict
"""
# fixup ... | 0.001629 |
def request_name(self, name):
"""Request a name, might return the name or a similar one if already
used or reserved
"""
while name in self._blacklist:
name += "_"
self._blacklist.add(name)
return name | 0.007663 |
def reparentUnions(self):
'''
Helper method for :func:`~exhale.graph.ExhaleRoot.reparentAll`. Namespaces and
classes should have the unions defined in them to be in the child list of itself
rather than floating around. Union nodes that are reparented (e.g. a union
defined in a ... | 0.006067 |
def get_plugin_instance(plugin_class, *args, **kwargs):
"""Returns an instance of a fully initialized plugin class
Every plugin class is kept in a plugin cache, effectively making
every plugin into a singleton object.
When a plugin has a yaz.dependency decorator, it will be called
as well, before ... | 0.003418 |
def get_port_channel_detail_output_lacp_individual_agg(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_port_channel_detail = ET.Element("get_port_channel_detail")
config = get_port_channel_detail
output = ET.SubElement(get_port_channel_detail... | 0.003396 |
def to_barrier_key(cls, barrier_index_key):
"""Converts a _BarrierIndex key to a _BarrierRecord key.
Args:
barrier_index_key: db.Key for a _BarrierIndex entity.
Returns:
db.Key for the corresponding _BarrierRecord entity.
"""
barrier_index_path = barrier_index_key.to_path()
# Pick... | 0.001451 |
def Sigmoid(input_vertex: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
"""
Applies the sigmoid function to a vertex.
The sigmoid function is a special case of the Logistic function.
:param input_vertex: the vertex
"""
return Double(context.jvm_view().SigmoidVertex, ... | 0.016529 |
def skip_child(self, child, ancestry):
""" get whether or not to skip the specified child """
if child.any(): return True
for x in ancestry:
if x.choice():
return True
return False | 0.0125 |
def strip_oembeds(text, args=None):
"""
Take a block of text and strip all the embeds from it, optionally taking
a maxwidth, maxheight / resource_type
Usage:
{{ post.content|strip_embeds }}
{{ post.content|strip_embeds:"600x600xphoto" }}
{{ post.content|strip_embeds:"video" }}... | 0.007013 |
def validate_checkpoint_files(checkpoint_file, backup_file):
"""Checks if the given checkpoint and/or backup files are valid.
The checkpoint file is considered valid if:
* it passes all tests run by ``check_integrity``;
* it has at least one sample written to it (indicating at least one
... | 0.000323 |
def init_app(self, app, storage=None, cache=None, file_upload=None):
"""
Initialize the engine.
:param app: The app to use
:type app: Object
:param storage: The blog storage instance that implements the
:type storage: Object
:param cache: (Optional) A Flask-Cache... | 0.001493 |
def set_interactive_policy(*, locals=None, banner=None, serve=None,
prompt_control=None):
"""Use an interactive event loop by default."""
policy = InteractiveEventLoopPolicy(
locals=locals,
banner=banner,
serve=serve,
prompt_control=prompt_control)
... | 0.002801 |
def resolve_egg_link(path):
"""
Given a path to an .egg-link, resolve distributions
present in the referenced path.
"""
referenced_paths = non_empty_lines(path)
resolved_paths = (
os.path.join(os.path.dirname(path), ref)
for ref in referenced_paths
)
dist_groups = map(fin... | 0.002597 |
def size(self):
"""
The size of this block, in bytes
"""
if self._size is None:
self._size = sum(s.len for s in self.statements if type(s) is stmt.IMark)
return self._size | 0.013453 |
def angle_between_vectors(x, y):
""" Compute the angle between vector x and y """
dp = dot_product(x, y)
if dp == 0:
return 0
xm = magnitude(x)
ym = magnitude(y)
return math.acos(dp / (xm*ym)) * (180. / math.pi) | 0.004115 |
def to_graph_decomposition(H):
"""Returns a DirectedHypergraph object that has the same nodes (and
corresponding attributes) as the given hypergraph, except that for all
hyperedges in the given hypergraph, each node in the tail of the hyperedge
is pairwise connected to each node in the head of the hyper... | 0.000772 |
def depth(self):
"""Depth at grid centers (m)
:getter: Returns the points of axis ``'depth'`` if availible in the
process's domains.
:type: array
:raises: :exc:`ValueError`
if no ``'depth'`` axis can be found.
"""
try:
... | 0.006633 |
def h5ToDict(h5, readH5pyDataset=True):
""" Read a hdf5 file into a dictionary """
h = h5py.File(h5, "r")
ret = unwrapArray(h, recursive=True, readH5pyDataset=readH5pyDataset)
if readH5pyDataset: h.close()
return ret | 0.008475 |
def get_house_conn_gen_load(graph, node):
"""
Get generation capacity/ peak load of neighboring house connected to main
branch
Parameters
----------
graph : :networkx:`NetworkX Graph Obj< >`
Directed graph
node : graph node
Node of the main branch of LV grid
Returns
... | 0.004073 |
def initialize(self, request, response):
"""Initialize.
1. call webapp init.
2. check request is indeed from taskqueue.
3. check the task has not been retried too many times.
4. run handler specific processing logic.
5. run error handling logic if precessing failed.
Args:
request: a ... | 0.00939 |
def add_user(name, password=None, runas=None):
'''
Add a rabbitMQ user via rabbitmqctl user_add <user> <password>
CLI Example:
.. code-block:: bash
salt '*' rabbitmq.add_user rabbit_user password
'''
clear_pw = False
if password is None:
# Generate a random, temporary pas... | 0.000553 |
def create_lab_meeting(self, event_type, presenters, foodie = None, locked = False):
'Presenters can be a comma-separated list of presenters.'
e = self.initialize_tagged_copy()
summary_texts = {
'Lab meeting' : 'Kortemme Lab meeting',
'Kortemme/DeGrado joint meeting' : 'D... | 0.010722 |
def Wang_Chiang_Lu(m, x, rhol, rhog, mul, mug, D, roughness=0, L=1):
r'''Calculates two-phase pressure drop with the Wang, Chiang, and Lu (1997)
correlation given in [1]_ and reviewed in [2]_ and [3]_.
.. math::
\Delta P = \Delta P_{g} \phi_g^2
.. math::
\phi_g^2 = 1 + 9.397X^{0.62} + ... | 0.000622 |
def log(self):
""" Returns the natural logarithm of the quaternion.
(not tested)
"""
# Init
norm = self.norm()
vecNorm = self.x**2 + self.y**2 + self.z**2
tmp = self.w / norm
q = Quaternion()
# Calculate
q.w = np.log(norm... | 0.011194 |
def delete_node(self, node_id):
"""Removes the node identified by node_id from the graph."""
node = self.get_node(node_id)
# Remove all edges from the node
for e in node['edges']:
self.delete_edge_by_id(e)
# Remove all edges to the node
edges = [edge_id for ... | 0.0053 |
def _save_artifact(build, data, content_type):
"""Saves an artifact to the DB and returns it."""
sha1sum = hashlib.sha1(data).hexdigest()
artifact = models.Artifact.query.filter_by(id=sha1sum).first()
if artifact:
logging.debug('Upload already exists: artifact_id=%r', sha1sum)
else:
log... | 0.007987 |
def get_handler(handler_name):
"""
Imports the module for a DOAC handler based on the string representation of the module path that is provided.
"""
from .conf import options
handlers = options.handlers
for handler in handlers:
handler_path = handler.split(".")
name = ... | 0.013913 |
def lookup_thread_id(self):
"Lookup the thread id as path to comment file."
path = os.path.join(self.realm, self.topic + '.csv')
return path | 0.012121 |
def _is_lang_change(self, request):
"""Return True if the lang param is present and URL isn't exempt."""
if 'lang' not in request.GET:
return False
return not any(request.path.endswith(url) for url in self.exempt_urls) | 0.007843 |
def propagate(self, date):
"""Compute state of orbit at a given date, past or future
Args:
date (Date)
Return:
Orbit:
"""
i0, Ω0, e0, ω0, M0, n0 = self.tle
n0 *= 60 # conversion to min⁻¹
if isinstance(date, Date):
t0 = self.t... | 0.002803 |
def dbserver(cmd, dbhostport=None,
dbpath=os.path.expanduser(config.dbserver.file)):
"""
start/stop/restart the database server, or return its status
"""
if config.dbserver.multi_user and getpass.getuser() != 'openquake':
sys.exit('oq dbserver only works in single user mode')
s... | 0.001017 |
def _parse_parameter_locks(optimizer, meta_parameters, parameter_locks):
"""Synchronize meta_parameters and locked_values.
The union of these two sets will have all necessary parameters.
locked_values will have the parameters specified in parameter_locks.
"""
# WARNING: meta_parameters is modified ... | 0.001531 |
def purge_scenario(scenario_id, **kwargs):
"""
Set the status of a scenario.
"""
_check_can_edit_scenario(scenario_id, kwargs['user_id'])
user_id = kwargs.get('user_id')
scenario_i = _get_scenario(scenario_id, user_id)
db.DBSession.delete(scenario_i)
db.DBSession.flush()
retu... | 0.003058 |
def delete_communication_channel_id(self, id, user_id):
"""
Delete a communication channel.
Delete an existing communication channel.
"""
path = {}
data = {}
params = {}
# REQUIRED - PATH - user_id
"""ID"""
path["user_id"] = u... | 0.005362 |
def run(self,
horizon: int,
initial_state: Optional[StateTensor] = None) -> SimulationOutput:
'''Builds the MDP graph and simulates in batch the trajectories
with given `horizon`. Returns the non-fluents, states, actions, interms
and rewards. Fluents and non-fluents are r... | 0.006073 |
def create(self, data):
"""
Create a new SyncListItemInstance
:param dict data: The data
:returns: Newly created SyncListItemInstance
:rtype: twilio.rest.preview.sync.service.sync_list.sync_list_item.SyncListItemInstance
"""
data = values.of({'Data': serialize.o... | 0.004601 |
def get_sections(self, section_name):
"""
Return the list of sections stored in self.timers() given `section_name`
A fake section is returned if the timer does not have section_name.
"""
sections = []
for timer in self.timers():
for sect in timer.sections:
... | 0.005639 |
def account_for_stripped_whitespace(spaces_keys,
removed_spaces,
replacement_types,
len_reportnums,
journals_matches,
replacement_index):
... | 0.000221 |
def _query_wrap(fun, *args, **kwargs):
"""Wait until at least QUERY_WAIT_TIME seconds have passed
since the last invocation of this function, then call the given
function with the given arguments.
"""
with _query_lock:
global _last_query_time
since_last_query = time.time() - _last_qu... | 0.001965 |
def load_existing_json():
"""
Look for an existing json under :meth:`logger.get_logger_dir()` named "stats.json",
and return the loaded list of statistics if found. Returns None otherwise.
"""
dir = logger.get_logger_dir()
fname = os.path.join(dir, JSONWriter.FILENAME)
... | 0.007505 |
def _upgrade_genome_resources(galaxy_dir, base_url):
"""Retrieve latest version of genome resource YAML configuration files.
"""
import requests
for dbkey, ref_file in genome.get_builds(galaxy_dir):
# Check for a remote genome resources file
remote_url = base_url % dbkey
requests... | 0.003215 |
def create_method(self):
"""
Build the estimator method or function.
Returns
-------
:return : string
The built method as string.
"""
n_indents = 0 if self.target_language in ['c', 'go'] else 1
method_type = 'separated.{}.method'.format(self.p... | 0.004082 |
def normalize_etpinard_df(df='https://plot.ly/~etpinard/191.csv', columns='x y size text'.split(),
category_col='category', possible_categories=['Africa', 'Americas', 'Asia', 'Europe', 'Oceania']):
"""Reformat a dataframe in etpinard's format for use in plot functions and sklearn models"""... | 0.007805 |
def fill_in_table(self, table, worksheet, flags):
'''
Fills in any rows with missing right hand side data with empty cells.
'''
max_row = 0
min_row = sys.maxint
for row in table:
if len(row) > max_row:
max_row = len(row)
if len(row)... | 0.003817 |
def min(a, axis=None):
"""
Request the minimum of an Array over any number of axes.
.. note:: Currently limited to operating on a single axis.
Parameters
----------
a : Array object
The object whose minimum is to be found.
axis : None, or int, or iterable of ints
Axis or ax... | 0.001027 |
def create_form(self, label_columns=None, inc_columns=None,
description_columns=None, validators_columns=None,
extra_fields=None, filter_rel_fields=None):
"""
Converts a model to a form given
:param label_columns:
A dictionary with... | 0.004188 |
def print_validation_errors(result):
""" Accepts validation result object and prints report (in red)"""
click.echo(red('\nValidation failed:'))
click.echo(red('-' * 40))
messages = result.get_messages()
for property in messages.keys():
click.echo(yellow(property + ':'))
for error in ... | 0.002475 |
def notify(correlation_id, components, args = None):
"""
Notifies multiple components.
To be notified components must implement [[INotifiable]] interface.
If they don't the call to this method has no effect.
:param correlation_id: (optional) transaction id to trace execution th... | 0.010355 |
def _main(self, client, fileobj, bucket, key, extra_args):
"""
:param client: The client to use when calling PutObject
:param fileobj: The file to upload.
:param bucket: The name of the bucket to upload to
:param key: The name of the key to upload to
:param extra_args: A ... | 0.003861 |
def listFileArray(self):
"""
API to list files in DBS. Either non-wildcarded logical_file_name, non-wildcarded dataset,
non-wildcarded block_name or non-wildcarded lfn list is required.
The combination of a non-wildcarded dataset or block_name with an wildcarded logical_file_name is supported.... | 0.010044 |
def launch(self, args=None):
"""
This method triggers the parsing of arguments.
"""
self.options = self.parse_args(args)
if self.options.saveinputmeta:
# save original input options
self.save_input_meta()
if self.options.inputmeta:
# re... | 0.004878 |
def run_simulation(
t, y0=None, volume=1.0, model=None, solver='ode',
is_netfree=False, species_list=None, without_reset=False,
return_type='matplotlib', opt_args=(), opt_kwargs=None,
structures=None, observers=(), progressbar=0, rndseed=None,
factory=None, ## deprecated
... | 0.001584 |
def shrink_wrap(self):
"""Tightly bound the current text respecting current padding."""
self.frame.size = (self.text_size[0] + self.padding[0] * 2,
self.text_size[1] + self.padding[1] * 2) | 0.008621 |
def getKwargs(self, args, values={}, get=Get()):
"""Gets necessary data from user input.
:args: Dictionary of arguments supplied in command line.
:values: Default values dictionary, supplied for editing.
:get: Object used to get values from user input.
:returns: A dictionary con... | 0.00318 |
def learnObject(self,
objectDescription,
randomLocation=False,
useNoise=False,
noisyTrainingTime=1):
"""
Train the network to recognize the specified object. Move the sensor to one of
its features and activate a random location represen... | 0.005582 |
def get_datasets(dataset_ids,**kwargs):
"""
Get a single dataset, by ID
"""
user_id = int(kwargs.get('user_id'))
datasets = []
if len(dataset_ids) == 0:
return []
try:
dataset_rs = db.DBSession.query(Dataset.id,
Dataset.type,
Dataset.unit_... | 0.012783 |
def _twosComplement(x, bits=16):
"""Calculate the two's complement of an integer.
Then also negative values can be represented by an upper range of positive values.
See https://en.wikipedia.org/wiki/Two%27s_complement
Args:
* x (int): input integer.
* bits (int): number of bits, must b... | 0.004647 |
def get_default_config(self):
"""
Returns default collector settings.
"""
config = super(FilesCollector, self).get_default_config()
config.update({
'path': '.',
'dir': '/tmp/diamond',
'delete': False,
})
return config | 0.006472 |
def cancelar_ultima_venda(self, chave_cfe, dados_cancelamento):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.cancelar_ultima_venda`.
:return: Uma resposta SAT especializada em ``CancelarUltimaVenda``.
:rtype: satcfe.resposta.cancelarultimavenda.RespostaCancelarUltimaVenda
"""
reto... | 0.006173 |
def read_thrift(file_obj, ttype):
"""Read a thrift structure from the given fo."""
from thrift.transport.TTransport import TFileObjectTransport, TBufferedTransport
starting_pos = file_obj.tell()
# set up the protocol chain
ft = TFileObjectTransport(file_obj)
bufsize = 2 ** 16
# for accelera... | 0.004469 |
def cache(handle=lambda *args, **kwargs: None, args=UNDEFINED, kwargs=UNDEFINED, ignore=UNDEFINED, call_stack=UNDEFINED, callback=UNDEFINED, subsequent_rvalue=UNDEFINED):
"""
Store a call descriptor
:param lambda handle: Any callable will work here. The method to cache.
:param tuple args: The arguments... | 0.009021 |
def p_scalar_group(self, p):
"""
scalar_group : SCALAR
| scalar_group SCALAR
"""
if len(p) == 2:
p[0] = (str(p[1]),)
if len(p) == 3:
p[0] = p[1] + (str(p[2]),)
if len(p) == 4:
p[0] = p[1] + (str(p[3]),) | 0.006349 |
def init(driverName=None, debug=False):
'''
Constructs a new TTS engine instance or reuses the existing instance for
the driver name.
@param driverName: Name of the platform specific driver to use. If
None, selects the default driver for the operating system.
@type: str
@param debug: De... | 0.001656 |
def reset_dirty_flags(self):
"""Set all marked_dirty flags of the state machine to false."""
for sm_id, sm in self.state_machines.items():
sm.marked_dirty = False | 0.010526 |
def get_box(self, box_key = None, sort_by = None):
'''Gets a list of one/all box objects. Performs a single GET.
To go deeper individual boxes need to be polled for their contents.
This is a directory for what we could ask for.
Args:
box_key key for the target box (default: None i.e. ALL)
sort_by in des... | 0.04 |
def infer_call_result(self, caller, context):
"""
The boundnode of the regular context with a function called
on ``object.__new__`` will be of type ``object``,
which is incorrect for the argument in general.
If no context is given the ``object.__new__`` call argument will
... | 0.002571 |
def make_grid(rect, cells={}, num_rows=0, num_cols=0, padding=None,
inner_padding=None, outer_padding=None, row_heights={}, col_widths={},
default_row_height='expand', default_col_width='expand'):
"""
Return rectangles for each cell in the specified grid. The rectangles are
returned in a ... | 0.005959 |
def ltcube(self, **kwargs):
""" return the name of a livetime cube file
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
kwargs_copy['dataset'] = kwargs.get('dataset', self.dataset(**kwargs))
localpath = NameFactory.ltcube_format.format(**kwargs_copy)
... | 0.004545 |
def main_browse():
"""Entry point for command line use for browsing a JobArchive """
parser = argparse.ArgumentParser(usage="job_archive.py [options]",
description="Browse a job archive")
parser.add_argument('--jobs', action='store', dest='job_archive_table',
... | 0.00463 |
def _cast_to_type(self, value):
""" Raise error if the value is not a dict """
if not isinstance(value, dict):
self.fail('invalid', value=value)
return value | 0.010363 |
def pagerank(graph, damping_factor=0.85, max_iterations=100, min_delta=0.00001):
"""
Compute and return the PageRank in an directed graph.
@type graph: digraph
@param graph: Digraph.
@type damping_factor: number
@param damping_factor: PageRank dumping factor.
@type max_... | 0.014696 |
def process_paper(model_name, pmid):
"""Process a paper with the given pubmed identifier
Parameters
----------
model_name : str
The directory for the INDRA machine
pmid : str
The PMID to process.
Returns
-------
rp : ReachProcessor
A ReachProcessor containing th... | 0.000546 |
def _end_of_century(self):
"""
Reset the date to the last day of the century
and the time to 23:59:59.999999.
:rtype: DateTime
"""
year = self.year - 1 - (self.year - 1) % YEARS_PER_CENTURY + YEARS_PER_CENTURY
return self.set(year, 12, 31, 23, 59, 59, 999999) | 0.009464 |
def is_stable(self,species):
'''
This routine accepts input formatted like 'He-3' and checks with
stable_el list if occurs in there. If it does, the routine
returns True, otherwise False.
Notes
-----
this method is designed to work with an se instance from
... | 0.014307 |
def _set_dscp_ttl_mode(self, v, load=False):
"""
Setter method for dscp_ttl_mode, mapped from YANG variable /interface/tunnel/dscp_ttl_mode (enumeration)
If this variable is read-only (config: false) in the
source YANG file, then _set_dscp_ttl_mode is considered as a private
method. Backends looking... | 0.004764 |
def get_go2sectiontxt(self):
"""Return a dict with actual header and user GO IDs as keys and their sections as values."""
go2txt = {}
_get_secs = self.hdrobj.get_sections
hdrgo2sectxt = {h:" ".join(_get_secs(h)) for h in self.get_hdrgos()}
usrgo2hdrgo = self.get_usrgo2hdrgo()
... | 0.007968 |
def addToTimeInv(self,*params):
'''
Adds any number of parameters to time_inv for this instance.
Parameters
----------
params : string
Any number of strings naming attributes to be added to time_inv
Returns
-------
None
'''
fo... | 0.007059 |
def clinvar_submission_lines(submission_objs, submission_header):
"""Create the lines to include in a Clinvar submission csv file from a list of submission objects and a custom document header
Args:
submission_objs(list): a list of objects (variants or casedata) to include in a csv file
... | 0.009836 |
def get_feedback_from_submission(self, submission, only_feedback=False, show_everything=False, translation=gettext.NullTranslations()):
"""
Get the input of a submission. If only_input is False, returns the full submissions with a dictionnary object at the key "input".
Else, returns only... | 0.007127 |
def extend(self, collection):
""" L.extend(iterable) -- extend list by appending elements from the iterable """
if type(collection) is list:
if self._col_dict is None and self._col_list is None:
self._col_list = collection
else:
self._col_list += c... | 0.003995 |
def retention_policy_add(database,
name,
duration,
replication,
default=False,
user=None,
password=None,
host=None,
port... | 0.002043 |
def _commonWordStart(self, words):
"""Get common start of all words.
i.e. for ['blablaxxx', 'blablayyy', 'blazzz'] common start is 'bla'
"""
if not words:
return ''
length = 0
firstWord = words[0]
otherWords = words[1:]
for index, char in enum... | 0.00404 |
def exists(device=''):
'''
Check to see if the partition exists
CLI Example:
.. code-block:: bash
salt '*' partition.exists /dev/sdb1
'''
if os.path.exists(device):
dev = os.stat(device).st_mode
if stat.S_ISBLK(dev):
return True
return False | 0.003226 |
def parallel(func, arr:Collection, max_workers:int=None):
"Call `func` on every element of `arr` in parallel using `max_workers`."
max_workers = ifnone(max_workers, defaults.cpus)
if max_workers<2: results = [func(o,i) for i,o in progress_bar(enumerate(arr), total=len(arr))]
else:
with ProcessPo... | 0.025078 |
def p_identlist(self, t):
'''identlist : IDENT
| NOT IDENT
| IDENT AND identlist
| NOT IDENT AND identlist
'''
if len(t)==5 :
#print(t[1],t[2],t[3],t[4])
t[0] = t[1]+t[2]+t[3]+t[4]
elif len(t)==4 :
#pri... | 0.052727 |
def _openssl_key_iv(passphrase, salt):
"""
Returns a (key, iv) tuple that can be used in AES symmetric encryption
from a *passphrase* (a byte or unicode string) and *salt* (a byte array).
"""
def _openssl_kdf(req):
if hasattr(passphrase, 'encode'):
passwd = passphrase.encode('asc... | 0.001174 |
def _update_structure_lines(self):
'''ATOM and HETATM lines may be altered by function calls. When this happens, this function should be called to keep self.structure_lines up to date.'''
structure_lines = []
atom_chain_order = []
chain_atoms = {}
for line in self.lines:
... | 0.004258 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.