text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def alter_1(self, given_container_name, container_name, meta, val):
"""Get the container_name of the container if a container is specified"""
meta.container = None
if not isinstance(container_name, six.string_types):
meta.container = container_name
container_name = contai... | 0.008043 |
def closer_than(self, mesh, radius):
"""
Check for proximity of points in the ``mesh``.
:param mesh:
:class:`openquake.hazardlib.geo.mesh.Mesh` instance.
:param radius:
Proximity measure in km.
:returns:
Numpy array of boolean values in the sa... | 0.002006 |
def shift(func, *args, **kwargs):
"""This function is basically a beefed up lambda x: func(x, *args, **kwargs)
:func:`shift` comes in handy when it is used in a pipeline with a function that
needs the passed value as its first argument.
:param func: a function
:param args: objects
:param kwarg... | 0.004225 |
def _child(self, path):
"""
Return a ConfigNode object representing a child node with the specified
relative path.
"""
if self._path:
path = '{}.{}'.format(self._path, path)
return ConfigNode(root=self._root, path=path) | 0.007168 |
def listeners_iter(self):
"""Return an iterator over the mapping of event => listeners bound.
The listener list(s) returned should **not** be mutated.
NOTE(harlowja): Each listener in the yielded (event, listeners)
tuple is an instance of the :py:class:`~.Listener` type, which
... | 0.003072 |
def get_provider_token(self, provider_secret):
"""
获取服务商凭证
https://work.weixin.qq.com/api/doc#90001/90143/91200
:param provider_secret: 服务商的secret,在服务商管理后台可见
:return: 返回的 JSON 数据包
"""
return self._post(
'service/get_provider_token',
data=... | 0.004494 |
def reduce_stack(array3D, z_function):
"""Return 2D array projection of the input 3D array.
The input function is applied to each line of an input x, y value.
:param array3D: 3D numpy.array
:param z_function: function to use for the projection (e.g. :func:`max`)
"""
xmax, ymax, _ = array3D.sha... | 0.001919 |
def padded_cross_entropy(logits,
labels,
label_smoothing,
weights_fn=weights_nonzero,
reduce_sum=True,
cutoff=0.0,
gaussian=False):
"""Compute cross-entropy assuming 0s... | 0.006048 |
def cpu_percent(interval=0.1, percpu=False):
"""Return a float representing the current system-wide CPU
utilization as a percentage.
When interval is > 0.0 compares system CPU times elapsed before
and after the interval (blocking).
When interval is 0.0 or None compares system CPU times elapsed
... | 0.00052 |
def w(self):
"""Extract write lock (w) counter if available (lazy)."""
if not self._counters_calculated:
self._counters_calculated = True
self._extract_counters()
return self._w | 0.00885 |
def create_qrcode(self, data):
"""
创建二维码
详情请参考 http://mp.weixin.qq.com/wiki/18/28fc21e7ed87bec960651f0ce873ef8a.html
:param data: 你要发送的参数 dict
:return: 返回的 JSON 数据包
"""
data = self._transcoding_dict(data)
return self.request.post(
url='https://... | 0.007634 |
def _zip_with_scalars(args):
"""Zips across args in order and replaces non-iterables with repeats."""
zipped = []
for arg in args:
if isinstance(arg, prettytensor.PrettyTensor):
zipped.append(arg if arg.is_sequence() else itertools.repeat(arg))
elif (isinstance(arg, collections.Sequence) and
... | 0.017682 |
def add_fast(self, filepath, hashfn=None, force=False):
"""
Bespoke function to add filepaths but set shortcircuit to True, which
means only the first calculable hash will be stored. In this way only
one "fast" hashing function need be called for each filepath.
"""
if has... | 0.004695 |
def Run(self, unused_arg):
"""Run the kill."""
# Send a message back to the service to say that we are about to shutdown.
reply = rdf_flows.GrrStatus(status=rdf_flows.GrrStatus.ReturnedStatus.OK)
# Queue up the response message, jump the queue.
self.SendReply(reply, message_type=rdf_flows.GrrMessage... | 0.002008 |
def p_network_sentence(self, t):
"""network_sentence : NETWORK VAR
| NETWORK VAR LPAREN features RPAREN"""
if len(t) == 3:
t[0] = network(t[2], reference=True, line=t.lineno(1))
else:
t[0] = network(t[2], t[4], line=t.lineno(1)) | 0.006557 |
def attach(self, host=None, source=None, sourcetype=None):
"""Opens a stream (a writable socket) for writing events to the index.
:param host: The host value for events written to the stream.
:type host: ``string``
:param source: The source value for events written to the stream.
... | 0.00652 |
def loop(self):
""" Enter loop, read user input then run command. Repeat """
while True:
text = compat.input('ctl > ')
command, args = self.parse_input(text)
if not command:
continue
response = self.call(command, *args)
respons... | 0.006098 |
def extract(input, output):
"""Extract public key from private key.
Given INPUT a private paillier key file as generated by generate, extract the
public key portion to OUTPUT.
Use "-" to output to stdout.
"""
log("Loading paillier keypair")
priv = json.load(input)
error_msg = "Invalid ... | 0.00381 |
def settings():
""" Fetch the middleware settings.
:return dict: settings
"""
# Get the user-provided settings
user_settings = dict(getattr(django_settings, _settings_key, {}))
user_settings_keys = set(user_settings.keys())
# Check for required but missing settings
missing = _required_s... | 0.001032 |
def generate_batches(sequence, batch_len=1, allow_partial=True, ignore_errors=True, verbosity=1):
"""Iterate through a sequence (or generator) in batches of length `batch_len`
http://stackoverflow.com/a/761125/623735
>>> [batch for batch in generate_batches(range(7), 3)]
[[0, 1, 2], [3, 4, 5], [6]]
... | 0.003562 |
def validate(self, proxy_ip, client_ip):
"""
Looks up the proxy identified by its IP, then verifies that
the given client IP may be introduced by that proxy.
:param proxy_ip: The IP address of the proxy.
:param client_ip: The IP address of the supposed client.
:returns:... | 0.002463 |
def writerow(self, row):
""" Writes a row to the CSV file """
self.writer.writerow(row)
# Fetch UTF-8 output from the queue ...
data = self.queue.getvalue()
# write to the target stream
self.stream.write(data)
# empty queue
self.queue.truncate(0)
s... | 0.005935 |
def _get_stddev_rock(self, mag, imt):
"""
Calculate and return total standard deviation for rock sites.
Implements formulae from table 3.
"""
C = self.COEFFS_ROCK_STDDERR[imt]
if mag > C['maxmag']:
return C['maxsigma']
else:
return C['sigm... | 0.005764 |
def update_channels(self):
"""Update the GUI to reflect channels and image listing.
"""
if not self.gui_up:
return
self.logger.debug("channel configuration has changed--updating gui")
try:
channel = self.fv.get_channel(self.chname)
except KeyErro... | 0.003141 |
def published(self, for_user=None, include_login_required=False):
"""
Override ``DisplayableManager.published`` to exclude
pages with ``login_required`` set to ``True``. if the
user is unauthenticated and the setting
``PAGES_PUBLISHED_INCLUDE_LOGIN_REQUIRED`` is ``False``.
... | 0.002037 |
def plot(self, grid=None, size=256, limits=None, square=False, center=None, weight=None, weight_stat="mean", figsize=None,
aspect="auto", f="identity", axes=None, xlabel=None, ylabel=None,
group_by=None, group_limits=None, group_colors='jet', group_labels=None, group_count=None,
v... | 0.005509 |
def dump_to_console(pylint_data):
"""
Displays pylint data to the console.
:param pylint_data:
:return:
"""
for key, value in list(pylint_data.items()):
if key not in ('errors', 'total', 'scores', 'average') and len(value) > 0:
print("\n*********** {}".format(key))
... | 0.005792 |
async def fetch_invite(self, url, *, with_counts=True):
"""|coro|
Gets an :class:`.Invite` from a discord.gg URL or ID.
.. note::
If the invite is for a guild you have not joined, the guild and channel
attributes of the returned :class:`.Invite` will be :class:`.Partia... | 0.004062 |
def _spectrum(self, photon_energy):
"""
Compute differential spectrum from pp interactions using Eq.71 and
Eq.58 of Kelner, S.R., Aharonian, F.A., and Bugayov, V.V., 2006
PhysRevD 74, 034018 (`arXiv:astro-ph/0606058
<http://www.arxiv.org/abs/astro-ph/0606058>`_).
Paramet... | 0.001301 |
def post_build(self, packet, payload):
"""Compute the 'records_number' field when needed"""
if self.records_number is None:
recnum = struct.pack("!H", len(self.records))
packet = packet[:6] + recnum + packet[8:]
return _ICMPv6.post_build(self, packet, payload) | 0.006494 |
def _set_current_subscript(self, active):
"""
sets the current subscript and keeps a counter of how ofter a particular subscript has been executed
this information is usefull when implementing a status update or plotting functions that depend on which subscript is being executed
keeps t... | 0.008547 |
def get_param(self):
"""Method to get current optimizer's parameter value
"""
cycle_progress = self.event_index / self.cycle_size
return self.start_value + ((self.end_value - self.start_value) / 2) * (1 - math.cos(math.pi * cycle_progress)) | 0.011029 |
def set_section(self, section):
"""Set a section. If section already exists, overwrite the old one.
"""
if not isinstance(section, Section):
raise Exception("You")
try:
self.remove_section(section.name)
except:
pass
self._sections[sec... | 0.008451 |
def register_rml_def(self,
location_type,
location,
filename=None,
**kwargs):
"""
Registers the rml file locations for easy access
Args:
-----
location_type: ['package_all',
... | 0.00369 |
def get_tree_from_branch(self, ref):
'''
Return a pygit2.Tree object matching a head ref fetched into
refs/remotes/origin/
'''
try:
return self.peel(self.repo.lookup_reference(
'refs/remotes/origin/{0}'.format(ref))).tree
except KeyError:
... | 0.005917 |
def _cache_get_last_in_slice(url_dict, start_int, total_int, authn_subj_list):
"""Return None if cache entry does not exist."""
key_str = _gen_cache_key_for_slice(url_dict, start_int, total_int, authn_subj_list)
# TODO: Django docs state that cache.get() should return None on unknown key.
try:
l... | 0.007576 |
def template_instance(self):
'''
parse the template instance node.
this is used to compute the location of the template definition structure.
Returns:
TemplateInstanceNode: the template instance.
'''
ofs = self.offset()
if self.unpack_byte(0x0) & 0x0F =... | 0.007177 |
def submit_tar(cl_args, unknown_args, tmp_dir):
'''
Extract and execute the java files inside the tar and then add topology
definition file created by running submitTopology
We use the packer to make a package for the tar and dump it
to a well-known location. We then run the main method of class
with the s... | 0.009756 |
def get_stp_mst_detail_output_cist_port_rx_bpdu_count(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_stp_mst_detail = ET.Element("get_stp_mst_detail")
config = get_stp_mst_detail
output = ET.SubElement(get_stp_mst_detail, "output")
c... | 0.003295 |
def paste(client, event, channel, nick, rest):
"Drop a link to your latest paste"
path = '/last/{nick}'.format(**locals())
paste_root = pmxbot.config.get('librarypaste', 'http://paste.jaraco.com')
url = urllib.parse.urljoin(paste_root, path)
auth = pmxbot.config.get('librarypaste auth')
resp = requests.head(url, ... | 0.021231 |
def lonlat2xyz(lon, lat):
"""Convert lon lat to cartesian."""
lat = xu.deg2rad(lat)
lon = xu.deg2rad(lon)
x = xu.cos(lat) * xu.cos(lon)
y = xu.cos(lat) * xu.sin(lon)
z = xu.sin(lat)
return x, y, z | 0.004464 |
def format_number(col, d):
"""
Formats the number X to a format like '#,--#,--#.--', rounded to d decimal places
with HALF_EVEN round mode, and returns the result as a string.
:param col: the column name of the numeric value to be formatted
:param d: the N decimal places
>>> spark.createDataFr... | 0.005556 |
def zfill(self, width):
"""
Pad strings in the Series/Index by prepending '0' characters.
Strings in the Series/Index are padded with '0' characters on the
left of the string to reach a total string length `width`. Strings
in the Series/Index with length greater or equal to `wi... | 0.001004 |
def circuit_to_latex(circ: Circuit,
qubits: Qubits = None,
document: bool = True) -> str:
"""
Create an image of a quantum circuit in LaTeX.
Can currently draw X, Y, Z, H, T, S, T_H, S_H, RX, RY, RZ, TX, TY, TZ,
TH, CNOT, CZ, SWAP, ISWAP, CCNOT, CSWAP, XX, YY, ... | 0.000143 |
def till(self):
""" Queries the current shop till and returns the amount
Returns
str -- Amount of NPs in shop till
Raises
parseException
"""
pg = self.usr.getPage("http://www.neopets.com/market.phtml?type=till")
try:
... | 0.015228 |
def _updateEndpoints(self,*args,**kwargs):
"""
Updates all endpoints except the one from which this slot was called.
Note: this method is probably not complete threadsafe. Maybe a lock is needed when setter self.ignoreEvents
"""
sender = self.sender()
if not self.ignore... | 0.01105 |
def EQ105(T, A, B, C, D):
r'''DIPPR Equation #105. Often used in calculating liquid molar density.
All 4 parameters are required. C is sometimes the fluid's critical
temperature.
.. math::
Y = \frac{A}{B^{1 + (1-\frac{T}{C})^D}}
Parameters
----------
T : float
Temperature, ... | 0.002014 |
def getkey(self, path, filename=None):
"""
Get single matching key for a path
"""
scheme, keys = self.getkeys(path, filename=filename)
try:
key = next(keys)
except StopIteration:
raise FileNotFoundError("Could not find object for: '%s'" % path)
... | 0.003311 |
def run(command, show=True, *args, **kwargs):
"""
Runs a shell comand on the remote server.
"""
if show:
print_command(command)
with hide("running"):
return _run(command, *args, **kwargs) | 0.004484 |
def add_firewalld_service(service, permanent=True):
""" adds a firewall rule """
yum_install(packages=['firewalld'])
with settings(hide('warnings', 'running', 'stdout', 'stderr'),
warn_only=True, capture=True):
p = ''
if permanent:
p = '--permanent'
sud... | 0.00241 |
def read_lsm_eventlist(fh):
"""Read LSM events from file and return as list of (time, type, text)."""
count = struct.unpack('<II', fh.read(8))[1]
events = []
while count > 0:
esize, etime, etype = struct.unpack('<IdI', fh.read(16))
etext = bytes2str(stripnull(fh.read(esize - 16)))
... | 0.002532 |
def compile_fetch(self, raw, doi_id):
"""
Loop over Raw and add selected items to Fetch with proper formatting
:param dict raw: JSON data from doi.org
:param str doi_id:
:return dict:
"""
fetch_dict = OrderedDict()
order = {'author': 'author', 'type': 'typ... | 0.008026 |
def filter_factory(global_conf, **local_conf):
"""Returns a WSGI filter app for use with paste.deploy."""
conf = global_conf.copy()
conf.update(local_conf)
def blacklist(app):
return BlacklistFilter(app, conf)
return blacklist | 0.003922 |
def calculate_md5(fileobject, size=2**16):
"""Utility function to calculate md5 hashes while being light on memory usage.
By reading the fileobject piece by piece, we are able to process content that
is larger than available memory"""
fileobject.seek(0)
md5 = hashlib.md5()
for data in iter(lamb... | 0.010292 |
def is_diagonal_matrix(mat, rtol=RTOL_DEFAULT, atol=ATOL_DEFAULT):
"""Test if an array is a diagonal matrix"""
if atol is None:
atol = ATOL_DEFAULT
if rtol is None:
rtol = RTOL_DEFAULT
mat = np.array(mat)
if mat.ndim != 2:
return False
return np.allclose(mat, np.diag(np.d... | 0.002809 |
def _load_url(url):
"""
Loads a URL resource from a remote server
"""
try:
response = requests.get(url)
return BytesIO(response.content)
except IOError as ex:
parser.error("{url} could not be loaded remotely! ({ex})".format(url=url, ex=ex)) | 0.007042 |
def dragdrop(self, chviewer, uris):
"""Called when a drop operation is performed on a channel viewer.
We are called back with a URL and we attempt to (down)load it if it
names a file.
"""
# find out our channel
chname = self.get_channel_name(chviewer)
self.open_ur... | 0.00551 |
def get_tree_type(tree):
"""
returns the type of the (sub)tree: Root, Nucleus or Satellite
Parameters
----------
tree : nltk.tree.ParentedTree
a tree representing a rhetorical structure (or a part of it)
"""
tree_type = tree.label()
assert tree_type in SUBTREE_TYPES, "tree_type:... | 0.002755 |
def transmute(df, *keep_columns, **kwargs):
"""
Creates columns and then returns those new columns and optionally specified
original columns from the DataFrame.
This works like `mutate`, but designed to discard the original columns used
to create the new ones.
Args:
*keep_columns: Colu... | 0.002593 |
def _base_repr_(self, html=False, show_name=True, **kwargs):
"""
Override the method in the astropy.Table class
to avoid displaying the description, and the format
of the columns
"""
table_id = 'table{id}'.format(id=id(self))
data_lines, outs = self.formatter._p... | 0.006649 |
def create_object(self, filename, img_properties=None):
"""Create an image object on local disk from the given file. The file
is copied to a new local directory that is created for the image object.
The optional list of image properties will be associated with the new
object together wit... | 0.003358 |
def applyEdits(self,
addFeatures=None,
updateFeatures=None,
deleteFeatures=None,
gdbVersion=None,
useGlobalIds=False,
rollbackOnFailure=True,
attachments=None):
"""
Thi... | 0.00366 |
def run_miner_if_free(self):
"""TODO: docstring"""
(address, username, password, device, tstart, tend) = read_config()
if self.dtype == 0:
self.run_miner_cmd = [
cpu_miner_path, '-o', address, '-O', '{}:{}'.format(
username, password)
... | 0.002008 |
def field_types(self):
"""
Access the field_types
:returns: twilio.rest.autopilot.v1.assistant.field_type.FieldTypeList
:rtype: twilio.rest.autopilot.v1.assistant.field_type.FieldTypeList
"""
if self._field_types is None:
self._field_types = FieldTypeList(sel... | 0.007444 |
def _pack3(obj, fp, **options):
"""
Serialize a Python object into MessagePack bytes.
Args:
obj: a Python object
fp: a .write()-supporting file-like object
Kwargs:
ext_handlers (dict): dictionary of Ext handlers, mapping a custom type
to a callable ... | 0.000401 |
def listsdm(sdm, file=None):
"""Generate a standard "listsdm" listing of(A)SDM dataset contents.
sdm (str)
The path to the (A)SDM dataset to parse
file (stream-like object, such as an opened file)
Where to print the human-readable listing. If unspecified, results
go to :data:`sys.stdout`.... | 0.002604 |
def ReportConfiguration(self, file):
""" Report configuration for logging purposes.
:param file: Destination for report details
:return: None
"""
print >> file, BuildReportLine("PED FILE", self.datasource)
print >> file, BuildReportLine("MAP FILE", self.mapfile) | 0.006431 |
def exclusive(via=threading.Lock):
"""
Mark a callable as exclusive
:param via: factory for a Lock to guard the callable
Guards the callable against being entered again before completion.
Explicitly raises a :py:exc:`RuntimeError` on violation.
:note: If applied to a method, it is exclusive a... | 0.001242 |
def evict(self, urls):
"""Remove items from cache matching URLs.
Return the number of items removed.
"""
if isinstance(urls, six.text_type):
urls = [urls]
urls = set(normalize_url(url) for url in urls)
retval = 0
for key in list(self.cache):
... | 0.004292 |
def FromDict(cls, obj):
"""Create an IOTileEvent from the result of a previous call to asdict().
Args:
obj (dict): A dictionary produced by a call to IOTileEvent.asdict()
Returns:
IOTileEvent: The converted IOTileEvent object.
"""
timestamp = obj.get('t... | 0.00753 |
def get_list(self, list_name, options=None):
"""
Get detailed metadata information about a list.
"""
options = options or {}
data = {'list': list_name}
data.update(options)
return self.api_get('list', data) | 0.007634 |
def uniq_by_id(self, records):
"""Only the first record for each id"""
uniq = []
keys = set()
for rec in records:
rec_id = rec[self._id_field]
if rec_id not in keys:
uniq.append(rec)
keys.add(rec_id)
return uniq | 0.006515 |
def rgb_to_hsl(r, g, b):
"""
Converts an RGB color value to HSL.
:param r: The red color value
:param g: The green color value
:param b: The blue color value
:return: The HSL representation
"""
r = float(r) / 255.0
g = float(g) / 255.0
b = float(b) / 255.0
max_value = max(r,... | 0.002347 |
def retention_period(self, value):
"""Set the retention period for items in the bucket.
:type value: int
:param value:
number of seconds to retain items after upload or release from
event-based lock.
:raises ValueError: if the bucket's retention policy is locked... | 0.00346 |
def add(envelope):
""" Take a dict-like fedmsg envelope and store the headers and message
in the table.
"""
message = envelope['body']
timestamp = message.get('timestamp', None)
try:
if timestamp:
timestamp = datetime.datetime.utcfromtimestamp(timestamp)
else:
... | 0.000608 |
def p_Revisions(self, p):
"""Revisions : Revisions Revision
| Revision"""
n = len(p)
if n == 3:
p[0] = ('Revisions', p[1][1] + [p[2]])
elif n == 2:
p[0] = ('Revisions', [p[1]]) | 0.007905 |
def insert(self, x1, x2, name = '', referedObject = []) :
"""Insert the segment in it's right place and returns it.
If there's already a segment S as S.x1 == x1 and S.x2 == x2. S.name will be changed to 'S.name U name' and the
referedObject will be appended to the already existing list"""
if x1 > x2 :
xx... | 0.051897 |
def are_equivalent(*args, **kwargs):
"""Indicate if arguments passed to this function are equivalent.
.. hint::
This checker operates recursively on the members contained within iterables
and :class:`dict <python:dict>` objects.
.. caution::
If you only pass one argument to this checke... | 0.003597 |
def readString(self):
"""
Reads and returns a string from the stream.
"""
length, is_reference = self._readLength()
if is_reference:
result = self.context.getString(length)
return self.context.getStringForBytes(result)
if length == 0:
... | 0.004274 |
def getOverlayErrorNameFromEnum(self, error):
"""
returns a string that corresponds with the specified overlay error. The string will be the name
of the error enum value for all valid error codes
"""
fn = self.function_table.getOverlayErrorNameFromEnum
result = fn(error... | 0.011662 |
def mahalanobis(self):
""""
Mahalanobis distance of measurement. E.g. 3 means measurement
was 3 standard deviations away from the predicted value.
Returns
-------
mahalanobis : float
"""
if self._mahalanobis is None:
self._mahalanobis = sqrt(f... | 0.007595 |
def set_name_filters(self, name_filters):
"""Set name filters"""
self.name_filters = name_filters
self.fsmodel.setNameFilters(name_filters) | 0.012048 |
def has_tokens(self, phrase):
"""
Checks if phrase or sub-phrase exists in the tree.
If set of phrases contains phrases such as: "state", "of the" and "state of the art", look up on:
"state" returns true, "of" returns null, "of the art" returns false.
:param phrase: Phrase or s... | 0.005252 |
def get_hyperparams_dict(self, id, display=True):
"""
Derived and returned the model parameters used to train the particular grid search model.
:param str id: The model id of the model with hyperparameters of interest.
:param bool display: Flag to indicate whether to display the hyperpa... | 0.009031 |
def display_event(div, attributes=[]):
"""
Function to build a suitable CustomJS to display the current event
in the div model.
"""
style = 'float: left; clear: left; font-size: 10pt'
return CustomJS(args=dict(div=div), code="""
var attrs = %s;
var args = [];
for (var i =... | 0.002296 |
def stop(self):
"""Stops read loop and closes socket if it has been created.
"""
self._running = False
if self._socket is None:
return
try:
self._socket.shutdown(socket.SHUT_RDWR)
self._socket.close()
except socket.error:
p... | 0.005698 |
def resolve_peer(self,
peer_id: Union[int, str]):
"""Use this method to get the InputPeer of a known peer_id.
This is a utility method intended to be used **only** when working with Raw Functions (i.e: a Telegram API
method you wish to use which is not available yet in the ... | 0.004035 |
def tag(self, name=None):
"""Create and list tag objects running git-tag command"""
command = ["git", "tag"]
if not name:
command.extend(
[
"-l",
"--sort=creatordate",
"--format=%(creatordate:short)%09%(ref... | 0.002703 |
def potential_from_grid(self, grid):
"""
Calculate the potential at a given set of arc-second gridded coordinates.
Parameters
----------
grid : grids.RegularGrid
The grid of (y,x) arc-second coordinates the deflection angles are computed on.
"""
eta =... | 0.009685 |
def _load_model(self):
"""
Loads the arena and pot object.
"""
super()._load_model()
self.mujoco_robot.set_base_xpos([0, 0, 0])
# load model for table top workspace
self.mujoco_arena = TableArena(
table_full_size=self.table_full_size, table_friction=s... | 0.004592 |
def export_urdf(mesh,
directory,
scale=1.0,
color=[0.75, 0.75, 0.75],
**kwargs):
"""
Convert a Trimesh object into a URDF package for physics simulation.
This breaks the mesh into convex pieces and writes them to the same
directory as the .... | 0.000354 |
def get_contract_factory(self, name: ContractName) -> Contract:
"""
Return the contract factory for a given contract type, generated from the data vailable
in ``Package.manifest``. Contract factories are accessible from the package class.
.. code:: python
Owned = OwnedPackag... | 0.00384 |
def p_NsContentNameAsId(p):
'''
NsContentNameAsId : DefOrConstModifier NsContentName
| DefOrConstModifier NsContentName AS INDENTIFIER
'''
if len(p) <= 3:
p[0] = NsContentNameAsId(p[1], p[2], None)
else:
p[0] = NsContentNameAsId(p[1], p[2], p[4]) | 0.003289 |
def set_images(self, text, parse_html=True):
""" set_images: Replace image strings with downloaded image checksums
Args:
text (str): text to parse for image strings
Returns:string with checksums in place of image strings and
list of files that were downloa... | 0.002947 |
def load_csv(self):
""" Load old benchmark results from CSV. """
if path.exists(self.csv_filepath):
self.results = self.results.append(
pandas.read_csv(self.csv_filepath)) | 0.009302 |
def get_segments_intersections(segment1, segment2):
"""Return at least one point in a list where segments intersect if an
intersection exists. Otherwise, return an empty list.
>>> get_segments_intersections(LineSegment(Point(0,0), Point(1,0)), \
LineSegment(Point(0,0), ... | 0.000232 |
def processFlat(self):
"""Main process.
Returns
-------
est_idxs : np.array(N)
Estimated indeces the segment boundaries in frame indeces.
est_labels : np.array(N-1)
Estimated labels for the segments.
"""
# Preprocess to obtain features (arr... | 0.003601 |
def _step1func(self, force, ipyclient):
""" hidden wrapped function to start step 1 """
## check input data files
sfiles = self.paramsdict["sorted_fastq_path"]
rfiles = self.paramsdict["raw_fastq_path"]
## do not allow both a sorted_fastq_path and a raw_fastq
if sfiles ... | 0.008454 |
def max(self):
"""
:returns the maximum of the column
"""
res = self._qexec("max(%s)" % self._name)
if len(res) > 0:
self._max = res[0][0]
return self._max | 0.009302 |
def add_options(self, path: str, handler: _WebHandler,
**kwargs: Any) -> AbstractRoute:
"""
Shortcut for add_route with method OPTIONS
"""
return self.add_route(hdrs.METH_OPTIONS, path, handler, **kwargs) | 0.011719 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.