text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def b2u(string):
""" bytes to unicode """
if (isinstance(string, bytes) or
(PY2 and isinstance(string, str))):
return string.decode('utf-8')
return string | 0.010989 |
def _set_addpath_select(self, v, load=False):
"""
Setter method for addpath_select, mapped from YANG variable /routing_system/router/router_bgp/address_family/ipv6/ipv6_unicast/af_ipv6_vrf/af_additional_paths/addpath_select (container)
If this variable is read-only (config: false) in the
source YANG fil... | 0.004983 |
def convert_embedding(builder, layer, input_names, output_names, keras_layer):
"""Convert a dense layer from keras to coreml.
Parameters
keras_layer: layer
----------
A keras layer object.
builder: NeuralNetworkBuilder
A neural network builder object.
"""
# Get input and ou... | 0.019759 |
def clipping_params(ts, capacity=100, rate_limit=float('inf'), method=None, max_attempts=100):
"""Start, end, and threshold that clips the value of a time series the most, given a limitted "capacity" and "rate"
Assumes that signal can be linearly interpolated between points (trapezoidal integration)
Argum... | 0.007104 |
def secure(view_func):
"""Handles SSL redirect on the view level."""
@wraps(view_func, assigned=available_attrs(view_func))
def _wrapped_view(request, *args, **kwargs):
if not request.is_secure():
redirect = _redirect(request, True)
if redirect:
# Redirect mi... | 0.002169 |
async def _resolve_params(self,
params: Dict[Text, Any],
request: Optional['Request']):
"""
If any StringToTranslate was passed as parameter then it is rendered
at this moment.
"""
out = {}
for k, v in params.i... | 0.008147 |
def mean_by_window(self, indices, window):
"""
Average series across multiple windows specified by their centers.
Parameters
----------
indices : array-like
List of times specifying window centers
window : int
Window size
"""
mask... | 0.006135 |
def cohesion(self, d=100):
""" Boids move towards the flock's centre of mass.
The centre of mass is the average position of all boids,
not including itself (the "perceived centre").
"""
vx = vy = vz = 0
for b in self.boids:
... | 0.01487 |
def _filter(self, query, **kwargs):
"""
Filter a query with user-supplied arguments.
"""
query = self._auto_filter(query, **kwargs)
return query | 0.010811 |
def wrap(self, alias=None):
"""
Wraps the query by selecting all fields from itself
:rtype: :class:`Query <querybuilder.query.Query>`
:return: The wrapped query
"""
field_names = self.get_field_names()
query = Query(self.connection).from_table(deepcopy(self), ali... | 0.003824 |
def get_x_inds(self, *dynac_type):
"""
Return the indices into the lattice list attribute of elements whose Dynac
type matches the input string. Multiple input strings can be given, either
as a comma-separated list or as a genuine Python list.
"""
return [i for i, x in e... | 0.012853 |
def _ncc_c(x, y):
"""
>>> _ncc_c([1,2,3,4], [1,2,3,4])
array([ 0.13333333, 0.36666667, 0.66666667, 1. , 0.66666667,
0.36666667, 0.13333333])
>>> _ncc_c([1,1,1], [1,1,1])
array([ 0.33333333, 0.66666667, 1. , 0.66666667, 0.33333333])
>>> _ncc_c([1,2,3], [-1,-1,-1... | 0.001468 |
def _bfd_tx(self, **kwargs):
"""Return the BFD minimum transmit interval XML.
You should not use this method.
You probably want `BGP.bfd`.
Args:
min_tx (str): BFD transmit interval in milliseconds (300, 500, etc)
delete (bool): Remove the configuration if ``True... | 0.002594 |
def export_public_key(vk, label):
"""
Export public key to text format.
The resulting string can be written into a .pub file or
appended to the ~/.ssh/authorized_keys file.
"""
key_type, blob = serialize_verifying_key(vk)
log.debug('fingerprint: %s', fingerprint(blob))
b64 = base64.b64e... | 0.002398 |
def default_loc_scale_fn(
is_singular=False,
loc_initializer=tf.compat.v1.initializers.random_normal(stddev=0.1),
untransformed_scale_initializer=tf.compat.v1.initializers.random_normal(
mean=-3., stddev=0.1),
loc_regularizer=None,
untransformed_scale_regularizer=None,
loc_constraint=Non... | 0.001813 |
def dataframe(self):
"""
Returns a pandas DataFrame where each row is a representation of the
Game class. Rows are indexed by the boxscore string.
"""
frames = []
for game in self.__iter__():
df = game.dataframe
if df is not None:
f... | 0.004785 |
def assignrepr(self, prefix):
"""Return a |repr| string with a prefixed assignment."""
caller = 'Timegrids('
blanks = ' ' * (len(prefix) + len(caller))
prefix = f'{prefix}{caller}'
lines = [f'{self.init.assignrepr(prefix)},']
if self.sim != self.init:
lines.ap... | 0.00463 |
def message(title="", text="", width=DEFAULT_WIDTH,
height=DEFAULT_HEIGHT, timeout=None):
"""
Display a simple message
:param text: text inside the window
:type text: str
:param title: title of the window
:type title: str
:param width: window width
:type width: int
:para... | 0.001786 |
def schema_org(builder):
# pylint: disable=line-too-long
"""Builds schema.org microdata for DatasetSearch from DatasetBuilder.
Markup spec: https://developers.google.com/search/docs/data-types/dataset#dataset
Testing tool: https://search.google.com/structured-data/testing-tool
For Google Dataset Search: http... | 0.011226 |
def _collect_classes(
self, package_paths: Sequence[str], recurse_subpackages: bool = True
) -> Sequence[type]:
"""
Collect all classes defined in/under ``package_paths``.
"""
import uqbar.apis
classes = []
initial_source_paths: Set[str] = set()
# Gra... | 0.002516 |
def _build_credentials_tuple(mech, source, user, passwd, extra, database):
"""Build and return a mechanism specific credentials tuple.
"""
if mech != 'MONGODB-X509' and user is None:
raise ConfigurationError("%s requires a username." % (mech,))
if mech == 'GSSAPI':
if source is not None ... | 0.000529 |
def default(cls):
"Make the current foreground color the default."
wAttributes = cls._get_text_attributes()
wAttributes &= ~win32.FOREGROUND_MASK
wAttributes |= win32.FOREGROUND_GREY
wAttributes &= ~win32.FOREGROUND_INTENSITY
cls._set_text_attributes(wAttributes) | 0.009615 |
def find_in_data_path(filename):
"""Searches for a file within Fuel's data path.
This function loops over all paths defined in Fuel's data path and
returns the first path in which the file is found.
Parameters
----------
filename : str
Name of the file to find.
Returns
-------... | 0.001239 |
def _add_gene_to_graph(self, gene, variant_bnode, gene_id, relation):
"""
:param gene:
:param variant_bnode:
:return:
"""
model = Model(self.graph)
if gene_id:
self.graph.addTriple(variant_bnode, relation, gene_id)
elif gene:
LOG.in... | 0.005245 |
def makefile(self, sock, mode='r', bufsize=-1):
"""Return socket file object."""
cls = (
SSLFileobjectStreamReader
if 'r' in mode else
SSLFileobjectStreamWriter
)
if SSL and isinstance(sock, ssl_conn_type):
wrapped_socket = cls(sock, mode, ... | 0.003448 |
def create_alignment(self, x_align=0, y_align=0, x_scale=0, y_scale=0):
"""
Function creates an alignment
"""
align = Gtk.Alignment()
align.set(x_align, y_align, x_scale, y_scale)
return align | 0.008333 |
def get_dsub_version():
"""Get the dsub version out of the _dsub_version.py source file.
Setup.py should not import dsub version from dsub directly since ambiguity in
import order could lead to an old version of dsub setting the version number.
Parsing the file directly is simpler than using import tools (whos... | 0.006881 |
def plot_voight_painting(painting, palette='colorblind', flank='right',
ax=None, height_factor=0.01):
"""Plot a painting of shared haplotype prefixes.
Parameters
----------
painting : array_like, int, shape (n_variants, n_haplotypes)
Painting array.
ax : axes, optio... | 0.000656 |
def setBuildProperty(self, bid, name, value, source):
""" A kind of create_or_update, that's between one or two queries per
call """
def thd(conn):
bp_tbl = self.db.model.build_properties
self.checkLength(bp_tbl.c.name, name)
self.checkLength(bp_tbl.c.source, ... | 0.001838 |
def _get_parameters_from_request(self, request, exception=False):
"""Get parameters to log in OPERATION_LOG."""
user = request.user
referer_url = None
try:
referer_dic = urlparse.urlsplit(
urlparse.unquote(request.META.get('HTTP_REFERER')))
referer... | 0.001399 |
def on_execute__set_video_config(self, request):
'''
.. versionchanged:: 0.12
Accept empty video configuration as either `None` or an empty
`pandas.Series`.
'''
data = decode_content_data(request)
compare_fields = ['device_name', 'width', 'height', 'name',... | 0.001649 |
def list_templates(call=None):
'''
Lists all templates available to the user and the user's groups.
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt-cloud -f list_templates opennebula
'''
if call == 'action':
raise SaltCloudSystemExit(
'The li... | 0.001427 |
def mass_3d_lens(self, r, theta_E, gamma, e1, e2):
"""
computes the spherical power-law mass enclosed (with SPP routiune)
:param r:
:param theta_E:
:param gamma:
:param q:
:param phi_G:
:return:
"""
return self.spp.mass_3d_lens(r, theta_E, ... | 0.006135 |
def build_suite(args):
"""Build a test suite by loading TAP files or a TAP stream."""
loader = Loader()
if len(args.files) == 0 or args.files[0] == "-":
suite = loader.load_suite_from_stdin()
else:
suite = loader.load(args.files)
return suite | 0.003597 |
def find_group_consistencies(groups1, groups2):
r"""
Returns a measure of group consistency
Example:
>>> # ENABLE_DOCTEST
>>> from utool.util_alg import * # NOQA
>>> groups1 = [[1, 2, 3], [4], [5, 6]]
>>> groups2 = [[1, 2], [4], [5, 6]]
>>> common_groups = find_grou... | 0.001416 |
def list_records(zone_id, profile, type=None):
'''
List records for the given zone_id on the given profile
:param zone_id: Zone to export.
:type zone_id: ``str``
:param profile: The profile key
:type profile: ``str``
:param type: The record type, e.g. A, NS
:type type: ``str``
... | 0.002762 |
def init_widget(self):
""" Initialize the underlying widget.
"""
super(AndroidTextView, self).init_widget()
d = self.declaration
w = self.widget
if d.input_type:
self.set_input_type(d.input_type)
w.addTextChangedListener(w.getId())
w.o... | 0.005525 |
def as_sql(self, qn, connection):
"""
Create the proper SQL fragment. This inserts something like
"(T0.flags & value) != 0".
This will be called by Where.as_sql()
"""
engine = connection.settings_dict['ENGINE'].rsplit('.', -1)[-1]
if engine.startswith('postgres')... | 0.005435 |
def _tmpfile(self, cache_key, use):
"""Allocate tempfile on same device as cache with a suffix chosen to prevent collisions"""
with temporary_file(suffix=cache_key.id + use, root_dir=self._cache_root,
permissions=self._permissions) as tmpfile:
yield tmpfile | 0.010169 |
def get_size(self, value=None):
"""Return the action length including the padding (multiple of 8)."""
if isinstance(value, ActionHeader):
return value.get_size()
elif value is None:
current_size = super().get_size()
return ceil(current_size / 8) * 8
ra... | 0.005195 |
def convert(model, image_input_names=[], is_bgr=False,
red_bias=0.0, blue_bias=0.0, green_bias=0.0, gray_bias=0.0,
image_scale=1.0, class_labels=None, predicted_feature_name=None, model_precision=_MLMODEL_FULL_PRECISION):
"""
Convert a Caffe model to Core ML format.
Parameters
-... | 0.006453 |
def get_model_class(name):
"""
This is being implemented to help
with the Email Module, where we
want to use a model for the email
context without needing to import
the model (which is most cases create
a circular dependency, anyway)
Beware that currently implementation
returns the ... | 0.002469 |
def lookupFunction(self, proto, name, namespace):
"""Return a callable to invoke when executing the named command.
"""
# Try to find a method to be invoked in a transaction first
# Otherwise fallback to a "regular" method
fName = self.autoDispatchPrefix + name
fObj = geta... | 0.002494 |
def ghmean(nums):
"""Return geometric-harmonic mean.
Iterates between geometric & harmonic means until they converge to
a single value (rounded to 12 digits).
Cf. https://en.wikipedia.org/wiki/Geometric-harmonic_mean
Parameters
----------
nums : list
A series of numbers
Retur... | 0.001148 |
def parse_uk_postcode(postcode, strict=True, incode_mandatory=True):
'''Split UK postcode into outcode and incode portions.
Arguments:
postcode The postcode to be split.
strict If true, the postcode will be validated according to
the rules as specified at... | 0.000925 |
def grep_file(query, item):
"""This function performs the actual grep on a given file."""
return ['%s: %s' % (item, line) for line in open(item)
if re.search(query, line)] | 0.005236 |
def do_loop_turn(self):
# pylint: disable=too-many-branches, too-many-statements, too-many-locals
"""Loop turn for Arbiter
If not a master daemon, wait for my master death...
Else, run:
* Check satellites are alive
* Check and dispatch (if needed) the configuration
... | 0.001933 |
def record(cls_def):
"""
Namedtuple which could inherit from other types.
>>> from Redy.Magic.Classic import record
>>> class Interface: pass
>>> @record
>>> class S(Interface):
>>> name: str
>>> addr: str
>>> sex : int
>>> s = S("sam", "I/O", 1)
"""
annotati... | 0.003745 |
def read(self, size=-1):
"Reads up to size bytes, but always completes the last line."
buf = self.fin.read(size)
if not buf:
return ''
lines = buf.splitlines()
# Read the rest of the last line if necessary
if not buf.endswith('\n'):
last = lines.po... | 0.003604 |
def get_descriptors_in_module(mdl, submodule=True):
r"""Get descriptors in module.
Parameters:
mdl(module): module to search
submodule(bool): search recursively
Returns:
Iterator[Descriptor]
"""
__all__ = getattr(mdl, "__all__", None)
if __all__ is None:
__all_... | 0.001307 |
def winner(self):
'The winner of this board if one exists.'
for potential_win in self._potential_wins():
if potential_win == tuple('XXX'):
return Outcome.win_for_crosses
elif potential_win == tuple('OOO'):
return Outcome.win_for_naughts
if ... | 0.004938 |
def update(x, P, z, R, H=None, return_all=False):
"""
Add a new measurement (z) to the Kalman filter. If z is None, nothing
is changed.
This can handle either the multidimensional or unidimensional case. If
all parameters are floats instead of arrays the filter will still work,
and return float... | 0.002636 |
def generateIdentityKeyPair():
"""
Generate an identity key pair. Clients should only do this once,
at install time.
@return the generated IdentityKeyPair.
"""
keyPair = Curve.generateKeyPair()
publicKey = IdentityKey(keyPair.getPublicKey())
serialized = ... | 0.005865 |
def to_html(self, index=False, escape=False, header=True,
collapse_table=True, class_outer="table_outer", **kargs):
"""Return HTML version of the table
This is a wrapper of the to_html method of the pandas dataframe.
:param bool index: do not include the index
:param bool e... | 0.002161 |
def getContent(self):
"""
Returns:
str: Content of tag (everything between `opener` and `endtag`).
"""
if not self.isTag() and self._element:
return self._element
if not self.childs:
return ""
output = ""
for c in self.childs:... | 0.004124 |
def do_help(self, arg):
"""Help command.
Usage:
help [command]
Parameters:
command: Optional - command name to display detailed help
"""
cmds = arg.split()
if cmds:
func = getattr(self, 'do_{}'.format(cmds[0]))
if func:
... | 0.002639 |
def run(command, exit, silent, check):
"""
Runs given command on all repos and checks status
$ maintain repo run -- git checkout master
"""
status = 0
for (repo, path) in gather_repositories():
if check and not check_repo(repo, path):
status = 1
if exit:
... | 0.001464 |
def update_installed_files(self, installed_files):
"""
Track the files installed by a package so pip knows how to remove the package.
This method is used by :func:`install_binary_dist()` (which collects
the list of installed files for :func:`update_installed_files()`).
:param i... | 0.00632 |
def convert_notebook(self, fname):
"""Convert an IPython notebook to a Python script in editor"""
try:
script = nbexporter().from_filename(fname)[0]
except Exception as e:
QMessageBox.critical(self, _('Conversion error'),
_("It was... | 0.009381 |
def typechecked_func(func, force = False, argType = None, resType = None, prop_getter = False):
"""Works like typechecked, but is only applicable to functions, methods and properties.
"""
if not pytypes.checking_enabled and not pytypes.do_logging_in_typechecked:
return func
assert(_check_as_func... | 0.017497 |
def apply_to(self, launchable):
"""
Apply this ISCM configuration into a launchable resource, such as
an EC2 instance or an AutoScalingGroup LaunchConfig.
"""
# Update user data
if launchable.get_property("UserData") is not None:
raise NotImplementedError("It'... | 0.009291 |
def positions(self):
"""Initial position for each particle. Shape (N, 3, 1)."""
return np.vstack([p.r0 for p in self]).reshape(len(self), 3, 1) | 0.012579 |
def get_text(self):
'''
::returns:
a rendered string representation of the given row
'''
row_lines = []
for line in zip_longest(*[column.get_cell_lines() for column in self.columns], fillvalue=' '):
row_lines.append(' '.join(line))
return '\n'... | 0.008929 |
def grayspec(k):
"""
List of gray-scale colors in HSV space as web hex triplets.
For integer argument k, returns list of `k` gray-scale colors, increasingly
light, linearly in the HSV color space, as web hex triplets.
Technical dependency of :func:`tabular.spreadsheet.aggregate_in`.
**Parame... | 0.003053 |
def list_distinfo_files(self):
"""
Iterates over the ``RECORD`` entries and returns paths for each line if
the path is pointing to a file located in the ``.dist-info`` directory
or one of its subdirectories.
:returns: iterator of paths
"""
base = os.path.dirname(... | 0.003322 |
def get_top_priority(self):
"""Pops the element that has the top (smallest) priority.
:returns: element with the top (smallest) priority.
:raises: IndexError -- Priority queue is empty.
"""
if self.is_empty():
raise IndexError("Priority queue is empty.")
_, ... | 0.004292 |
def ls(args):
"""
lexibank ls [COLS]+
column specification:
- license
- lexemes
- macroareas
"""
db = Database(args.db)
db.create(exists_ok=True)
in_db = {r[0]: r[1] for r in db.fetchall('select id, version from dataset')}
# FIXME: how to smartly choose columns?
table = ... | 0.001982 |
def calc_wtd_exp(skydir, ltc, event_class, event_types,
egy_bins, cth_bins, fn, nbin=16):
"""Calculate the effective exposure.
Parameters
----------
skydir : `~astropy.coordinates.SkyCoord`
ltc : `~fermipy.irfs.LTCube`
nbin : int
Number of points per decade with w... | 0.003521 |
def snapshots(self, xml_bytes):
"""Parse the XML returned by the C{DescribeSnapshots} function.
@param xml_bytes: XML bytes with a C{DescribeSnapshotsResponse} root
element.
@return: A list of L{Snapshot} instances.
TODO: ownersSet, restorableBySet, ownerId, volumeSize, des... | 0.001835 |
def write_newick(rootnode,
features=None,
format=1,
format_root_node=True,
is_leaf_fn=None,
dist_formatter=None,
support_formatter=None,
name_formatter=None):
"""
Iteratively export a tree structure and returns its NHX
representation.
"""
newick = []
leaf = is_leaf_fn if... | 0.012971 |
def check_output_command(file_path, head=None, tail=None):
'''call check_output command to read content from a file'''
if os.path.exists(file_path):
if sys.platform == 'win32':
cmds = ['powershell.exe', 'type', file_path]
if head:
cmds += ['|', 'select', '-first',... | 0.001176 |
def get_handle(self, filepath):
"""Get the `FileHandle` object associated to a particular file """
localpath = self._get_localpath(filepath)
return self._cache[localpath] | 0.010309 |
def EnumerateQualifiers(self, namespace=None, **extra):
# pylint: disable=invalid-name
"""
Enumerate the qualifier types (= qualifier declarations) in a
namespace.
This method performs the EnumerateQualifiers operation
(see :term:`DSP0200`). See :ref:`WBEM operations` fo... | 0.000945 |
def transact(self, f, *a, **k):
"""
Execute C{f(*a, **k)} in the context of a database transaction.
Any changes made to this L{Store} by C{f} will be committed when C{f}
returns. If C{f} raises an exception, those changes will be reverted
instead.
If a transaction is a... | 0.002668 |
def write(self, data):
''' This could be a bit less clumsy. '''
if data == '\n': # print does this
return self.stream.write(data)
else:
bytes_ = 0
for line in data.splitlines(True):
nl = ''
if line.endswith('\n'): # mv nl to e... | 0.003311 |
def get_tmpfile(requested_tmpdir=None, prefix=""):
'''get a temporary file with an optional prefix. By default will be
created in /tmp unless SREGISTRY_TMPDIR is set. By default, the file
is closed (and just a name returned).
Parameters
==========
requested_tmpdir: an optional re... | 0.002389 |
def from_config(cls, config, name, section_key="segmenters"):
"""
Constructs a segmenter from a configuration doc.
"""
section = config[section_key][name]
segmenter_class_path = section['class']
Segmenter = yamlconf.import_module(segmenter_class_path)
return Segme... | 0.005333 |
def insert(self, meter_db):
""" Insert to :class:`~ekmmeters.MeterDB` subclass.
Please note MeterDB subclassing is only for simplest-case.
Args:
meter_db (MeterDB): Instance of subclass of MeterDB.
"""
if meter_db:
meter_db.dbInsert(self.m_req, self.m_r... | 0.004515 |
def compare_networks(self, other):
"""Compare two IP objects.
This is only concerned about the comparison of the integer
representation of the network addresses. This means that the
host bits aren't considered at all in this method. If you want
to compare host bits, you can ea... | 0.001074 |
def get_app_env():
"""
if the app and the envi are passed in the command line as 'app=$app:$env'
:return: tuple app, env
"""
app, env = None, get_env()
if "app" in os.environ:
app = os.environ["app"].lower()
if ":" in app:
app, env = os.environ["app"].split(":", 2)
... | 0.002762 |
def encode_message(self):
"""Encode message to AMQP wire-encoded bytearray.
:rtype: bytearray
"""
if not self._message:
raise ValueError("No message data to encode.")
cloned_data = self._message.clone()
self._populate_message_attributes(cloned_data)
e... | 0.004525 |
def create(iterations=1000, distance=1.0, layout=LAYOUT_SPRING, depth=True):
""" Returns a new graph with predefined styling.
"""
#global _ctx
_ctx.colormode(_ctx.RGB)
g = graph(iterations, distance, layout)
# Styles for different types of nodes.
s = style.style
... | 0.023922 |
def _convert_value_to_native(value):
"""
Converts pysnmp objects into native Python objects.
"""
if isinstance(value, Counter32):
return int(value.prettyPrint())
if isinstance(value, Counter64):
return int(value.prettyPrint())
if isinstance(value, Gauge32):
return int(val... | 0.001056 |
def parse_comments(document, xmlcontent):
"""Parse comments document.
Comments are defined in file 'comments.xml'
"""
comments = etree.fromstring(xmlcontent)
document.comments = {}
for comment in comments.xpath('.//w:comment', namespaces=NAMESPACES):
# w:author
# w:id
... | 0.002725 |
def variational_lower_bound(params, t, logprob, sampler, log_density,
num_samples, rs):
"""Provides a stochastic estimate of the variational lower bound,
for any variational family and model density."""
samples = sampler(params, num_samples, rs)
log_qs = log_density(params... | 0.001996 |
def setLaneChangeMode(self, vehID, lcm):
"""setLaneChangeMode(string, integer) -> None
Sets the vehicle's lane change mode as a bitset.
"""
self._connection._sendIntCmd(
tc.CMD_SET_VEHICLE_VARIABLE, tc.VAR_LANECHANGE_MODE, vehID, lcm) | 0.007168 |
def create_rackservers(self):
"""Get an instance of rackservers services facade."""
return RackServers(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | 0.008696 |
def operation_recorder_enabled(self, value):
"""Setter method; for a description see the getter method."""
for recorder in self._operation_recorders:
if value:
recorder.enable()
else:
recorder.disable() | 0.007299 |
def Freqs(self,jr,jphi,jz,**kwargs):
"""
NAME:
Freqs
PURPOSE:
return the frequencies corresponding to a torus
INPUT:
jr - radial action (scalar)
jphi - azimuthal action (scalar)
jz - vertical action (scalar)
tol= (... | 0.014925 |
def _update_cinder_config(cls):
"""Parse in-memory file to update OSLO configuration used by Cinder."""
cls._config_string_io.seek(0)
cls._parser.write(cls._config_string_io)
# Check if we have any multiopt
cls._config_string_io.seek(0)
current_cfg = cls._config_string_i... | 0.003591 |
def compute_tf(self, sentences):
"""
Computes the normalized term frequency as explained in http://www.tfidf.com/
:type sentences: [sumy.models.dom.Sentence]
"""
content_words = self._get_all_content_words_in_doc(sentences)
content_words_count = len(content_words)
... | 0.007813 |
def update_edge_keys(G):
"""
Update the keys of edges that share a u, v with another edge but differ in
geometry. For example, two one-way streets from u to v that bow away from
each other as separate streets, rather than opposite direction edges of a
single street.
Parameters
--------... | 0.007083 |
def _delete_sbo_tar_gz(self):
"""Delete slackbuild tar.gz file after untar
"""
if not self.auto and os.path.isfile(self.meta.build_path + self.script):
os.remove(self.meta.build_path + self.script) | 0.012876 |
def createStateText(self):
'''Creates the mode and arm state text.'''
self.modeText = self.axes.text(self.leftPos+(self.vertSize/10.0),0.97,'UNKNOWN',color='grey',size=1.5*self.fontSize,ha='left',va='top')
self.modeText.set_path_effects([PathEffects.withStroke(linewidth=self.fontSize/10.0,foregr... | 0.032836 |
def partition_expiration(self):
"""Union[int, None]: Expiration time in milliseconds for a partition.
If :attr:`partition_expiration` is set and :attr:`type_` is
not set, :attr:`type_` will default to
:attr:`~google.cloud.bigquery.table.TimePartitioningType.DAY`.
"""
war... | 0.003086 |
def getproject_cmd(argv):
"""Print a virtualenv's project directory, if set.
If called without providing a virtualenv name as argument, print the
current virtualenv's project directory.
"""
# Parse command line arguments
parser = argparse.ArgumentParser(
description="Print an environmen... | 0.000876 |
def host_validator(value, **kwargs):
"""
From: http://stackoverflow.com/questions/2532053/validate-a-hostname-string
According to: http://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_host_names
"""
scheme, hostname, port, path = decompose_hostname(value)
if len(hostname) > 255:
... | 0.003749 |
def url_decode(s, charset='utf-8', decode_keys=False, include_empty=True,
errors='replace', separator='&', cls=None):
"""Parse a querystring and return it as :class:`MultiDict`. Per default
only values are decoded into unicode strings. If `decode_keys` is set to
`True` the same will happen ... | 0.000576 |
def asobject(self):
"""
Return object Series which contains boxed values.
.. deprecated :: 0.23.0
Use ``astype(object)`` instead.
*this is an internal non-public method*
"""
warnings.warn("'asobject' is deprecated. Use 'astype(object)'"
... | 0.004963 |
def build(self, id, **kwargs):
"""
Builds the Configurations for the Specified Set
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> de... | 0.003706 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.