text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def hermite_interpolate(
x, y, precision=250, type='cardinal', c=None, b=None, t=None
):
"""
Interpolate x, y using the hermite method.
See https://en.wikipedia.org/wiki/Cubic_Hermite_spline
This interpolation is configurable and contain 4 subtypes:
* Catmull Rom
* Finite Difference... | 0.000435 |
def _by_version_descending(names):
"""
Given a list of filenames, return them in descending order
by version number.
>>> names = 'bar', 'foo', 'Python-2.7.10.egg', 'Python-2.7.2.egg'
>>> _by_version_descending(names)
['Python-2.7.10.egg', 'Python-2.7.2.egg', 'foo', 'bar']
>>> names = 'Setup... | 0.001053 |
def set_led_brightness(self, brightness):
"""Set the LED brightness for the current group/button."""
set_cmd = self._create_set_property_msg("_led_brightness", 0x07,
brightness)
self._send_method(set_cmd, self._property_set) | 0.006757 |
def _sparse_blockify(tuples, dtype=None):
""" return an array of blocks that potentially have different dtypes (and
are sparse)
"""
new_blocks = []
for i, names, array in tuples:
array = _maybe_to_sparse(array)
block = make_block(array, placement=[i])
new_blocks.append(block... | 0.002907 |
def to_dict(self):
"""Return a dictionary representation of the Predicate."""
return {
'predicate': self.predicate,
'parents': list(self.supertypes),
'synopses': [[role.to_dict() for role in synopsis]
for synopsis in self.synopses]
} | 0.006289 |
def populateFromFile(self, dataUrl):
"""
Populates the instance variables of this ReferencSet from the
data URL.
"""
self._dataUrl = dataUrl
fastaFile = self.getFastaFile()
for referenceName in fastaFile.references:
reference = HtslibReference(self, re... | 0.002928 |
def send_request(req=None, method=None, requires_response=True):
"""Call function req and then send its results via ZMQ."""
if req is None:
return functools.partial(send_request, method=method,
requires_response=requires_response)
@functools.wraps(req)
def wrapp... | 0.001942 |
def create_parser(self, prog_name, subcommand):
"""
Override the base create_parser() method to add this command's custom
options in Django 1.7 and below.
"""
if not self.use_argparse:
self.__class__.option_list = TestCommand.option_list + self.custom_options
... | 0.007353 |
def _get_instance_attributes(self):
"""Return a generator for instance attributes' name and value.
.. code-block:: python3
for _name, _value in self._get_instance_attributes():
print("attribute name: {}".format(_name))
print("attribute value: {}".format(_val... | 0.003466 |
def process_normal_line( self, line ):
"""process a normal line and check whether it is the start of a new block"""
for f in re_source_block_formats:
if f.start.match( line ):
self.add_block_lines()
self.format = f
self.lineno = fileinput.file... | 0.027548 |
def get_device(self, device_id):
"""
Return specified device.
Returns a Command.
"""
def process_result(result):
return Device(result)
return Command('get', [ROOT_DEVICES, device_id],
process_result=process_result) | 0.006689 |
def put(self, measurementId, deviceId):
"""
Fails the measurement for this device.
:param measurementId: the measurement name.
:param deviceId: the device name.
:return: 200 if
"""
payload = request.get_json()
failureReason = json.loads(payload).get('failu... | 0.008294 |
def _process_prb_strain_genotype_view(self, limit=None):
"""
Here we fetch the free text descriptions of the phenotype associations.
Triples:
<annot_id> dc:description "description text"
:param limit:
:return:
"""
line_counter = 0
if self.test_mo... | 0.002625 |
def adapt_single_html(html):
"""Adapts a single html document generated by
``.formatters.SingleHTMLFormatter`` to a ``models.Binder``
"""
html_root = etree.fromstring(html)
metadata = parse_metadata(html_root.xpath('//*[@data-type="metadata"]')[0])
id_ = metadata['cnx-archive-uri'] or 'book'
... | 0.001664 |
def ricker(f, length, dt):
"""
A Ricker wavelet.
Args:
f (float): frequency in Haz, e.g. 25 Hz.
length (float): Length in s, e.g. 0.128.
dt (float): sample interval in s, e.g. 0.001.
Returns:
tuple. time basis, amplitude values.
"""
t = np.linspace(-int(length/2... | 0.002217 |
def _get_ANSI_colored_font( color ):
''' Returns an ANSI escape code (a string) corresponding to switching the font
to given color, or None, if the given color could not be associated with
the available colors.
See also:
https://en.wikipedia.org/wiki/ANSI_escape_cod... | 0.005369 |
def ncores_used(self):
"""
Returns the number of cores used in this moment.
A core is used if there's a job that is running on it.
"""
return sum(task.manager.num_cores for task in self if task.status == task.S_RUN) | 0.011765 |
def get_matching_then_nonmatching_text(string_list, separator='', match_min_size=30, ignore='',
end_characters='.!\r\n'):
# type: (List[str], str, int, str, str) -> str
"""Returns a string containing matching blocks of text in a list of strings followed by non-matching.
... | 0.002211 |
def _score(self, state, score_movement=True):
"""Score a state based on how balanced it is. A higher score represents
a more balanced state.
:param state: The state to score.
"""
score = 0
max_score = 0
if state.total_weight:
# Coefficient of variance... | 0.001183 |
def create_repository(self, repository, body, params=None):
"""
Registers a shared file system repository.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html>`_
:arg repository: A repository name
:arg body: The repository definition
:... | 0.004848 |
def files_changed():
"""
Return the list of file changed in the current branch compared to `master`
"""
with chdir(get_root()):
result = run_command('git diff --name-only master...', capture='out')
changed_files = result.stdout.splitlines()
# Remove empty lines
return [f for f in ch... | 0.002967 |
def add_template_for_node(name, node_id):
"Set the template to use to display the node"
with current_app.app_context():
db.execute(text(fetch_query_string('insert_template.sql')),
name=name, node_id=node_id)
result = db.execute(text(fetch_query_string('select_template.sql')),
... | 0.00692 |
def guess_manifest_media_type(content):
"""
Guess the media type for the given manifest content
:param content: JSON content of manifest (bytes)
:return: media type (str), or None if unable to guess
"""
encoding = guess_json_utf(content)
try:
manifest = json.loads(content.decode(enc... | 0.001062 |
def get_single_int_autoincrement_colname(table_: Table) -> Optional[str]:
"""
If a table has a single integer ``AUTOINCREMENT`` column, this will
return its name; otherwise, ``None``.
- It's unlikely that a database has >1 ``AUTOINCREMENT`` field anyway, but
we should check.
- SQL Server's ``... | 0.000705 |
def config_notebook_plotting():
"""
Configure plotting functions for inline plotting within a Jupyter
Notebook shell. This function has no effect when not within a
notebook shell, and may therefore be used within a normal python
script.
"""
# Check whether running within a notebook shell an... | 0.00046 |
def create_module(self, course_id, module_name, module_position=None, module_prerequisite_module_ids=None, module_publish_final_grade=None, module_require_sequential_progress=None, module_unlock_at=None):
"""
Create a module.
Create and return a new module
"""
path = {}
... | 0.00354 |
def use(self, middleware):
"""
attache middleware
:param middleware:
:return:
"""
logger.debug('use')
logger.debug(middleware)
self.middlewares.append(middleware)
di.injector.register(instance=middleware)
di.bind(middleware, auto=True)
... | 0.004073 |
def temp_pyfile(src, ext='.py'):
"""Make a temporary python file, return filename and filehandle.
Parameters
----------
src : string or list of strings (no need for ending newlines if list)
Source code to be written to the file.
ext : optional, string
Extension for the generated file.
... | 0.003484 |
def _properties_table(obj, columns=None, exclude_columns=None):
"""
Construct a `~astropy.table.QTable` of source properties from a
`SourceProperties` or `SourceCatalog` object.
Parameters
----------
obj : `SourceProperties` or `SourceCatalog` instance
The object containing the source p... | 0.000386 |
def is_displayed(self):
"""
:return: False if element is not present in the DOM or invisible, otherwise True.
Ignore implicit and element timeouts and execute immediately.
To wait when element displayed or not, use ``waiter.wait_displayed`` or ``waiter.wait_not_displayed``
... | 0.006981 |
def get_log_likelihood(inputs,data,clust):
"""Get the LL of a combined set of clusters, ignoring time series offsets.
Get the log likelihood of a cluster without worrying about the fact
different time series are offset. We're using it here really for those
cases in which we only have one cluster to... | 0.019742 |
def _updateKW(image, filename, exten, skyKW, Value):
"""update the header with the kw,value"""
# Update the value in memory
image.header[skyKW] = Value
# Now update the value on disk
if isinstance(exten,tuple):
strexten = '[%s,%s]'%(exten[0],str(exten[1]))
else:
strexten = '[%s]... | 0.008834 |
def read(self):
"""
Reads enough bytes from ``open_stream_in`` to fill the ``width``
(if available) and converts them to an ``int``. Returns this ``int``.
"""
int_ = bytes_to_int(self.open_stream_in.read(math.ceil(self.width / 8)), self.width)
self.repr_.setvalue(int_)
return self.value.getvalue() | 0.035144 |
def _search_generator(self, item: Any) -> Generator[Tuple[Any, Any], None, None]:
"""A helper method for `self.search` that returns a generator rather than a list."""
results = 0
for key, value in self.enumerate(item):
yield key, value
results += 1
if results == 0... | 0.01105 |
def _simplify_shape(self, alist, rec=0):
"""Reduce the alist dimension if needed"""
if rec != 0:
if len(alist) == 1:
return alist[-1]
return alist
if len(alist) == 1:
return self._simplify_shape(alist[-1], 1)
return [self._simpl... | 0.005666 |
def set_note_footer(data, trigger):
"""
handle the footer of the note
"""
footer = ''
if data.get('link'):
provided_by = _('Provided by')
provided_from = _('from')
footer_from = "<br/><br/>{} <em>{}</em> {} <a href='{}'>{}</a>"
... | 0.004024 |
def needs_quotes(s):
"""Checks whether a string is a dot language ID.
It will check whether the string is solely composed
by the characters allowed in an ID or not.
If the string is one of the reserved keywords it will
need quotes too but the user will need to add them
manually.
"""
# If... | 0.003398 |
def expect_keyword(lexer: Lexer, value: str) -> Token:
"""Expect the next token to be a given keyword.
If the next token is a given keyword, return that token after advancing the lexer.
Otherwise, do not change the parser state and throw an error.
"""
token = lexer.token
if token.kind == TokenK... | 0.003899 |
def increment_frame(self):
"""Increment a frame of the animation."""
self.current_frame += 1
if self.current_frame >= self.end_frame:
# Wrap back to the beginning of the animation.
self.current_frame = 0 | 0.007937 |
def dumps(collection: BioCCollection, pretty_print: bool = True) -> str:
"""
Serialize ``collection`` to a BioC formatted ``str``.
Args:
collection: the BioC collection
pretty_print: enables formatted XML
Returns:
a BioC formatted ``str``
"""
doc = etree.Elem... | 0.003636 |
def _calc_ML(sampler, modelidx=0, e_range=None, e_npoints=100):
"""Get ML model from blob or compute them from chain and sampler.modelfn
"""
ML, MLp, MLerr, ML_model = find_ML(sampler, modelidx)
if e_range is not None:
# prepare bogus data for calculation
e_range = validate_array(
... | 0.000758 |
def get_download_total(rows):
"""Return the total downloads, and the downloads column"""
headers = rows.pop(0)
index = headers.index('download_count')
total_downloads = sum(int(row[index]) for row in rows)
rows.insert(0, headers)
return total_downloads, index | 0.003521 |
def add_episode(db, aid, episode):
"""Add an episode."""
values = {
'aid': aid,
'type': episode.type,
'number': episode.number,
'title': episode.title,
'length': episode.length,
}
upsert(db, 'episode', ['aid', 'type', 'number'], values) | 0.003425 |
def p_top(p):
"""
top :
| top stmt
"""
if len(p) == 1:
p[0] = node.stmt_list()
else:
p[0] = p[1]
p[0].append(p[2]) | 0.005952 |
def set_selection_strategy(self, strategy='spectral-oasis', nsel=1, neig=None):
""" Defines the column selection strategy
Parameters
----------
strategy : str
One of the following strategies to select new columns:
random : randomly choose from non-selected column... | 0.004556 |
def setup_jukebox_logger():
"""Setup the jukebox top-level logger with handlers
The logger has the name ``jukebox`` and is the top-level logger for all other loggers of jukebox.
It does not propagate to the root logger, because it also has a StreamHandler and that might cause double output.
The logger... | 0.004603 |
def read_certificate_signing_request_status(self, name, **kwargs):
"""
read status of the specified CertificateSigningRequest
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.read_certificat... | 0.004735 |
def circuit_to_instruction(circuit):
"""Build an ``Instruction`` object from a ``QuantumCircuit``.
The instruction is anonymous (not tied to a named quantum register),
and so can be inserted into another circuit. The instruction will
have the same string name as the circuit.
Args:
circuit ... | 0.002728 |
def update(self, notification_level):
"""
Update the UserChannelInstance
:param UserChannelInstance.NotificationLevel notification_level: The push notification level to assign to the User Channel
:returns: Updated UserChannelInstance
:rtype: twilio.rest.chat.v2.service.user.use... | 0.004988 |
def find_by_dynamic_locator(self, template_locator, variables, find_all=False, search_object=None):
'''
Find with dynamic locator
@type template_locator: webdriverwrapper.support.locator.Locator
@param template_locator: Template locator w/ formatting bits to insert
... | 0.007348 |
def to_kwargs(triangles):
"""
Convert a list of triangles to the kwargs for the Trimesh
constructor.
Parameters
---------
triangles : (n, 3, 3) float
Triangles in space
Returns
---------
kwargs : dict
Keyword arguments for the trimesh.Trimesh constructor
Includes ... | 0.001248 |
def __update_cursor_info(self):
""" Map the mouse to the 1-d position within the line graph. """
if not self.delegate: # allow display to work without delegate
return
if self.__mouse_in and self.__last_mouse:
pos_1d = None
axes = self.__axes
lin... | 0.004242 |
def range(self, start=None, stop=None, months=0, days=0):
"""
Return a new query that fetches metrics within a certain date range.
```python
query.range('2014-01-01', '2014-06-30')
```
If you don't specify a `stop` argument, the date range will end today. If instead
... | 0.005106 |
def over(self, state, fn):
# type: (S, Callable[[A], B]) -> T
'''Applies a function `fn` to all the foci within `state`.
Requires kind Setter. This method will raise TypeError when the
optic has no way to set foci.
'''
if not self._is_kind(Setter):
raise Type... | 0.00996 |
def write_journal(self, journal_file_path):
"""Write the constructed journal in to the provided file.
Args:
journal_file_path (str): full path to output journal file
"""
# TODO: assert the extension is txt and not other
with open(journal_file_path, "w") as jrn_file:
... | 0.005405 |
def cookie_get(self, name):
"""
Check for a cookie value by name.
:param str name: Name of the cookie value to retreive.
:return: Returns the cookie value if it's set or None if it's not found.
"""
if not hasattr(self, 'cookies'):
return None
if self.cookies.get(name):
return self.cookies.get(name)... | 0.035294 |
def get_output(self):
"""Get the output of a reading job as a list of filenames."""
logger.info("Getting outputs.")
# Get the set of prefixes (each will correspond to three json files.)
json_files = glob.glob(path.join(self.output_dir, '*.json'))
json_prefixes = set()
for... | 0.001554 |
def create_schema(self, hash_key_name, hash_key_proto_value,
range_key_name=None, range_key_proto_value=None):
"""
Create a Schema object used when creating a Table.
:type hash_key_name: str
:param hash_key_name: The name of the HashKey for the schema.
:ty... | 0.002642 |
async def list_vms(self, preset_name):
'''
List VMs by preset name
:arg present_name: string
'''
response = await self.nova.servers.list(name=f'^{preset_name}$')
result = []
for server in response['servers']:
result.append(self._map_vm_structure(serve... | 0.005797 |
def parse_dirname(fc_dir):
"""Parse the flow cell ID and date from a flow cell directory.
"""
(_, fc_dir) = os.path.split(fc_dir)
parts = fc_dir.split("_")
name = None
date = None
for p in parts:
if p.endswith(("XX", "xx", "XY", "X2")):
name = p
elif len(p) == 6:
... | 0.001776 |
def in_span(loc: int, span: Span) -> bool:
"""Checks if loc is inside span"""
if loc >= span[0] and loc <= span[1]:
return True
else:
return False | 0.005714 |
def languages(self):
"""Languages.
Returns a set of languages in lower-case.
:return:
Returns a set of languages in lower-case (strings).
"""
result = set()
languages = self._safe_get_element('ItemAttributes.Languages')
if languages is not None:
... | 0.003774 |
def _render_closure(self):
'''Use a closure so that draw attributes can be saved'''
fillcolor = self.fill
strokecolor = self.stroke
strokewidth = self.strokewidth
def _render(cairo_ctx):
'''
At the moment this is based on cairo.
TODO: Need to... | 0.000857 |
def mount(self, volume):
"""Mounts the given volume on the provided mountpoint. The default implementation simply calls mount.
:param Volume volume: The volume to be mounted
:param mountpoint: The file system path to mount the filesystem on.
:raises UnsupportedFilesystemError: when the ... | 0.007622 |
def get_server(key, server=MAIN_SERVER, servers=LOAD_SERVERS):
""" given a key, get the IP address of the server that has the pvt key that
owns the name/key
"""
namecoind = NamecoindClient(NAMECOIND_SERVER, NAMECOIND_PORT,
NAMECOIND_USER, NAMECOIND_PASSWD)
info... | 0.001748 |
def revision(self):
"""The name of the feature branch (a string)."""
location, _, revision = self.expression.partition('#')
return revision if location and revision else self.expression | 0.009569 |
def __deleteOutputCache(self, modelID):
"""
Delete's the output cache associated with the given modelID. This actually
clears up the resources associated with the cache, rather than deleting al
the records in the cache
Parameters:
----------------------------------------------------------------... | 0.007299 |
def register_adapter(from_classes, to_classes, func):
"""
Register a function that can handle adapting from `from_classes` to `to_classes`.
"""
assert from_classes, 'Must supply classes to adapt from'
assert to_classes, 'Must supply classes to adapt to'
assert func, 'Must supply adapter function... | 0.002907 |
def get_all_longest_col_lengths(self):
"""
iterate over all columns and get their longest values
:return: dict, {"column_name": 132}
"""
response = {}
for col in self.col_list:
response[col] = self._longest_val_in_column(col)
return response | 0.006452 |
def refresh(self, index=None):
"""Refresh tabwidget"""
if index is None:
index = self.get_stack_index()
# Set current editor
if self.get_stack_count():
index = self.get_stack_index()
finfo = self.data[index]
editor = finfo.editor
... | 0.002296 |
def _handle_shift(self, other: Union[int, "BitVec"], operator: Callable) -> "BitVec":
"""
Handles shift
:param other: The other BitVector
:param operator: The shift operator
:return: the resulting output
"""
if isinstance(other, BitVecFunc):
return ope... | 0.004854 |
def plot_final(self, ax):
'''
Plots the final de-trended light curve.
'''
# Plot the light curve
bnmask = np.array(
list(set(np.concatenate([self.badmask, self.nanmask]))), dtype=int)
def M(x): return np.delete(x, bnmask)
if (self.cadence == 'lc') o... | 0.000859 |
def register_proper_name(self, name):
"""Registers a proper name to the database."""
with self.proper_names_db_path.open("a") as f:
f.write(u"{0}\n".format(name)) | 0.010526 |
def multiSMC(nruns=10, nprocs=0, out_func=None, **args):
"""Run SMC algorithms in parallel, for different combinations of parameters.
`multiSMC` relies on the `multiplexer` utility, and obeys the same logic.
A basic usage is::
results = multiSMC(fk=my_fk_model, N=100, nruns=20, nprocs=0)
T... | 0.008262 |
def parse_recipients(header, reference_id=None):
"""\
Returns the recipients of the cable as (maybe empty) list.
"""
m = _TO_PATTERN.search(header)
if not m:
if reference_id and reference_id not in _CABLES_WITHOUT_TO:
logger.warn('No TO header found in "%s", header: "%s"' % (refe... | 0.004464 |
def from_entity(entity, self_user_id):
"""Construct user from ``Entity`` message.
Args:
entity: ``Entity`` message.
self_user_id (~hangups.user.UserID or None): The ID of the current
user. If ``None``, assume ``entity`` is the current user.
Returns:
... | 0.002642 |
def need_record_permission(factory_name):
"""Decorator checking that the user has the required permissions on record.
:param factory_name: name of the permission factory.
"""
def need_record_permission_builder(f):
@wraps(f)
def need_record_permission_decorator(self, record=None, *args,
... | 0.001156 |
def mskWshape(W, cri):
"""Get appropriate internal shape (see
:class:`CSC_ConvRepIndexing` and :class:`CDU_ConvRepIndexing`) for
data fidelity term mask array `W`. The external shape of `W`
depends on the external shape of input data array `S`. The
simplest criterion for ensuring that the external ... | 0.000516 |
def _extract_lookup(self, key):
"""Extract lookup method based on key name format"""
parts = key.split('__')
# 'exact' is the default lookup if there was no explicit comparison op in `key`
# Assume there is only one `__` in the key.
# FIXME Change for child attribute query su... | 0.006073 |
def set(self, value, metadata=dict(), content_type=None):
"""Sets the key to the given value."""
return self._boto_object.put(Body=value, Metadata=metadata, ContentType=content_type) | 0.015152 |
def email_address(self, address, owner=None, **kwargs):
"""
Create the Email Address TI object.
Args:
owner:
address:
**kwargs:
Return:
"""
return EmailAddress(self.tcex, address, owner=owner, **kwargs) | 0.00692 |
def addex(extype, exmsg, condition=None, edata=None):
r"""
Add an exception in the global exception handler.
:param extype: Exception type; *must* be derived from the `Exception
<https://docs.python.org/2/library/exceptions.html#
exceptions.Exception>`_ class
:type... | 0.000461 |
def stratHeun(f, G, y0, tspan, dW=None):
"""Use the Stratonovich Heun algorithm to integrate Stratonovich equation
dy = f(y,t)dt + G(y,t) \circ dW(t)
where y is the d-dimensional state vector, f is a vector-valued function,
G is an d x m matrix-valued function giving the noise coefficients and
dW(t... | 0.00168 |
async def wait_event(self, event, *, timeout=None):
"""
Waits for a custom event to occur. Timeouts still apply.
Unless you're certain that your code will run fast enough,
generally you should get a "handle" of this special coroutine
before acting. Generally, you should do this:... | 0.001707 |
def _get_omimtype(entry, globaltt):
"""
(note: there is anlaternative using mimTitle in omia)
Here, we look at the omim 'prefix' to help to type the entry.
For now, we only classify omim entries as genes;
the rest we leave alone.
:param entry:
:return:
"... | 0.001025 |
def datacenter(self, name):
"""
:param name: location key
:type name: :py:class:`basestring`
:Returns: a new DataCenter object
This method treats the 'name' argument as a location key (on the
`known_locations` attribute dict) or FQDN, and keeps existing... | 0.012543 |
def set_size(self, size):
""" Set the size of the map in pixels
This is an expensive operation, do only when absolutely needed.
:param size: (width, height) pixel size of camera/view of the group
"""
buffer_size = self._calculate_zoom_buffer_size(size, self._zoom_level)
... | 0.005208 |
def main():
""" main entry """
options = parse(sys.argv[1:], CLIRULES, ".splunkrc")
if options.kwargs['omode'] not in OUTPUT_MODES:
print("output mode must be one of %s, found %s" % (OUTPUT_MODES,
options.kwargs['omode']))
sys.exit(1)
service = connect(**options.kwargs)
... | 0.00473 |
def get_changes(self, serialized=False, keep=False):
""" Get a journal of changes that have occurred
:param `serialized`:
Return changes in the serialized format used by TaskWarrior.
:param `keep_changes`:
By default, the list of changes is reset after running
... | 0.001869 |
def CreateAdGroup(client, campaign_id):
"""Creates a dynamic remarketing campaign.
Args:
client: an AdWordsClient instance.
campaign_id: an int campaign ID.
Returns:
The ad group that was successfully created.
"""
ad_group_service = client.GetService('AdGroupService', 'v201809')
ad_group = {
... | 0.010695 |
def get_package_version():
"""returns package version without importing it"""
base = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(base, "firepit/__init__.py")) as pkg:
for line in pkg:
m = version.match(line.strip())
if not m:
continue
... | 0.002695 |
def R_package_path(package):
"""
return the path to an installed R package
"""
local_sitelib = R_sitelib()
rscript = Rscript_cmd()
cmd = """{rscript} --no-environ -e '.libPaths(c("{local_sitelib}")); find.package("{package}")'"""
try:
output = subprocess.check_output(cmd.format(**loc... | 0.003096 |
def calculateLocalElasticitySegments(self, bp, span=2, frameGap=None, helical=False, unit='kT',
err_type='block', tool='gmx analyze', outFile=None):
"""Calculate local elastic properties of consecutive overlapped DNA segments
Calculate local elastic properties o... | 0.005741 |
def _do_put(self):
"""
HTTP Put Request
"""
return requests.put(self._url, data=self._data, headers=self._headers, auth=(self._email, self._api_token)) | 0.016393 |
def handle_key_rotate(self, now):
'''
Rotate the AES key rotation
'''
to_rotate = False
dfn = os.path.join(self.opts['cachedir'], '.dfn')
try:
stats = os.stat(dfn)
# Basic Windows permissions don't distinguish between
# user/group/all. ... | 0.003359 |
def patched_function(self, *args, **kwargs):
"""
Step 3. Wrapped function calling.
"""
result = self.function(*args, **kwargs)
self.validate(result)
return result | 0.009524 |
def set(self, val):
"""Set the heat set point."""
msg = ExtendedSend(
address=self._address,
commandtuple=COMMAND_THERMOSTAT_SET_HEAT_SETPOINT_0X6D_NONE,
cmd2=int(val * 2),
userdata=Userdata())
msg.set_checksum()
self._send_method(msg, self... | 0.005865 |
def get_all_network_interfaces(self, filters=None):
"""
Retrieve all of the Elastic Network Interfaces (ENI's)
associated with your account.
:type filters: dict
:param filters: Optional filters that can be used to limit
the results returned. Filters are ... | 0.001923 |
def create_participant(worker_id, hit_id, assignment_id, mode):
"""Create a participant.
This route will be hit very early on as any nodes the participant creates
will be defined in reference to the participant object.
You must specify the worker_id, hit_id, assignment_id and mode in the url.
"""
... | 0.000709 |
def increase_writes_in_units(
current_provisioning, units, max_provisioned_writes,
consumed_write_units_percent, log_tag):
""" Increase the current_provisioning with units units
:type current_provisioning: int
:param current_provisioning: The current provisioning
:type units: int
:p... | 0.000585 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.