text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def _set_igmps_prefix_list(self, v, load=False):
"""
Setter method for igmps_prefix_list, mapped from YANG variable /igmp_snooping/ip/igmp/ssm_map/igmps_prefix_list (list)
If this variable is read-only (config: false) in the
source YANG file, then _set_igmps_prefix_list is considered as a private
me... | 0.004064 |
def validate(self):
"""
Asserts that every declared :term:`specification` can actually be
realized, meaning that all of its :term:`dependencies <dependency>` are
present and there are no self-dependencies or :term:`dependency cycles
<dependency cycle>`. If such a problem is found... | 0.000674 |
def run(self):
""" Runs the printer loop in a subprocess. This is called by
multiprocessing.
"""
try:
self._loop()
except Exception:
# Send the exception through the exc_queue, so the parent
# process can check it.
typ, val, tb ... | 0.004464 |
def iter_zeros(self):
"""Iterate through the indices of all zero items."""
num = quotient = 0
while num < self._len:
chunk = self.data[quotient]
if chunk & self.zero_mask:
remainder = 0
while remainder < self.width and num < self._len:
... | 0.00339 |
def selection(x_bounds,
x_types,
clusteringmodel_gmm_good,
clusteringmodel_gmm_bad,
minimize_starting_points,
minimize_constraints_fun=None):
'''
Select the lowest mu value
'''
results = lib_acquisition_function.next_hyperparameter_lo... | 0.008681 |
def __from_format(jd: float, fmt: str) -> (int, float):
"""
Converts a Julian Day format into the "standard" Julian
day format.
Parameters
----------
jd
fmt
Returns
-------
(jd, fractional): (int, float)
A tuple representing a Julian day. The first number is the
... | 0.00106 |
def getLogger(name):
"""This is used by gcdt plugins to get a logger with the right level."""
logger = logging.getLogger(name)
# note: the level might be adjusted via '-v' option
logger.setLevel(logging_config['loggers']['gcdt']['level'])
return logger | 0.003676 |
def isFloat(nstr, schema):
"""
!~~isFloat
"""
if isinstance(nstr, (float, int, long)):
return True
elif not isinstance(nstr, basestring):
return False
try:
float(nstr)
except ValueError:
return False
return True | 0.00361 |
def GetCpuReservationMHz(self):
'''Retrieves the minimum processing power in MHz reserved for the virtual
machine. For information about setting a CPU reservation, see "Limits and
Reservations" on page 14.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetCpuReservationM... | 0.013015 |
def request(self, shards, full_response, return_status_tuple=False):
"""Request the API
This method is wrapped by similar functions
"""
try:
resp = self._request(shards)
if return_status_tuple:
return (self._parser(resp, full_response), True)
... | 0.002907 |
def converter(val, current_unit, destination_unit):
"""Convert from one unit to another.
Parameters
----------
val : number
Number to convert.
current_unit : string
Current unit.
destination_unit : string
Destination unit.
Returns
-------
number
Conv... | 0.000922 |
def set_object_acl(self, obj):
""" Set object ACL on creation if not already present. """
if not obj._acl:
from nefertari_guards import engine as guards_engine
acl = self._factory(self.request).generate_item_acl(obj)
obj._acl = guards_engine.ACLField.stringify_acl(acl... | 0.006231 |
def get_requests(self, params={}):
"""
List requests
http://dev.wheniwork.com/#listing-requests
"""
if "status" in params:
params['status'] = ','.join(map(str, params['status']))
requests = []
users = {}
messages = {}
params['page'] =... | 0.001498 |
def metastable_sets(self):
"""
Crisp clustering using PCCA. This is only recommended for visualization purposes. You *cannot* compute any
actual quantity of the coarse-grained kinetics without employing the fuzzy memberships!
Returns
-------
A list of length equal to meta... | 0.008621 |
def build_post_policy(self, expiration_time, conditions):
"""
Taken from the AWS book Python examples and modified for use with boto
"""
assert type(expiration_time) == time.struct_time, \
'Policy document must include a valid expiration Time object'
# Convert condit... | 0.005825 |
def set(self, locs, values):
"""
Modify Block in-place with new item value
Returns
-------
None
"""
values = conversion.ensure_datetime64ns(values, copy=False)
self.values[locs] = values | 0.007937 |
def get_fld2val(self, name, vals):
"""Describe summary statistics for a list of numbers."""
if vals:
return self._init_fld2val_stats(name, vals)
return self._init_fld2val_null(name) | 0.009217 |
def do_graphviz(self, args, arguments):
"""
::
Usage:
graphviz FILENAME
Export the data in cvs format to a file. Former cvs command
Arguments:
FILENAME The filename
"""
filename = arguments['FILENAME']
... | 0.008247 |
def is_arabicword(word):
""" Checks for an valid Arabic word.
An Arabic word not contains spaces, digits and pounctuation
avoid some spelling error, TEH_MARBUTA must be at the end.
@param word: input word
@type word: unicode
@return: True if all charaters are in Arabic block
@rtype: Bool... | 0.006472 |
async def auto_add(self, device, recursive=None, automount=True):
"""
Automatically attempt to mount or unlock a device, but be quiet if the
device is not supported.
:param device: device object, block device path or mount path
:param bool recursive: recursively mount and unlock... | 0.001125 |
def success(request, message, extra_tags='', fail_silently=False):
"""Adds a message with the ``SUCCESS`` level."""
add_message(request, constants.SUCCESS, message, extra_tags=extra_tags,
fail_silently=fail_silently) | 0.004167 |
def plot_xtime(self, y, x='time', label='default', labelx=None,
labely=None ,title=None, shape='.', logx=False,
logy=True, base=10):
'''
make a simple plot of two columns against each other.
An example would be instance.plot_xtime('PB206', label='PB206 vs t... | 0.006912 |
def ner_net(source, destinations, width, height, wrap_around=False, radius=10):
"""Produce a shortest path tree for a given net using NER.
This is the kernel of the NER algorithm.
Parameters
----------
source : (x, y)
The coordinate of the source vertex.
destinations : iterable([(x, y)... | 0.000116 |
def load_patterns(filename):
"""Loads the patters contained in the filename and puts them into a list
of patterns, each pattern being a list of occurrence, and each
occurrence being a list of (onset, midi) pairs.
The input file must be formatted as described in MIREX 2013:
http://www.music-ir.org/m... | 0.000337 |
def dominator_tree_to_dot(self, filename):
"""
Export the dominator tree of the function to a dot file
Args:
filename (str)
"""
def description(node):
desc ='{}\n'.format(node)
desc += 'id: {}'.format(node.node_id)
if node.domin... | 0.007126 |
def find(self, filter=None, page=1, per_page=10, fields=None, context=None):
"""
Find records that match the filter.
Pro Tip: The fields could have nested fields names if the field is
a relationship type. For example if you were looking up an order
and also want to get the shipp... | 0.001432 |
def defaultSessionFactory(env={}, usePTY=False, *args, **kwargs):
"""Create a SSHChannel of the given :channelType: type
"""
return SSHSession(env, usePTY, *args, **kwargs) | 0.005435 |
def delete(self, config_file=None):
"""Deletes the credentials file specified in `config_file`. If no
file is specified, it deletes the default user credential file.
Args:
config_file (str): Path to configuration file. Defaults to delete
the user default location if ... | 0.002 |
def directory_create_temp(self, template_name, mode, path, secure):
"""Creates a temporary directory in the guest.
in template_name of type str
Template for the name of the directory to create. This must
contain at least one 'X' character. The first group of consecutive
... | 0.004026 |
def load(fp, **kwargs) -> BioCCollection:
"""
Deserialize fp (a .read()-supporting text file or binary file containing a JSON document) to
a BioCCollection object
Args:
fp: a file containing a JSON document
**kwargs:
Returns:
BioCCollection: a collection
"""
... | 0.005155 |
def get_instructor_term_list_name(instructor_netid, year, quarter):
"""
Return the list address of UW instructor email list for
the given year and quarter
"""
return "{uwnetid}_{quarter}{year}".format(
uwnetid=instructor_netid,
quarter=quarter.lower()[:2],
year=str(year)[-2:]... | 0.003115 |
def rename_db_ref(stmts_in, ns_from, ns_to, **kwargs):
"""Rename an entry in the db_refs of each Agent.
This is particularly useful when old Statements in pickle files
need to be updated after a namespace was changed such as
'BE' to 'FPLX'.
Parameters
----------
stmts_in : list[indra.state... | 0.000797 |
def dict_gather(comm, d, op='mean', assert_all_have_data=True):
"""
Perform a reduction operation over dicts
"""
if comm is None: return d
alldicts = comm.allgather(d)
size = comm.size
k2li = defaultdict(list)
for d in alldicts:
for (k,v) in d.items():
k2li[k].append(... | 0.011494 |
def open_external_console(self, fname, wdir, args, interact, debug, python,
python_args, systerm, post_mortem=False):
"""Open external console"""
if systerm:
# Running script in an external system terminal
try:
if CONF.get('main... | 0.00308 |
def totalNumberOfTiles(self, minZoom=None, maxZoom=None):
"Return the total number of tiles for this instance extent"
nbTiles = 0
minZoom = minZoom or 0
if maxZoom:
maxZoom = maxZoom + 1
else:
maxZoom = len(self.RESOLUTIONS)
for zoom in xrange(minZ... | 0.004866 |
def setPrefix(self, p, u=None):
"""
Set the element namespace prefix.
@param p: A new prefix for the element.
@type p: basestring
@param u: A namespace URI to be mapped to the prefix.
@type u: basestring
@return: self
@rtype: L{Element}
"""
... | 0.004619 |
def format_table(table,
align='<',
format='{:.3g}',
colwidth=None,
maxwidth=None,
spacing=2,
truncate=0,
suffix="..."
):
"""
Formats a table represented as an iterable of iterab... | 0.006191 |
def allow_analyst_reassignment(self):
"""Allow the Analyst reassignment
"""
reassing_analyst_transition = {
"id": "reassign",
"title": _("Reassign")}
for rs in self.review_states:
if rs["id"] not in ["default", "mine", "open", "all"]:
c... | 0.004098 |
def get_pluggable_module_information(self, id_or_uri):
"""
Gets all the pluggable module information.
Args:
id_or_uri: Can be either the interconnect id or uri.
Returns:
array: dicts of the pluggable module information.
"""
uri = self._client.bui... | 0.004926 |
def logout(config):
"""Remove and forget your Bugzilla credentials"""
state = read(config.configfile)
if state.get("BUGZILLA"):
remove(config.configfile, "BUGZILLA")
success_out("Forgotten")
else:
error_out("No stored Bugzilla credentials") | 0.003571 |
def write_mRNA_children(self, db, mRNA_id):
"""
Write out the children records of the mRNA given by the ID
(not including the mRNA record itself) in a canonical
order, where exons are sorted by start position and given
first.
"""
mRNA_children = db.children(mRNA_i... | 0.002972 |
def getResourceFile(self, pid, filename, destination=None):
""" Get a file within a resource.
:param pid: The HydroShare ID of the resource
:param filename: String representing the name of the resource file to get.
:param destination: String representing the directory to save the resour... | 0.005064 |
def untrace_function(module, function):
"""
Untraces given module function.
:param module: Module of the function.
:type module: object
:param function: Function to untrace.
:type function: object
:return: Definition success.
:rtype: bool
"""
if not is_traced(function):
... | 0.002309 |
def select(self, selection_specs=None, **selection):
"""Applies selection by dimension name
Applies a selection along the dimensions of the object using
keyword arguments. The selection may be narrowed to certain
objects using selection_specs. For container objects the
selection... | 0.002521 |
def remove_blocked_work_units(self, work_spec_name, work_unit_names):
'''Remove some work units in the blocked list.
If `work_unit_names` is :const:`None` (which must be passed
explicitly), all pending work units in `work_spec_name` are
removed; otherwise only the specific named work un... | 0.002167 |
def set_scenario_role_names(self):
"""Populates the list of scenario role names in this deployment and
populates the scenario_master with the master role
Gets a list of deployment properties containing "isMaster" because
there is exactly one per scenario host, containing the role name
... | 0.00197 |
def checkIfIsTooSimple(proc):
"""check if process is just unconditional assignments
and it is useless to merge them"""
try:
a, = proc.statements
if isinstance(a, Assignment):
return True
except ValueError:
pass
return False | 0.003546 |
def get_upcoming_event_lists_for_the_remainder_of_the_month(self, year = None, month = None):
'''Return the set of events as triple of (today's events, events for the remainder of the week, events for the remainder of the month).'''
events = []
if year == None and month == None:
now... | 0.019893 |
async def clear(self, namespace=None, _conn=None):
"""
Clears the cache in the cache namespace. If an alternative namespace is given, it will
clear those ones instead.
:param namespace: str alternative namespace to use
:param timeout: int or float in seconds specifying maximum t... | 0.007396 |
def runHotgym(numRecords):
"""Run the Hot Gym example."""
# Create a data source for the network.
dataSource = FileRecordStream(streamID=_INPUT_FILE_PATH)
numRecords = min(numRecords, dataSource.getDataRowCount())
network = createNetwork(dataSource)
# Set predicted field
network.regions["sensor"].setPar... | 0.013708 |
def write_report(summary_dict, seqid, genus, key):
"""
Parse the PointFinder outputs, and write the summary report for the current analysis type
:param summary_dict: nested dictionary containing data such as header strings, and paths to reports
:param seqid: name of the strain,
:... | 0.004074 |
def _galaxy_library_upload(finfo, sample_info, config):
"""Upload results to galaxy library.
"""
folder_name = "%s_%s" % (config["fc_date"], config["fc_name"])
storage_dir = utils.safe_makedir(os.path.join(config["dir"], folder_name))
if finfo.get("type") == "directory":
storage_file = None
... | 0.004823 |
def decode(self, envelope, session, **kwargs):
""" :meth:`.WMessengerOnionCoderLayerProto.decode` method implementation.
:param envelope: original envelope
:param session: original session
:param kwargs: additional arguments
:return: WMessengerBytesEnvelope
"""
return WMessengerBytesEnvelope(bytes(WUnHe... | 0.027933 |
def to_native(self, obj):
"""Remove password field when serializing an object"""
ret = super(UserSerializer, self).to_native(obj)
del ret['password']
return ret | 0.010417 |
def AddProperty(self, interface, name, value):
'''Add property to this object
interface: D-Bus interface to add this to. For convenience you can
specify '' here to add the property to the object's main
interface (as specified on construction).
name: Propert... | 0.002727 |
def action(self, *args, **kwargs):
"""the default action for Support Classifiers invokes any derivied
_action function, trapping any exceptions raised in the process. We
are obligated to catch these exceptions to give subsequent rules the
opportunity to act and perhaps mitigate the erro... | 0.002049 |
def community_topic_create(self, data, **kwargs):
"https://developer.zendesk.com/rest_api/docs/help_center/topics#create-topic"
api_path = "/api/v2/community/topics.json"
return self.call(api_path, method="POST", data=data, **kwargs) | 0.011673 |
def namespace_to_regex(namespace):
"""Create a RegexObject from a wildcard namespace."""
db_name, coll_name = namespace.split(".", 1)
# A database name cannot contain a '.' character
db_regex = re.escape(db_name).replace(r"\*", "([^.]*)")
# But a collection name can.
coll_regex = re.escape(coll_... | 0.002398 |
def _t_normals(self):
r"""
Update the throat normals from the voronoi vertices
"""
verts = self['throat.vertices']
value = sp.zeros([len(verts), 3])
for i in range(len(verts)):
if len(sp.unique(verts[i][:, 0])) == 1:
verts_2d = sp.vstack((verts... | 0.002283 |
def money(s, thousand_sep=".", decimal_sep=","):
"""Converts money amount in string to a Decimal object.
With the default arguments, the format is expected to be
``-38.500,00``, where dots separate thousands and comma the decimals.
Args:
thousand_sep: Separator for thousand... | 0.003472 |
def complete_sum(self):
"""
Return an equivalent DNF expression that includes all prime
implicants.
"""
node = self.node.complete_sum()
if node is self.node:
return self
else:
return _expr(node) | 0.007299 |
def findLibrary(name):
"""
Look for a library in the system.
Emulate the algorithm used by dlopen.
`name`must include the prefix, e.g. ``libpython2.4.so``
"""
assert is_unix, "Current implementation for Unix only (Linux, Solaris, AIX)"
lib = None
# Look in the LD_LIBRARY_PATH
lp =... | 0.001619 |
def is_unary_operator(oper):
"""returns True, if operator is unary operator, otherwise False"""
# definition:
# member in class
# ret-type operator symbol()
# ret-type operator [++ --](int)
# globally
# ret-type operator symbol( arg )
# ret-type operator [++ --](X&, int)
symbols = ['... | 0.000887 |
def v_full_copy(self, val):
""" Sets full copy mode of trajectory and (!) ALL explored parameters!"""
self._full_copy = bool(val)
for param in self._explored_parameters.values():
if param is not None:
param.v_full_copy = bool(val) | 0.010638 |
def update_extension_statistics(self, extension_statistics_update, publisher_name, extension_name):
"""UpdateExtensionStatistics.
[Preview API]
:param :class:`<ExtensionStatisticUpdate> <azure.devops.v5_0.gallery.models.ExtensionStatisticUpdate>` extension_statistics_update:
:param str p... | 0.006809 |
def _tar_and_copy(src_dir, target_dir):
"""Tar and gzip src_dir and copy to GCS target_dir."""
src_dir = src_dir.rstrip("/")
target_dir = target_dir.rstrip("/")
tmp_dir = tempfile.gettempdir().rstrip("/")
src_base = os.path.basename(src_dir)
shell_run(
"tar --exclude=.git -zcf {tmp_dir}/{src_base}.tar... | 0.014641 |
def Uniform(low, high, tag=None):
"""
A Uniform random variate
Parameters
----------
low : scalar
Lower bound of the distribution support.
high : scalar
Upper bound of the distribution support.
"""
assert low < high, 'Uniform "low" must be less than "high"'
retur... | 0.005376 |
def _progress_ret(self, progress, out):
'''
Print progress events
'''
import salt.output
# Get the progress bar
if not hasattr(self, 'progress_bar'):
try:
self.progress_bar = salt.output.get_progress(self.config, out, progress)
exce... | 0.009917 |
def user(self, extra_params=None):
"""
The User currently assigned to the Ticket
"""
if self.get('assigned_to_id', None):
users = self.space.users(
id=self['assigned_to_id'],
extra_params=extra_params
)
if users:
... | 0.005814 |
def delete(self, id, project_id=None):
"""delete."""
result = db.session.query(Result).filter_by(id=id).first()
if result is None:
response = jsonify({
'result': None, 'message': 'No interface defined for URL.'
})
return response, 404
... | 0.004684 |
def load_ini(filename):
"""
Read a CLASS ``.ini`` file, returning a dictionary of parameters
Parameters
----------
filename : str
the name of an existing parameter file to load, or one included as
part of the CLASS source
Returns
-------
dict :
the input paramet... | 0.005556 |
def loader(schema, validator=CerberusValidator, update=None):
"""Create a load function based on schema dict and Validator class.
:param schema: a Cerberus schema dict.
:param validator: the validator class which must be a subclass of
more.cerberus.CerberusValidator which is the default.
:param... | 0.00096 |
def partial_transform(self, traj):
"""Featurize an MD trajectory into a vector space via distance
after superposition
Parameters
----------
traj : mdtraj.Trajectory
A molecular dynamics trajectory to featurize.
Returns
-------
features : np.n... | 0.002028 |
def get_hidden_signups(self):
""" Return a list of Users who are *not* in the All Students list but have signed up for an activity.
This is usually a list of signups for z-Withdrawn from TJ """
return EighthSignup.objects.filter(scheduled_activity__block=self).exclude(user__in=User.objects.g... | 0.011976 |
def calculateSignature(privateSigningKey, message):
"""
:type privateSigningKey: ECPrivateKey
:type message: bytearray
"""
if privateSigningKey.getType() == Curve.DJB_TYPE:
rand = os.urandom(64)
res = _curve.calculateSignature(rand, privateSigningKey.getP... | 0.008584 |
def convert_mc_times_to_jte_times(times_mc, evt_timestamp_in_ns, evt_mc_time):
"""
Function that converts MC times to JTE times.
Parameters
----------
times_mc : np.ndarray
Time array with MC times.
evt_timestamp_in_ns : int
Total timestamp of the event in nanoseconds.
evt_m... | 0.00142 |
def to_json(self):
"""
Returns the JSON Representation of the content type field validation.
"""
result = {}
for k, v in self._data.items():
result[camel_case(k)] = v
return result | 0.008299 |
def rebuild_token_map(self, partitioner, token_map):
"""
Rebuild our view of the topology from fresh rows from the
system topology tables.
For internal use only.
"""
self.partitioner = partitioner
if partitioner.endswith('RandomPartitioner'):
token_cla... | 0.001932 |
def p_statement_draw3(p):
""" statement : DRAW expr COMMA expr COMMA expr
"""
p[0] = make_sentence('DRAW3',
make_typecast(TYPE.integer, p[2], p.lineno(3)),
make_typecast(TYPE.integer, p[4], p.lineno(5)),
make_typecast(TYPE.float_, p[... | 0.002967 |
def currentPlugin( self ):
"""
Returns the currently selected plugin.
:return <XWizardPlugin> || None
"""
col = self.uiWizardTABLE.currentColumn()
row = self.uiWizardTABLE.currentRow()
item = self.uiWizardTABLE.currentItem()
widget ... | 0.024 |
def handle_control_frame(self, frame):
"""
Handle a control frame as defined by RFC 6455.
"""
if frame.opcode == OPCODE_CLOSE:
self.close_frame_received = True
code, reason = frame.unpack_close()
if self.close_frame_sent:
self.onclose(... | 0.001712 |
def validate_accept(form, field):
"""Validate that accept have not been set."""
if field.data and form.reject.data:
raise validators.ValidationError(
_("Both reject and accept cannot be set at the same time.")
) | 0.007491 |
def make_query(catalog):
"""A function to prepare a query
"""
query = {}
request = api.get_request()
index = get_search_index_for(catalog)
limit = request.form.get("limit")
q = request.form.get("q")
if len(q) > 0:
query[index] = q + "*"
else:
return None
portal_... | 0.001664 |
def hstack(gctoos, remove_all_metadata_fields=False, error_report_file=None, fields_to_remove=[], reset_ids=False):
""" Horizontally concatenate gctoos.
Args:
gctoos (list of gctoo objects)
remove_all_metadata_fields (bool): ignore/strip all common metadata when combining gctoos
error_... | 0.004792 |
def html_page_context(app, pagename, templatename, context, doctree):
"""Event handler for the html-page-context signal.
Modifies the context directly.
- Replaces the 'toc' value created by the HTML builder with one
that shows all document titles and the local table of contents.
- Sets display_... | 0.000852 |
def _find_by_sha1(self, sha1):
"""
Return an |ImagePart| object belonging to this package or |None| if
no matching image part is found. The image part is identified by the
SHA1 hash digest of the image binary it contains.
"""
for image_part in self:
# ---skip ... | 0.003766 |
def getQCAnalyses(self):
"""
Return the Quality Control analyses.
:returns: a list of QC analyses
:rtype: List of ReferenceAnalysis/DuplicateAnalysis
"""
qc_types = ['ReferenceAnalysis', 'DuplicateAnalysis']
analyses = self.getAnalyses()
return [a for a in... | 0.005571 |
def value(self, t):
"""See Schedule.value"""
for (l_t, l), (r_t, r) in zip(self._endpoints[:-1], self._endpoints[1:]):
if l_t <= t and t < r_t:
alpha = float(t - l_t) / (r_t - l_t)
return self._interpolation(l, r, alpha)
# t does not belong to any of ... | 0.007109 |
def outputs(ctx):
"""Download outputs for job.
Uses [Caching](/references/polyaxon-cli/#caching)
Examples:
\b
```bash
$ polyaxon job -j 1 outputs
```
"""
user, project_name, _job = get_job_or_local(ctx.obj.get('project'), ctx.obj.get('job'))
try:
PolyaxonClient().job.d... | 0.006051 |
def gopro_set_request_send(self, target_system, target_component, cmd_id, value, force_mavlink1=False):
'''
Request to set a GOPRO_COMMAND with a desired
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
... | 0.006601 |
def _normalize_query(self, query):
"""
Converts Arrays in the query to comma
separaters lists for proper API handling.
"""
for k, v in query.items():
if isinstance(v, list):
query[k] = ','.join([str(e) for e in v]) | 0.007067 |
def fem(ab, off, angle, zsrc, zrec, lsrc, lrec, depth, freq, etaH, etaV, zetaH,
zetaV, xdirect, isfullspace, ht, htarg, use_ne_eval, msrc, mrec,
loop_freq, loop_off, conv=True):
r"""Return the electromagnetic frequency-domain response.
This function is called from one of the above modelling rou... | 0.00028 |
def _invalid_triple_quote(self, quote, row, col=None):
"""Add a message for an invalid triple quote.
Args:
quote: The quote characters that were found.
row: The row number the quote characters were found on.
col: The column the quote characters were found on.
... | 0.003788 |
def _expanded_sql(self):
"""Get the expanded BigQuery SQL string of this UDF
Returns
The expanded SQL string of this UDF
"""
if not self._sql:
self._sql = UDF._build_udf(self._name, self._code, self._return_type, self._params,
self._language, self._imports)
... | 0.008824 |
def get_body_from_file(kwds):
"""Reads message body if specified via filepath."""
if kwds["file"] and os.path.isfile(kwds["file"]):
kwds["body"] = open(kwds["file"], "r").read()
kwds["file"] = None | 0.004525 |
def call_function(self, c, i):
"""
Implement the CALL_FUNCTION_ operation.
.. _CALL_FUNCTION: https://docs.python.org/3/library/dis.html#opcode-CALL_FUNCTION
"""
callable_ = self.__stack[-1-i.arg]
args = tuple(self.__stack[len(self.__stack) - i.arg:])
... | 0.007439 |
def init_logging(settings):
'''Set up logger'''
lg_format = '%(asctime)s : - %(message)s'
lg_dateformat = '%Y.%m.%d %H:%M:%S'
logging.basicConfig(format=lg_format, datefmt=lg_dateformat)
log = get_logger()
handler = logging.handlers.WatchedFileHandler(
filename=sett... | 0.003295 |
def divide(x: LispNumber, y: LispNumber) -> LispNumber:
"""Division reducer. If both arguments are integers, return a Fraction.
Otherwise, return the true division of x and y."""
if isinstance(x, int) and isinstance(y, int):
return Fraction(x, y)
return x / y | 0.003534 |
def monkey_patch_override_instance_method(instance):
"""
Override an instance method with a new version of the same name. The
original method implementation is made available within the override method
as `_original_<METHOD_NAME>`.
"""
def perform_override(override_fn):
fn_name = overrid... | 0.001309 |
def notify_slack(title, content, attachment_color="#4bb543", short_threshold=40, token=None,
channel=None, mention_user=None, **kwargs):
"""
Sends a slack notification and returns *True* on success. The communication with the slack API
might have some delays and is therefore handled by a thread. The... | 0.003208 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.