text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def profile_v3_to_proofs(profile, fqdn, refresh=False, address = None):
"""
Convert profile format v3 to proofs
"""
proofs = []
try:
test = profile.items()
except:
return proofs
if 'account' in profile:
accounts = profile['account']
else:
return pro... | 0.006233 |
def show_metal(self):
"""Visualize metal coordination."""
metal_complexes = self.plcomplex.metal_complexes
if not len(metal_complexes) == 0:
self.select_by_ids('Metal-M', self.metal_ids)
for metal_complex in metal_complexes:
cmd.select('tmp_m', 'id %i' % m... | 0.003418 |
def delete(self, key_name):
"""Delete the key and return true if the key was deleted, else false
"""
self.db.remove(Query().name == key_name)
return self.get(key_name) == {} | 0.009756 |
def _handle_actions(self, state, current_run, func, sp_addr, accessed_registers):
"""
For a given state and current location of of execution, will update a function by adding the offets of
appropriate actions to the stack variable or argument registers for the fnc.
:param SimState state... | 0.005457 |
def main(args):
'''
register_retinotopy.main(args) can be given a list of arguments, such as sys.argv[1:]; these
arguments may include any options and must include at least one subject id. All subjects whose
ids are given are registered to a retinotopy model, and the resulting registration, as well as
... | 0.006494 |
def numparser(strict=False):
"""Return a function that will attempt to parse the value as a number,
trying :func:`int`, :func:`long`, :func:`float` and :func:`complex` in
that order. If all fail, return the value as-is, unless ``strict=True``,
in which case raise the underlying exception.
"""
... | 0.001272 |
def say(
text = None,
preference_program = "festival",
background = False,
silent = True,
filepath = None
):
"""
Say specified text to speakers or to file, as specified. Determine the
program to use based on the specified program preference... | 0.016013 |
def addPluginPath(cls, pluginpath):
"""
Adds the plugin path for this class to the given path. The inputted
pluginpath value can either be a list of strings, or a string
containing paths separated by the OS specific path separator (':' on
Mac & Linux, ';' on Windows)
... | 0.002953 |
def get_cts_property(self, prop, lang=None):
""" Set given property in CTS Namespace
.. example::
collection.get_cts_property("groupname", "eng")
:param prop: Property to get (Without namespace)
:param lang: Language to get for given value
:return: Value or default ... | 0.004566 |
def setup_extended_logging(opts):
'''
Setup any additional logging handlers, internal or external
'''
if is_extended_logging_configured() is True:
# Don't re-configure external loggers
return
# Explicit late import of salt's loader
import salt.loader
# Let's keep a referenc... | 0.00032 |
def _evaluatelinearForces(Pot,x,t=0.):
"""Raw, undecorated function for internal use"""
if isinstance(Pot,list):
sum= 0.
for pot in Pot:
sum+= pot._force_nodecorator(x,t=t)
return sum
elif isinstance(Pot,linearPotential):
return Pot._force_nodecorator(x,t=t)
e... | 0.025751 |
def register_token(
self,
registry_address_hex: typing.AddressHex,
token_address_hex: typing.AddressHex,
retry_timeout: typing.NetworkTimeout = DEFAULT_RETRY_TIMEOUT,
) -> TokenNetwork:
""" Register a token with the raiden token manager.
Args:
... | 0.001975 |
def _classify_load_constant(self, regs_init, regs_fini, mem_fini, written_regs, read_regs):
"""Classify load-constant gadgets.
"""
matches = []
# Check for "dst_reg <- constant" pattern.
for dst_reg, dst_val in regs_fini.items():
# Make sure the *dst* register was wr... | 0.00612 |
def infer_dims(self, x, y, dims_x, dims_y, dims_out):
"""Infer probable output from input x, y
"""
OptimizedInverseModel.infer_x(self, y)
assert len(x) == len(dims_x)
assert len(y) == len(dims_y)
if len(self.fmodel.dataset) == 0:
return [[0.0]*self.dim_out]
... | 0.010848 |
def add(self, urls):
"""
Add the provided urls to this purge request
The urls argument can be a single string, a list of strings, a queryset
or model instance. Models must implement `get_absolute_url()`.
"""
if isinstance(urls, (list, tuple)):
self.urls.exte... | 0.002797 |
def git_tag_to_semver(git_tag: str) -> SemVer:
"""
:git_tag: A string representation of a Git tag.
Searches a Git tag's string representation for a SemVer, and returns that
as a SemVer object.
"""
pattern = re.compile(r'[0-9]+\.[0-9]+\.[0-9]+$')
match = pattern.search(git_tag)
if match:... | 0.00211 |
def _recursive_cleanup(foo):
"""
Aggressively cleans up things that look empty.
"""
if isinstance(foo, dict):
for (key, val) in list(foo.items()):
if isinstance(val, dict):
_recursive_cleanup(val)
if val == "" or val == [] or val == {}:
del... | 0.00304 |
def processed_shape(self, shape):
"""
Shape of preprocessed state given original shape.
Args:
shape: original state shape
Returns: processed state shape
"""
for processor in self.preprocessors:
shape = processor.processed_shape(shape=shape)
... | 0.00597 |
def _deploy_iapp(self, iapp_name, actions, deploying_device):
'''Deploy iapp to add trusted device
:param iapp_name: str -- name of iapp
:param actions: dict -- actions definition of iapp sections
:param deploying_device: ManagementRoot object -- device where the
... | 0.002275 |
def apt_purge(packages, fatal=False):
"""Purge one or more packages."""
cmd = ['apt-get', '--assume-yes', 'purge']
if isinstance(packages, six.string_types):
cmd.append(packages)
else:
cmd.extend(packages)
log("Purging {}".format(packages))
_run_apt_command(cmd, fatal) | 0.003236 |
def linebuffered_stdout():
""" Always line buffer stdout so pipes and redirects are CLI friendly. """
if sys.stdout.line_buffering:
return sys.stdout
orig = sys.stdout
new = type(orig)(orig.buffer, encoding=orig.encoding, errors=orig.errors,
line_buffering=True)
new.mode... | 0.002882 |
def polygon_to_geohashes(polygon, precision, inner=True):
"""
:param polygon: shapely polygon.
:param precision: int. Geohashes' precision that form resulting polygon.
:param inner: bool, default 'True'. If false, geohashes that are completely outside from the polygon are ignored.
:return: set. Set ... | 0.002946 |
def to_triangulation(self):
"""
Returns the mesh as a matplotlib.tri.Triangulation instance. (2D only)
"""
from matplotlib.tri import Triangulation
conn = self.split("simplices").unstack()
coords = self.nodes.coords.copy()
node_map = pd.Series(data = np.arange(len(coords)), index = coords.i... | 0.012903 |
def entries(self):
"""return the actual lists of entries tagged with"""
Tags = Query()
tag = self.table.get(Tags.name == self.name)
posts = tag['post_ids']
for id in posts:
post = self.db.posts.get(doc_id=id)
if not post: # pragma: no coverage
... | 0.006494 |
def lsqfit(self, data=None, pdata=None, prior=None, p0=None, **kargs):
""" Compute least-squares fit of models to data.
:meth:`MultiFitter.lsqfit` fits all of the models together, in
a single fit. It returns the |nonlinear_fit| object from the fit.
To see plots of the fit data divided ... | 0.001095 |
def update_delivery_note_item(self, delivery_note_item_id, delivery_note_item_dict):
"""
Updates a delivery note item
:param delivery_note_item_id: delivery note item id
:param delivery_note_item_dict: dict
:return: dict
"""
return self._create_put_request(
... | 0.006536 |
def set_res(self,res):
""" reset the private Pst.res attribute
Parameters
----------
res : (varies)
something to use as Pst.res attribute
"""
if isinstance(res,str):
res = pst_utils.read_resfile(res)
self.__res = res | 0.013423 |
def call_decorator(cls, func):
"""class function that MUST be specified as decorator
to the `__call__` method overriden by sub-classes.
"""
@wraps(func)
def _wrap(self, *args, **kwargs):
try:
return func(self, *args, **kwargs)
except Excep... | 0.003984 |
def __query(self, input_string):
# type: (text_type)->text_type
"""* What you can do
- It takes the result of Juman++
- This function monitors time which takes for getting the result.
"""
signal.signal(signal.SIGALRM, self.__notify_handler)
signal.alarm(self.timeo... | 0.003505 |
def save_model(self, file_name='model.sbgn'):
"""Save the assembled SBGN model in a file.
Parameters
----------
file_name : Optional[str]
The name of the file to save the SBGN network to.
Default: model.sbgn
"""
model = self.print_model()
... | 0.005249 |
def velocity_from_bundle(self, bundle):
"""[DEPRECATED] Return velocity, given the `coefficient_bundle()` return value."""
coefficients, days_per_set, T, twot1 = bundle
coefficient_count = coefficients.shape[2]
# Chebyshev derivative:
dT = np.empty_like(T)
dT[0] = 0.0
... | 0.005226 |
def _get_hanging_wall_term(self, C, dists, rup):
"""
Compute and return hanging wall model term, see page 1038.
"""
if rup.dip == 90.0:
return np.zeros_like(dists.rx)
else:
Fhw = np.zeros_like(dists.rx)
Fhw[dists.rx > 0] = 1.
# Comp... | 0.000898 |
def genderStats(self, asFractions = False):
"""Creates a dict (`{'Male' : maleCount, 'Female' : femaleCount, 'Unknown' : unknownCount}`) with the numbers of male, female and unknown names in the collection.
# Parameters
_asFractions_ : `optional bool`
> Default `False`, if `True` the ... | 0.015179 |
async def send(self, request: ClientRequest, **kwargs: Any) -> AsyncClientResponse: # type: ignore
"""Send the request using this HTTP sender.
"""
requests_kwargs = self._configure_send(request, **kwargs)
return await super(AsyncRequestsHTTPSender, self).send(request, **requests_kwargs) | 0.0125 |
def FetchFileContent(self):
"""Fetch as much as the file's content as possible.
This drains the pending_files store by checking which blobs we already have
in the store and issuing calls to the client to receive outstanding blobs.
"""
if not self.state.pending_files:
return
# Check what ... | 0.004566 |
def lookup_cell(self, uri):
"""Looks up a local actor by its location relative to this actor."""
steps = uri.steps
if steps[0] == '':
found = self.root
steps.popleft()
else:
found = self
for step in steps:
assert step != ''
... | 0.004405 |
def check_dns_txt(domain, prefix, code):
"""
Validates a domain by checking that {prefix}={code} is present in the TXT DNS record
of the domain to check.
Returns true if verification suceeded.
"""
token = '{}={}'.format(prefix, code)
try:
for rr in dns.resolver.query(domain, 'TXT'):... | 0.006593 |
def validate_basic_smoother():
"""Run Friedman's test from Figure 2b."""
x, y = sort_data(*smoother_friedman82.build_sample_smoother_problem_friedman82())
plt.figure()
# plt.plot(x, y, '.', label='Data')
for span in smoother.DEFAULT_SPANS:
my_smoother = smoother.perform_smooth(x, y, span)
... | 0.006908 |
def enum(self, other, rmax, process=None, bunch=100000, **kwargs):
""" cross correlate with other, for all pairs
closer than rmax, iterate.
>>> def process(r, i, j, **kwargs):
>>> ...
>>> A.enum(... process, **kwargs):
>>> ...
where... | 0.00286 |
def outdent(value):
"""
remove common whitespace prefix from lines
:param value:
:return:
"""
try:
num = 100
lines = toString(value).splitlines()
for l in lines:
trim = len(l.lstrip())
if trim > 0:
num = min(num, len(l) - len(l.lstr... | 0.006024 |
def start(self, hash, name=None, service='facebook'):
""" Start a recording for the provided hash
:param hash: The hash to start recording with
:type hash: str
:param name: The name of the recording
:type name: str
:param service: The service for this... | 0.002532 |
def get_next(self):
"""Return next iteration time related to loop time"""
return self.loop_time + (self.croniter.get_next(float) - self.time) | 0.012739 |
def get_value(self):
"""Returns the value of the constant."""
if self.value is not_computed:
self.value = self.value_provider()
if self.value is not_computed:
return None
return self.value | 0.007937 |
def get_guest_property_value(self, property_p):
"""Reads a value from the machine's guest property store.
in property_p of type str
The name of the property to read.
return value of type str
The value of the property. If the property does not exist then this
... | 0.007194 |
async def stop_async(self):
"""
Stop the EventHubClient and all its Sender/Receiver clients.
"""
log.info("%r: Stopping %r clients", self.container_id, len(self.clients))
self.stopped = True
await self._close_clients_async() | 0.011029 |
def create_query(self, fields=None):
"""Convenience method to create a Query with the Index's fields.
Args:
fields (iterable, optional): The fields to include in the Query,
defaults to the Index's `all_fields`.
Returns:
Query: With the specified fields o... | 0.002941 |
def obj_box_coord_centroid_to_upleft_butright(coord, to_int=False):
"""Convert one coordinate [x_center, y_center, w, h] to [x1, y1, x2, y2] in up-left and botton-right format.
Parameters
------------
coord : list of 4 int/float
One coordinate.
to_int : boolean
Whether to convert ou... | 0.002296 |
def display_path(path):
# type: (Union[str, Text]) -> str
"""Gives the display value for a given path, making it relative to cwd
if possible."""
path = os.path.normcase(os.path.abspath(path))
if sys.version_info[0] == 2:
path = path.decode(sys.getfilesystemencoding(), 'replace')
path... | 0.00207 |
def process_quote(self, data):
"""报价推送"""
for ix, row in data.iterrows():
symbol = row['code']
tick = self._tick_dict.get(symbol, None)
if not tick:
tick = TinyQuoteData()
tick.symbol = symbol
self._tick_dict[symbol] = ... | 0.002564 |
def edmcompletion(A, reordered = True, **kwargs):
"""
Euclidean distance matrix completion. The routine takes an EDM-completable
cspmatrix :math:`A` and returns a dense EDM :math:`X`
that satisfies
.. math::
P( X ) = A
:param A: :py:class:`cspmatrix`
:param reo... | 0.02947 |
def toStringArray(name, a, width = 0):
"""
Returns an array (any sequence of floats, really) as a string.
"""
string = name + ": "
cnt = 0
for i in a:
string += "%4.2f " % i
if width > 0 and (cnt + 1) % width == 0:
string += '\n'
cnt += 1
return string | 0.012579 |
def mark_regex(regex, text, split_locations):
"""
Regex that adds a 'SHOULD_SPLIT' marker at the end
location of each matching group of the given regex.
Arguments
---------
regex : re.Expression
text : str, same length as split_locations
split_locations : list<int>, split de... | 0.001976 |
def fetch(self, log_group_name, start=None, end=None, filter_pattern=None):
"""
Fetch logs from all streams under the given CloudWatch Log Group and yields in the output. Optionally, caller
can filter the logs using a pattern or a start/end time.
Parameters
----------
lo... | 0.003313 |
def rargmax(x, eps=1e-8):
"""Argmax with random tie-breaking
Args:
x: a 1-dim numpy array
Returns:
the argmax index
"""
idxs = np.where(abs(x - np.max(x, axis=0)) < eps)[0]
return np.random.choice(idxs) | 0.004115 |
def container_describe(object_id, input_params={}, always_retry=True, **kwargs):
"""
Invokes the /container-xxxx/describe API method.
For more info, see: https://wiki.dnanexus.com/API-Specification-v1.0.0/Containers-for-Execution#API-method%3A-%2Fcontainer-xxxx%2Fdescribe
"""
return DXHTTPRequest('... | 0.010076 |
def get_tournaments(self, only_active=True):
"""Get all tournaments
Args:
only_active (bool): Flag to indicate of only active tournaments
should be returned or all of them. Defaults
to True.
Returns:
list o... | 0.001237 |
def delete_lower(script, layer_num=None):
""" Delete all layers below the specified one.
Useful for MeshLab ver 2016.12, whcih will only output layer 0.
"""
if layer_num is None:
layer_num = script.current_layer()
if layer_num != 0:
change(script, 0)
for i in range(layer_num):
... | 0.002778 |
def sils_cut(T,f,c,d,h):
"""solve_sils -- solve the lot sizing problem with cutting planes
- start with a relaxed model
- add cuts until there are no fractional setup variables
Parameters:
- T: number of periods
- P: set of products
- f[t]: set-up costs (on period t)
... | 0.017744 |
def _grow_trees(self):
"""
Adds new trees to the forest according to the specified growth method.
"""
if self.grow_method == GROW_AUTO_INCREMENTAL:
self.tree_kwargs['auto_grow'] = True
while len(self.trees) < self.size:
self.trees.append(Tree(data... | 0.008523 |
def get_total_mass(self):
"""Returns the total mass in g/mol.
Args:
None
Returns:
float:
"""
try:
mass = self.loc[:, 'mass'].sum()
except KeyError:
mass_molecule = self.add_data('mass')
mass = mass_molecule.loc... | 0.005602 |
def genfile(*paths):
'''
Create or open ( for read/write ) a file path join.
Args:
*paths: A list of paths to join together to make the file.
Notes:
If the file already exists, the fd returned is opened in ``r+b`` mode.
Otherwise, the fd is opened in ``w+b`` mode.
Returns:... | 0.001779 |
def dict_as_tuple_list(d, as_list=False):
"""
Format a dict to a list of tuples
:param d: the dictionary
:param as_list: return a list of lists rather than a list of tuples
:return: formatted dictionary list
"""
dd = list()
for k, v in d.items():
dd.append([k, v] if as_list else ... | 0.002933 |
def ColorfullyWrite(log: str, consoleColor: int = -1, writeToFile: bool = True, printToStdout: bool = True, logFile: str = None) -> None:
"""
log: str.
consoleColor: int, a value in class `ConsoleColor`, such as `ConsoleColor.DarkGreen`.
writeToFile: bool.
printToStdout: bool.
... | 0.004955 |
def execute(self, action):
"""Execute the indicated action within the environment and
return the resulting immediate reward dictated by the reward
program.
Usage:
immediate_reward = scenario.execute(selected_action)
Arguments:
action: The action to be ex... | 0.002134 |
def Client(api_version, *args, **kwargs):
"""Return an neutron client.
@param api_version: only 2.0 is supported now
"""
neutron_client = utils.get_client_class(
API_NAME,
api_version,
API_VERSIONS,
)
return neutron_client(*args, **kwargs) | 0.003472 |
def parse_250_row(row: list) -> BasicMeterData:
""" Parse basic meter data record (250) """
return BasicMeterData(row[1], row[2], row[3], row[4], row[5],
row[6], row[7], float(row[8]),
parse_datetime(row[9]), row[10], row[11], row[12],
... | 0.010453 |
def all_enclosing_scopes(scope, allow_global=True):
"""Utility function to return all scopes up to the global scope enclosing a
given scope."""
_validate_full_scope(scope)
# TODO: validate scopes here and/or in `enclosing_scope()` instead of assuming correctness.
def scope_within_range(tentative_scope):
... | 0.015332 |
def query_by_slug(slug):
'''
查询全部章节
'''
cat_rec = MCategory.get_by_slug(slug)
if cat_rec:
cat_id = cat_rec.uid
else:
return None
if cat_id.endswith('00'):
cat_con = TabPost2Tag.par_id == cat_id
else:
cat_con... | 0.003367 |
def averageOnTime(vectors, numSamples=None):
"""
Returns the average on-time, averaged over all on-time runs.
Parameters:
-----------------------------------------------
vectors: the vectors for which the onTime is calculated. Row 0
contains the outputs from time step 0, row 1 fr... | 0.016917 |
def complete_shells(line, text, predicate=lambda i: True):
"""Return the shell names to include in the completion"""
res = [i.display_name + ' ' for i in dispatchers.all_instances() if
i.display_name.startswith(text) and
predicate(i) and
' ' + i.display_name + ' ' not in line]
... | 0.003003 |
def _generateDDL(self):
"""Generate DDL statements for SQLLite"""
sql = []
# Next convert each set of columns into a table structure
for dataset_name in sorted(self.datasets.keys()):
# SQL to drop the table if it already exists
sql.append('''drop table if exists ... | 0.002632 |
def get(self, cid, fields=[], **kwargs):
'''taobao.itemprops.get 获取标准商品类目属性
Q:能否通过图形化界面获取特定类目下面的属性及属性值?
A:请点击属性工具,通过图形化界面直接获取上述数据
Q:关键属性,非关键属性,销售属性有什么区别? A:产品的关键属性是必填的,关键属性+类目id确定一个产品,非关键属性,是分类上除了关键属性和销售属性以外的属性。销售属性是只有一件实物的商品才能确定的一个属性,如:N73 红色,黑色。没有实物不能确定。
Q:销售属性与SKU之... | 0.013039 |
def parent(self):
"""
Select the direct child(ren) from the UI element(s) given by the query expression, see ``QueryCondition`` for
more details about the selectors.
Warnings:
Experimental method, may not be available for all drivers.
Returns:
:py:class:... | 0.006126 |
def format_base64(data):
"""
<Purpose>
Return the base64 encoding of 'data' with whitespace and '=' signs omitted.
<Arguments>
data:
Binary or buffer of data to convert.
<Exceptions>
securesystemslib.exceptions.FormatError, if the base64 encoding fails or the
argument is invalid.
<Sid... | 0.009917 |
def open(self, method, url):
'''
Opens the request.
method:
the request VERB 'GET', 'POST', etc.
url:
the url to connect
'''
flag = VARIANT.create_bool_false()
_method = BSTR(method)
_url = BSTR(url)
_WinHttpRequest._Open(s... | 0.005797 |
def file_download_using_requests(self,url):
'''It will download file specified by url using requests module'''
file_name=url.split('/')[-1]
if os.path.exists(os.path.join(os.getcwd(),file_name)):
print 'File already exists'
return
#print 'Downloading file %s '%file_name
#print 'Downloading from %s'%url... | 0.053691 |
def get_proficiencies(self):
"""Gets all ``Proficiencies``.
return: (osid.learning.ProficiencyList) - a list of
``Proficiencies``
raise: OperationFailed - unable to complete request
raise: PermissionDenied - authorization failure
*compliance: mandatory -- This ... | 0.003413 |
def serialize_endnote(ctx, document, el, root):
"Serializes endnotes."
footnote_num = el.rid
if el.rid not in ctx.endnote_list:
ctx.endnote_id += 1
ctx.endnote_list[el.rid] = ctx.endnote_id
footnote_num = ctx.endnote_list[el.rid]
note = etree.SubElement(root, 'sup')
link = et... | 0.002012 |
def chunk(self, seek=None, lenient=False):
"""
Read the next PNG chunk from the input file
returns a (*chunk_type*, *data*) tuple. *chunk_type* is the chunk's
type as a byte string (all PNG chunk types are 4 bytes long).
*data* is the chunk's data content, as a byte string.
... | 0.001635 |
def get_assigned_object(self, object_type=None):
"""Return the current assigned object UUID.
:param object_type: If it's specified, returns only if the PID
object_type is the same, otherwise returns None. (default: None).
:returns: The object UUID.
"""
if object_type... | 0.004008 |
def is_left(point0, point1, point2):
""" Tests if a point is Left|On|Right of an infinite line.
Ported from the C++ version: on http://geomalgorithms.com/a03-_inclusion.html
.. note:: This implementation only works in 2-dimensional space.
:param point0: Point P0
:param point1: Point P1
:param... | 0.005051 |
def connect(self, chassis_list):
"""Establish connection to one or more chassis.
Arguments:
chassis_list -- List of chassis (IP addresses or DNS names)
Return:
List of chassis addresses.
"""
self._check_session()
if not isinstance(chassis_list, (list, t... | 0.002587 |
def plotDutyCycles(dutyCycle, filePath):
"""
Create plot showing histogram of duty cycles
:param dutyCycle: (torch tensor) the duty cycle of each unit
:param filePath: (str) Full filename of image file
"""
_,entropy = binaryEntropy(dutyCycle)
bins = np.linspace(0.0, 0.3, 200)
plt.hist(dutyCycle, bins, ... | 0.021277 |
def delta(self, other):
'''
Return the error between this and another bearing. This will be an
angle in degrees, positive or negative depending on the direction of
the error.
self other
\ /
\ /
\__/
... | 0.014528 |
def setting(self):
"""
Load setting (Amps, Watts, or Ohms depending on program mode)
"""
prog_type = self.__program.program_type
return self._setting / self.SETTING_DIVIDES[prog_type] | 0.008969 |
def __validate1 (property):
""" Exit with error if property is not valid.
"""
assert isinstance(property, Property)
msg = None
if not property.feature.free:
feature.validate_value_string (property.feature, property.value) | 0.012 |
def _startNextChunk(self) -> None:
"""
Close current and start next chunk
"""
if self.currentChunk is None:
self._useLatestChunk()
else:
self._useChunk(self.currentChunkIndex + self.chunkSize) | 0.007813 |
def main(argString=None):
"""The main function.
:param argString: the options.
:type argString: list
These are the steps performed by this module:
1. Prints the options of the module.
2. Computes the number of markers in the input file
(:py:func:`computeNumberOfMarkers`).
3. If th... | 0.000324 |
def malloc(self, sim_size):
"""
A somewhat faithful implementation of libc `malloc`.
:param sim_size: the amount of memory (in bytes) to be allocated
:returns: the address of the allocation, or a NULL pointer if the allocation failed
"""
raise NotImplementedError(... | 0.010593 |
def get_bundles():
"""
Used to cache the bundle definitions rather than loading from config every time they're used
"""
global _cached_bundles
if not _cached_bundles:
_cached_bundles = BundleManager()
for bundle_conf in bundles_settings.BUNDLES:
_cached_bundles[bundle_c... | 0.005305 |
def command_loop(self, run_script_event):
""" This is the debugger command loop that processes (protocol) client
requests.
"""
while True:
obj = remote_client.receive(self)
command = obj["command"]
# TODO: ensure we always have a command if receive r... | 0.004672 |
def ping():
'''
Returns true if the device is reachable, else false.
'''
try:
session, cookies, csrf_token = logon()
logout(session, cookies, csrf_token)
except salt.exceptions.CommandExecutionError:
return False
except Exception as err:
log.debug(err)
ret... | 0.002899 |
def message(self, category, subject, msg_file):
"""Send message to all users in `category`."""
users = getattr(self.sub, category)
if not users:
print('There are no {} users on {}.'.format(category, self.sub))
return
if msg_file:
try:
... | 0.002018 |
def unique_scene_labels(scene_list):
"""Find the unique scene labels
Parameters
----------
scene_list : list, shape=(n,)
A list containing scene dicts
Returns
-------
labels: list, shape=(n,)
Unique labels in alphabetical order
"""
if isinstance(scene_list, dcase_u... | 0.001575 |
def set_tunnel(self, host, port=None, headers=None):
""" Sets up the host and the port for the HTTP CONNECT Tunnelling.
The headers argument should be a mapping of extra HTTP headers
to send with the CONNECT request.
"""
self._tunnel_host = host
self._tunnel_port = port
... | 0.004577 |
def getVariances(self):
"""
get variances
"""
var = []
var.append(self.Cr.K().diagonal())
if self.bgRE:
var.append(self.Cg.K().diagonal())
var.append(self.Cn.K().diagonal())
var = sp.array(var)
return var | 0.006944 |
def filtered_search(
self,
id_list: List,
negated_classes: List,
limit: Optional[int] = 100,
taxon_filter: Optional[int] = None,
category_filter: Optional[str] = None,
method: Optional[SimAlgorithm] = SimAlgorithm.PHENODIGM) -> SimResul... | 0.006873 |
def set_display_name(self, display_name):
"""Sets a display name.
A display name is required and if not set, will be set by the
provider.
arg: display_name (string): the new display name
raise: InvalidArgument - ``display_name`` is invalid
raise: NoAccess - ``Metad... | 0.005 |
def _set_packet_error_counters(self, v, load=False):
"""
Setter method for packet_error_counters, mapped from YANG variable /mpls_state/rsvp/statistics/packet_error_counters (container)
If this variable is read-only (config: false) in the
source YANG file, then _set_packet_error_counters is considered a... | 0.005564 |
def plot_psrrates(pkllist, outname=''):
""" Plot cumulative rate histograms. List of pkl files in order, as for make_psrrates.
"""
if not outname:
outname = 'tmp.png'
labels = {0: 'Flux at 0\'', 1: 'Flux at 7\'', 2: 'Flux at 15\'', 3: 'Flux at 25\''}
labelsr = {1: 'Flux Ratio 7\' to 0\'', ... | 0.00584 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.