text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def use_plenary_composition_view(self):
"""Pass through to provider CompositionLookupSession.use_plenary_composition_view"""
self._object_views['composition'] = PLENARY
# self._get_provider_session('composition_lookup_session') # To make sure the session is tracked
for session in self._g... | 0.008493 |
def get_file_contents(source_path: str) -> str:
"""
Loads the contents of the source into a string for execution using multiple
loading methods to handle cross-platform encoding edge cases. If none of
the load methods work, a string is returned that contains an error function
response that will be d... | 0.001155 |
def fetch(yts, needed_range, fh):
"""
Download desired range of data and put it in `yts` object (e.g. ``YTStor``).
Parameters
----------
yts : YTStor
Stor-like object to which we will write.
needed_range : tuple
Two element tuple that represents ... | 0.00796 |
def __callback (self, event):
'''
Callback function to receive and save Bumper Scans.
@param event: ROS BumperScan received
@type event: BumperScan
'''
bump = bumperEvent2BumperData(event)
if bump.state == 1:
self.lock.acquire()
... | 0.012048 |
def _applyTriggerValue(self, triggerName, outval):
""" Here we look through the entire .cfgspc to see if any parameters
are affected by this trigger. For those that are, we apply the action
to the GUI widget. The action is specified by depType. """
# First find which items are dependen... | 0.004654 |
def _reorient_3d(image):
"""
Reorganize the data for a 3d nifti
"""
# Create empty array where x,y,z correspond to LR (sagittal), PA (coronal), IS (axial) directions and the size
# of the array in each direction is the same with the corresponding direction of the input image.
new_image = numpy.z... | 0.008468 |
def segment_intersection1(start0, end0, start1, end1, s):
"""Image for :func:`.segment_intersection` docstring."""
if NO_IMAGES:
return
line0 = bezier.Curve.from_nodes(stack1d(start0, end0))
line1 = bezier.Curve.from_nodes(stack1d(start1, end1))
ax = line0.plot(2)
line1.plot(256, ax=ax)... | 0.002012 |
def get_user_autocompletions(ctx, args, incomplete, cmd_param):
"""
:param ctx: context associated with the parsed command
:param args: full list of args
:param incomplete: the incomplete text to autocomplete
:param cmd_param: command definition
:return: all the possible user-specified completio... | 0.002112 |
def _wrap_response(self, status=None, **kwargs):
"""Convenience method to wrap a status with any key word args.
Args:
status (enum): enum response status, defaults to OK
Returns:
dict: inlcudes a 'status' attribute and any key word arguments
"""
kwargs['... | 0.004975 |
def _move_path(self):
"""
Move the downloaded file to the authentic path (identified by
effective URL)
"""
if is_temp_path(self._path) and self._pycurl is not None:
eurl = self._pycurl.getinfo(pycurl.EFFECTIVE_URL)
er = get_resource_name(eurl)
... | 0.00363 |
def add_package(self, name):
"""
Registers a single package
:param name: (str) The effect package to add
"""
name, cls_name = parse_package_string(name)
if name in self.package_map:
return
package = EffectPackage(name)
package.load()
... | 0.004073 |
def add(self, registry):
""" Add works like replace, but only previously pushed metrics with the
same name (and the same job and instance) will be replaced.
(It uses HTTP method 'POST' to push to the Pushgateway.)
"""
# POST
payload = self.formatter.marshall(regis... | 0.005038 |
def login_required(function=None, message=None, login_url=None):
"""
Decorator for views that checks that the user is logged in, redirecting
to the log-in page if necessary.
"""
actual_decorator = user_passes_test(
lambda u: u.is_authenticated(),
message=message,
login_url=lo... | 0.002375 |
def uvindex_forecast_around_coords(self, lat, lon):
"""
Queries the OWM Weather API for forecast Ultra Violet values in the next 8
days in the surroundings of the provided geocoordinates.
:param lat: the location's latitude, must be between -90.0 and 90.0
:type lat: int/float
... | 0.00498 |
def _dimension(rank0, rankt, dim, singular_values):
""" output dimension """
if dim is None or (isinstance(dim, float) and dim == 1.0):
return min(rank0, rankt)
if isinstance(dim, float):
return np.searchsorted(VAMPModel._cumvar(singular_values), dim) + 1
else:
... | 0.005495 |
def merge_consecutive_filter_clauses(ir_blocks):
"""Merge consecutive Filter(x), Filter(y) blocks into Filter(x && y) block."""
if not ir_blocks:
return ir_blocks
new_ir_blocks = [ir_blocks[0]]
for block in ir_blocks[1:]:
last_block = new_ir_blocks[-1]
if isinstance(last_block,... | 0.005357 |
def observe_all(self, callback: Callable[[str, Any, Any], None]):
"""Subscribes to all keys changes"""
self._all_callbacks.append(callback) | 0.012903 |
def __init_keystone_session(self):
"""Create and return a Keystone session object."""
api = self._identity_api_version # for readability
tried = []
if api in ['3', None]:
sess = self.__init_keystone_session_v3(check=(api is None))
tried.append('v3')
i... | 0.002999 |
def _validate_config(self):
""" Handle and check configuration.
"""
groups = dict(
job=defaultdict(Bunch),
httpd=defaultdict(Bunch),
)
for key, val in config.torque.items():
# Auto-convert numbers and bools
if val.isdigit():
... | 0.003755 |
def create_temporary_workspace(version=None, mode=0700):
# type: (str, int) -> str
"""
Create a temporary directory, optionally by placing a subdirectory: version
:rtype: str
:return: Directory path
"""
workspace = mkdtemp('hemp_')
if version is not None:
workspace = join(workspa... | 0.002433 |
def handle_offchain_secretreveal(
mediator_state: MediatorTransferState,
mediator_state_change: ReceiveSecretReveal,
channelidentifiers_to_channels: ChannelMap,
pseudo_random_generator: random.Random,
block_number: BlockNumber,
block_hash: BlockHash,
) -> TransitionResult... | 0.001517 |
def _add_sub(self, other, op):
"""Implements both addition and subtraction."""
if not isinstance(other, Number):
return NotImplemented
# If either side is unitless, inherit the other side's units. Skip all
# the rest of the conversion math, too.
if self.is_unitless ... | 0.003102 |
def delimiter_groups(line, begin_delim=begin_delim,
end_delim=end_delim):
"""Split a line into alternating groups.
The first group cannot have a line feed inserted,
the next one can, etc.
"""
text = []
line = iter(line)
while True:
# First build and yield a... | 0.001034 |
def update_favorite_song(self, song_id, op):
"""
:param str op: `add` or `del`
"""
op = 'un' if op == 'del' else ''
action = 'mtop.alimusic.fav.songfavoriteservice.{}favoritesong'.format(op)
payload = {
'songId': song_id
}
code, msg, rv = self.... | 0.007538 |
def dump_dict_to_file(dictionary, filepath):
"""Dump @dictionary as a line to @filepath."""
create_dirs(
os.path.dirname(filepath)
)
with open(filepath, 'a') as outfile:
json.dump(dictionary, outfile)
outfile.write('\n') | 0.003831 |
def __set_transaction_detail(self, *args, **kwargs):
"""
Checks kwargs for 'customer_transaction_id' and sets it if present.
"""
customer_transaction_id = kwargs.get('customer_transaction_id', None)
if customer_transaction_id:
transaction_detail = self.client.factory... | 0.005629 |
def parse_bind(bind):
"""Parses a connection string and creates SQL trace metadata"""
if isinstance(bind, Connection):
engine = bind.engine
else:
engine = bind
m = re.match(r"Engine\((.*?)\)", str(engine))
if m is not None:
u = urlparse(m.group(1))
# Add Scheme to use... | 0.001122 |
def get(self, aspect):
"""Get a network, system or configure or contextualize with the same id as aspect passed."""
classification = [(network, self.networks), (system, self.systems),
(configure, self.configures)]
aspect_list = [l for t, l in classification if isinstan... | 0.005263 |
def apply(query, replacements=None, vars=None, allow_io=False,
libs=("stdcore", "stdmath")):
"""Run 'query' on 'vars' and return the result(s).
Arguments:
query: A query object or string with the query.
replacements: Built-time parameters to the query, either as dict or
as... | 0.000264 |
def wrap_results_for_axis(self):
""" return the results for the rows """
results = self.results
result = self.obj._constructor(data=results)
if not isinstance(results[0], ABCSeries):
try:
result.index = self.res_columns
except ValueError:
... | 0.004367 |
def LSL(value, amount, width):
"""
The ARM LSL (logical left shift) operation.
:param value: Value to shift
:type value: int or long or BitVec
:param int amount: How many bits to shift it.
:param int width: Width of the value
:return: Resultant value
:rtype int or BitVec
"""
if ... | 0.002404 |
def handle_abort(self, obj):
"""Handle an incoming ``Data`` abort processing request.
.. IMPORTANT::
This only makes manager's state consistent and doesn't
affect Data object in any way. Any changes to the Data
must be applied over ``handle_update`` method.
... | 0.003933 |
def list(self, order=values.unset, from_=values.unset, bounds=values.unset,
limit=None, page_size=None):
"""
Lists SyncListItemInstance records from the API as a list.
Unlike stream(), this operation is eager and will load `limit` records into
memory before returning.
... | 0.008333 |
def update_from_pypi(self):
"""Call get_latest_version and then save the object."""
package = pypi.Package(self.package_name)
self.licence = package.licence()
if self.is_parseable:
self.latest_version = package.latest_version()
self.next_version = package.next_ver... | 0.004342 |
def add_output_path(path: str = None) -> str:
"""
Adds the specified path to the output logging paths if it is not
already in the listed paths.
:param path:
The path to add to the logging output paths. If the path is empty
or no path is given, the current working directory will be used
... | 0.002053 |
def no_auth(self):
"""Unset authentication temporarily as a context manager."""
old_basic_auth, self.auth = self.auth, None
old_token_auth = self.headers.pop('Authorization', None)
yield
self.auth = old_basic_auth
if old_token_auth:
self.headers['Authorizati... | 0.005865 |
def returnAllChips(self,extname=None,exclude=None):
""" Returns a list containing all the chips which match the
extname given minus those specified for exclusion (if any).
"""
extensions = self._findExtnames(extname=extname,exclude=exclude)
chiplist = []
for i in rang... | 0.013836 |
def _add_iam_policy_binding(service_account, roles):
"""Add new IAM roles for the service account."""
project_id = service_account["projectId"]
email = service_account["email"]
member_id = "serviceAccount:" + email
policy = crm.projects().getIamPolicy(resource=project_id).execute()
already_con... | 0.000854 |
def unpack_from(self, buff, offset=0):
"""Unpack the next bytes from a file object."""
return self._create(super(DictStruct, self).unpack_from(buff, offset)) | 0.011561 |
def welch_anova(dv=None, between=None, data=None, export_filename=None):
"""One-way Welch ANOVA.
Parameters
----------
dv : string
Name of column containing the dependant variable.
between : string
Name of column containing the between factor.
data : pandas DataFrame
Dat... | 0.000194 |
def grid(self, z_x_y):
""" Return the UTFGrid content """
# sources.py -> MapnikRenderer -> grid
(z, x, y) = z_x_y
content = self.reader.grid(z, x, y, self.grid_fields, self.grid_layer)
return content | 0.008333 |
def set_theme(theme=None, for_code=None):
""" set md and code theme """
try:
if theme == 'default':
return
theme = theme or os.environ.get('AXC_THEME', 'random')
# all the themes from here:
themes = read_themes()
if theme == 'random':
rand = randin... | 0.001775 |
def replace_uri(self, src, dest):
"""Replace a uri reference everywhere it appears in the graph with
another one. It could appear as the subject, predicate, or object of
a statement, so for each position loop through each statement that
uses the reference in that position, remove the old... | 0.001033 |
def get_elastix_exes():
""" Get the executables for elastix and transformix. Raises an error
if they cannot be found.
"""
if EXES:
if EXES[0]:
return EXES
else:
raise RuntimeError('No Elastix executable.')
# Find exe
elastix, ver = _find_executables('... | 0.0033 |
def histogram_equalization(
data,
mask_to_equalize,
number_of_bins=1000,
std_mult_cutoff=4.0,
do_zerotoone_normalization=True,
valid_data_mask=None,
# these are theoretically hooked up, but not useful with only one
# equalization
clip_limit=None,
... | 0.000865 |
def apply_to(self, x, columns=False):
"""Apply this rotation to the given object
The argument can be several sorts of objects:
* ``np.array`` with shape (3, )
* ``np.array`` with shape (N, 3)
* ``np.array`` with shape (3, N), use ``columns=True``
* ``Tran... | 0.00324 |
def from_csv(cls, name=None, col_names=None, sep=None, **kwargs):
"""Create instrument metadata object from csv.
Parameters
----------
name : string
absolute filename for csv file or name of file
stored in pandas instruments location
col_names : list-like... | 0.006378 |
def deserialize(self, obj=None, ignore_non_existing=False):
"""
:type obj dict|None
:type ignore_non_existing bool
"""
if not isinstance(obj, dict):
if ignore_non_existing:
return
raise TypeError("Wrong data '{}' passed for '{}' deserialization".format(obj, self.__class__.__name... | 0.012993 |
def params(self, hidden=True):
"""
Gets all instance parameters, and their *cast* values.
:return: dict of the form: ``{<name>: <value>, ... }``
:rtype: :class:`dict`
"""
param_names = self.class_param_names(hidden=hidden)
return dict(
(name, getattr(... | 0.005291 |
def coupl_model5(self):
""" Toggle switch.
"""
self.Coupl = -0.2*self.Adj
self.Coupl[2,0] *= -1
self.Coupl[3,0] *= -1
self.Coupl[4,1] *= -1
self.Coupl[5,1] *= -1 | 0.02765 |
def force_seek(fd, offset, chunk=CHUNK):
""" Force adjustment of read cursort to specified offset
This function takes a file descriptor ``fd`` and tries to seek to position
specified by ``offset`` argument. If the descriptor does not support the
``seek()`` method, it will fall back to ``emulate_seek()`... | 0.001642 |
def get_quoted_columns(self, platform):
"""
Returns the quoted representation of the column names
the constraint is associated with.
But only if they were defined with one or a column name
is a keyword reserved by the platform.
Otherwise the plain unquoted value as inser... | 0.003241 |
def _item_check(self, dim_vals, data):
"""
Applies optional checks to individual data elements before
they are inserted ensuring that they are of a certain
type. Subclassed may implement further element restrictions.
"""
if not self._check_items:
return
... | 0.0056 |
def get(self, key, no_cache=False):
"""Return the value of a single preference using a dotted path key
:arg no_cache: if true, the cache is bypassed
"""
section, name = self.parse_lookup(key)
preference = self.registry.get(
section=section, name=name, fallback=False)
... | 0.00289 |
def notify(self, data):
"""Notify subscribers that data was received"""
triggered_channels = []
for channel_name, items in data.items():
for item in items or []:
LOG.debug('notify received: %s', item)
try:
# some channels return str... | 0.006834 |
def get_slope(self):
"""Return the slope m of this line segment."""
# y1 = m*x1 + t
# y2 = m*x2 + t => y1-y2 = m*(x1-x2) <=> m = (y1-y2)/(x1-x2)
return ((self.p1.y-self.p2.y) / (self.p1.x-self.p2.x)) | 0.008658 |
def sigmoid_cross_entropy_one_hot(logits, labels, weights_fn=None):
"""Calculate sigmoid cross entropy for one-hot lanels and logits.
Args:
logits: Tensor of size [batch-size, o=1, p=1, num-classes]
labels: Tensor of size [batch-size, o=1, p=1, num-classes]
weights_fn: Function that takes in labels and... | 0.004464 |
def doc(model):
""" Get documentation object for an SqlAlchemy model
:param model: Model
:type model: sqlalchemy.ext.declarative.DeclarativeBase
:rtype: SaModelDoc
"""
ins = inspect(model)
return SaModelDoc(
name=model.__name__,
table=[t.name for t in ins.tables],
d... | 0.001873 |
def from_buffer(string, serverEndpoint=ServerEndpoint):
'''
Parse from buffered content
:param string: buffered content
:param serverEndpoint: Tika server URL (Optional)
:return: parsed content
'''
status, response = callServer('put', serverEndpoint, '/unpack/all', string,
... | 0.002141 |
def clear(cls, persistent=False):
""" If persistent is True, delete the temporary file
Parameters:
----------------------------------------------------------------
persistent: if True, custom configuration file is deleted
"""
if persistent:
try:
os.unlink(cls.getPath())
exce... | 0.009983 |
def bloch_vector_of(self, qubit: ops.Qid) -> np.ndarray:
"""Returns the bloch vector of a qubit in the state.
Calculates the bloch vector of the given qubit
in the state given by self.state_vector(), given that
self.state_vector() follows the standard Kronecker convention of
num... | 0.003488 |
def _case_insensitive_rpartition(input_string: str, separator: str) -> typing.Tuple[str, str, str]:
"""Same as str.rpartition(), except that the partitioning is done case insensitive."""
lowered_input_string = input_string.lower()
lowered_separator = separator.lower()
try:
sp... | 0.007865 |
def launch_new_checks(self):
"""Launch checks that are in status
REF: doc/alignak-action-queues.png (4)
:return: None
"""
# queue
for chk in self.checks:
if chk.status not in [ACT_STATUS_QUEUED]:
continue
logger.debug("Launch check... | 0.004415 |
def _expand_data(self, old_data, new_data, group):
""" data expansion - uvision needs filename and path separately. """
for file in old_data:
if file:
extension = file.split(".")[-1].lower()
if extension in self.file_types.keys():
new_data[... | 0.005175 |
def p_UnionMemberType_anyType(p):
"""UnionMemberType : any "[" "]" TypeSuffix"""
p[0] = helper.unwrapTypeSuffix(model.Array(t=model.SimpleType(
type=model.SimpleType.ANY)), p[4]) | 0.016129 |
def pauli_group(number_of_qubits, case='weight'):
"""Return the Pauli group with 4^n elements.
The phases have been removed.
case 'weight' is ordered by Pauli weights and
case 'tensor' is ordered by I,X,Y,Z counting lowest qubit fastest.
Args:
number_of_qubits (int): number of qubits
... | 0.001018 |
def get_global_sources(self):
"""
Gets streams that live outside of the plates
:return: Global streams
"""
sources = []
if self.sources:
for source in self.sources:
if None in source.streams:
sources.append(source.streams[N... | 0.005747 |
def __gen_hierarchy_file(self, layer):
"""
Hierarchical structures (<structList> elements) are used to create
hierarchically nested annotation graphs (e.g. to express consists-of
relationships or dominance-edges in syntax trees, RST).
A <struct> element will be created for each h... | 0.001258 |
def build(self, obj=None, queryset=None, push=True):
"""Trigger building of the indexes.
Support passing ``obj`` parameter to the indexes, so we can
trigger build only for one object.
"""
for index in self.indexes:
index.build(obj, queryset, push) | 0.006667 |
def calc_x_from_L(L, y):
""" Calculate the industry output x from L and a y vector
Parameters
----------
L : pandas.DataFrame or numpy.array
Symmetric input output Leontief table
y : pandas.DataFrame or numpy.array
a column vector of the total final demand
Returns
-------
... | 0.00159 |
def create_table(
self, table_name, obj=None, schema=None, database=None, max_rows=None
):
"""
Create a new table in MapD using an Ibis table expression.
Parameters
----------
table_name : string
obj : TableExpr or pandas.DataFrame, optional
If pass... | 0.001706 |
def Jpjmcoeff(ls, m, shift=False) -> sympy.Expr:
r'''Eigenvalue of the $\Op{J}_{+}$ (:class:`Jplus`) operator
.. math::
\Op{J}_{+} \ket{s, m} = \sqrt{s (s+1) - m (m+1)} \ket{s, m}
where the multiplicity $s$ is implied by the size of the Hilbert space
`ls`: there are $2s+1$ eigenstates with $m... | 0.000784 |
def find_harpoon_options(self, configuration, args_dict):
"""Return us all the harpoon options"""
d = lambda r: {} if r in (None, "", NotSpecified) else r
return MergedOptions.using(
dict(d(configuration.get('harpoon')).items())
, dict(d(args_dict.get("harpoon")).items(... | 0.014451 |
def _pruaf(self):
"""
Return percentage runoff urban adjustment factor.
Methodology source: eqn. 6, Kjeldsen 2010
"""
return 1 + 0.47 * self.catchment.descriptors.urbext(self.year) \
* self.catchment.descriptors.bfihost / (1 - self.catchment.descriptors.bfihos... | 0.012422 |
def _filter_schemas(schemas, schema_tables, exclude_table_columns):
"""Wrapper method for _filter_schema to filter multiple schemas."""
return [_filter_schema(s, schema_tables, exclude_table_columns)
for s in schemas] | 0.004219 |
def _get_data_attr(data, attr):
"""Get data object field."""
if isinstance(data, dict):
# `Data` object's id is hydrated as `__id` in expression engine
data = data['__id']
data_obj = Data.objects.get(id=data)
return getattr(data_obj, attr) | 0.003663 |
def get_nested_blocks_spec(self):
"""
Converts allowed_nested_blocks items to NestedXBlockSpec to provide common interface
"""
return [
block_spec if isinstance(block_spec, NestedXBlockSpec) else NestedXBlockSpec(block_spec)
for block_spec in self.allowed_nested_b... | 0.01194 |
def CompressedHistograms(self, run, tag):
"""Retrieve the compressed histogram events associated with a run and tag.
Args:
run: A string name of the run for which values are retrieved.
tag: A string name of the tag for which values are retrieved.
Raises:
KeyError: If the run is not found... | 0.001802 |
def from_string(cls, rawstr):
"""
Creates an ApcorData record from the raw string format.
Expected string format:
ap_in ap_out ap_cor apcor_err
"""
try:
args = map(float, rawstr.split())
except Exception as ex:
import sys
lo... | 0.006928 |
def DeleteJob(self, job_id, token=None):
"""Deletes cron job with the given URN."""
job_urn = self.CRON_JOBS_PATH.Add(job_id)
aff4.FACTORY.Delete(job_urn, token=token) | 0.005587 |
def _append(self, sh):
'''
Internal. Chains a command after this.
:param sh: Next command.
'''
sh._input = self
self._output = sh
if self._env:
sh._env = dict(self._env)
if self._cwd:
sh._cwd = self._cwd | 0.006873 |
def threshold_monitor_hidden_threshold_monitor_sfp_apply(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
threshold_monitor_hidden = ET.SubElement(config, "threshold-monitor-hidden", xmlns="urn:brocade.com:mgmt:brocade-threshold-monitor")
threshold_monito... | 0.006515 |
def onesided_cl_to_dlnl(cl):
"""Compute the delta-loglikehood values that corresponds to an
upper limit of the given confidence level.
Parameters
----------
cl : float
Confidence level.
Returns
-------
dlnl : float
Delta-loglikelihood value with respect to the maximum o... | 0.002183 |
def get(self, now):
"""
Get a bucket key to compact. If none are available, returns
None. This uses a Lua script to ensure that the bucket key is
popped off the sorted set in an atomic fashion.
:param now: The current time, as a float. Used to ensure the
b... | 0.002928 |
def _parse_memory_embedded_health(self, data):
"""Parse the get_host_health_data() for essential properties
:param data: the output returned by get_host_health_data()
:returns: memory size in MB.
:raises IloError, if unable to get the memory details.
"""
memory_mb = 0
... | 0.001957 |
def setup_logging(
config='logging.yaml',
default_level=logging.INFO,
env_key='LOG_CFG'
):
"""Setup logging configuration
"""
path = config
value = os.getenv(env_key, None)
if value:
path = value
if path.exists():
with open(path, 'rt') as f:
config = yaml... | 0.002066 |
def _set_lsp_frr_revertive(self, v, load=False):
"""
Setter method for lsp_frr_revertive, mapped from YANG variable /mpls_config/router/mpls/mpls_cmds_holder/lsp/lsp_frr/lsp_frr_revertive (container)
If this variable is read-only (config: false) in the
source YANG file, then _set_lsp_frr_revertive is co... | 0.005147 |
def _canFormAraPhrase( araVerb, otherVerb ):
''' Teeb kindlaks, kas etteantud 'ära' verb (araVerb) yhildub teise verbiga;
Arvestab järgimisi ühilduvusi:
ains 2. pööre: ära_neg.o + V_o
ains 3. pööre: ära_neg.gu + V_gu
mitm 1. pööre: ära_neg.me + V_me... | 0.010133 |
def validate_slashes(param, value, minimum=2, maximum=None, form=None):
"""Ensure that parameter has slashes and minimum parts."""
try:
value = value.split("/")
except ValueError:
value = None
if value:
if len(value) < minimum:
value = None
elif maximum and l... | 0.002729 |
def median2D(const, bin1, label1, bin2, label2, data_label,
returnData=False):
"""Return a 2D average of data_label over a season and label1, label2.
Parameters
----------
const: Constellation or Instrument
bin#: [min, max, number of bins]
label#: string
i... | 0.010793 |
def _harmonic_number(x):
"""Compute the harmonic number from its analytic continuation.
Derivation from [here](
https://en.wikipedia.org/wiki/Digamma_function#Relation_to_harmonic_numbers)
and [Euler's constant](
https://en.wikipedia.org/wiki/Euler%E2%80%93Mascheroni_constant).
Args:
x: input float.
... | 0.008016 |
def stats(self, input_filepath):
'''Display time domain statistical information about the audio
channels. Audio is passed unmodified through the SoX processing chain.
Statistics are calculated and displayed for each audio channel
Unlike other Transformer methods, this does not modify th... | 0.001473 |
def get_next_step(self):
"""Find the proper step when user clicks the Next button.
:returns: The step to be switched to
:rtype: WizardStep instance or None
"""
is_raster = is_raster_layer(self.parent.layer)
subcategory = self.parent.step_kw_subcategory.selected_subcatego... | 0.002169 |
def faulty():
'''
Display list of faulty resources
CLI Example:
.. code-block:: bash
salt '*' fmadm.faulty
'''
fmadm = _check_fmadm()
cmd = '{cmd} faulty'.format(
cmd=fmadm,
)
res = __salt__['cmd.run_all'](cmd)
result = {}
if res['stdout'] == '':
re... | 0.002421 |
def autocompleter():
"""Return autocompleter results"""
# set blocked engines
disabled_engines = request.preferences.engines.get_disabled()
# parse query
if PY3:
raw_text_query = RawTextQuery(request.form.get('q', b''), disabled_engines)
else:
raw_text_query = RawTextQuery(requ... | 0.002851 |
def export_as_file(self, filepath, hyperparameters):
"""Generates a Python file with the importable base learner set to ``hyperparameters``
This function generates a Python file in the specified file path that contains
the base learner as an importable variable stored in ``base_learner``. The... | 0.008097 |
def col_widths(self):
# type: () -> defaultdict
"""Get MAX possible width of each column in the table.
:return: defaultdict
"""
_widths = defaultdict(int)
all_rows = [self.headers]
all_rows.extend(self._rows)
for row in all_rows:
for idx, co... | 0.006224 |
def recipe_zheng17(adata, n_top_genes=1000, log=True, plot=False, copy=False):
"""Normalization and filtering as of [Zheng17]_.
Reproduces the preprocessing of [Zheng17]_ - the Cell Ranger R Kit of 10x
Genomics.
Expects non-logarithmized data. If using logarithmized data, pass `log=False`.
The re... | 0.004101 |
def value_compare(left, right, ordering=1):
"""
SORT VALUES, NULL IS THE LEAST VALUE
:param left: LHS
:param right: RHS
:param ordering: (-1, 0, 1) TO AFFECT SORT ORDER
:return: The return value is negative if x < y, zero if x == y and strictly positive if x > y.
"""
try:
ltype ... | 0.002255 |
def nanmean(values, axis=None, skipna=True, mask=None):
"""
Compute the mean of the element along an axis ignoring NaNs
Parameters
----------
values : ndarray
axis: int, optional
skipna : bool, default True
mask : ndarray[bool], optional
nan-mask if known
Returns
------... | 0.000661 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.