text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def titles(self, unique=False):
"""Return a list of all available spreadsheet titles.
Args:
unique (bool): drop duplicates
Returns:
list: list of title/name strings
"""
if unique:
return tools.uniqued(title for _, title in self.iterfiles())
... | 0.005362 |
def count_unique_mapped_reads(self, file_name, paired_end):
"""
For a bam or sam file with paired or or single-end reads, returns the
number of mapped reads, counting each read only once, even if it appears
mapped at multiple locations.
:param str file_name: name of reads file
... | 0.005659 |
def get_collections(self, ignore=None):
"""Return the collections matching the given `_ignore` value
Parameters
----------
ignore : `bool`, or `None`
value of `_ignore` to match
Returns
-------
collections : `list`
if `ignore=None`, simpl... | 0.003317 |
def coherence(self, other, fftlength=None, overlap=None,
window='hann', **kwargs):
"""Calculate the frequency-coherence between this `TimeSeries`
and another.
Parameters
----------
other : `TimeSeries`
`TimeSeries` signal to calculate coherence with... | 0.00099 |
def _lnqmed_residual(catchment):
"""
Return ln(QMED) model error at a gauged catchment
:param catchment: Gauged catchment
:type catchment: :class:`Catchment`
:return: Model error
:rtype: float
"""
analysis = QmedAnalysis(catchment, year=2000) # Probably ... | 0.005455 |
def invoke(self, args, kwargs):
"""
Send the required soap message to invoke the specified method
@param args: A list of args for the method invoked.
@type args: list
@param kwargs: Named (keyword) args for the method invoked.
@type kwargs: dict
@return: The resul... | 0.002174 |
def user_activities(self, user_id, extra_query_params={}):
"""
client = BacklogClient("your_space_name", "your_api_key")
client.user_activities(3)
client.user_activities(3, {"count": 2, "order": "asc"})
"""
return self.do("GET", "users/{user_id}/activities",
... | 0.004785 |
def insert(self, **kwargs):
"""
Insert commands at the beginning of the sequence.
This is provided because certain commands
have to come first (such as user creation), but may be need to beadded
after other commands have already been specified.
Later calls to insert put ... | 0.007194 |
def do_work(self):
""" Do work """
self._starttime = time.time()
if not os.path.isdir(self._dir2):
if self._maketarget:
if self._verbose:
self.log('Creating directory %s' % self._dir2)
try:
os.makedirs(self._di... | 0.003597 |
def xcorr(x, y=None, maxlags=None, norm='biased'):
"""Cross-correlation using numpy.correlate
Estimates the cross-correlation (and autocorrelation) sequence of a random
process of length N. By default, there is no normalisation and the output
sequence of the cross-correlation has a length 2*N+1.
:... | 0.001521 |
def _writeMzmlChecksum(xmlWriter, outputFile):
""" #TODO: docstring
:param xmlWriter: #TODO: docstring
:param outputFile: #TODO: docstring
"""
sha = hashlib.sha1(outputFile.getvalue())
sha.update('<fileChecksum>')
xmlChecksumElement = ETREE.Element('fileChecksum')
xmlChecksumElement.te... | 0.0025 |
def find_file(path, tgt_env='base', **kwargs): # pylint: disable=W0613
'''
Find the first file to match the path and ref. This operates similarly to
the roots file sever but with assumptions of the directory structure
based on svn standard practices.
'''
fnd = {'path': '',
'rel': ''}... | 0.000594 |
def get_default_section(self, file_name):
"""Returns first non-DEFAULT section; falls back to DEFAULT."""
if not os.path.isfile(file_name):
return 'DEFAULT'
parser = self.make_parser()
with open(file_name) as fp:
parser.read_file(fp)
sections = parser.sect... | 0.004819 |
def load_schema(schema_path):
"""Prepare the api specification for request and response validation.
:returns: a mapping from :class:`RequestMatcher` to :class:`ValidatorMap`
for every operation in the api specification.
:rtype: dict
"""
with open(schema_path, 'r') as schema_file:
sc... | 0.002101 |
def bulk_refresh(self):
"""
Refreshes all refreshable tokens in the queryset.
Deletes any tokens which fail to refresh.
Deletes any tokens which are expired and cannot refresh.
Excludes tokens for which the refresh was incomplete for other reasons.
"""
session = O... | 0.003738 |
def _search_generator(self, item: Any) -> Generator[Any, None, None]:
"""A helper method for `self.search` that returns a generator rather than a list."""
results = 0
for x in self.enumerate(item):
yield x
results += 1
if results == 0:
raise SearchErro... | 0.009036 |
def save(self) -> None:
"""
Save the training trace to :py:attr:`CXF_TRACE_FILE` file under the specified directory.
:raise ValueError: if no output directory was specified
"""
if self._output_dir is None:
raise ValueError('Can not save TrainingTrace without output d... | 0.007634 |
def add_user(
self, user,
first_name=None, last_name=None,
email=None, password=None
):
"""
Add a new user.
Args:
user (string): User name.
first_name (optional[string]): User's first name. Defaults to None.
last_n... | 0.003916 |
def get(self, sid):
"""
Constructs a ConferenceContext
:param sid: The unique string that identifies this resource
:returns: twilio.rest.api.v2010.account.conference.ConferenceContext
:rtype: twilio.rest.api.v2010.account.conference.ConferenceContext
"""
return ... | 0.007389 |
def set_autosession(self, value=None):
"""
Turn autosession (automatic committing after each modification call) on/off.
If value is None, only query the current value (don't change anything).
"""
if value is not None:
self.rollback()
self.autosession = val... | 0.008475 |
def _query_names(self, names):
"""Find products by their names, e.g.
S1A_EW_GRDH_1SDH_20141003T003840_20141003T003920_002658_002F54_4DD1.
Note that duplicates exist on server, so multiple products can be returned for each name.
Parameters
----------
names : list[string]... | 0.004153 |
def hill_i(self,x,threshold=0.1,power=2):
""" Inhibiting hill function.
Is equivalent to 1-hill_a(self,x,power,threshold).
"""
x_pow = np.power(x,power)
threshold_pow = np.power(threshold,power)
return threshold_pow / (x_pow + threshold_pow) | 0.02381 |
def preload_tops(meta):
"""Load all topology files into memory.
This might save some performance compared to re-parsing the topology
file for each trajectory you try to load in. Typically, you have far
fewer (possibly 1) topologies than trajectories
Parameters
----------
meta : pd.DataFram... | 0.001553 |
def send_email_from_template(to_email, from_email, subject,
markdown_template=None,
text_template=None, html_template=None,
fail_silently=False, context=None,
**kwargs):
"""Send an email from a templa... | 0.000695 |
def QA_indicator_BIAS(DataFrame, N1, N2, N3):
'乖离率'
CLOSE = DataFrame['close']
BIAS1 = (CLOSE - MA(CLOSE, N1)) / MA(CLOSE, N1) * 100
BIAS2 = (CLOSE - MA(CLOSE, N2)) / MA(CLOSE, N2) * 100
BIAS3 = (CLOSE - MA(CLOSE, N3)) / MA(CLOSE, N3) * 100
DICT = {'BIAS1': BIAS1, 'BIAS2': BIAS2, 'BIAS3': BIAS3}... | 0.002849 |
def _config(name, conf, default=None):
'''
Return a value for 'name' from the config file options. If the 'name' is
not in the config, the 'default' value is returned. This method converts
unicode values to str type under python 2.
'''
try:
value = conf[name]
except KeyError:
... | 0.002564 |
def remove(self, key):
"""
Remove the data stored for the given key.
Args:
key (str): Key of the data to remove.
Note:
The container has to be opened in advance.
"""
self.raise_error_if_not_open()
if key in self._file:
del se... | 0.006006 |
def smeft_evolve_continuous(C_in, scale_in, scale_out, newphys=True, **kwargs):
"""Solve the SMEFT RGEs by numeric integration, returning a function that
allows to compute an interpolated solution at arbitrary intermediate
scales."""
sol = _smeft_evolve(C_in, scale_in, scale_out, newphys=newphys,
... | 0.004225 |
def _POUpdateBuilderWrapper(env, target=None, source=_null, **kw):
""" Wrapper for `POUpdate` builder - make user's life easier """
if source is _null:
if 'POTDOMAIN' in kw:
domain = kw['POTDOMAIN']
elif 'POTDOMAIN' in env and env['POTDOMAIN']:
domain = env['POTDOMAIN']
else:
domain = ... | 0.022075 |
def mutate(self, mutation=None, set_obj=None, del_obj=None, set_nquads=None,
del_nquads=None, commit_now=None, ignore_index_conflict=None,
timeout=None, metadata=None, credentials=None):
"""Adds a mutate operation to the transaction."""
mutation = self._common_mutate(
... | 0.002703 |
def old_status(self, old_status):
"""
Sets the old_status of this BuildSetStatusChangedEvent.
:param old_status: The old_status of this BuildSetStatusChangedEvent.
:type: str
"""
allowed_values = ["NEW", "DONE", "REJECTED"]
if old_status not in allowed_values:
... | 0.003795 |
def make_copy(cls, generator):
"""
Creates a copy of the generator.
:param generator: the generator to copy
:type generator: DataGenerator
:return: the copy of the generator
:rtype: DataGenerator
"""
return from_commandline(
to_commandline(gen... | 0.007937 |
def validate_description(xml_data):
""" Validate the description for validity """
try:
root = ET.fromstring('<document>' + xml_data + '</document>')
except StdlibParseError as e:
raise ParseError(str(e))
return _parse_desc(root) | 0.003846 |
def java_version():
"""Call java and return version information.
:return unicode: Java version string
"""
result = subprocess.check_output(
[c.JAVA, '-version'], stderr=subprocess.STDOUT
)
first_line = result.splitlines()[0]
return first_line.decode() | 0.003472 |
def subs_consts(self, expr):
"""Substitute constants in expression unless it is already a number."""
if isinstance(expr, numbers.Number):
return expr
else:
return expr.subs(self.constants) | 0.008475 |
def add_contact(self, contact_id, scope='contact/invite'):
"""
Add a contact
contact_id can either be the mxit ID of a service or a Mxit user
User authentication required with the following scope: 'contact/invite'
"""
return _put(
token=self.oauth.get_user_tok... | 0.004854 |
def parents(self, vertex):
"""
Return the list of immediate parents of this vertex.
"""
return [self.tail(edge) for edge in self.in_edges(vertex)] | 0.011173 |
def secure_authorized_channel(
credentials, target, ssl_credentials=None):
"""Creates a secure authorized gRPC channel."""
http_request = _request_factory()
return google.auth.transport.grpc.secure_authorized_channel(
credentials, http_request, target,
ssl_credentials=ssl_credentials... | 0.003115 |
def list_instances(show=1, name=None, group=None, release=None, except_release=None):
"""
Retrieves all virtual machines instances in the current environment.
"""
from burlap.common import shelf, OrderedDict, get_verbose
verbose = get_verbose()
require('vm_type', 'vm_group')
assert env.vm_t... | 0.006159 |
def set_param(self, param, value, header='Content-Type', requote=True,
charset=None, language=''):
"""Set a parameter in the Content-Type header.
If the parameter already exists in the header, its value will be
replaced with the new value.
If header is Content-Type an... | 0.001437 |
def parent(self) -> Optional['CtsReference']:
""" Parent of the actual URN, for example, 1.1 for 1.1.1
:rtype: CtsReference
"""
if self.start.depth == 1 and (self.end is None or self.end.depth <= 1):
return None
else:
if self.start.depth > 1 and (self.end... | 0.003167 |
def set_publication_failure(cursor, exc):
"""Given a publication exception, set the publication as failed and
append the failure message to the publication record.
"""
publication_id = exc.publication_id
if publication_id is None:
raise ValueError("Exception must have a ``publication_id`` va... | 0.001209 |
def export(group, bucket, prefix, start, end, role, poll_period=120,
session=None, name="", region=None):
"""export a given log group to s3"""
start = start and isinstance(start, six.string_types) and parse(start) or start
end = (end and isinstance(start, six.string_types) and
parse(en... | 0.001054 |
def _embed_state(embedding, state):
"""Embed a single state/sample by spreading it's values over the chains in the embedding"""
return {u: state[v] for v, chain in embedding.items() for u in chain} | 0.009756 |
def residual_block(x, hparams):
"""A stack of convolution blocks with residual connection."""
k = (hparams.kernel_height, hparams.kernel_width)
dilations_and_kernels = [((1, 1), k) for _ in range(3)]
y = common_layers.subseparable_conv_block(
x,
hparams.hidden_size,
dilations_and_kernels,
... | 0.013725 |
def _set_raw(target, raw_value, bitarray):
''' put value into bit array '''
offset = int(target['offset'])
size = int(target['size'])
for digit in range(size):
bitarray[offset+digit] = (raw_value >> (size-digit-1)) & 0x01 != 0
return bitarray | 0.006803 |
def summary(self, CorpNum, JobID, Type, TaxType, PurposeType, TaxRegIDType, TaxRegIDYN, TaxRegID, UserID=None):
""" 수집 결과 요약정보 조회
args
CorpNum : 팝빌회원 사업자번호
JobID : 작업아이디
Type : 문서형태 배열, N-일반전자세금계산서, M-수정전자세금계산서
TaxType : 과세형태 배열, T-과세, ... | 0.00314 |
def setOutputObject(self, newOutput=output.CalcpkgOutput(True, True)):
"""Set an object where all output from calcpkg will be redirected to for this repository"""
self.output = newOutput | 0.026316 |
def authenticate_direct_credentials(self, username, password):
"""
Performs a direct bind, however using direct credentials. Can be used
if interfacing with an Active Directory domain controller which
authenticates using username@domain.com directly.
Performing this kind of look... | 0.001805 |
def build_args():
"""Create command line argument parser."""
parser = argparse.ArgumentParser(description=u'Compile a sensor graph.')
parser.add_argument(u'sensor_graph', type=str, help=u"the sensor graph file to load and run.")
parser.add_argument(u'-f', u'--format', default=u"nodes", choices=[u'nodes... | 0.007153 |
def register(self, plugin, name=None):
""" Register a plugin and return its canonical name or None if the name
is blocked from registering. Raise a ValueError if the plugin is already
registered. """
plugin_name = name or self.get_canonical_name(plugin)
if plugin_name in self._... | 0.002875 |
def _visit(self, L, marked, tempmarked):
"""
Sort features topologically.
This recursive function uses depth-first search to find an ordering of
the features in the feature graph that is sorted both topologically and
with respect to genome coordinates.
Implementation ba... | 0.001246 |
def load_by_name(name):
"""
Load a spec from either a file path or a fully qualified name.
"""
if os.path.exists(name):
load_from_path(name)
else:
__import__(name) | 0.004975 |
def _dist_info_files(whl_zip):
"""Identify the .dist-info folder inside a wheel ZipFile."""
res = []
for path in whl_zip.namelist():
m = re.match(r'[^/\\]+-[^/\\]+\.dist-info/', path)
if m:
res.append(path)
if res:
return res
raise Exception("No .dist-info folder ... | 0.002976 |
def set_fig_size(self, width, height=None):
"""Set the figure size in inches.
Sets the figure size with a call to fig.set_size_inches.
Default in code is 8 inches for each.
Args:
width (float): Dimensions for figure width in inches.
height (float, optional): Dim... | 0.006186 |
def LikelihoodFunction(Template, Data, PSD, detRespP, detGCDelay=0):
""" LikelihoodFunction - function to calculate the likelihood of livePoint,
given Data.
Template - (N_fd) complex array containing Fourier domain trial signal.
Data - (N_fd) complex array containing Fourier domain GW data.... | 0.020721 |
def get(self, sid):
"""
Constructs a StepContext
:param sid: Step Sid.
:returns: twilio.rest.studio.v1.flow.engagement.step.StepContext
:rtype: twilio.rest.studio.v1.flow.engagement.step.StepContext
"""
return StepContext(
self._version,
... | 0.004464 |
def display_value(self, ctx, value):
""" Display value to be used for this parameter. """
gandi = ctx.obj
gandi.log('%s: %s' % (self.name, (value if value is not None
else 'Not found'))) | 0.007937 |
def viscosity_kinematic_chem(conc_chem, temp, en_chem):
"""Return the dynamic viscosity of water at a given temperature.
If given units, the function will automatically convert to Kelvin.
If not given units, the function will assume Kelvin.
"""
if en_chem == 0:
nu = viscosity_kinematic_a... | 0.024164 |
def prepare_dispatches(cls, message, recipients=None):
"""Creates Dispatch models for a given message and return them.
:param Message message: Message model instance
:param list|None recipients: A list or Recipient objects
:return: list of created Dispatch models
:rtype: list
... | 0.004926 |
def exons(context, build):
"""Load exons into the scout database"""
adapter = context.obj['adapter']
start = datetime.now()
# Test if there are any exons loaded
nr_exons = adapter.exons(build=build).count()
if nr_exons:
LOG.warning("Dropping all exons ")
adapter.dr... | 0.009901 |
def _vispy_emit_match_andor_record(self, record):
"""Log message emitter that optionally matches and/or records"""
test = record.getMessage()
match = self._vispy_match
if (match is None or re.search(match, test) or
re.search(match, _get_vispy_caller())):
if se... | 0.003322 |
def choice_download(self):
"""Download script.tar.gz and sources
"""
Download(path="", url=self.dwn_srcs, repo="sbo").start()
raise SystemExit() | 0.011364 |
def get_data_file_names_from_scan_base(scan_base, filter_str=['_analyzed.h5', '_interpreted.h5', '_cut.h5', '_result.h5', '_hists.h5'], sort_by_time=True, meta_data_v2=True):
"""
Generate a list of .h5 files which have a similar file name.
Parameters
----------
scan_base : list, string
List... | 0.00348 |
def check_dependencies(model, model_queue, avaliable_models):
""" Check that all the depenedencies for this model are already in the queue. """
# A list of allowed links: existing fields, itself and the special case ContentType
allowed_links = [m.model.__name__ for m in model_queue] + [model.__name__, 'Cont... | 0.004484 |
def parameter_count(funcsig):
"""Get the number of positional-or-keyword or position-only parameters in a
function signature.
Parameters
----------
funcsig : inspect.Signature
A UDF signature
Returns
-------
int
The number of parameters
"""
return sum(
p... | 0.002066 |
def _generate_auth_url(self, path, params, accepts_clientid):
"""Returns the path and query string portion of the request URL, first
adding any necessary parameters.
:param path: The path portion of the URL.
:type path: string
:param params: URL parameters.
:type params... | 0.002861 |
def websafe(s):
"""return a string with HTML-safe text"""
s=s.replace("<","<").replace(">",">")
s=s.replace(r'\x',r' \x')
s=s.replace("\n","<br>")
return s | 0.043011 |
def wait_until_element_not_visible(webdriver, locator_lambda_expression,
timeout=WTF_TIMEOUT_MANAGER.NORMAL, sleep=0.5):
"""
Wait for a WebElement to disappear.
Args:
webdriver (Webdriver) - Selenium Webdriver
locator (lambda) - Loc... | 0.005133 |
def zoom_for_pixelsize(pixel_size, max_z=24, tilesize=256):
"""
Get mercator zoom level corresponding to a pixel resolution.
Freely adapted from
https://github.com/OSGeo/gdal/blob/b0dfc591929ebdbccd8a0557510c5efdb893b852/gdal/swig/python/scripts/gdal2tiles.py#L294
Parameters
----------
pix... | 0.001285 |
def patch_connection_file_paths(connection: str) -> str:
"""
Patch any paths in a connection to remove the balena host paths
Undoes the changes applied by
:py:meth:`opentrons.system.nmcli._rewrite_key_path_to_host_path`
:param connection: The contents of a NetworkManager connection file
:retur... | 0.000982 |
def get_identifiers_splitted_by_weights(identifiers={}, proportions={}):
"""
Divide the given identifiers based on the given proportions. But instead of randomly split
the identifiers it is based on category weights. Every identifier has a weight for any
number of categories. The target is, to split the... | 0.002815 |
def JoinPath(self, path_segments):
"""Joins the path segments into a path.
Args:
path_segments (list[str]): path segments.
Returns:
str: joined path segments prefixed with the path separator.
"""
# For paths on Windows we need to make sure to handle the first path
# segment correct... | 0.00694 |
def write(self, addr, data):
'''Write access.
:param addr: i2c slave address
:type addr: char
:param data: array/list of bytes
:type data: iterable
:rtype: None
'''
self.set_addr(addr & 0xfe)
self.set_data(data)
self.set_size(... | 0.00495 |
def check_address(address):
"""
Check if the format of the address is correct
Arguments:
address (tuple):
(``str``, ``int``) representing an IP address and port,
respectively
.. note::
alternatively a local ``address`` can be a ``str`` when worki... | 0.000845 |
def simulate_diffusion(self, save_pos=False, total_emission=True,
radial=False, rs=None, seed=1, path='./',
wrap_func=wrap_periodic,
chunksize=2**19, chunkslice='times', verbose=True):
"""Simulate Brownian motion trajectories and e... | 0.00172 |
def models(cls, api_version=DEFAULT_API_VERSION):
"""Module depends on the API version:
* 2015-10-01-preview: :mod:`v2015_10_01_preview.models<azure.mgmt.resource.policy.v2015_10_01_preview.models>`
* 2016-04-01: :mod:`v2016_04_01.models<azure.mgmt.resource.policy.v2016_04_01.models>`
... | 0.005867 |
def set_chat_photo(
self,
chat_id: Union[int, str],
photo: str
) -> bool:
"""Use this method to set a new profile photo for the chat.
Photos can't be changed for private chats.
You must be an administrator in the chat for this to work and must have the appropriate adm... | 0.003996 |
def replace_nulls(hdrs):
"""Replace '' in hdrs."""
ret = []
idx = 0
for hdr in hdrs:
if hdr == '':
ret.append("no_hdr{}".format(idx))
else:
ret.append(hdr)
return ret | 0.007634 |
def merge_commit(commit):
"Fetches the latest code and merges up the specified commit."
with cd(env.path):
run('git fetch')
if '@' in commit:
branch, commit = commit.split('@')
run('git checkout {0}'.format(branch))
run('git merge {0}'.format(commit)) | 0.003257 |
def update_build_properties(self, document, project, build_id):
"""UpdateBuildProperties.
[Preview API] Updates properties for a build.
:param :class:`<[JsonPatchOperation]> <azure.devops.v5_0.build.models.[JsonPatchOperation]>` document: A json-patch document describing the properties to update... | 0.004743 |
def setup_figcanvas(self):
"""Setup the FigureCanvas."""
self.figcanvas = FigureCanvas(background_color=self.background_color)
self.figcanvas.installEventFilter(self)
self.setWidget(self.figcanvas) | 0.008734 |
def _AddToSingleColumnTable(self, tableName, columnHeading, newValue):
"""
Add an entry to a table containing a single column. Checks existing
table entries to avoid duplicate entries if the given value already
exists in the table.
Parameters
----------
tableName : string
Name of ... | 0.008217 |
def check_ups_input_frequency(the_session, the_helper, the_snmp_value):
"""
OID .1.3.6.1.2.1.33.1.3.3.1.2.1
MIB excerpt
The present input frequency.
"""
a_frequency = calc_frequency_from_snmpvalue(the_snmp_value)
the_helper.add_metric(
label=the_helper.options.type,
value=a_f... | 0.002364 |
def on_heartbeat(self, message):
"""
Runs on a heartbeat event from websocket connection
Args:
message (dict): Full message from Discord websocket connection"
"""
logger.info("Got a heartbeat")
logger.info("Heartbeat message: {}".format(message))
sel... | 0.005222 |
def execute():
""" Ensure provisioning """
boto_server_error_retries = 3
# Ensure provisioning
for table_name, table_key in sorted(dynamodb.get_tables_and_gsis()):
try:
table_num_consec_read_checks = \
CHECK_STATUS['tables'][table_name]['reads']
except KeyErr... | 0.00044 |
def _build_abbreviation_regex(input_string):
""" builds a recursive regex based on an input string to find possible abbreviations more simply.
e.g. = punct(u(a(t(i(on?)?)?)?)?)?
:param input_string: str, input string
:return: str, output regex
"""
result=''
f... | 0.009132 |
def prepare_env(self):
"""
Manages reading environment metadata files under ``private_data_dir`` and merging/updating
with existing values so the :py:class:`ansible_runner.runner.Runner` object can read and use them easily
"""
try:
passwords = self.loader.load_file('e... | 0.005427 |
def remote_space_available(self, search_pattern=r"(\d+) bytes free"):
"""Return space available on remote device."""
remote_cmd = 'system "df {}"'.format(self.folder_name)
remote_output = self.ssh_ctl_chan.send_command_expect(remote_cmd)
for line in remote_output.splitlines():
... | 0.004357 |
def _precompute_euristics(self):
"""
Предвычисляет будущие символы и стоимости операций с ними
для h-эвристики
"""
if self.euristics is None:
return
# вычисление минимальной стоимости операции,
# приводящей к появлению ('+') или исчезновению ('-') данн... | 0.004258 |
def densu(alt, dlb, tinf, tlb, xm, alpha, tz, zlb, s2, mn1, zn1, tn1, tgn1):
'''
/* Calculate Temperature and Density Profiles for MSIS models
* New lower thermo polynomial
*/
tz, zn1, tn1, and tgn1 are simulated pointers
'''
rgas = 831.4
#rgas = 831.44621 #maybe make this a global constant... | 0.036891 |
def map(self, map_function):
"""Return a new Streamlet by applying map_function to each element of this Streamlet.
"""
from heronpy.streamlet.impl.mapbolt import MapStreamlet
map_streamlet = MapStreamlet(map_function, self)
self._add_child(map_streamlet)
return map_streamlet | 0.006689 |
def extractValue(self, model, item):
"""
Get the class name of the factory referenced by a port.
@param model: Either a TabularDataModel or a ScrollableView, depending
on what this column is part of.
@param item: A port item instance (as defined by L{xmantissa.port}).
... | 0.003454 |
def update_field(self, name, value):
"""Changes the definition of a KV Store field.
:param name: name of field to change
:type name: ``string``
:param value: new field definition
:type value: ``string``
:return: Result of POST request
"""
kwargs = {}
... | 0.005115 |
def update_user_password(new_pwd_user_id, new_password,**kwargs):
"""
Update a user's password
"""
#check_perm(kwargs.get('user_id'), 'edit_user')
try:
user_i = db.DBSession.query(User).filter(User.id==new_pwd_user_id).one()
user_i.password = bcrypt.hashpw(str(new_password).encod... | 0.014675 |
def _ecc_static_length_signature(key, algorithm, digest):
"""Calculates an elliptic curve signature with a static length using pre-calculated hash.
:param key: Elliptic curve private key
:type key: cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePrivateKey
:param algorithm: Master algorithm t... | 0.004155 |
def astype(self, dtype):
"""Return a copy of this space with new ``dtype``.
Parameters
----------
dtype :
Scalar data type of the returned space. Can be provided
in any way the `numpy.dtype` constructor understands, e.g.
as built-in type or as a strin... | 0.001431 |
def reload(self, reload_timeout=300, save_config=True):
"""Reload the device.
CSM_DUT#reload
System configuration has been modified. Save? [yes/no]: yes
Building configuration...
[OK]
Proceed with reload? [confirm]
"""
SAVE_CONFIG = re.compile(re.escape(... | 0.001566 |
def create_config(cls, cfgfile, nick, twtfile, twturl, disclose_identity, add_news):
"""Create a new config file at the default location.
:param str cfgfile: path to the config file
:param str nick: nickname to use for own tweets
:param str twtfile: path to the local twtxt file
... | 0.00241 |
def move_file_to_directory(file_path, directory_path):
"""Moves file to given directory
:param file_path: path to file to move
:param directory_path: path to target directory where to move file
"""
file_name = os.path.basename(file_path) # get name of file
if not os.pat... | 0.003774 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.