text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def get(self):
"""Gets the next item from the queue.
Returns a Future that resolves to the next item once it is available.
"""
io_loop = IOLoop.current()
new_get = Future()
with self._lock:
get, self._get = self._get, new_get
answer = Future()
... | 0.002035 |
def create(self, expiration_date=values.unset, details=values.unset,
hidden_details=values.unset):
"""
Create a new ChallengeInstance
:param datetime expiration_date: The future date in which this Challenge will expire
:param unicode details: Public details provided to co... | 0.006108 |
def linkify_templates(self):
"""
Link all templates, and create the template graph too
:return: None
"""
# First we create a list of all templates
for i in itertools.chain(iter(list(self.items.values())),
iter(list(self.templates.values()... | 0.00463 |
def zbar_function(fname, restype, *args):
"""Returns a foreign function exported by `zbar`.
Args:
fname (:obj:`str`): Name of the exported function as string.
restype (:obj:): Return type - one of the `ctypes` primitive C data
types.
*args: Arguments - a sequence of `ctypes` pri... | 0.001965 |
def get_all_quiz_submissions(self, quiz_id, course_id, include=None):
"""
Get all quiz submissions.
Get a list of all submissions for this quiz. Users who can view or manage
grades for a course will have submissions from multiple users returned. A
user who can only submit ... | 0.005879 |
def scroll_deck(self, decknum, scroll_x, scroll_y):
"""Move a deck."""
self.scroll_deck_x(decknum, scroll_x)
self.scroll_deck_y(decknum, scroll_y) | 0.011765 |
def variable_on_cpu(name, shape, initializer):
r"""
Next we concern ourselves with graph creation.
However, before we do so we must introduce a utility function ``variable_on_cpu()``
used to create a variable in CPU memory.
"""
# Use the /cpu:0 device for scoped operations
with tf.device(Con... | 0.004246 |
def to_json(objects, filename, warnings=True):
"""
Export the indicators of one or several users to JSON.
Parameters
----------
objects : list
List of objects to be exported.
filename : string
File to export to.
Examples
--------
This function can be use to export t... | 0.001014 |
def setup(self, layers, plot):
"""
Create a layout for the panels
The layout is a dataframe that stores all the
structual information about the panels that will
make up the plot. The actual layout depends on
the type of facet.
This method ensures that each layer... | 0.002508 |
def save_array_types(self, fname):
'''Save array type registry to a file
Args:
fname (str): Name of file to save array database to
'''
type_defs = {'arrays': sorted(list(self.array_types))}
with open(fname, 'wt') as fh:
pprint(type_defs, stream=fh) | 0.010526 |
def dict_merge(base, addition, append_lists=False):
"""Merge one dictionary with another, recursively.
Fields present in addition will be added to base if not present or merged
if both values are dictionaries or lists (with append_lists=True). If
the values are different data types, the value in additio... | 0.001776 |
def _update_fitness(self, action_set):
"""Update the fitness values of the rules belonging to this action
set."""
# Compute the accuracy of each rule. Accuracy is inversely
# proportional to error. Below a certain error threshold, accuracy
# becomes constant. Accuracy values rang... | 0.001577 |
def add(self,attrlist,attrvalues):
'''
add an attribute
:parameter dimlist: list of dimensions
:parameter dimvalues: list of values for dimlist
'''
for i,d in enumerate(attrlist):
self[d] = attrvalues[i] | 0.021429 |
def get_colormap(cls, names=[], N=10, *args, **kwargs):
"""Open a :class:`ColormapDialog` and get a colormap
Parameters
----------
%(ColormapModel.parameters)s
Other Parameters
----------------
``*args, **kwargs``
Anything else that is passed to the ... | 0.001652 |
def apply_figure(self, figure):
"""
Makes any desired changes to the figure object
This method will be called once with a figure object
after plot has completed. Subclasses that override this
method should make sure that the base class method is
called.
"""
... | 0.005076 |
def run_script(dist_spec, script_name):
"""Locate distribution `dist_spec` and run its `script_name` script"""
ns = sys._getframe(1).f_globals
name = ns['__name__']
ns.clear()
ns['__name__'] = name
require(dist_spec)[0].run_script(script_name, ns) | 0.00369 |
def _removeSingleMemberGroupReferences(kerning, leftGroups, rightGroups):
"""
Translate group names into glyph names in pairs
if the group only contains one glyph.
"""
new = {}
for (left, right), value in kerning.items():
left = leftGroups.get(left, left)
right = rightGroups.get(... | 0.002625 |
def _ParseTimeRange(self, timerange):
"""Parses a timerange argument and always returns non-None timerange."""
if timerange is None:
timerange = (None, None)
from_time, to_time = timerange
if not from_time:
from_time = rdfvalue.RDFDatetime().FromSecondsSinceEpoch(0)
if not to_time:
... | 0.009456 |
def request(self, api_query, url=None):
"""
e.g. {'action': 'query', 'meta': 'userinfo'}. format=json not required
function returns a python dict that resembles the api's json response
"""
api_query['format'] = 'json'
if url is not None:
api_url = url + "/api.... | 0.002727 |
def presence_handler(type_, from_):
"""
Deprecated alias of :func:`.dispatcher.presence_handler`.
.. deprecated:: 0.9
"""
import aioxmpp.dispatcher
return aioxmpp.dispatcher.presence_handler(type_, from_) | 0.004367 |
def plot_mag_map(fignum, element, lons, lats, element_type, cmap='coolwarm', lon_0=0, date="", contours=False, proj='PlateCarree'):
"""
makes a color contour map of geomagnetic field element
Parameters
____________
fignum : matplotlib figure number
element : field element array from pmag.do_mag... | 0.001592 |
def data(self, column, role):
"""Return the data for the specified column and role
The column addresses one attribute of the data.
:param column: the data column
:type column: int
:param role: the data role
:type role: QtCore.Qt.ItemDataRole
:returns: data depen... | 0.004484 |
def send_message_for_lane_change(sender, **kwargs):
"""
Sends a message to possible owners of the current workflows
next lane.
Args:
**kwargs: ``current`` and ``possible_owners`` are required.
sender (User): User object
"""
current = kwargs['current']
owners = kwargs['possi... | 0.003104 |
def morphemes(args):
"""Segment words according to their morphemes."""
morfessor = load_morfessor_model(lang=args.lang)
for l in args.input:
words = l.strip().split()
morphemes = [(w, u"_".join(morfessor.viterbi_segment(w)[0])) for w in words]
line_annotations = [u"{:<16}{:<5}".format(w,p) for w, p in... | 0.018041 |
def nni(
self,
edge,
head_subtree,
tail_subtree,
):
""" *Inplace* Nearest-neighbour interchange (NNI) operation.
An edge in the tree has two or more subtrees at each end (ends are
designated 'head' and 'tail'). The NNI operation exchanges one ... | 0.00574 |
def parse(self, file_obj):
"""
Read an OpenSSH config from the given file object.
@param file_obj: a file-like object to read the config file from
@type file_obj: file
"""
order = 1
host = {"host": ['*'], "config": {}, }
for line in file_obj:
... | 0.000813 |
def main(self):
"""
Scheduler steps:
- run ready until exhaustion
- if there's something scheduled
- run overdue scheduled immediately
- or if there's nothing registered, sleep until next scheduled
and then go back to ready
... | 0.001143 |
def retry_loop(retries, delay_in_seconds, conditions, function):
"""
Actually performs the retry loop used by the retry decorator
and handler functions. Failures for retrying are defined by
the RetryConditions passed in. If the maximum number of
retries has been reached then it raises the most recen... | 0.00058 |
def _get_session(region, key, keyid, profile):
'''
Get a boto3 session
'''
if profile:
if isinstance(profile, six.string_types):
_profile = __salt__['config.option'](profile)
elif isinstance(profile, dict):
_profile = profile
key = _profile.get('key', None... | 0.001359 |
def handle_resourcelist(ltext, **kwargs):
'''
A helper that converts lists of resources from a textual format such as Markdown, including absolutizing relative IRIs
'''
base=kwargs.get('base', VERSA_BASEIRI)
model=kwargs.get('model')
iris = ltext.strip().split()
newlist = model.generate_reso... | 0.009029 |
def from_list(cls, database, key, data, clear=False):
"""
Create and populate an Array object from a data dictionary.
"""
arr = cls(database, key)
if clear:
arr.clear()
arr.extend(data)
return arr | 0.007576 |
def get_recipes_in_cookbook(name):
"""Gets the name of all recipes present in a cookbook
Returns a list of dictionaries
"""
recipes = {}
path = None
cookbook_exists = False
metadata_exists = False
for cookbook_path in cookbook_paths:
path = os.path.join(cookbook_path, name)
... | 0.000322 |
def _complex_dtype(dtype):
"""Patched version of :func:`sporco.linalg.complex_dtype`."""
dt = cp.dtype(dtype)
if dt == cp.dtype('float128'):
return cp.dtype('complex256')
elif dt == cp.dtype('float64'):
return cp.dtype('complex128')
else:
return cp.dtype('complex64') | 0.003205 |
def parse_atoms(self, pdb):
"""Parse the ATOM entries into the object"""
atomre = re.compile("ATOM")
atomlines = [line for line in pdb.lines if atomre.match(line)]
chainresnums = {}
for line in atomlines:
chain = line[21]
resname = line[17:20]
resnum = line[22:2... | 0.026163 |
def _convert_range_to_list(tgt, range_server):
'''
convert a seco.range range into a list target
'''
r = seco.range.Range(range_server)
try:
return r.expand(tgt)
except seco.range.RangeException as err:
log.error('Range server exception: %s', err)
return [] | 0.003279 |
def mark_whole_doc_dirty(self):
"""
Marks the whole document as dirty to force a full refresh. **SLOW**
"""
text_cursor = self._editor.textCursor()
text_cursor.select(text_cursor.Document)
self._editor.document().markContentsDirty(text_cursor.selectionStart(),
... | 0.005181 |
def make_export(self, exports):
"""Populate library exported function data."""
sql = 'drop table if exists export'
logging.debug(sql)
self.cursor.execute(sql)
sql = 'create table if not exists export ' \
'(func text unique, module text)'
logging.debug(sql)
... | 0.002625 |
def summary_stats(data):
"""
Returns a :class:`~bandicoot.helper.maths.SummaryStats` object
containing statistics on the given distribution.
Examples
--------
>>> summary_stats([0, 1])
SummaryStats(mean=0.5, std=0.5, min=0.0, max=1.0, median=0.5, skewness=0.0, kurtosis=1.0, distribution=[0,... | 0.002384 |
def sitemap_uri(self, basename):
"""Get full URI (filepath) for sitemap based on basename."""
if (re.match(r"\w+:", basename)):
# looks like URI
return(basename)
elif (re.match(r"/", basename)):
# looks like full path
return(basename)
else:... | 0.004556 |
def mode(self, values, weights=None):
"""compute the mode within each group.
Parameters
----------
values : array_like, [keys, ...]
values to compute the mode of per group
weights : array_like, [keys], float, optional
optional weight associated with each ... | 0.004711 |
def record_manifest(self):
"""
Called after a deployment to record any data necessary to detect changes
for a future deployment.
"""
manifest = super(PIPSatchel, self).record_manifest()
manifest['all-requirements'] = self.get_combined_requirements()
if self.verbos... | 0.007792 |
def assert_no_selector(self, *args, **kwargs):
"""
Asserts that a given selector is not on the page or a descendant of the current node. Usage
is identical to :meth:`assert_selector`.
Query options such as ``count``, ``minimum``, and ``between`` are considered to be an
integral ... | 0.004986 |
def all(cls, state=None, include_deactivated=False):
"""
Get all organisations
:param state: State of organisation
:param include_deactivated: Flag to include deactivated
:returns: list of Organisation instances
:raises: SocketError, CouchException
"""
if... | 0.003398 |
def select_header_content_type(self, content_types):
"""
Returns `Content-Type` based on an array of content_types provided.
:param content_types: List of content-types.
:return: Content-Type (e.g. application/json).
"""
if not content_types:
return 'applicat... | 0.003623 |
def fetch(self, x, y, w, h):
"""Fill a region with pixel data.
Pixels are filled with data!
Returns:
Pixel data.
Raises:
:class:`.Error`
"""
if not at_least_libvips(8, 8):
raise Error('libvips too old')
psize = ffi.new('si... | 0.00339 |
def validate(self, required_props):
"""
Check if the required application metadata properties have been populated.
:param required_props: List of required properties
:type required_props: list
:return: True, if the metadata is valid
:raises: InvalidApplicationMetadataErr... | 0.004992 |
def merge(a_intervals, b_intervals, op):
"""
Merge two lists of intervals according to the boolean function op
``a_intervals`` and ``b_intervals`` need to be sorted and consistent (no overlapping intervals).
This operation keeps the resulting interval set consistent.
Parameters... | 0.004373 |
def _get_field(xdmf_file, data_item):
"""Extract field from data item."""
shp = _get_dim(data_item)
h5file, group = data_item.text.strip().split(':/', 1)
icore = int(group.split('_')[-2]) - 1
fld = _read_group_h5(xdmf_file.parent / h5file, group).reshape(shp)
return icore, fld | 0.003322 |
def set_shuffle_off(self):
"""Sets playback to sequential."""
self.publish(
action='set',
resource='audioPlayback/config',
publish_response=False,
properties={'config': {'shuffleActive': False}}
) | 0.007463 |
def fqscreen_plot (self):
""" Makes a fancy custom plot which replicates the plot seen in the main
FastQ Screen program. Not useful if lots of samples as gets too wide. """
categories = list()
getCats = True
data = list()
p_types = OrderedDict()
p_types['multiple... | 0.005175 |
def get_buckets(min_length, max_length, bucket_count):
'''
Get bucket by length.
'''
if bucket_count <= 0:
return [max_length]
unit_length = int((max_length - min_length) // (bucket_count))
buckets = [min_length + unit_length *
(i + 1) for i in range(0, bucket_count)]
... | 0.002755 |
def value_from_datadict(self, *args, **kwargs):
"""
Pass the submitted value through the sanitizer before returning it.
"""
value = super(RichTextWidget, self).value_from_datadict(
*args, **kwargs)
if value is not None:
value = self.get_sanitizer()(value)
... | 0.005882 |
def handoverCommand(SynchronizationIndication_presence=0,
FrequencyShortList_presence=0, FrequencyList_presence=0,
CellChannelDescription_presence=0,
MultislotAllocation_presence=0,
ChannelMode_presence=0, ChannelMode_presence1=0,
... | 0.000375 |
def create_git_action_for_new_study(self, new_study_id=None):
"""Checks out master branch as a side effect"""
ga = self.create_git_action()
if new_study_id is None:
new_study_id = self._mint_new_study_id()
self.register_doc_id(ga, new_study_id)
return ga, new_study_id | 0.00625 |
def get(self, section, key, default=MANIFEST_NULL_KEY):
""" Returns the value if it exist, or default if default is set """
if not self.manifest.has_option(section, key) and default is not MANIFEST_NULL_KEY:
return default
return self.manifest.get(section, key) | 0.010101 |
def toggle_line_numbers(self, checked):
"""Toggle line numbers."""
if self.tabwidget is None:
return
for editor in self.editors:
editor.toggle_line_numbers(linenumbers=checked, markers=False)
self.set_option('line_numbers', checked) | 0.006803 |
def pack_rpc_response(response=None, exception=None):
"""Convert a response payload or exception to a status code and payload.
This function will convert an Exception raised by an RPC implementation
to the corresponding status code.
"""
if response is None:
response = bytes()
if excep... | 0.001209 |
def add_boundary(self, metabolite, type="exchange", reaction_id=None,
lb=None, ub=None, sbo_term=None):
"""
Add a boundary reaction for a given metabolite.
There are three different types of pre-defined boundary reactions:
exchange, demand, and sink reactions.
... | 0.000676 |
def jsd(p, q):
"""Finds the per-column JSD between dataframes p and q
Jensen-Shannon divergence of two probability distrubutions pandas
dataframes, p and q. These distributions are usually created by running
binify() on the dataframe.
Parameters
----------
p : pandas.DataFrame
An n... | 0.001024 |
def entries(self, start = datetime.datetime.today(), end =
datetime.datetime.today()):
'''Retrieves entries from all projects/tasks logged by this person.
Can be filtered based on time by specifying start/end datetimes.'''
fr = start.strftime('%Y%m%d')
to = end.strftime('%Y%m%d')
... | 0.015762 |
def convert(self, amount: Number, currency: str, to: str, reverse: bool=False) -> Number:
"""Convert amount to another currency"""
rate = self.get_rate_for(currency, to, reverse)
if self.return_decimal:
amount = Decimal(amount)
return amount * rate | 0.017123 |
def _fit_one_class(self, clx, cl):
""" Train clas number cl with data clx.
Use trainFromImageAndSeeds() function if you want to use 3D image data
as an input.
clx: data, 2d matrix
cl: label, integer
label: gmmsame, gaussian_kde, dpgmm, stored
"""
logge... | 0.000631 |
def transpose_image(self, image):
"""
Transpose based on EXIF information.
Borrowed from django-imagekit:
imagekit.processors.Transpose
"""
EXIF_ORIENTATION_STEPS = {
1: [],
2: ['FLIP_LEFT_RIGHT'],
3: ['ROTATE_180'],
... | 0.003841 |
def rename_compute(self, old_compute, new_compute):
"""
Change the label of a compute attached to the Bundle
:parameter str old_compute: the current name of the compute options
(must exist)
:parameter str new_compute: the desired new name of the compute options
(... | 0.003407 |
def from_data(cls, data):
"""Load an FCS file from a bytes-like object.
Args:
data: buffer containing contents of an FCS file.
Returns:
FCSParser instance with data loaded
"""
obj = cls()
with contextlib.closing(BytesIO(data)) as file_handle:
... | 0.005348 |
def with_transaction(self, callback, read_concern=None, write_concern=None,
read_preference=None):
"""Execute a callback in a transaction.
This method starts a transaction on this session, executes ``callback``
once, and then commits the transaction. For example::
... | 0.000535 |
def delete_if_not_in_zsets(self, key, member, set_list, client=None):
"""
Removes ``key`` only if ``member`` is not member of any sets in the
``set_list``. Returns the number of removed elements (0 or 1).
"""
return self._delete_if_not_in_zsets(
keys=[key]+set_list,
... | 0.005376 |
def bar(x, y, **kwargs):
"""Draws a bar chart in the current context figure.
Parameters
----------
x: numpy.ndarray, 1d
The x-coordinates of the data points.
y: numpy.ndarray, 1d
The y-coordinates of the data pints.
options: dict (default: {})
Options for the scales to ... | 0.001193 |
def _match(self, pred):
"""
Helper function to determine if this node matches the given predicate.
"""
if not pred:
return True
# Strip off the [ and ]
pred = pred[1:-1]
if pred.startswith('@'):
# An attribute predicate checks the existence... | 0.002538 |
def boolean(value, boolmap=_BOOL_MAP):
"""
Convert value to <type bool>.
Uses the boolean mapping dict to attempt to determine the conversion
of the given value. If the value is not found in the mapping, it falls
back to the built-in Python bool conversion. Optionally, a custom
mapping dict can... | 0.000778 |
def get_names():
"""Get colormap names."""
res = list(cmaps.keys())
res = sorted(res, key=lambda s: s.lower())
return res | 0.007299 |
def clean(self, *args, **kwargs):
"""
Custom validation
1. interface_a and interface_b mandatory except for planned links
2. planned links should have at least node_a and node_b filled in
3. dbm and noise fields can be filled only for radio links
4. interf... | 0.006782 |
def _sprite_map_name(map):
"""
Returns the name of a sprite map The name is derived from the folder than
contains the sprites.
"""
map = StringValue(map).value
sprite_map = sprite_maps.get(map)
if not sprite_map:
log.error("No sprite map found: %s", map)
if sprite_map:
re... | 0.002604 |
def get_func_sourcecode(func):
"""
Try to get sourcecode using standard inspect.getsource().
If the function comes from a module which has been created dynamically
(not from the filesystem), then it tries to read the sourcecode on the
filesystem anyway.
WARNING: can do weird things if the filesy... | 0.001521 |
def convert_maxpool3(params, w_name, scope_name, inputs, layers, weights, names):
"""
Convert 3d Max pooling.
Args:
params: dictionary with layer parameters
w_name: name prefix in state_dict
scope_name: pytorch scope name
inputs: pytorch node inputs
layers: dictionar... | 0.001127 |
def stick_perm(presenter, egg, dist_dict, strategy):
"""Computes weights for one reordering using stick-breaking method"""
# seed RNG
np.random.seed()
# unpack egg
egg_pres, egg_rec, egg_features, egg_dist_funcs = parse_egg(egg)
# reorder
regg = order_stick(presenter, egg, dist_dict, stra... | 0.002649 |
def disable_hostgroup_host_notifications(self, hostgroup):
"""Disable host notifications for a hostgroup
Format of the line that triggers function call::
DISABLE_HOSTGROUP_HOST_NOTIFICATIONS;<hostgroup_name>
:param hostgroup: hostgroup to disable
:type hostgroup: alignak.object... | 0.00369 |
def rerender(self):
'''
Rerender all derived images from the original.
If optmization settings or expected sizes changed,
they will be used for the new rendering.
'''
with self.fs.open(self.original, 'rb') as f_img:
img = io.BytesIO(f_img.read()) # Store the ... | 0.006881 |
def start(self):
"""start connection threads, blocks until started
"""
if not (self.__recv_thread or self.__send_thread):
self.__end.clear()
self.__send_ready.clear()
self.__recv_ready.clear()
timeout = self.__socket_timeout + 1
ignore_... | 0.005332 |
def _path_is_abs(path):
'''
Return a bool telling whether or ``path`` is absolute. If ``path`` is None,
return ``True``. This function is designed to validate variables which
optionally contain a file path.
'''
if path is None:
return True
try:
return os.path.isabs(path)
... | 0.002525 |
def owner(self, pathobj):
"""
Returns file owner
This makes little sense for Artifactory, but to be consistent
with pathlib, we return modified_by instead, if available
"""
stat = self.stat(pathobj)
if not stat.is_dir:
return stat.modified_by
... | 0.005666 |
def _class_info(self, classes, show_builtins, private_bases, parts, aliases, top_classes):
# type: (List[Any], bool, bool, int, Optional[Dict[unicode, unicode]], List[Any]) -> List[Tuple[unicode, unicode, List[unicode], unicode]] # NOQA
"""Return name and bases for all classes that are ancestors of
... | 0.0022 |
def _get_content_type(self, filename):
""" gets the content type of a file """
mntype = mimetypes.guess_type(filename)[0]
filename, fileExtension = os.path.splitext(filename)
if mntype is None and\
fileExtension.lower() == ".csv":
mntype = "text/csv"
elif ... | 0.010381 |
def repository_verify(name, hosts=None, profile=None):
'''
.. versionadded:: 2017.7.0
Obtain list of cluster nodes which successfully verified this repository.
name
Repository name
CLI example::
salt myminion elasticsearch.repository_verify testrepo
'''
es = _get_instance... | 0.003021 |
def checkpoint(self):
"""
Update the database to reflect in-memory changes made to this item; for
example, to make it show up in store.query() calls where it is now
valid, but was not the last time it was persisted to the database.
This is called automatically when in 'autocommi... | 0.002133 |
def _connect(self):
"""
Connect to the statsite server
"""
# Create socket
if self.udpport > 0:
self.socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
self.port = self.udpport
elif self.tcpport > 0:
self.socket = socket.socket(s... | 0.001709 |
def set_transcript_name(self,name):
"""assign a transcript name
:param name: name
:type name: string
"""
self._options = self._options._replace(name = name) | 0.022599 |
def extern_call(self, context_handle, func, args_ptr, args_len):
"""Given a callable, call it."""
c = self._ffi.from_handle(context_handle)
runnable = c.from_value(func[0])
args = tuple(c.from_value(arg[0]) for arg in self._ffi.unpack(args_ptr, args_len))
return self.call(c, runnable, args) | 0.006431 |
def _from_dict(cls, _dict):
"""Initialize a IdentifiableLanguages object from a json dictionary."""
args = {}
if 'languages' in _dict:
args['languages'] = [
IdentifiableLanguage._from_dict(x)
for x in (_dict.get('languages'))
]
else... | 0.006198 |
def read_detections(fname):
"""
Read detections from a file to a list of Detection objects.
:type fname: str
:param fname: File to read from, must be a file written to by \
Detection.write.
:returns: list of :class:`eqcorrscan.core.match_filter.Detection`
:rtype: list
.. note::
... | 0.000678 |
def create_astrometric_catalog(inputs, **pars):
"""Create an astrometric catalog that covers the inputs' field-of-view.
Parameters
----------
input : str, list
Filenames of images to be aligned to astrometric catalog
catalog : str, optional
Name of catalog to extract astrometric po... | 0.000617 |
def _overlapping_channels(self, wavelengths):
"""
Return the channels that match the given wavelength array.
"""
sizes = self.meta["channel_sizes"]
min_a, max_a = wavelengths.min(), wavelengths.max()
matched_channel_names = []
for i, (name, size) in enumerate(zi... | 0.003425 |
def remove_pv(self, pv):
"""
Removes a physical volume from the volume group::
from lvm2py import *
lvm = LVM()
vg = lvm.get_vg("myvg", "w")
pv = vg.pvscan()[0]
vg.remove_pv(pv)
*Args:*
* pv (obj): A PhysicalVolu... | 0.003319 |
def command(self, command, value=1, callback=None,
check=True, allowable_errors=[], **kwargs):
"""Issue a MongoDB command.
Send command `command` to the database and return the
response. If `command` is an instance of :class:`basestring`
then the command {`command`: `val... | 0.002828 |
async def _disconnect(self):
"""
Disconnect only, without closing the session. Used in reconnections
to different data centers, where we don't want to close the session
file; user disconnects however should close it since it means that
their job with the client is complete and we... | 0.003891 |
def single_gene_deletion(model, gene_list=None, method="fba", solution=None,
processes=None, **kwargs):
"""
Knock out each gene from a given list.
Parameters
----------
model : cobra.Model
The metabolic model to perform deletions in.
gene_list : iterable
... | 0.000641 |
def report(ctx, board, done, output):
ctx.obj['board_id'] = board
ts = TrelloStats(ctx.obj)
"""
Reporting mode - Daily snapshots of a board for ongoing reporting:
-> trellis report --board=87hiudhw
--spend
--revenue
... | 0.007426 |
def getMultiple(self, pks, cascadeFetch=False):
'''
getMultiple - Gets multiple objects with a single atomic operation
@param cascadeFetch <bool> Default False, If True, all Foreign objects associated with this model
will be fetched immediately. If False, foreign objects will be fetched on-access.
@... | 0.041171 |
def _bdtr(k, n, p):
"""The binomial cumulative distribution function.
Args:
k: floating point `Tensor`.
n: floating point `Tensor`.
p: floating point `Tensor`.
Returns:
`sum_{j=0}^k p^j (1 - p)^(n - j)`.
"""
# Trick for getting safe backprop/gradients into n, k when
# betainc(a = 0, ..) ... | 0.018425 |
def plot_gate_map(backend, figsize=None,
plot_directed=False,
label_qubits=True,
qubit_size=24,
line_width=4,
font_size=12,
qubit_color=None,
line_color=None,
font_color='w'):
... | 0.000332 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.