text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def remove_peer_from_group(self, group_jid, peer_jid):
"""
Kicks someone out of a group
:param group_jid: The group JID from which to remove the user
:param peer_jid: The JID of the user to remove
"""
log.info("[+] Requesting removal of user {} from group {}".format(peer... | 0.009153 |
def duplicate(self):
'''
Returns a copy of the current contact element.
@returns: Contact
'''
return self.__class__(name=self.name, identifier=self.identifier,
phone=self.phone, require_id=self.__require_id,
address=self... | 0.005865 |
def OpenFile(filename, binary=False, newline=None, encoding=None):
'''
Open a file and returns it.
Consider the possibility of a remote file (HTTP, HTTPS, FTP)
:param unicode filename:
Local or remote filename.
:param bool binary:
If True returns the file as is, ignore any EOL conv... | 0.002059 |
def parse(self, xml_file, view_name=None) -> XmlNode:
"""Parses xml file with xml_path and returns XmlNode"""
self._setup_parser()
try:
self._view_name = view_name
self._parser.ParseFile(xml_file)
except ExpatError as error:
# pylint: disable=E1101
... | 0.006303 |
def upload_image(vol, img, offset, parallel=1,
manual_shared_memory_id=None, manual_shared_memory_bbox=None, manual_shared_memory_order='F'):
"""Upload img to vol with offset. This is the primary entry point for uploads."""
global NON_ALIGNED_WRITE
if not np.issubdtype(img.dtype, np.dtype(vol.dtype).type):
... | 0.019277 |
def run_bwa(job, fastqs, sample_type, univ_options, bwa_options):
"""
This module aligns the SAMPLE_TYPE dna fastqs to the reference
ARGUMENTS -- <ST> depicts the sample type. Substitute with 'tumor'/'normal'
1. fastqs: Dict of list of input WGS/WXS fastqs
fastqs
+- '<ST>_dna': [... | 0.00235 |
def ijk_to_xyz(dset,ijk):
'''convert the dset indices ``ijk`` to RAI coordinates ``xyz``'''
i = nl.dset_info(dset)
orient_codes = [int(x) for x in nl.run(['@AfniOrient2RAImap',i.orient]).output.split()]
orient_is = [abs(x)-1 for x in orient_codes]
rai = []
for rai_i in xrange(3):
ijk_i ... | 0.017762 |
def base(ctx, verbose, config):
"""Puzzle: manage DNA variant resources."""
# configure root logger to print to STDERR
loglevel = LEVELS.get(min(verbose, 3))
configure_stream(level=loglevel)
ctx.obj = {}
if config and os.path.exists(config):
ctx.obj = yaml.load(open(config, 'r')) or {}
... | 0.002212 |
def make_export_strategy(
args,
keep_target,
assets_extra,
features,
schema,
stats):
"""Makes prediction graph that takes json input.
Args:
args: command line args
keep_target: If ture, target column is returned in prediction graph. Target
column must... | 0.007731 |
def get_members(self, selector):
"""
Returns the members that satisfy the given selector.
:param selector: (:class:`~hazelcast.core.MemberSelector`), Selector to be applied to the members.
:return: (List), List of members.
"""
members = []
for member in self.get_... | 0.006865 |
def create(self, doc_details):
'''
a method to create a new document in the collection
:param doc_details: dictionary with document details and user id value
:return: dictionary with document details and _id and _rev values
'''
# https://developer.couchbase... | 0.004188 |
def new_comment(self, string, start, end, line):
""" Possibly add a new comment.
Only adds a new comment if this comment is the only thing on the line.
Otherwise, it extends the noncomment block.
"""
prefix = line[:start[1]]
if prefix.strip():
# Oops! Trailin... | 0.003401 |
def recipe_status(backend):
"""
Compare local recipe to remote recipe for the current recipe.
"""
kitchen = DKCloudCommandRunner.which_kitchen_name()
if kitchen is None:
raise click.ClickException('You are not in a Kitchen')
recipe_dir = DKRecipeDisk.find_recipe_root_dir()
if recipe_... | 0.004127 |
def set_out(self, que_out, num_followers):
"""Set the queue in output and the number of parallel tasks that follow"""
self._que_out = que_out
self._num_followers = num_followers | 0.014925 |
def loadOrInitSettings(self, groupName=None):
""" Reads the registry items from the persistent settings store, falls back on the
default plugins if there are no settings in the store for this registry.
"""
groupName = groupName if groupName else self.settingsGroupName
setting... | 0.006742 |
def type(self, s, enter=False, clear=False):
"""Input some text, this method has been tested not very stable on some device.
"Hi world" maybe spell into "H iworld"
Args:
- s: string (text to input), better to be unicode
- enter(bool): input enter at last
- ne... | 0.003865 |
def seq_seqhash(seq, normalize=True):
"""returns 24-byte Truncated Digest sequence `seq`
>>> seq_seqhash("")
'z4PhNX7vuL3xVChQ1m2AB9Yg5AULVxXc'
>>> seq_seqhash("ACGT")
'aKF498dAxcJAqme6QYQ7EZ07-fiw8Kw2'
>>> seq_seqhash("acgt")
'aKF498dAxcJAqme6QYQ7EZ07-fiw8Kw2'
>>> seq_seqhash("acgt"... | 0.002037 |
def clean_config(config):
"""Check if all values have defaults and replace errors with their default value
:param config: the configobj to clean
:type config: ConfigObj
:returns: None
:raises: ConfigError
The object is validated, so we need a spec file. All failed values will be replaced
b... | 0.004167 |
def map_lrepr(
entries: Callable[[], Iterable[Tuple[Any, Any]]],
start: str,
end: str,
meta=None,
**kwargs,
) -> str:
"""Produce a Lisp representation of an associative collection, bookended
with the start and end string supplied. The entries argument must be a
callable which will produc... | 0.000739 |
def _reset(self):
'''
_reset - reset this object. Assigned to .reset after __init__ call.
'''
HTMLParser.reset(self)
self.root = None
self.doctype = None
self._inTag = [] | 0.008658 |
def namedb_offset_count_predicate( offset=None, count=None ):
"""
Make an offset/count predicate
even if offset=None or count=None.
Return (query, args)
"""
offset_count_query = ""
offset_count_args = ()
if count is not None:
offset_count_query += "LIMIT ? "
offset_coun... | 0.005758 |
def widgetForName(self, name):
"""Gets a widget with *name*
:param name: the widgets in this container should all have
a name() method. This is the string to match to that result
:type name: str
"""
for iwidget in range(len(self)):
if self.widget(iwidget).na... | 0.005305 |
def _validate_pixel_density(self):
"""
Validate image pixel density
See `spec <https://ocr-d.github.io/mets#pixel-density-of-images-must-be-explicit-and-high-enough>`_.
"""
for f in [f for f in self.mets.find_files() if f.mimetype.startswith('image/')]:
if not f.loca... | 0.007692 |
def findfirst(f, coll):
"""Return first occurrence matching f, otherwise None"""
result = list(dropwhile(f, coll))
return result[0] if result else None | 0.006024 |
def selectedConnections( self ):
"""
Returns a list of the selected connections in a scene.
:return <list> [ <XNodeConnection>, .. ]
"""
output = []
for item in self.selectedItems():
if ( isinstance(item, XNodeConnection) ):
output... | 0.019718 |
def destroy_comment(self, access_token, comment_id):
"""doc: http://open.youku.com/docs/doc?id=42
"""
url = 'https://openapi.youku.com/v2/comments/destroy.json'
data = {
'client_id': self.client_id,
'access_token': access_token,
'comment_id': comment_i... | 0.004695 |
def count_integers(arr,
weights=None,
minlength=None,
maxlength=None,
axis=None,
dtype=tf.int32,
name=None):
"""Counts the number of occurrences of each value in an integer array `arr`.
Works like `tf.... | 0.003038 |
def SegmentSum(a, ids, *args):
"""
Segmented sum op.
"""
func = lambda idxs: reduce(np.add, a[idxs])
return seg_map(func, a, ids), | 0.013333 |
def _get_ref_from_galaxy_loc(name, genome_build, loc_file, galaxy_dt, need_remap,
galaxy_config, data):
"""Retrieve reference genome file from Galaxy *.loc file.
Reads from tool_data_table_conf.xml information for the index if it
exists, otherwise uses heuristics to find line b... | 0.005277 |
def _declare(self, var):
""" Declare the variable `var` """
if var.name in self._declarations:
raise ValueError('Variable already declared')
self._declarations[var.name] = var
return var | 0.008696 |
def _Backward3_P_hs(h, s):
"""Backward equation for region 3, P=f(h,s)
Parameters
----------
h : float
Specific enthalpy, [kJ/kg]
s : float
Specific entropy, [kJ/kgK]
Returns
-------
P : float
Pressure, [MPa]
"""
sc = 4.41202148223476
if s <= sc:
... | 0.002488 |
def register():
"""Plugin registration."""
from pelican import signals
signals.initialized.connect(setup_git)
signals.article_generator_finalized.connect(replace_git_url) | 0.005319 |
def hiveconfs(self):
"""
Returns a dict of key=value settings to be passed along
to the hive command line via --hiveconf. By default, sets
mapred.job.name to task_id and if not None, sets:
* mapred.reduce.tasks (n_reduce_tasks)
* mapred.fairscheduler.pool (pool) or mapre... | 0.003762 |
def dumps(self, indent=1):
""" Returns nested string representation of the dictionary (like json.dumps).
:param indent: indentation level.
"""
str_keys_dict = OrderedDict({str(k): v for k, v in self.items()})
for k, v in str_keys_dict.items():
if isinstance(v, dict)... | 0.007541 |
def quantile_binning(data=None, bins=10, *, qrange=(0.0, 1.0), **kwargs) -> StaticBinning:
"""Binning schema based on quantile ranges.
This binning finds equally spaced quantiles. This should lead to
all bins having roughly the same frequencies.
Note: weights are not (yet) take into account for calcul... | 0.002519 |
def build_map(function: Callable[[Any], Any] = None,
unpack: bool = False):
""" Decorator to wrap a function to return a Map operator.
:param function: function to be wrapped
:param unpack: value from emits will be unpacked (*value)
"""
def _build_map(function: Callable[[Any], Any]):
... | 0.001502 |
def make_node(can_device_name, **kwargs):
"""Constructs a node instance with specified CAN device.
:param can_device_name: CAN device name, e.g. "/dev/ttyACM0", "COM9", "can0".
:param kwargs: These arguments will be supplied to the CAN driver factory and to the node constructor.
"""
can = driver.mak... | 0.007772 |
def mark(self, lineno, count=1):
"""Mark a given source line as executed count times.
Multiple calls to mark for the same lineno add up.
"""
self.sourcelines[lineno] = self.sourcelines.get(lineno, 0) + count | 0.008333 |
def get_region(service, region, profile):
"""
Retrieve the region for a particular AWS service based on configured region and/or profile.
"""
_, region, _, _ = _get_profile(service, region, None, None, profile)
return region | 0.008163 |
def _handle_error(self, data, params):
"""Handle an error response from the SABnzbd API"""
error = data.get('error', 'API call failed')
mode = params.get('mode')
raise SabnzbdApiException(error, mode=mode) | 0.008439 |
def addCurvatureScalars(self, method=0, lut=None):
"""
Build an ``Actor`` that contains the color coded surface
curvature calculated in three different ways.
:param int method: 0-gaussian, 1-mean, 2-max, 3-min curvature.
:param float lut: optional look up table.
:Exampl... | 0.002757 |
def span_in_context(span):
"""
Create a context manager that stores the given span in the thread-local
request context. This function should only be used in single-threaded
applications like Flask / uWSGI.
## Usage example in WSGI middleware:
.. code-block:: python
from opentracing_ins... | 0.000577 |
def _treat_devices_removed(self):
"""Process the removed devices."""
for device in self._removed_ports.copy():
eventlet.spawn_n(self._process_removed_port, device) | 0.010471 |
def grad_local_log_likelihood(self, x):
"""
d/d \psi y \psi - log (1 + exp(\psi))
= y - exp(\psi) / (1 + exp(\psi))
= y - sigma(psi)
= y - p
d \psi / dx = C
d / dx = (y - sigma(psi)) * C
"""
C, D, u, y = self.C, self.D, self.inputs, ... | 0.018476 |
def record(self):
# type: () -> bytes
'''
Generate a string representing the Rock Ridge Symbolic Link record.
Parameters:
None.
Returns:
String containing the Rock Ridge record.
'''
if not self._initialized:
raise pycdlibexception.Py... | 0.008418 |
def setValueSafe(self, row, value):
'setValue and ignore exceptions'
try:
return self.setValue(row, value)
except Exception as e:
exceptionCaught(e) | 0.010204 |
def compile_proto(source, python_out, proto_path):
"""Invoke Protocol Compiler to generate python from given source .proto."""
if not protoc:
sys.exit('protoc not found. Is the protobuf-compiler installed?\n')
protoc_command = [
protoc,
'--proto_path', proto_path,
'--python_out', python_out... | 0.009542 |
def _compute_quads(self, element, data, mapping):
"""
Computes the node quad glyph data.x
"""
quad_mapping = {'left': 'x0', 'right': 'x1', 'bottom': 'y0', 'top': 'y1'}
quad_data = dict(data['scatter_1'])
quad_data.update({'x0': [], 'x1': [], 'y0': [], 'y1': []})
f... | 0.004438 |
def get_translations(self, context_id):
"""Retrieves all translation entries for a tunnel context.
:param int context_id: The id-value representing the context instance.
:return list(dict): Translations associated with the given context
"""
_mask = ('[mask[addressTranslations[cu... | 0.001876 |
def mmInformation(NetworkName_presence=0, NetworkName_presence1=0,
TimeZone_presence=0, TimeZoneAndTime_presence=0,
LsaIdentifier_presence=0):
"""MM INFORMATION Section 9.2.15a"""
a = TpPd(pd=0x5)
b = MessageType(mesType=0x32) # 00110010
packet = a / b
if Network... | 0.001088 |
def share_application_with_accounts(application_id, account_ids, sar_client=None):
"""
Share the application privately with given AWS account IDs.
:param application_id: The Amazon Resource Name (ARN) of the application
:type application_id: str
:param account_ids: List of AWS account IDs, or *
... | 0.004206 |
def _create(self):
"""Create the Whisper file on disk"""
if not os.path.exists(settings.SALMON_WHISPER_DB_PATH):
os.makedirs(settings.SALMON_WHISPER_DB_PATH)
archives = [whisper.parseRetentionDef(retentionDef)
for retentionDef in settings.ARCHIVES.split(",")]
... | 0.004107 |
def update(self, i):
"""D.update(E) -> None. Update D from iterable E with pre-existing
items being overwritten.
Elements in E are assumed to be dicts containing the primary key to
allow the equivelent of:
for k in E: D[k.primary_key] = k
"""
key_list = ... | 0.008368 |
def my_import(name):
""" dynamic importing """
module, attr = name.rsplit('.', 1)
mod = __import__(module, fromlist=[attr])
klass = getattr(mod, attr)
return klass() | 0.005405 |
def index():
"""Generate a list of all crawlers, alphabetically, with op counts."""
crawlers = []
for crawler in manager:
data = Event.get_counts(crawler)
data['last_active'] = crawler.last_run
data['total_ops'] = crawler.op_count
data['running'] = crawler.is_running
... | 0.002299 |
def checkCAS(CASRN):
'''Checks if a CAS number is valid. Returns False if the parser cannot
parse the given string..
Parameters
----------
CASRN : string
A three-piece, dash-separated set of numbers
Returns
-------
result : bool
Boolean value if CASRN was valid. If par... | 0.004139 |
def remote_unpack(self):
"""
Called by remote worker to state that no more data will be transferred
"""
# Make sure remote_close is called, otherwise atomic rename won't happen
self.remote_close()
# Map configured compression to a TarFile setting
if self.compress... | 0.004478 |
def send_to_back(self):
"""adjusts sprite's z-order so that the sprite is behind it's
siblings"""
if not self.parent:
return
self.z_order = self.parent._z_ordered_sprites[0].z_order - 1 | 0.008734 |
def log_errors(f, self, *args, **kwargs):
"""decorator to log unhandled exceptions raised in a method.
For use wrapping on_recv callbacks, so that exceptions
do not cause the stream to be closed.
"""
try:
return f(self, *args, **kwargs)
except Exception:
self.log.error("Unca... | 0.00554 |
def update_backend(use_pypi=False, index='dev', build=True, user=None, version=None):
"""
Install the backend from the given devpi index at the given version on the target host and restart the service.
If version is None, it defaults to the latest version
Optionally, build and upload the application f... | 0.00572 |
def stft(self, samples: np.ndarray):
"""
Perform Short-time Fourier transform to get the spectrogram for the given samples
:return: short-time Fourier transform of the given signal
"""
window = self.window_function(self.window_size)
hop_size = self.hop_size
if le... | 0.006863 |
def add_projection(query_proto, *projection):
"""Add projection properties to the given datatstore.Query proto message."""
for p in projection:
proto = query_proto.projection.add()
proto.property.name = p | 0.013889 |
def _get_site(self, url, headers, cookies, timeout, driver_args, driver_kwargs):
"""
Try and return page content in the requested format using requests
"""
try:
# Headers and cookies are combined to the ones stored in the requests session
# Ones passed in here wi... | 0.00439 |
def p_primary_expr_no_brace_4(self, p):
"""primary_expr_no_brace : LPAREN expr RPAREN"""
if isinstance(p[2], self.asttypes.GroupingOp):
# this reduces the grouping operator to one.
p[0] = p[2]
else:
p[0] = self.asttypes.GroupingOp(expr=p[2])
p[0].s... | 0.006098 |
def assert_shape_match(shape1, shape2):
"""Ensure the shape1 match the pattern given by shape2.
Ex:
assert_shape_match((64, 64, 3), (None, None, 3))
Args:
shape1 (tuple): Static shape
shape2 (tuple): Dynamic shape (can contain None)
"""
shape1 = tf.TensorShape(shape1)
shape2 = tf.TensorShape(s... | 0.012195 |
async def json(self, *, encoding: Optional[str]=None) -> Any:
"""Like read(), but assumes that body parts contains JSON data."""
data = await self.read(decode=True)
if not data:
return None
encoding = encoding or self.get_charset(default='utf-8')
return json.loads(dat... | 0.011799 |
def fetch(self, recursive=1, exclude_children=False, exclude_back_refs=False):
"""Fetch resource from the API server
:param recursive: level of recursion for fetching resources
:type recursive: int
:param exclude_children: don't get children references
:type exclude_children: bo... | 0.002198 |
def open_image(fname_or_instance: Union[str, IO[bytes]]):
"""Opens a Image and returns it.
:param fname_or_instance: Can either be the location of the image as a
string or the Image.Image instance itself.
"""
if isinstance(fname_or_instance, Image.Image):
return fn... | 0.002653 |
def get_ngroups(self, field=None):
'''
Returns ngroups count if it was specified in the query, otherwise ValueError.
If grouping on more than one field, provide the field argument to specify which count you are looking for.
'''
field = field if field else self._determine_group_f... | 0.009311 |
def egg_info_writer(cmd, basename, filename):
# type: (setuptools.command.egg_info.egg_info, str, str) -> None
"""Read rcli configuration and write it out to the egg info.
Args:
cmd: An egg info command instance to use for writing.
basename: The basename of the file to write.
filena... | 0.000855 |
def validateBool(value, blank=False, strip=None, allowlistRegexes=None, blocklistRegexes=None, trueVal='True', falseVal='False', caseSensitive=False, excMsg=None):
"""Raises ValidationException if value is not an email address.
Returns the yesVal or noVal argument, not value.
* value (str): The value being... | 0.006076 |
def _serve_clients(self):
'''
Accept cients and serve, one separate thread per client.
'''
self.__up = True
while self.__up:
log.debug('Waiting for a client to connect')
try:
conn, addr = self.skt.accept()
log.debug('Receive... | 0.003942 |
def specwindow_lsp_value(times, mags, errs, omega):
'''This calculates the peak associated with the spectral window function
for times and at the specified omega.
NOTE: this is classical Lomb-Scargle, not the Generalized
Lomb-Scargle. `mags` and `errs` are silently ignored since we're calculating
t... | 0.005959 |
def _update_gecos(name, key, value, root=None):
'''
Common code to change a user's GECOS information
'''
if value is None:
value = ''
elif not isinstance(value, six.string_types):
value = six.text_type(value)
else:
value = salt.utils.stringutils.to_unicode(value)
pre_... | 0.001261 |
def info(*packages, **kwargs):
'''
Returns a detailed summary of package information for provided package names.
If no packages are specified, all packages will be returned.
.. versionadded:: 2015.8.1
packages
The names of the packages for which to return information.
failhard
... | 0.002903 |
def _handle_actionconstantpool(self, _):
"""Handle the ActionConstantPool action."""
obj = _make_object("ActionConstantPool")
obj.Count = count = unpack_ui16(self._src)
obj.ConstantPool = pool = []
for _ in range(count):
pool.append(self._get_struct_string())
... | 0.006079 |
async def on_error(self, event_method, *args, **kwargs):
"""|coro|
The default error handler provided by the client.
By default this prints to :data:`sys.stderr` however it could be
overridden to have a different implementation.
Check :func:`discord.on_error` for more details.
... | 0.004535 |
def checksum(digits, scale):
"""
Calculate checksum of Norwegian personal identity code.
Checksum is calculated with "Module 11" method using a scale.
The digits of the personal code are multiplied by the corresponding
number in the scale and summed;
if remainder of module 11 of the sum is less... | 0.001706 |
def generate_settings():
"""
This command is run when ``default_path`` doesn't exist, or ``init`` is
run and returns a string representing the default data to put into their
settings file.
"""
conf_file = os.path.join(os.path.dirname(base_settings.__file__),
'example... | 0.001227 |
def add_untagged_ok(self, text: MaybeBytes,
code: Optional[ResponseCode] = None) -> None:
"""Add an untagged ``OK`` response.
See Also:
:meth:`.add_untagged`, :class:`ResponseOk`
Args:
text: The response text.
code: Optional response ... | 0.007109 |
def security_rule_exists(name,
rulename=None,
vsys='1',
action=None,
disabled=None,
sourcezone=None,
destinationzone=None,
source=None,
... | 0.003646 |
def _pool_one_shape(features_2d, area_width, area_height, batch_size,
width, height, depth, fn=tf.reduce_max, name=None):
"""Pools for an area in features_2d.
Args:
features_2d: a Tensor in a shape of [batch_size, height, width, depth].
area_width: the max width allowed for an area.
... | 0.004831 |
def pack(self, topic_dims, t):
""" Packs selected logs into a numpy array
:param list topic_dims: list of (topic, dims) tuples, where topic is a string and dims a list dimensions to be packed for that topic
:param int t: time indexes to be packed
"""
data = []
fo... | 0.006579 |
def u2open(self, u2request):
"""
Open a connection.
@param u2request: A urllib2 request.
@type u2request: urllib2.Requet.
@return: The opened file-like urllib2 object.
@rtype: fp
"""
tm = self.options.timeout
url = build_opener(HTTPSClientAuthHandl... | 0.003899 |
def should_build(self, fpath, meta):
"""
Checks if the file should be built or not
Only skips layouts which are tagged as INCREMENTAL
Rebuilds only those files with mtime changed since previous build
"""
if meta.get('layout', self.default_template) in self.inc_layout:
... | 0.004132 |
def transcript_to_fake_psl_line(self,ref):
"""Convert a mapping to a fake PSL line
:param ref: reference genome dictionary
:type ref: dict()
:return: psl line
:rtype: string
"""
self._initialize()
e = self
mylen = 0
matches = 0
qstartslist = []
for exon in self.exons:
... | 0.02207 |
def _extern_decl(return_type, arg_types):
"""A decorator for methods corresponding to extern functions. All types should be strings.
The _FFISpecification class is able to automatically convert these into method declarations for
cffi.
"""
def wrapper(func):
signature = _ExternSignature(
return_type... | 0.012474 |
def conversations(self, getsrcdst=None, **kargs):
"""Graphes a conversations between sources and destinations and display it
(using graphviz and imagemagick)
getsrcdst: a function that takes an element of the list and
returns the source, the destination and optionally
... | 0.00098 |
def concretize(self, symbolic, policy, maxcount=7):
""" This finds a set of solutions for symbolic using policy.
This raises TooManySolutions if more solutions than maxcount
"""
assert self.constraints == self.platform.constraints
symbolic = self.migrate_expression(symbolic)
... | 0.004063 |
def list_zones():
'''
Displays a list of available time zones. Use this list when setting a
time zone using ``timezone.set_zone``
:return: a list of time zones
:rtype: list
CLI Example:
.. code-block:: bash
salt '*' timezone.list_zones
'''
ret = salt.utils.mac_utils.execu... | 0.002092 |
def set_tensor_final(self, tensor_name):
"""Denotes a tensor as a final output of the computation.
Args:
tensor_name: a string, name of a tensor in the graph.
"""
tensor = self._name_to_tensor(tensor_name)
self._final_tensors.add(tensor) | 0.003788 |
def return_dat(self, chan, begsam, endsam):
"""Return the data as 2D numpy.ndarray.
Parameters
----------
chan : int or list
index (indices) of the channels to read
begsam : int
index of the first sample
endsam : int
index of the last ... | 0.002468 |
def GetConfigPolicy(self, request, context):
"""Dispatches the request to the plugins get_config_policy method"""
try:
policy = self.plugin.get_config_policy()
return policy._pb
except Exception as err:
msg = "message: {}\n\nstack trace: {}".format(
... | 0.004843 |
def post(self, url, postParameters=None, urlParameters=None):
"""
Convenience method for requesting to google with proper cookies/params.
"""
if urlParameters:
url = url + "?" + self.getParameters(urlParameters)
headers = {'Authorization':'GoogleLogin auth=%s' % self.... | 0.008726 |
def created(self, instance, commit=True):
"""
Convenience method for saving a model (automatically commits it to
the database and returns the object with an HTTP 201 status code)
"""
if commit:
self.session_manager.save(instance, commit=True)
return instance, ... | 0.005917 |
def clear(self):
"""
Clears the context.
"""
self._objects.clear()
self._class_aliases = {}
self._unicodes = {}
self.extra = {} | 0.010929 |
def removeUnreferencedIDs(referencedIDs, identifiedElements):
"""
Removes the unreferenced ID attributes.
Returns the number of ID attributes removed
"""
global _num_ids_removed
keepTags = ['font']
num = 0
for id in identifiedElements:
node = identifiedElements[id]
if id... | 0.002062 |
def copy( self ):
"""
Returns a new copy of a C{ParseResults} object.
"""
ret = ParseResults( self.__toklist )
ret.__tokdict = self.__tokdict.copy()
ret.__parent = self.__parent
ret.__accumNames.update( self.__accumNames )
ret.__name = self.__name
... | 0.023599 |
def _wrap_parse(code, filename):
"""
async wrapper is required to avoid await calls raising a SyntaxError
"""
code = 'async def wrapper():\n' + indent(code, ' ')
return ast.parse(code, filename=filename).body[0].body[0].value | 0.007547 |
def volcano(differential_dfs, title='Axial Volcano Plot', scripts_mode="CDN", data_mode="directory",
organism="human", q_value_column_name="q", log2FC_column_name="logFC",
output_dir=".", filename="volcano.html", version=this_version):
"""
Arguments:
differential_dfs (dict or pan... | 0.004647 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.