text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def parse_genemap2(lines):
"""Parse the omim source file called genemap2.txt
Explanation of Phenotype field:
Brackets, "[ ]", indicate "nondiseases," mainly genetic variations that
lead to apparently abnormal laboratory test values.
Braces, "{ }", indicate mutations that contribute to suscept... | 0.007225 |
def root_item_selected(self, item):
"""Root item has been selected: expanding it and collapsing others"""
if self.show_all_files:
return
for root_item in self.get_top_level_items():
if root_item is item:
self.expandItem(root_item)
else:
... | 0.005479 |
def format(self, record):
"""
Formats a given log record to include the timestamp, log level, thread
ID and message. Colorized if coloring is available.
"""
if not self.is_tty:
return super(CLIHandler, self).format(record)
level_abbrev = record.levelname[0]
... | 0.002688 |
def _from_p(self, mode):
"""Convert the image from P or PA to RGB or RGBA."""
self._check_modes(("P", "PA"))
if not self.palette:
raise RuntimeError("Can't convert palettized image, missing palette.")
pal = np.array(self.palette)
pal = da.from_array(pal, chunks=pal.s... | 0.004115 |
async def delete(self):
"""Delete boot source selection."""
await self._handler.delete(
boot_source_id=self.boot_source.id, id=self.id) | 0.01227 |
def _sliced_shape(self, shapes, i, major_axis):
"""Get the sliced shapes for the i-th executor.
Parameters
----------
shapes : list of (str, tuple)
The original (name, shape) pairs.
i : int
Which executor we are dealing with.
"""
sliced_sh... | 0.004702 |
def pkt_check(*args, func=None):
"""Check if arguments are valid packets."""
func = func or inspect.stack()[2][3]
for var in args:
dict_check(var, func=func)
dict_check(var.get('frame'), func=func)
enum_check(var.get('protocol'), func=func)
real_check(var.get('timestamp'), fu... | 0.003724 |
def maybeReceiveAck(self, ackPacket):
"""
Receive an L{ack} or L{synAck} input from the given packet.
"""
ackPredicate = self.ackPredicate
self.ackPredicate = lambda packet: False
if ackPacket.syn:
# New SYN packets are always news.
self.synAck()
... | 0.005051 |
def DiffArrayObjects(self, oldObj, newObj, isElementLinks=False):
"""Method which deligates the diffing of arrays based on the type"""
if oldObj == newObj:
return True
if not oldObj or not newObj:
return False
if len(oldObj) != len(newObj):
__Log__.debug('DiffArrayObje... | 0.023283 |
def draw_marked_line(self, data, coordinates, linestyle, markerstyle,
label, mplobj=None):
"""Draw a line that also has markers.
If this isn't reimplemented by a renderer object, by default, it will
make a call to BOTH draw_line and draw_markers when both markerstyle
... | 0.00491 |
def _downsample(self, how, **kwargs):
"""
Downsample the cython defined function.
Parameters
----------
how : string / cython mapped function
**kwargs : kw args passed to how function
"""
# we may need to actually resample as if we are timestamps
... | 0.001402 |
def create_queue(self, vhost, name, **kwargs):
"""
Create a queue. The API documentation specifies that all of the body
elements are optional, so this method only requires arguments needed
to form the URI
:param string vhost: The vhost to create the queue in.
:param stri... | 0.003717 |
def run_ppm_server(pdb_file, outfile, force_rerun=False):
"""Run the PPM server from OPM to predict transmembrane residues.
Args:
pdb_file (str): Path to PDB file
outfile (str): Path to output HTML results file
force_rerun (bool): Flag to rerun PPM if HTML results file already exists
... | 0.001965 |
def add_mea(mea_yaml_path):
'''Adds the mea design defined by the yaml file in the install folder
Parameters
----------
mea_yaml_file
Returns
-------
'''
path = os.path.abspath(mea_yaml_path)
if path.endswith('.yaml') or path.endswith('.yml') and os.path.isfile(path):
wit... | 0.005028 |
def change_type(self, bucket, key, storage_type):
"""修改文件的存储类型
修改文件的存储类型为普通存储或者是低频存储,参考文档:
https://developer.qiniu.com/kodo/api/3710/modify-the-file-type
Args:
bucket: 待操作资源所在空间
key: 待操作资源文件名
storage_type: 待操作资源存储类型,0为普通存储,1为低频存储... | 0.006652 |
def join(self, other, on=None, how='left', lsuffix=None, rsuffix=None,
algorithm='merge', is_on_sorted=True, is_on_unique=True):
"""Database-like join this DataFrame with the other DataFrame.
Currently assumes the `on` columns are sorted and the on-column(s) values are unique!
Next... | 0.004087 |
def update(name=None,
pkgs=None,
refresh=True,
skip_verify=False,
normalize=True,
minimal=False,
obsoletes=False,
**kwargs):
'''
.. versionadded:: 2019.2.0
Calls :py:func:`pkg.upgrade <salt.modules.yumpkg.upgrade>` with
``obso... | 0.00319 |
def add_tileset(self, tileset):
""" Add a tileset to the map
:param tileset: TiledTileset
"""
assert (isinstance(tileset, TiledTileset))
self.tilesets.append(tileset) | 0.009662 |
def convert_elementwise_sub(
params, w_name, scope_name, inputs, layers, weights, names
):
"""
Convert elementwise subtraction.
Args:
params: dictionary with layer parameters
w_name: name prefix in state_dict
scope_name: pytorch scope name
inputs: pytorch node inputs
... | 0.001205 |
def get_live_weather(lat, lon, writer):
"""Gets the live weather via lat and long"""
requrl = FORECAST_BASE_URL+forecast_api_token+'/'+str(lat)+','+str(lon)
req = requests.get(requrl)
if req.status_code == requests.codes.ok:
weather = req.json()
if not weather['currently']:
c... | 0.003781 |
def _get_queries(self, migration, method):
"""
Get all of the queries that would be run for a migration.
:param migration: The migration
:type migration: eloquent.migrations.migration.Migration
:param method: The method to execute
:type method: str
:rtype: list... | 0.002387 |
def lookup(self, request_class: Request) -> Callable[[Request], BrightsideMessage]:
"""
Looks up the message mapper function associated with this class. Function should take in a Request derived class
and return a BrightsideMessage derived class, for sending on the wire
:param request_c... | 0.00821 |
def main(ctx, config, debug): # pragma: no cover
""" gilt - A GIT layering tool. """
ctx.obj = {}
ctx.obj['args'] = {}
ctx.obj['args']['debug'] = debug
ctx.obj['args']['config'] = config | 0.004831 |
def check_par(chrom, pos):
"""Check if a coordinate is in the PAR region
Args:
chrom(str)
pos(int)
Returns:
par(bool)
"""
par = False
for interval in PAR.get(chrom,[]):
if (pos >= interval[0] and pos <= interval[1]):
... | 0.017143 |
def evaluate(self,scope,local_vars,block=None):
''' Execute the compiled template and return the result string. Template
evaluation is guaranteed to be performed in the scope object with the
locals specified and with support for yielding to the block.
This method is only used by source generating t... | 0.044444 |
def save_settings(cls, project=None, user=None, settings=None):
"""
Save settings for a user without first fetching their preferences.
- **user** and **project** can be either a :py:class:`.User` and
:py:class:`.Project` instance respectively, or they can be given as
IDs. If... | 0.001457 |
def registerSimulator(self, name=None, hdl=None, analyze_cmd=None, elaborate_cmd=None, simulate_cmd=None):
''' Registers an HDL _simulator
name - str, user defined name, used to identify this _simulator record
hdl - str, case insensitive, (verilog, vhdl), the HDL to which the sim... | 0.00733 |
def _format_list(result):
"""Format list responses into a table."""
if not result:
return result
if isinstance(result[0], dict):
return _format_list_objects(result)
table = Table(['value'])
for item in result:
table.add_row([iter_to_table(item)])
return table | 0.003226 |
def _getPayload(self, record):
"""
The data that will be sent to loggly.
"""
payload = super(LogglyHandler, self)._getPayload(record)
payload['tags'] = self._implodeTags()
return payload | 0.008511 |
def GetMessages(self, formatter_mediator, event):
"""Determines the formatted message strings for an event object.
Args:
formatter_mediator (FormatterMediator): mediates the interactions
between formatters and other components, such as storage and Windows
EventLog resources.
eve... | 0.00495 |
def escape_tags(value, valid_tags):
"""
Strips text from the given html string, leaving only tags.
This functionality requires BeautifulSoup, nothing will be
done otherwise.
This isn't perfect. Someone could put javascript in here:
<a onClick="alert('hi');">test</a>
So if you use v... | 0.000796 |
def configure (command = None, condition = None, options = None):
"""
Configures a new resource compilation command specific to a condition,
usually a toolset selection condition. The possible options are:
* <rc-type>(rc|windres) - Indicates the type of options the command
... | 0.008709 |
def generate(self, mA=1, age=9.6, feh=0.0, n=1e5, ichrone='mist',
orbpop=None, bands=None, **kwargs):
"""
Generates population.
Called if :class:`MultipleStarPopulation` is initialized without
providing ``stars``, and if ``mA`` is provided.
"""
ichrone ... | 0.005496 |
def _get_attr_by_name_and_dimension(name, dimension_id):
"""
Search for an attribute with the given name and dimension_id.
If such an attribute does not exist, create one.
"""
attr = db.DBSession.query(Attr).filter(Attr.name==name, Attr.dimension_id==dimension_id).first()
if attr is No... | 0.011887 |
def Brkic_2011_1(Re, eD):
r'''Calculates Darcy friction factor using the method in Brkic
(2011) [2]_ as shown in [1]_.
.. math::
f_d = [-2\log(10^{-0.4343\beta} + \frac{\epsilon}{3.71D})]^{-2}
.. math::
\beta = \ln \frac{Re}{1.816\ln\left(\frac{1.1Re}{\ln(1+1.1Re)}\right)}
Paramet... | 0.000773 |
def filter_by_months_per_hour(self, months_per_hour):
"""Filter the Data Collection based on a list of months per hour (as strings).
Args:
months_per_hour: A list of tuples representing months per hour.
Each tuple should possess two values: the first is the month
... | 0.003708 |
def get_option_int(self, name, section=None, vars=None, expect=None):
"""Just like ``get_option`` but parse as an integer."""
val = self.get_option(name, section, vars, expect)
if val:
return int(val) | 0.008475 |
def write_ln(self, *text, sep=' '):
"""
Write line
:param text:
:param sep:
:return:
"""
if self.text and self.text[-1] != '\n':
self.text += '\n'
self.text += markdown.text(*text, sep) + '\n'
return self | 0.00692 |
def run(self, host: str="localhost", port: int=8000, debug: bool=False):
"""
start the http server
:param host: The listening host
:param port: The listening port
:param debug: whether it is in debug mod or not
"""
self.debug = debug
loop = asyncio.get_eve... | 0.012422 |
def _ParseValueData(self, parser_mediator, registry_key, registry_value):
"""Extracts event objects from a Explorer ProgramsCache value data.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
registry_key (dfwinr... | 0.007312 |
def report(usaf):
"""generate report for usaf base"""
fig = plt.figure()
ax = fig.add_subplot(111)
station_info = geo.station_info(usaf)
y = {}
for i in range(1991, 2011):
monthData = monthly(usaf, i)
t = sum(monthData)
y[i] = t
print t
tmy3tot = tmy3.total(us... | 0.000544 |
def angle(self, other):
"""Return the angle to the vector other"""
return math.acos(self.dot(other) / (self.magnitude() * other.magnitude())) | 0.019108 |
def check_sim_in(self):
'''check for FDM packets from runsim'''
try:
pkt = self.sim_in.recv(17*8 + 4)
except socket.error as e:
if not e.errno in [ errno.EAGAIN, errno.EWOULDBLOCK ]:
raise
return
if len(pkt) != 17*8 + 4:
# w... | 0.015117 |
def all_points_membership_vectors(clusterer):
"""Predict soft cluster membership vectors for all points in the
original dataset the clusterer was trained on. This function is more
efficient by making use of the fact that all points are already in the
condensed tree, and processing in bulk.
Paramete... | 0.000962 |
def _add_res(line):
'''
Analyse the line of local resource of ``drbdadm status``
'''
global resource
fields = line.strip().split()
if resource:
ret.append(resource)
resource = {}
resource["resource name"] = fields[0]
resource["local role"] = fields[1].split(":")[1]
... | 0.002618 |
def search(self):
"""Search for a url by returning the value from the first callback that
returns a non-None value"""
for cb in SearchUrl.search_callbacks:
try:
v = cb(self)
if v is not None:
return v
except Exception ... | 0.005764 |
def iter_chunks(l, size):
"""
Returns a generator containing chunks of *size* of a list, integer or generator *l*. A *size*
smaller than 1 results in no chunking at all.
"""
if isinstance(l, six.integer_types):
l = six.moves.range(l)
if is_lazy_iterable(l):
if size < 1:
... | 0.005 |
def get_processed_events(self) -> List[Event]:
"""Get all processed events.
This method is intended to be used to recover events stuck in the
processed state which could happen if an event handling processing
an processed event goes down before completing the event processing.
... | 0.002519 |
def maskname(mask):
"""
Returns the event name associated to mask. IN_ISDIR is appended to
the result when appropriate. Note: only one event is returned, because
only one event can be raised at a given time.
@param mask: mask.
@type mask: int
@return: event name.... | 0.003752 |
def split_sentences(text):
'''
The regular expression matches all sentence ending punctuation and splits the string at those points.
At this point in the code, the list looks like this ["Hello, world", "!" ... ]. The punctuation and all quotation marks
are separated from the actual text. The first s_ite... | 0.010743 |
def task_table(self, task_id=None):
"""Fetch and parse the task table information for one or more task IDs.
Args:
task_id: A hex string of the task ID to fetch information about. If
this is None, then the task object table is fetched.
Returns:
Informatio... | 0.001938 |
def alignment_chart(data):
"""Make the HighCharts HTML to plot the alignment rates """
keys = OrderedDict()
keys['reads_mapped'] = {'color': '#437bb1', 'name': 'Mapped'}
keys['reads_unmapped'] = {'color': '#b1084c', 'name': 'Unmapped'}
# Config for the plot
plot_conf = {
'id': 'samtools... | 0.001916 |
def defer_entity_syncing(wrapped, instance, args, kwargs):
"""
A decorator that can be used to defer the syncing of entities until after the method has been run
This is being introduced to help avoid deadlocks in the meantime as we attempt to better understand
why they are happening
"""
# Defer... | 0.002695 |
def print_app_tb_only(self, file):
"NOT_RPYTHON"
tb = self._application_traceback
if tb:
import linecache
print >> file, "Traceback (application-level):"
while tb is not None:
co = tb.frame.pycode
lineno = tb.get_lineno()
... | 0.006737 |
def get_events(self):
"""Get events from the cloud node."""
to_send = {'limit': 50}
response = self._send_data('POST', 'admin', 'get-events', to_send)
output = {'message': ""}
for event in response['events']:
desc = "Source IP: {ip}\n"
desc += "Datetime: ... | 0.002915 |
def _get_basilisp_bytecode(
fullname: str, mtime: int, source_size: int, cache_data: bytes
) -> List[types.CodeType]:
"""Unmarshal the bytes from a Basilisp bytecode cache file, validating the
file header prior to returning. If the file header does not match, throw
an exception."""
exc_details = {"n... | 0.002559 |
def event_env_updated(app, env):
"""Called by Sphinx during phase 3 (resolving).
* Find Imgur IDs that need to be queried.
* Query the Imgur API for new/outdated albums/images.
:param sphinx.application.Sphinx app: Sphinx application object.
:param sphinx.environment.BuildEnvironment env: Sphinx b... | 0.004386 |
def CsvToTable(self, buf, header=True, separator=","):
"""Parses buffer into tabular format.
Strips off comments (preceded by '#').
Optionally parses and indexes by first line (header).
Args:
buf: String file buffer containing CSV data.
header: Is the first line of buffer a header.
... | 0.001353 |
def hash(self):
'''
:rtype: int
:return: hash of the container
'''
hashed = super(Repeat, self).hash()
return khash(hashed, self._min_times, self._max_times, self._step, self._repeats) | 0.012931 |
def average_last_builds(connection, package, limit=5):
"""
Find the average duration time for the last couple of builds.
:param connection: txkoji.Connection
:param package: package name
:returns: deferred that when fired returns a datetime.timedelta object, or
None if there were no p... | 0.001112 |
def wrann(self, write_fs=False, write_dir=''):
"""
Write a WFDB annotation file from this object.
Parameters
----------
write_fs : bool, optional
Whether to write the `fs` attribute to the file.
"""
for field in ['record_name', 'extension']:
... | 0.003499 |
def tree_is_in_collection(collection, study_id=None, tree_id=None):
"""Takes a collection object (or a filepath to collection object), returns
True if it includes a decision to include the specified tree
"""
included = collection_to_included_trees(collection)
study_id = study_id.strip()
tree_id ... | 0.002058 |
def _perform_update_steps(
self, observ, action, old_policy_params, reward, length):
"""Perform multiple update steps of value function and policy.
The advantage is computed once at the beginning and shared across
iterations. We need to decide for the summary of one iteration, and thus
choose the... | 0.002041 |
def Sum(idx, *args, **kwargs):
"""Instantiator for an arbitrary indexed sum.
This returns a function that instantiates the appropriate
:class:`QuantumIndexedSum` subclass for a given term expression. It is the
preferred way to "manually" create indexed sum expressions, closely
resembling the normal... | 0.000287 |
def process_nxml(nxml_filename, pmid=None, extra_annotations=None,
cleanup=True, add_grounding=True):
"""Process an NXML file using the ISI reader
First converts NXML to plain text and preprocesses it, then runs the ISI
reader, and processes the output to extract INDRA Statements.
Par... | 0.000546 |
def get_kernel_ports(self, kernel_id):
"""Return a dictionary of ports for a kernel.
Parameters
==========
kernel_id : uuid
The id of the kernel.
Returns
=======
port_dict : dict
A dict of key, value pairs where the keys are the names
... | 0.00411 |
def to_long_time_string(self) -> str:
""" Return the iso time string only """
hour = self.time.hour
minute = self.time.minute
second = self.time.second
return f"{hour:02}:{minute:02}:{second:02}" | 0.008511 |
def list_objects(self, bucket_name, prefix='', recursive=False):
"""
List objects in the given bucket.
Examples:
objects = minio.list_objects('foo')
for current_object in objects:
print(current_object)
# hello
# hello/
... | 0.001297 |
def _validate_datetime_from_to(cls, start, end):
"""
validate from-to
:param start: Start Day(YYYYMMDD)
:param end: End Day(YYYYMMDD)
:return: None or MlbAmException
"""
if not start <= end:
raise MlbAmBadParameter("not Start Day({start}) <= End Day({e... | 0.008451 |
def _send(self, ip, port, data):
"""
Send an UDP message
:param ip: Ip to send to
:type ip: str
:param port: Port to send to
:type port: int
:return: Number of bytes sent
:rtype: int
"""
return self._listen_socket.sendto(data, (ip, port)) | 0.00627 |
def get_relationship_lookup_session_for_family(self, family_id=None, proxy=None, *args, **kwargs):
"""Gets the ``OsidSession`` associated with the relationship lookup service for the given family.
arg: family_id (osid.id.Id): the ``Id`` of the family
arg: proxy (osid.proxy.Proxy): a proxy... | 0.004461 |
def addMatch(self, callback, mtype=None, sender=None, interface=None,
member=None, path=None, path_namespace=None, destination=None,
arg=None, arg_path=None, arg0namespace=None):
"""
Creates a message matching rule, associates it with the specified
callback func... | 0.002441 |
def run_apidoc(_):
"""This method is required by the setup method below."""
import os
dirname = os.path.dirname(__file__)
ignore_paths = [os.path.join(dirname, '../../aaf2/model'),]
# https://github.com/sphinx-doc/sphinx/blob/master/sphinx/ext/apidoc.py
argv = [
'--force',
'--no-... | 0.003578 |
def _modify(item, func):
"""
Modifies each item.keys() string based on the func passed in.
Often used with inflection's camelize or underscore methods.
:param item: dictionary representing item to be modified
:param func: function to run on each key string
:return: dictionary where each key has... | 0.002232 |
def guess_mime_type(content, deftype):
"""Description: Guess the mime type of a block of text
:param content: content we're finding the type of
:type str:
:param deftype: Default mime type
:type str:
:rtype: <type>:
:return: <description>
"""
#Mappings recognized by cloudinit
s... | 0.012315 |
def object_to_dict(cls, obj):
"""
This function converts Objects into Dictionary
"""
dict_obj = dict()
if obj is not None:
if type(obj) == list:
dict_list = []
for inst in obj:
dict_list.append(cls.object_to_dict... | 0.001771 |
def normalize(arg=None):
"""Normalizes an argument for signing purpose.
This is used for normalizing the arguments of RPC method calls.
:param arg: The argument to normalize
:return: A string representating the normalized argument.
.. doctest::
>>> from cloud.rpc import normalize
>>> ... | 0.001711 |
def cluster_path(cls, project, instance, cluster):
"""Return a fully-qualified cluster string."""
return google.api_core.path_template.expand(
"projects/{project}/instances/{instance}/clusters/{cluster}",
project=project,
instance=instance,
cluster=cluster... | 0.006042 |
def address_line_1(self):
"""
This method returns the first line of the address.
:return:
"""
formalised_address = self.formalised_address
if formalised_address is None:
return
try:
address = formalised_address.split(',')
except Exc... | 0.005703 |
def link_to(self, source, transformation=None):
"""
Kervi values may be linked together.
A KerviValue is configured to be either an input or output.
When an output value is linked to an input value the input will become
an observer of the output. Every time the output value chan... | 0.00674 |
def is_image(file):
"""
Returns ``True`` if the file extension looks like an image file to Telegram.
"""
match = re.match(r'\.(png|jpe?g)', _get_extension(file), re.IGNORECASE)
if match:
return True
else:
return isinstance(resolve_bot_file_id(file), types.Photo) | 0.006623 |
def bootstrap_main(args):
"""
Main function explicitly called from the C++ code.
Return the main application object.
"""
version_info = sys.version_info
if version_info.major != 3 or version_info.minor < 6:
return None, "python36"
main_fn = load_module_as_package("nionui_app.nionswif... | 0.002268 |
def get_objects_without_object(self, obj_type, *child_types):
"""
:param obj_type: requested object type.
:param child_type: unrequested child types.
:return: all children of the requested type that do not have the unrequested child types.
"""
return [o for o in self.get_... | 0.007407 |
def ftr_process(url=None, content=None, config=None, base_url=None):
u""" process an URL, or some already fetched content from a given URL.
:param url: The URL of article to extract. Can be
``None``, but only if you provide both ``content`` and
``config`` parameters.
:type url: str, unicode... | 0.000434 |
def median(ls):
"""
Takes a list and returns the median.
"""
ls = sorted(ls)
return ls[int(floor(len(ls)/2.0))] | 0.007634 |
def set_process(self, process = None):
"""
Manually set the parent process. Use with care!
@type process: L{Process}
@param process: (Optional) Process object. Use C{None} for no process.
"""
if process is None:
self.__process = None
else:
... | 0.007225 |
def paschen_back_energies(fine_state, Bz):
r"""Return Paschen-Back regime energies for a given fine state and\
magnetic field.
>>> ground_state = State("Rb", 87, 5, 0, 1/Integer(2))
>>> Bz = 200.0
>>> Bz = Bz/10000
>>> for f_group in paschen_back_energies(ground_state, Bz):
... ... | 0.000619 |
def get_img_data(image, copy=True):
"""Return the voxel matrix of the Nifti file.
If safe_mode will make a copy of the img before returning the data, so the input image is not modified.
Parameters
----------
image: img-like object or str
Can either be:
- a file path to a Nifti image... | 0.004735 |
def sources(scheduled=False):
'''List all harvest sources'''
sources = actions.list_sources()
if scheduled:
sources = [s for s in sources if s.periodic_task]
if sources:
for source in sources:
msg = '{source.name} ({source.backend}): {cron}'
if source.periodic_tas... | 0.001621 |
def difference(self,other):
"""
Return a new DiscreteSet with the difference of the two sets, i.e.
all elements that are in self but not in other.
:param DiscreteSet other: Set to subtract
:rtype: DiscreteSet
:raises ValueError: if self is a set of everything
"""... | 0.005319 |
def run_cdk(self, command='deploy'): # pylint: disable=too-many-branches
"""Run CDK."""
response = {'skipped_configs': False}
cdk_opts = [command]
if not which('npm'):
LOGGER.error('"npm" not found in path or is not executable; '
'please ensure it i... | 0.000592 |
def convert_differend_width(src_reg, dst_reg):
"""
e.g.:
8bit $cd TFR into 16bit, results in: $ffcd
16bit $1234 TFR into 8bit, results in: $34
>>> reg8 = ValueStorage8Bit(name="bar", initial_value=0xcd)
>>> reg16 = ValueStorage16Bit(name="foo", initial_value=0x0000)
>>> hex(convert_di... | 0.000912 |
def parseArgs(args):
"""Parse Arguments
Used to parse the arguments passed to the script
Args:
args (list): A list of strings representing arguments to a script
Returns:
dict: Returns a dictionary with args as keys and the values sent with
them or True for valueless arguments
Raises:
ValueError: If ar... | 0.040816 |
def rotationType(self, value):
"""gets/sets the rotationType"""
if self._rotationType.lower() in self._rotationTypes and \
self._rotationType != value:
self._rotationType = value | 0.009217 |
def render(self, writer_options=None):
"""Renders the barcode using `self.writer`.
:parameters:
writer_options : Dict
Options for `self.writer`, see writer docs for details.
:returns: Output of the writers render method.
"""
options = Barcode.default... | 0.003268 |
def get_exporter(obj, name):
"""
Get an exporter for the
:param obj: object to export
:type obj: :class:`Component <cqparts.Component>`
:param name: registered name of exporter
:type name: :class:`str`
:return: an exporter instance of the given type
:rtype: :class:`Exporter`
:raises... | 0.001225 |
def call(self, inputs):
"""Runs the model to generate an intermediate representation of x_t.
Args:
inputs: A batch of image sequences `x_{1:T}` of shape
`[sample_shape, batch_size, timesteps, height, width,
channels]`.
Returns:
A batch of intermediate representations of shape [... | 0.001267 |
def list_rules(self):
"""Print a list of all rules"""
for rule in sorted(self.all_rules, key=lambda rule: rule.name):
print(rule)
if self.args.verbose:
for line in rule.doc.split("\n"):
print(" ", line) | 0.007117 |
def template_list(call=None):
'''
Return available Xen template information.
This returns the details of
each template to show number cores, memory sizes, etc..
.. code-block:: bash
salt-cloud -f template_list myxen
'''
templates = {}
session = _get_session()
vms = session... | 0.001927 |
def save_dtrajs(self, prefix='', output_dir='.',
output_format='ascii', extension='.dtraj'):
r"""Saves calculated discrete trajectories. Filenames are taken from
given reader. If data comes from memory dtrajs are written to a default
filename.
Parameters
---... | 0.003393 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.