text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def run_spp(self, input_bam, output, plot, cpus):
"""
Run the SPP read peak analysis tool.
:param str input_bam: Path to reads file
:param str output: Path to output file
:param str plot: Path to plot file
:param int cpus: Number of processors to use
:return str:... | 0.003497 |
def from_path(path):
'''
create from path.
return `None` if path is not exists.
'''
if os.path.isdir(path):
return DirectoryInfo(path)
if os.path.isfile(path):
return FileInfo(path)
return None | 0.007246 |
def export(self, location):
"""Export the svn repository at the url to the destination location"""
url, rev = self.get_url_rev()
logger.notify('Exporting svn repository %s to %s' % (url, location))
logger.indent += 2
try:
if os.path.exists(location):
#... | 0.004425 |
def _setup_positions(self, positions):
"""Processes positions to account for ranges
Arguments:
positions - list of positions and/or ranges to process
"""
updated_positions = []
for i, position in enumerate(positions):
ranger = re.search(r'(?P<start>-... | 0.001427 |
def get_pool(cls) -> Pool:
"""
Yields:
existing db connection pool
"""
if len(cls._connection_params) < 5:
raise ConnectionError('Please call SQLStore.connect before calling this method')
if not cls._pool:
cls._pool = yield from create_pool(**c... | 0.008174 |
def namespace(self):
"""
Return the Namespace URI (if any) as a String for the current tag
"""
if self.m_name == -1 or (self.m_event != const.START_TAG and self.m_event != const.END_TAG):
return u''
# No Namespace
if self.m_namespaceUri == 0xFFFFFFFF:
... | 0.007895 |
def _func_addrs_from_prologues(self):
"""
Scan the entire program image for function prologues, and start code scanning at those positions
:return: A list of possible function addresses
"""
# Pre-compile all regexes
regexes = list()
for ins_regex in self.project... | 0.003856 |
def _makedos(self, ax, dos_plotter, dos_options, dos_label=None):
"""This is basically the same as the SDOSPlotter get_plot function."""
# don't use first 4 colours; these are the band structure line colours
cycle = cycler(
'color', rcParams['axes.prop_cycle'].by_key()['color'][4:])... | 0.001207 |
def _ensure_frames(cls, documents):
"""
Ensure all items in a list are frames by converting those that aren't.
"""
frames = []
for document in documents:
if not isinstance(document, Frame):
frames.append(cls(document))
else:
... | 0.005464 |
def dispatch(self, frame):
'''
Override the default dispatch since we don't need the rest of
the stack.
'''
if frame.type() == HeartbeatFrame.type():
self.send_heartbeat()
elif frame.type() == MethodFrame.type():
if frame.class_id == 10:
... | 0.001955 |
def run(self, generations, p_mutate, p_crossover, elitist=True, two_point_crossover=False,
refresh_after=None, quit_after=None):
"""
Run a standard genetic algorithm simulation for a set number
of generations (iterations), each consisting of the following
ordered steps:
... | 0.008331 |
def connect(self, address='session'):
"""Connect to *address* and wait until the connection is established.
The *address* argument must be a D-BUS server address, in the format
described in the D-BUS specification. It may also be one of the special
addresses ``'session'`` or ``'system'`... | 0.00224 |
def get_select_sql(self):
"""
Gets the SELECT field portion for the field without the alias. If the field
has a table, it will be included here like AggregateFunction(table.field)
:return: Gets the SELECT field portion for the field without the alias
:rtype: str
"""
... | 0.008016 |
def get_assessment_offered_lookup_session_for_bank(self, bank_id):
"""Gets the ``OsidSession`` associated with the assessment offered lookup service for the given bank.
arg: bank_id (osid.id.Id): the ``Id`` of the bank
return: (osid.assessment.AssessmentOfferedLookupSession) - an
... | 0.004177 |
async def process_ltd_doc(session, github_api_token, ltd_product_url,
mongo_collection=None):
"""Ingest any kind of LSST document hosted on LSST the Docs from its
source.
Parameters
----------
session : `aiohttp.ClientSession`
Your application's aiohttp client sess... | 0.000345 |
def deaccent(text):
"""
Remove accentuation from the given string. Input text is either a unicode string or utf8 encoded bytestring.
Return input string with accents removed, as unicode.
>>> deaccent("Šéf chomutovských komunistů dostal poštou bílý prášek")
u'Sef chomutovskych komunistu dostal post... | 0.003003 |
def _format_option_value(optdict, value):
"""return the user input's value from a 'compiled' value"""
if isinstance(value, (list, tuple)):
value = ",".join(_format_option_value(optdict, item) for item in value)
elif isinstance(value, dict):
value = ",".join("%s:%s" % (k, v) for k, v in value... | 0.001577 |
def comment (self, s, **args):
"""Write GML comment."""
self.writeln(s=u'comment "%s"' % s, **args) | 0.026087 |
def reserve_ipblock(self, ipblock):
"""
Reserves an IP block within your account.
"""
properties = {
"name": ipblock.name
}
if ipblock.location:
properties['location'] = ipblock.location
if ipblock.size:
properties['size'] = ... | 0.003731 |
def stream_download_async(self, response, user_callback):
"""Async Generator for streaming request body data.
:param response: The initial response
:param user_callback: Custom callback for monitoring progress.
"""
block = self.config.connection.data_block_size
return Str... | 0.005376 |
def __process_sentence(sentence_tuple, counts):
"""pull the actual sentence from the tuple (tuple contains additional data such as ID)
:param _sentence_tuple:
:param counts:
"""
sentence = sentence_tuple[2]
# now we start replacing words one type at a time...
sentence = __replace_verbs(sen... | 0.003118 |
def serialize(self, value, **kwargs):
"""Return a serialized copy of the tuple"""
kwargs.update({'include_class': kwargs.get('include_class', True)})
if self.serializer is not None:
return self.serializer(value, **kwargs)
if value is None:
return None
seri... | 0.004619 |
def make_link_node(rawtext, app, name, options):
"""
Create a link to the TL reference.
:param rawtext: Text being replaced with link node.
:param app: Sphinx application context
:param name: Name of the object to link to
:param options: Options dictionary passed to role func.
"""
try:
... | 0.001318 |
def send_sticker(self, sticker: str, reply: Message=None, on_success: callable=None,
reply_markup: botapi.ReplyMarkup=None):
"""
Send sticker to this peer.
:param sticker: File path to sticker to send.
:param reply: Message object.
:param on_success: Callback... | 0.019435 |
def predicted_obs_vec(self):
'''The predicted observation vector
The observation vector for the next step in the filter.
'''
if not self.has_cached_obs_vec:
self.obs_vec = dot_n(
self.observation_matrix,
self.predicted_state_vec[:,:,np.newaxis... | 0.016807 |
def decode(s):
"""
Decode a string using the system encoding if needed (ie byte strings)
"""
if isinstance(s, bytes):
return s.decode(sys.getdefaultencoding())
else:
return s | 0.004608 |
def generate_histograms_table(samples_table, samples, max_bins=1024):
"""
Generate a table of histograms as a DataFrame.
Parameters
----------
samples_table : DataFrame
Table specifying samples to analyze. For more information about the
fields required in this table, please consult ... | 0.001809 |
def omap(m):
'''
Create a nested mapping from origin to property to values/attributes covering an entire Versa model
'''
om = {}
for s, p, o, a in m.match():
om.setdefault(s, {})
om[s].setdefault(p, []).append((o, a))
return om | 0.007491 |
def make_ner_file(self, clean_visible_path, ner_xml_path):
'''run tagger a child process to get XML output'''
if self.template is None:
raise exceptions.NotImplementedError('''
Subclasses must specify a class property "template" that provides
command string format for running a tagger. It s... | 0.003247 |
def _get_system_python_executable():
""" Returns the path the system-wide python binary.
(In case we're running in a virtualenv or venv)
"""
# This function is required by get_package_as_folder() to work
# inside a virtualenv, since venv creation will fail with
# the virtualenv's local pytho... | 0.000301 |
def spawn(func, *args, **kwargs):
"""Spawn a new fiber.
A new :class:`Fiber` is created with main function *func* and positional
arguments *args*. The keyword arguments are passed to the :class:`Fiber`
constructor, not to the main function. The fiber is then scheduled to start
by calling its :meth:... | 0.002165 |
def downsample(self, factor):
"""
Compute a downsampled version of the skeleton by striding while
preserving endpoints.
factor: stride length for downsampling the saved skeleton paths.
Returns: downsampled PrecomputedSkeleton
"""
if int(factor) != factor or factor < 1:
raise ValueEr... | 0.011384 |
def setSceneRect( self, *args ):
"""
Overloads the set scene rect to handle rebuild information.
"""
super(XChartScene, self).setSceneRect(*args)
self._dirty = True | 0.019139 |
def get_properties(self, packet, bt_addr):
"""Get properties of beacon depending on type."""
if is_one_of(packet, [EddystoneTLMFrame, EddystoneURLFrame, \
EddystoneEncryptedTLMFrame, EddystoneEIDFrame]):
# here we retrieve the namespace and instance which corres... | 0.00813 |
def get(model, *args, **kwargs):
'''
Get an autofixture instance for the passed in *model* sing the either an
appropiate autofixture that was :ref:`registry <registry>` or fall back
to the default:class:`AutoFixture` class. *model* can be a model class or
its string representation (e.g. ``"app.Mod... | 0.001441 |
def _sendMouseEvent(ev, x, y, dwData=0):
"""The helper function that actually makes the call to the mouse_event()
win32 function.
Args:
ev (int): The win32 code for the mouse event. Use one of the MOUSEEVENTF_*
constants for this argument.
x (int): The x position of the mouse event.
... | 0.012146 |
def run(self, repo: str, branch: str, task: Task, git_repo: Repo, repo_path: Path):
""" Starts up a VM, builds an docker image and gets it to the VM, runs the script over SSH, returns result.
Stops the VM if ``keep_vm_running`` is not set.
"""
from fabric import api
from fabr... | 0.002972 |
def add_resource_attrs_from_type(type_id, resource_type, resource_id,**kwargs):
"""
adds all the attributes defined by a type to a node.
"""
type_i = _get_templatetype(type_id)
resource_i = _get_resource(resource_type, resource_id)
resourceattr_qry = db.DBSession.query(ResourceAttr).filter... | 0.007048 |
def save_list(self, list_name, emails):
"""
Upload a list. The list import job is queued and will happen shortly after the API request.
http://docs.sailthru.com/api/list
@param list: list name
@param emails: List of email values or comma separated string
"""
data ... | 0.008547 |
def getPattern(self, word):
"""
Returns the pattern with key word.
Example: net.getPattern("tom") => [0, 0, 0, 1]
"""
if word in self.patterns:
return self.patterns[word]
else:
raise ValueError('Unknown pattern in getPattern().', word) | 0.009464 |
def _run_on_chrom(chrom, work_bams, names, work_dir, items):
"""Run cn.mops on work BAMs for a specific chromosome.
"""
local_sitelib = utils.R_sitelib()
batch = sshared.get_cur_batch(items)
ext = "-%s-cnv" % batch if batch else "-cnv"
out_file = os.path.join(work_dir, "%s%s-%s.bed" % (os.path.s... | 0.00451 |
def load_labels(path: Union[str, Path]) -> List[SingleConditionSpec]:
"""Load labels files.
Parameters
----------
path
Path of labels file.
Returns
-------
List[SingleConditionSpec]
List of SingleConditionSpec stored in labels file.
"""
condition_specs = np.load(str... | 0.002545 |
def lchisquare(f_obs,f_exp=None):
"""
Calculates a one-way chi square for list of observed frequencies and returns
the result. If no expected frequencies are given, the total N is assumed to
be equally distributed across all groups.
Usage: lchisquare(f_obs, f_exp=None) f_obs = list of observed cell freq.
Retu... | 0.005926 |
def divide(self, phi1, inplace=True):
"""
DiscreteFactor division by `phi1`.
Parameters
----------
phi1 : `DiscreteFactor` instance
The denominator for division.
inplace: boolean
If inplace=True it will modify the factor itself, else would return... | 0.00209 |
def _assemble_and_send_request(self):
"""
Fires off the Fedex request.
@warning: NEVER CALL THIS METHOD DIRECTLY. CALL send_request(),
WHICH RESIDES ON FedexBaseService AND IS INHERITED.
"""
# Fire off the query.
return self.client.service.createPickup(
... | 0.002062 |
def _get_rows(self, options):
"""Return only those data rows that should be printed, based on slicing and sorting.
Arguments:
options - dictionary of option settings."""
if options["oldsortslice"]:
rows = copy.deepcopy(self._rows[options["start"]:options["end"]])
e... | 0.003405 |
def start(ctx, debug, version, config):
"""Commands for devops operations"""
ctx.obj = {}
ctx.DEBUG = debug
if os.path.isfile(config):
with open(config) as fp:
agile = json.load(fp)
else:
agile = {}
ctx.obj['agile'] = agile
if version:
click.echo(__version... | 0.002421 |
async def retry_request(*args, retry_exceptions=(asyncio.TimeoutError,
ScriptWorkerRetryException),
retry_async_kwargs=None, **kwargs):
"""Retry the ``request`` function.
Args:
*args: the args to send to request() through retry_as... | 0.001096 |
def hasannotationlayer(self, annotationtype=None,set=None):
"""Does the specified annotation layer exist?"""
l = self.layers(annotationtype, set)
return (len(l) > 0) | 0.021164 |
def _fullsize_link_tag(self, kwargs, title):
""" Render a <a href> that points to the fullsize rendition specified """
return utils.make_tag('a', {
'href': self.get_fullsize(kwargs),
'data-lightbox': kwargs['gallery_id'],
'title': title
}) | 0.01 |
def document(cls):
"""
Decorator to document a class
"""
if cls.__doc__ is None:
return cls
baseclass_name = cls.mro()[-2].__name__
try:
return DOC_FUNCTIONS[baseclass_name](cls)
except KeyError:
return cls | 0.003846 |
def determine_collections(self):
"""Try to determine which collections this record should belong to."""
for value in record_get_field_values(self.record, '980', code='a'):
if 'NOTE' in value.upper():
self.collections.add('NOTE')
if 'THESIS' in value.upper():
... | 0.001014 |
def network_security_group_delete(name, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Delete a network security group within a resource group.
:param name: The name of the network security group to delete.
:param resource_group: The resource group name assigned to the
network ... | 0.002217 |
def _request(self, url, api_call, request_args, method='GET'):
"""Function to request and returning JSON data.
Parameters:
url (str): Base url call.
api_call (str): API function to be called.
request_args (dict): All requests parameters.
method (str): (De... | 0.001259 |
def get_OHLCV(self, ticker, date=None, date_from=None, date_to=None):
"""Get Open, High, Low, Close prices and daily Volume for a given ticker.
ticker - ticker or symbol
date - date for a single-date query
date_from, date_to - date range (used only if "date" is not specifie... | 0.008333 |
def getEdges(self, fromVol):
""" Return the edges available from fromVol. """
return [
self.toObj.diff(diff)
for diff in self._client.getEdges(self.toArg.vol(fromVol))
] | 0.009217 |
def upcaseTokens(s,l,t):
"""Helper parse action to convert tokens to upper case."""
return [ tt.upper() for tt in map(_ustr,t) ] | 0.051471 |
def data_from_stream(self, stream):
"""
Creates a data element reading a representation from the given stream.
:returns: object implementing
:class:`everest.representers.interfaces.IExplicitDataElement`
"""
parser = self._make_representation_parser(stream, self.resou... | 0.004728 |
def genl_family_add_grp(family, id_, name):
"""https://github.com/thom311/libnl/blob/libnl3_2_25/lib/genl/family.c#L366.
Positional arguments:
family -- Generic Netlink family object (genl_family class instance).
id_ -- new numeric identifier (integer).
name -- new human readable name (string).
... | 0.002203 |
def bbox(self):
"Return the envelope as a Bound Box string compatible with (bb) params"
return ",".join(str(attr) for attr in
(self.xmin, self.ymin, self.xmax, self.ymax)) | 0.018519 |
def get_asset_query_session_for_repository(self, repository_id):
"""Gets an asset query session for the given repository.
arg: repository_id (osid.id.Id): the ``Id`` of the repository
return: (osid.repository.AssetQuerySession) - an
``AssetQuerySession``
raise: NotFo... | 0.00273 |
def does_table_exist(self, model_class):
'''
Checks whether a table for the given model class already exists.
Note that this only checks for existence of a table with the expected name.
'''
sql = "SELECT count() FROM system.tables WHERE database = '%s' AND name = '%s'"
r ... | 0.009592 |
def stdio(filters=None, search_dirs=None, data_dir=True, sys_path=True, panfl_=False, input_stream=None, output_stream=None):
"""
Reads JSON from stdin and second CLI argument:
``sys.argv[1]``. Dumps JSON doc to the stdout.
:param filters: Union[List[str], None]
if None then read from metadata
... | 0.001128 |
def register_plugins(cls, plugins):
'''
Reguster plugins. The plugins parameter should be dict mapping model to plugin.
Just calls a register_plugin for every such a pair.
'''
for model in plugins:
cls.register_plugin(model, plugins[model]) | 0.010239 |
def init(port=None, do_not_exit=False, disable_tls=False, log_level='WARNING'):
"""Start the Xenon GRPC server on the specified port, or, if a service
is already running on that port, connect to that.
If no port is given, a random port is selected. This means that, by
default, every python instance wil... | 0.000766 |
def make_str(value):
"""Converts a value into a valid string."""
if isinstance(value, bytes):
try:
return value.decode(sys.getfilesystemencoding())
except UnicodeError:
return value.decode('utf-8', 'replace')
return text_type(value) | 0.003521 |
def subpackets(*items):
"""Serialize several GPG subpackets."""
prefixed = [subpacket_prefix_len(item) for item in items]
return util.prefix_len('>H', b''.join(prefixed)) | 0.005495 |
def visit_NameConstant(self, node):
""" Python 3 """
nnode = self.dnode(node)
copy_from_lineno_col_offset(
nnode, str(node.value), self.bytes_pos_to_utf8, to=node) | 0.01005 |
def generate_results_subparser(subparsers):
"""Adds a sub-command parser to `subparsers` to manipulate CSV
results data."""
parser = subparsers.add_parser(
'results', description=constants.RESULTS_DESCRIPTION,
epilog=constants.RESULTS_EPILOG, formatter_class=ParagraphFormatter,
help=... | 0.000213 |
def save_config_value(request, response, key, value):
"""Sets value of key `key` to `value` in both session and cookies."""
request.session[key] = value
response.set_cookie(key, value, expires=one_year_from_now())
return response | 0.004082 |
def _connect(self):
"""
Establish a connection to the master process's UNIX listener socket,
constructing a mitogen.master.Router to communicate with the master,
and a mitogen.parent.Context to represent it.
Depending on the original transport we should emulate, trigger one of
... | 0.002999 |
def get_tax_class_by_id(cls, tax_class_id, **kwargs):
"""Find TaxClass
Return single instance of TaxClass by its ID.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_tax_class_by_id(tax_cla... | 0.004474 |
def write_nodes(gtfs, output, fields=None):
"""
Parameters
----------
gtfs: gtfspy.GTFS
output: str
Path to the output file
fields: list, optional
which pieces of information to provide
"""
nodes = gtfs.get_table("stops")
if fields is not None:
nodes = nodes[f... | 0.002132 |
def unpack_auth_b64(self, docker_registry):
"""Decode and unpack base64 'auth' credentials from config file.
:param docker_registry: str, registry reference in config file
:return: namedtuple, UnpackedAuth (or None if no 'auth' is available)
"""
UnpackedAuth = namedtuple('Unpac... | 0.004825 |
def timeline(self, request, drip_id, into_past, into_future):
"""
Return a list of people who should get emails.
"""
from django.shortcuts import render, get_object_or_404
drip = get_object_or_404(Drip, id=drip_id)
shifted_drips = []
seen_users = set()
f... | 0.005249 |
def bind(self):
""" Resets the Response object to its factory defaults. """
self._COOKIES = None
self.status = 200
self.headers = HeaderDict()
self.content_type = 'text/html; charset=UTF-8' | 0.008734 |
def _extract_germline(in_file, data):
"""Extract germline calls non-somatic, non-filtered calls.
"""
out_file = "%s-germline.vcf" % utils.splitext_plus(in_file)[0]
if not utils.file_uptodate(out_file, in_file) and not utils.file_uptodate(out_file + ".gz", in_file):
with file_transaction(data, ou... | 0.006764 |
def _batch_insert(self, inserts, intervals, **kwargs):
'''
Support for batch insert. Default implementation is non-optimized and
is a simple loop over values.
'''
for timestamp,names in inserts.iteritems():
for name,values in names.iteritems():
for value in values:
self._inse... | 0.01897 |
def _task_instances_for_dag_run(self, dag_run, session=None):
"""
Returns a map of task instance key to task instance object for the tasks to
run in the given dag run.
:param dag_run: the dag run to get the tasks from
:type dag_run: airflow.models.DagRun
:param session: ... | 0.003393 |
def order_sections(self, key, reverse=True):
"""Sort sections according to the value of key."""
fsort = lambda s: s.__dict__[key]
return sorted(self.sections, key=fsort, reverse=reverse) | 0.014286 |
def _load_sequences_to_reference_gene(self, g_id, force_rerun=False):
"""Load orthologous strain sequences to reference Protein object, save as new pickle"""
protein_seqs_pickle_path = op.join(self.sequences_by_gene_dir, '{}_protein_withseqs.pckl'.format(g_id))
if ssbio.utils.force_rerun(flag=f... | 0.004854 |
def IntraField(config={}):
"""Intra field interlace to sequential converter.
This uses a vertical filter with an aperture of 8 lines, generated
by
:py:class:`~pyctools.components.interp.filtergenerator.FilterGenerator`.
The aperture (and other parameters) can be adjusted after the
:py:class:`In... | 0.019608 |
def get_object_or_child_by_type(self, *types):
""" Get object if child already been read or get child.
Use this method for fast access to objects in case of static configurations.
:param types: requested object types.
:return: all children of the specified types.
"""
o... | 0.007059 |
async def evaluate_trained_model(state):
"""Evaluate the most recently trained model against the current best model.
Args:
state: the RL loop State instance.
"""
return await evaluate_model(
state.train_model_path, state.best_model_path,
os.path.join(fsdb.eval_dir(), state.train_model_name), s... | 0.009091 |
def get_image(self, digest, blob, mime_type, index, size=500):
"""Return an image for the given content, only if it already exists in
the image cache."""
# Special case, for now (XXX).
if mime_type.startswith("image/"):
return ""
cache_key = f"img:{index}:{size}:{dig... | 0.005464 |
def merged():
# type: () -> None
""" Cleanup a remotely merged branch. """
develop = conf.get('git.devel_branch', 'develop')
branch = git.current_branch(refresh=True)
common.assert_branch_type('feature')
# Pull develop with the merged feature
common.git_checkout(develop)
common.git_pul... | 0.002252 |
def unpack_archive(*components, **kwargs) -> str:
"""
Unpack a compressed archive.
Arguments:
*components (str[]): Absolute path.
**kwargs (dict, optional): Set "compression" to compression type.
Default: bz2. Set "dir" to destination directory. Defaults to the
direc... | 0.001517 |
def write(self, symbol, data, initial_image=None, metadata=None):
"""
Writes a list of market data events.
Parameters
----------
symbol : `str`
symbol name for the item
data : list of dicts or a pandas.DataFrame
List of ticks to store to the tick-... | 0.002818 |
def _observe_timeseries_fn(timeseries):
"""Build an observation_noise_fn that observes a Tensor timeseries."""
def observation_noise_fn(t):
current_slice = timeseries[..., t, :]
return tfd.MultivariateNormalDiag(
loc=current_slice,
scale_diag=tf.zeros_like(current_slice))
return observatio... | 0.012121 |
def extend_from_instances(self,
params: Params,
instances: Iterable['adi.Instance'] = ()) -> None:
"""
Extends an already generated vocabulary using a collection of instances.
"""
min_count = params.pop("min_count", None)
... | 0.007033 |
def _handle_output(self, channel, output):
"""
Given an initial channel and a sequence of messages or sentinels,
output the messages.
"""
augmented = Sentinel.augment_items(output, channel=channel, secret=False)
for message in augmented:
self.out(message.channel, message, not message.secret) | 0.029316 |
def check_installed_files(self):
"""
Checks that the hashes and sizes of the files in ``RECORD`` are
matched by the files themselves. Returns a (possibly empty) list of
mismatches. Each entry in the mismatch list will be a tuple consisting
of the path, 'exists', 'size' or 'hash' ... | 0.001854 |
def cancelTask(self, *args, **kwargs):
"""
Cancel Task
This method will cancel a task that is either `unscheduled`, `pending` or
`running`. It will resolve the current run as `exception` with
`reasonResolved` set to `canceled`. If the task isn't scheduled yet, ie.
it doe... | 0.00469 |
def start(self):
''' doesn't work'''
thread = threading.Thread(target=reactor.run)
thread.start() | 0.016529 |
def plot(feature, mp=None, style_function=None, **map_kwargs):
"""Plots a GeoVector in an ipyleaflet map.
Parameters
----------
feature : telluric.vectors.GeoVector, telluric.features.GeoFeature, telluric.collections.BaseCollection
Data to plot.
mp : ipyleaflet.Map, optional
Map in ... | 0.001894 |
def walk_interface(self, name, data, in_location):
interface = Interface()
location = "{}.{}".format(in_location, name)
if isinstance(data, dict):
interface.name = de_identifier(self.require_field(location, "name", data, "", str))
location = "{}.{}".format(in_location, cl... | 0.007674 |
def totals(self, start=None, end=None):
"""Returns a Totals object containing the sum of all debits, credits
and net change over the period of time from start to end.
'start' is inclusive, 'end' is exclusive
"""
qs = self._entries_range(start=start, end=end)
qs_positive... | 0.007428 |
def update(self):
'''Update definitions.'''
# Download http://rebase.neb.com/rebase/link_withref to tmp
self._tmpdir = tempfile.mkdtemp()
try:
self._rebase_file = self._tmpdir + '/rebase_file'
print 'Downloading latest enzyme definitions'
url = 'http:/... | 0.001119 |
def calculate_sleep_time(attempt, delay_factor=5.0, randomization_factor=.5, max_delay=120):
"""Calculate the sleep time between retries, in seconds.
Based off of `taskcluster.utils.calculateSleepTime`, but with kwargs instead
of constant `delay_factor`/`randomization_factor`/`max_delay`. The taskcluster
... | 0.005785 |
def _ctypes_ex_compatvars(executable):
"""Returns a list of code lines for signature matching variables, and
pointer saving variables.
"""
result = []
for p in executable.ordered_parameters:
_ctypes_code_parameter(result, p, "regular")
_ctypes_code_parameter(result, p, "saved")
... | 0.00396 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.