text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def call_operation(self, operation, **kwargs):
"""
A generic method to call any operation supported by the Lambda handler
"""
data = {'operation': operation}
data.update(kwargs)
return self.invoke(data) | 0.008 |
def _perturbation(self):
"""
Returns Gaussian perturbation
"""
if self.P>1:
scales = []
for term_i in range(self.n_terms):
_scales = SP.randn(self.diag[term_i].shape[0])
if self.offset[term_i]>0:
_scales = SP.co... | 0.011364 |
def a10_allocate_ip_from_dhcp_range(self, subnet, interface_id, mac, port_id):
"""Search for an available IP.addr from unallocated nmodels.IPAllocationPool range.
If no addresses are available then an error is raised. Returns the address as a string.
This search is conducted by a difference of t... | 0.006061 |
def aggregate(self, out_file: str = None, select: np.ndarray = None, group_by: Union[str, np.ndarray] = "Clusters", aggr_by: str = "mean", aggr_ca_by: Dict[str, str] = None) -> np.ndarray:
"""
Aggregate the Loom file by applying aggregation functions to the main matrix as well as to the column attributes
Args:
... | 0.025044 |
def sparse_var(X):
'''
Compute variance from
:param X:
:return:
'''
Xc = X.copy()
Xc.data **= 2
return np.array(Xc.mean(axis=0) - np.power(X.mean(axis=0), 2))[0] | 0.005181 |
def _parse_metadata_filename(self, metadata):
"""
Parse the header metadata to pull out the filename and then store it under the key 'filename'
"""
index = metadata['Content-Disposition'].index('=')+1
metadata['filename'] = metadata['Content-Disposition'][index:].replace('"', '')... | 0.011628 |
def delete_track(self, href=None):
"""Delete a track.
'href' the relative index of the track. May not be none.
Returns nothing.
If the response status is not 204, throws and APIException."""
# Argument error checking.
assert href is not None
raw_result = self... | 0.004566 |
def List(self):
"""
Lists the keys and values.
"""
print()
for key in list(self.keys()):
print(key,'=',self[key])
print() | 0.022099 |
def heartbeat():
"""Call Heartbeat URL"""
print "We got a call heartbeat notification\n"
if request.method == 'POST':
print request.form
else:
print request.args
return "OK" | 0.004739 |
def create_table(self, table, exists_ok=False, retry=DEFAULT_RETRY):
"""API call: create a table via a PUT request
See
https://cloud.google.com/bigquery/docs/reference/rest/v2/tables/insert
Args:
table (Union[ \
:class:`~google.cloud.bigquery.table.Table`, ... | 0.002516 |
def path_to_url(path):
"""
Convert a path to a file: URL. The path will be made absolute.
"""
path = os.path.normcase(os.path.abspath(path))
if _drive_re.match(path):
path = path[0] + '|' + path[2:]
url = urllib.quote(path)
url = url.replace(os.path.sep, '/')
url = url.lstrip('/... | 0.002857 |
def playlist_songs_add(
self,
songs,
playlist,
*,
after=None,
before=None,
index=None,
position=None
):
"""Add songs to a playlist.
Note:
* Provide no optional arguments to add to end.
* Provide playlist song dicts for ``after`` and/or ``before``.
* Provide a zero-based ``index``.
* Pr... | 0.032822 |
def output_reference(self, name):
"""Return a reference to the given output for use in an input
of a next Step.
For a Step named `echo` that has an output called `echoed`, the
reference `echo/echoed` is returned.
Args:
name (str): the name of the Step output
... | 0.00319 |
def init_file_mapping_store():
""" init_file_mapping_store: creates log to keep track of downloaded files
Args: None
Returns: None
"""
# Make storage directory for restore files if it doesn't already exist
path = os.path.join(RESTORE_DIRECTORY, FILE_STORE_LOCATION)
if not os.path.exi... | 0.002809 |
def _adjust_boundaries(self, boundary_indices, text_file, real_wave_mfcc, sync_root, force_aba_auto=False, leaf_level=False):
"""
Adjust boundaries as requested by the user.
Return the computed time map, that is,
a list of pairs ``[start_time, end_time]``,
of length equal to num... | 0.003566 |
def B_(self):
r''':math:`\underline{B}=\langle V_{n+1},M_lAM_rU\rangle`.
This property is obtained from :math:`C` if the operator is
self-adjoint. Otherwise, the inner products have to be formed
explicitly.'''
(n_, n) = self.H.shape
ls = self.linear_system
if sel... | 0.002205 |
def load_ini(self, ini_file):
""" Load the contents from the ini file
Args:
ini_file (str): The file from which the settings should be loaded
"""
if ini_file and not os.path.exists(ini_file):
self.log.critical(f"Settings file specified but not found. {in... | 0.006853 |
def rsa_private_key_pkcs1_to_pkcs8(pkcs1_key):
"""Convert a PKCS1-encoded RSA private key to PKCS8."""
algorithm = RsaAlgorithmIdentifier()
algorithm["rsaEncryption"] = RSA_ENCRYPTION_ASN1_OID
pkcs8_key = PKCS8PrivateKey()
pkcs8_key["version"] = 0
pkcs8_key["privateKeyAlgorithm"] = algorithm
... | 0.002532 |
def _run_config_cmds(self, commands, server):
"""Execute/sends a CAPI (Command API) command to EOS.
In this method, list of commands is appended with prefix and
postfix commands - to make is understandble by EOS.
:param commands : List of command to be executed on EOS.
:param s... | 0.003436 |
def os_function_mapper(map):
"""
When called with an open connection, this function uses the
conn.guess_os() function to guess the operating system
of the connected host.
It then uses the given map to look up a function name that corresponds
to the operating system, and calls it. Example::
... | 0.000729 |
def get_block_info(self, block):
"""
Args:
block: block number (eg: 223212)
block hash (eg: 0000000000000000210b10d620600dc1cc2380bb58eb2408f9767eb792ed31fa)
word "last" - this will always return the latest block
word "first" - this will always... | 0.006024 |
def dump_emails(part):
"""Show the sent emails' tested parts, to aid in debugging."""
print("Sent emails:")
for email in mail.outbox:
print(getattr(email, part)) | 0.005495 |
def workerTypeLastModified(self, *args, **kwargs):
"""
Get Worker Type Last Modified Time
This method is provided to allow workers to see when they were
last modified. The value provided through UserData can be
compared against this value to see if changes have been made
... | 0.005666 |
def cmd_follow(self, args):
'''control following of vehicle'''
if len(args) < 2:
print("map follow 0|1")
return
follow = int(args[1])
self.map.set_follow(follow) | 0.009217 |
def parse_exchange(self):
"""Yield tuples of exchange compounds.
Each exchange compound is a tuple of compound, reaction ID, lower and
upper flux limits.
"""
if 'media' in self._model:
if 'exchange' in self._model:
raise ParseError('Both "media" and ... | 0.001616 |
def select_rect(action, action_space, select_add, screen, screen2):
"""Select units within a rectangle."""
select = spatial(action, action_space).unit_selection_rect
out_rect = select.selection_screen_coord.add()
screen_rect = point.Rect(screen, screen2)
screen_rect.tl.assign_to(out_rect.p0)
screen_rect.br.... | 0.020833 |
def get_uri_list(self, **kwargs):
"""
Returns a list of Uris to index
"""
index_status_filter = """
optional {{ ?s dcterm:modified ?modTime }} .
optional {{ ?s kds:esIndexTime ?time }} .
optional {{ ?s kds:esIndexError ?error }}
... | 0.002206 |
def add_handlers(self, logger, handlers):
"""Add handlers to a logger from a list of names."""
for h in handlers:
try:
logger.addHandler(self.config['handlers'][h])
except StandardError as e:
raise ValueError('Unable to add handler %r: %s' % (h, e)... | 0.006231 |
def InitFromNotification(self, notification, is_pending=False):
"""Initializes this object from an existing notification.
Args:
notification: A rdfvalues.flows.Notification object.
is_pending: Indicates whether the user has already seen this notification
or not.
Returns:
The curr... | 0.005887 |
def _make_dynamic_magic(self,magic):
"""Return a function `fun` that will execute `magic` on active frontend.
Parameters
----------
magic : string
string that will be executed as is when the returned function is called
Returns
-------
fun : function
... | 0.007207 |
def _cache_credentials(self, source, credentials, connect=False):
"""Save a set of authentication credentials.
The credentials are used to login a socket whenever one is created.
If `connect` is True, verify the credentials on the server first.
"""
# Don't let other threads affe... | 0.001612 |
def _request(self, method, url, headers=None, params=None, **aio_kwargs):
"""Setup Authorization Header.."""
access_token = params.pop(self.access_token_key, None)
if access_token:
headers['Authorization'] = "Bearer %s" % access_token
return super(DiscordClient, self)._reques... | 0.005089 |
def to(self, unit):
"""
convert between units. Returns a new nparray object with the new units
"""
if not _has_astropy:
raise ImportError("astropy must be installed for unit/quantity support")
if self.unit is None:
raise ValueError("no units currently se... | 0.005445 |
def auto_migrate_storage_system(*, persistent_storage_system=None, new_persistent_storage_system=None, data_item_uuids=None, deletions: typing.List[uuid.UUID] = None, utilized_deletions: typing.Set[uuid.UUID] = None, ignore_older_files: bool = True):
"""Migrate items from the storage system to the object context.
... | 0.004537 |
def email(self, domains: Union[tuple, list] = None) -> str:
"""Generate a random email.
:param domains: List of custom domains for emails.
:type domains: list or tuple
:return: Email address.
:Example:
foretime10@live.com
"""
if not domains:
... | 0.003724 |
def create_turnover_tear_sheet(factor_data, turnover_periods=None):
"""
Creates a tear sheet for analyzing the turnover properties of a factor.
Parameters
----------
factor_data : pd.DataFrame - MultiIndex
A MultiIndex DataFrame indexed by date (level 0) and asset (level 1),
contain... | 0.000382 |
def expand_include(filename):
"""
Expand the content of a file into a string.
If @include directives are found in the config, they are expanded by
this function. In case recursion is detected or a RunTimeError is
thrown, ``None`` is returned.
"""
open_files = set... | 0.002132 |
def ensure_type(val, dtype, ndim, name, length=None, can_be_none=False, shape=None,
warn_on_cast=True, add_newaxis_on_deficient_ndim=False):
"""Typecheck the size, shape and dtype of a numpy array, with optional
casting.
Parameters
----------
val : {np.ndaraay, None}
The arr... | 0.001637 |
def schemaValidCtxtGetParserCtxt(self):
"""allow access to the parser context of the schema validation
context """
ret = libxml2mod.xmlSchemaValidCtxtGetParserCtxt(self._o)
if ret is None:raise parserError('xmlSchemaValidCtxtGetParserCtxt() failed')
__tmp = parserCtxt(_obj=ret... | 0.01462 |
def read_history_file(self, filename=None):
u'''Load a readline history file. The default filename is ~/.history.'''
if filename is None:
filename = self.mode._history.history_filename
log(u"read_history_file from %s"%ensure_unicode(filename))
self.mode._history.read_history... | 0.014925 |
def balanceSheetDF(symbol, token='', version=''):
'''Pulls balance sheet data. Available quarterly (4 quarters) and annually (4 years)
https://iexcloud.io/docs/api/#balance-sheet
Updates at 8am, 9am UTC daily
Args:
symbol (string); Ticker to request
token (string); Access token
... | 0.003466 |
async def delete_cas(self, key, *, index):
"""Deletes the Key with check-and-set semantics.
Parameters:
key (str): Key to delete
index (ObjectIndex): Index ID
Response:
bool: ``True`` on success
The Key will only be deleted if its current modify inde... | 0.003788 |
def _match_registers(self, query):
"""Tries to match in status registers
:param query: message tuple
:type query: Tuple[bytes]
:return: response if found or None
:rtype: Tuple[bytes] | None
"""
if query in self._status_registers:
register = self._stat... | 0.00369 |
def violinplot(x=None, y=None, data=None, bw=0.2, scale='width',
inner=None, ax=None, **kwargs):
"""Wrapper around Seaborn's Violinplot specifically for [0, 1] ranged data
What's different:
- bw = 0.2: Sets bandwidth to be small and the same between datasets
- scale = 'width': Sets the w... | 0.00155 |
def hostcmd_push(base_path, project_name, engine_name, vars_files=None, config_file=None, **kwargs):
"""
Push images to a registry. Requires authenticating with the registry prior to starting
the push. If your engine's config file does not already contain an authorization for the
registry, pass username... | 0.005797 |
def extract_packet(self):
"""
Extract packet from buffer
"""
packet_size = velbus.MINIMUM_MESSAGE_SIZE + \
(self.buffer[3] & 0x0F)
packet = self.buffer[0:packet_size]
return packet | 0.008333 |
def terminate_all(self):
"""Terminate all worker processes."""
for worker in self._workers:
worker.terminate()
# for thread in self._threads:
# try:
# thread.terminate()
# thread.wait()
# except Exception:
# pas... | 0.005571 |
def _get_ignored_version():
"""
:return: Most recently ignored API version
"""
if os.path.exists(filepath):
with open(filepath) as data_file:
data = json.load(data_file)
version = data.get('version')
else:
version = None
return version | 0.003344 |
def remove_check(self, func, *, call_once=False):
"""Removes a global check from the bot.
This function is idempotent and will not raise an exception
if the function is not in the global checks.
Parameters
-----------
func
The function to remove from the glo... | 0.004545 |
def is_noncopyable(class_, already_visited_cls_vars=None):
"""
Checks if class is non copyable
Args:
class_ (declarations.class_t): the class to be checked
already_visited_cls_vars (list): optional list of vars that should not
be checked a second time, to prevent infinite recurs... | 0.000345 |
def check_installation(cur_file):
"""Warn user if running cleverhans from a different directory than tutorial."""
cur_dir = os.path.split(os.path.dirname(os.path.abspath(cur_file)))[0]
ch_dir = os.path.split(cleverhans.__path__[0])[0]
if cur_dir != ch_dir:
warnings.warn("It appears that you have at least tw... | 0.007853 |
def coordinates_to_array(
log,
ra,
dec):
"""*Convert a single value RA, DEC or list of RA and DEC to numpy arrays*
**Key Arguments:**
- ``ra`` -- list, numpy array or single ra value
- ``dec`` --list, numpy array or single dec value
- ``log`` -- logger
**Ret... | 0.002323 |
def target_socket(self, config):
""" This method overrides :meth:`.WNetworkNativeTransport.target_socket` method. Do the same thing as
basic method do, but also checks that the result address is IPv4 multicast address.
:param config: beacon configuration
:return: WIPV4SocketInfo
"""
target = WUDPNetworkNat... | 0.026157 |
def customtype(self):
"""If this variable is a user-derivedy type, return the CustomType instance that
is its kind.
"""
result = None
if self.is_custom:
#Look for the module that declares this variable's kind in its public list.
self.dependency()
... | 0.00969 |
def to_rio(self):
"""Converts the colormap to a rasterio colormap.
"""
self.colors = (((self.colors * 1.0 - self.colors.min()) /
(self.colors.max() - self.colors.min())) * 255)
return dict(zip(self.values, tuple(map(tuple, self.colors)))) | 0.006803 |
def set_python(self, value):
"""Validate using cursor for consistency between direct set of values vs modification of cursor values"""
if not isinstance(value, (list, type(None))):
raise ValidationError(
self.record,
"Field '{}' must be set to a list, not '{}'... | 0.005415 |
def add_fields(self, log_record, record, message_dict):
"""
Override this method to implement custom logic for adding fields.
"""
for field in self._required_fields:
log_record[field] = record.__dict__.get(field)
log_record.update(message_dict)
merge_record_ex... | 0.005682 |
def n_executions(self):
"""
Queries and returns the number of past task executions.
"""
pipeline = self.tiger.connection.pipeline()
pipeline.exists(self.tiger._key('task', self.id))
pipeline.llen(self.tiger._key('task', self.id, 'executions'))
exists, n_executions... | 0.004073 |
def loop_until_closed(self, suppress_warning=False):
''' Execute a blocking loop that runs and executes event callbacks
until the connection is closed (e.g. by hitting Ctrl-C).
While this method can be used to run Bokeh application code "outside"
the Bokeh server, this practice is HIGHL... | 0.006912 |
def head(self, url):
'''head request, typically used for status code retrieval, etc.
'''
bot.debug('HEAD %s' %url)
return self._call(url, func=requests.head) | 0.011561 |
def check_valid_ip_or_cidr(val, return_as_cidr=False):
"""
Checks that the value is a valid IP address or a valid CIDR.
Returns the specified value.
If 'return_as_cidr' is set then the return value will always be in the form
of a CIDR, even if a plain IP address was specified.
"""
is_ip =... | 0.001175 |
def mass_3d(self, R, Rs, rho0, r_core):
"""
:param R: projected distance
:param Rs: scale radius
:param rho0: central core density
:param r_core: core radius
"""
Rs = float(Rs)
b = r_core * Rs ** -1
c = R * Rs ** -1
M0 = 4*np.pi*Rs**3 * r... | 0.007042 |
def nearby(word):
'''
Nearby word
'''
w = any2unicode(word)
# read from cache
if w in _cache_nearby: return _cache_nearby[w]
words, scores = [], []
try:
for x in _vectors.neighbours(w):
words.append(x[0])
scores.append(x[1])
except: pass # ignore key ... | 0.012048 |
def solveConsMarkov(solution_next,IncomeDstn,LivPrb,DiscFac,CRRA,Rfree,PermGroFac,
MrkvArray,BoroCnstArt,aXtraGrid,vFuncBool,CubicBool):
'''
Solves a single period consumption-saving problem with risky income and
stochastic transitions between discrete states, in a Markov fa... | 0.008 |
def get_dict_from_response(response):
"""Check for errors in the response and return the resulting JSON."""
if getattr(response, '_resp') and response._resp.code > 400:
raise OAuthResponseError(
'Application mis-configuration in Globus', None, response
)
return response.... | 0.003086 |
def sse(mean, estimator):
"""
Description:
Calculates the Sum of Squared Errors (SSE) of
an estimation on flat numpy ndarrays.
Parameters:
mean: actual value (numpy ndarray)
estimator: estimated value of the mean (numpy ndarray)
"""
return np.sum((np.asa... | 0.00271 |
def get_project_details(self, project):
""" Get the project details. """
result = self.get_project(project.pid)
if result is None:
result = {}
return result | 0.01 |
def find(cls, session, resource_id, include=None):
"""Retrieve a single resource.
This should only be called from sub-classes.
Args:
session(Session): The session to find the resource in
resource_id: The ``id`` for the resource to look up
Keyword Args:
... | 0.002581 |
def __args_check(self, envelope, target, modification_code):
""" Method checks arguments, that are specified to the
:meth:`.WMessengerFixedModificationLayer.encode` and :meth:`.WMessengerFixedModificationLayer.decode`
methods
:param envelope: same as envelope in :meth:`.WMessengerFixedModificationLayer.encode`... | 0.022825 |
def _add_sj_index_commands(fq1, ref_file, gtf_file):
"""
newer versions of STAR can generate splice junction databases on thephfly
this is preferable since we can tailor it to the read lengths
"""
if _has_sj_index(ref_file):
return ""
else:
rlength = fastq.estimate_maximum_read_l... | 0.002217 |
def register_processes(self, process_schemas, user, force=False, verbosity=1):
"""Read and register processors."""
log_processors = []
log_templates = []
for p in process_schemas:
# TODO: Remove this when all processes are migrated to the
# new syntax.
... | 0.003787 |
def sed(self, photon_energy, distance=1 * u.kpc, seed=None):
"""Spectral energy distribution at a given distance from the source
Parameters
----------
photon_energy : :class:`~astropy.units.Quantity` float or array
Photon energy array.
distance : :class:`~astropy.un... | 0.001797 |
def update(self, **kwargs):
'''Update the attributes of a JObject.
Parameters
----------
kwargs
Keyword arguments of the form `attribute=new_value`
Examples
--------
>>> J = jams.JObject(foo=5)
>>> J.dumps()
'{"foo": 5}'
>>> J... | 0.004032 |
def run_init_tables(*args):
'''
Run to init tables.
'''
print('--')
create_table(TabPost)
create_table(TabTag)
create_table(TabMember)
create_table(TabWiki)
create_table(TabLink)
create_table(TabEntity)
create_table(TabPostHist)
create_table(TabWikiHist)
create_table... | 0.001692 |
def is_lock_pending(
end_state: NettingChannelEndState,
secrethash: SecretHash,
) -> bool:
"""True if the `secrethash` corresponds to a lock that is pending to be claimed
and didn't expire.
"""
return (
secrethash in end_state.secrethashes_to_lockedlocks or
secrethash in ... | 0.004566 |
def _sum_by_samples(seqs_freq, samples_order):
"""
Sum sequences of a metacluster by samples.
"""
n = len(seqs_freq[seqs_freq.keys()[0]].freq.keys())
y = np.array([0] * n)
for s in seqs_freq:
x = seqs_freq[s].freq
exp = [seqs_freq[s].freq[sam] for sam in samples_order]
y ... | 0.002793 |
def spacing(self, spacing):
"""Set the spacing in each axial direction. Pass a length three tuple of
floats"""
dx, dy, dz = spacing[0], spacing[1], spacing[2]
self.SetSpacing(dx, dy, dz)
self.Modified() | 0.012397 |
async def deserialize(data: dict):
"""
Builds a Proof object with defined attributes.
Attributes are provided by a previous call to the serialize function.
:param data:
Example:
name = "proof name"
requested_attrs = [{"name": "age", "restrictions": [{"schema_id": ... | 0.001696 |
def split_all(reference, sep):
"""
Splits a given string at a given separator or list of separators.
:param reference: The reference to split.
:param sep: Separator string or list of separator strings.
:return: A list of split strings
"""
parts = partition_all(reference, sep)
return [p ... | 0.002849 |
def create_or_update_group(self, name, policies=None, mount_point=DEFAULT_MOUNT_POINT):
"""
Create or update LDAP group policies.
Supported methods:
POST: /auth/{mount_point}/groups/{name}. Produces: 204 (empty body)
:param name: The name of the LDAP group
:type na... | 0.003549 |
async def _run(self, data_id, script):
"""Execute the script and save results."""
self.data_id = data_id
# Fetch data instance to get any executor requirements.
self.process = PROCESS
requirements = self.process['requirements']
self.requirements = requirements.get('execu... | 0.002724 |
def GetArtifactPathDependencies(rdf_artifact):
"""Return a set of knowledgebase path dependencies.
Args:
rdf_artifact: RDF artifact object.
Returns:
A set of strings for the required kb objects e.g.
["users.appdata", "systemroot"]
"""
deps = set()
for source in rdf_artifact.sources:
for ar... | 0.013158 |
def stop(self):
""" Try to gracefully stop the greenlet synchronously
Stop isn't expected to re-raise greenlet _run exception
(use self.greenlet.get() for that),
but it should raise any stop-time exception """
if self._stop_event.ready():
return
self._stop_ev... | 0.00495 |
def request(self, method, params=None):
"""Send a JSON RPC request to the client.
Args:
method (str): The method name of the message to send
params (any): The payload of the message
Returns:
Future that will resolve once a response has been received
... | 0.002278 |
def request_doi_status_by_filename(self, file_name, data_type='result'):
"""
This method retrieve the DOI requests status.
file_name: Used as unique ID to identify a deposit.
data_type: [contents, result]
contents - retrieve the XML submited by the publisher
res... | 0.002442 |
def recur(obj, type_func_tuple_list=()):
'''recuring dealing an object'''
for obj_type, func in type_func_tuple_list:
if type(obj) == type(obj_type):
return func(obj)
# by default, we wolud recurring list, tuple and dict
if isinstance(obj, list) or isinstance(obj, tuple):
n_o... | 0.00335 |
def get_form(self, request, obj=None, **kwargs):
"""
Use special form during user creation
"""
defaults = {}
if obj is None:
defaults['form'] = self.add_form
defaults.update(kwargs)
return super(SettingsAdmin, self).get_form(request, obj, **defaults) | 0.006289 |
def add_analysis_dataset(self, group_name, dataset_name, data, attrs=None):
""" Add a dataset to the specified group.
:param group_name: The path of the group the dataset will be added to,
relative to the "Analyses" group.
:param dataset_name: The name of the new dataset.
... | 0.002644 |
def extract_pairs(abed, bbed, groups):
"""
Called by fromgroups(), extract pairs specific to a pair of species.
"""
agenome = op.basename(abed.filename).split(".")[0]
bgenome = op.basename(bbed.filename).split(".")[0]
aorder = abed.order
border = bbed.order
pairsfile = "{0}.{1}.pairs".fo... | 0.002451 |
def graph_from_edges(edges):
""" Constructs an undirected multigraph from a list containing data on
weighted edges.
Parameters
----------
edges : list
List of tuples each containing first node, second node, weight, key.
Returns
-------
M : :class:`networkx.classes.multigraph.Mu... | 0.002079 |
def setup(self):
""" Setups the controller by reading/setting position for all motors. """
self._init_vrep_streaming()
# Init lifo for temperature spoofing
for m in self.motors:
m.__dict__['_load_fifo'] = deque(200 * [1], maxlen=200)
self.update() | 0.009967 |
def convert_numeric_id_to_id36(numeric_id):
"""Convert an integer into its base36 string representation.
This method has been cleaned up slightly to improve readability. For more
info see:
https://github.com/reddit/reddit/blob/master/r2/r2/lib/utils/_utils.pyx
https://www.reddit.com/r/redditdev/c... | 0.000838 |
def commit_docs(*, added, removed):
"""
Commit the docs to the current branch
Assumes that :func:`setup_GitHub_push`, which sets up the ``doctr_remote``
remote, has been run.
Returns True if changes were committed and False if no changes were
committed.
"""
TRAVIS_BUILD_NUMBER = os.env... | 0.005679 |
def get_edge_list(self):
"""Get the list of Edge instances.
This method returns the list of Edge instances
composing the graph.
"""
edge_objs = list()
for obj_dict_list in self.obj_dict['edges'].values():
edge_objs.extend([
Edge(obj_dict=obj_... | 0.00489 |
def _stop_vibration_win(self):
"""Stop the vibration."""
xinput_set_state = self.manager.xinput.XInputSetState
xinput_set_state.argtypes = [
ctypes.c_uint, ctypes.POINTER(XinputVibration)]
xinput_set_state.restype = ctypes.c_uint
stop_vibration = ctypes.byref(XinputVi... | 0.005038 |
def categories_to_fetch(self, categories_to_fetch):
"""Sets the categories_to_fetch of this GCPConfiguration.
A list of Google Cloud Platform (GCP) services (such as ComputeEngine, PubSub, etc) from which to pull metrics. Allowable values are APPENGINE, BIGQUERY, BIGTABLE, CLOUDFUNCTIONS, CLOUDIOT, CL... | 0.001385 |
def hist_1d_index(x, shape):
"""
Fast 1d histogram of 1D indices with C++ inner loop optimization.
Is more than 2 orders faster than np.histogram().
The indices are given in coordinates and have to fit into a histogram of the dimensions shape.
Parameters
----------
x : array like
shape :... | 0.00267 |
def register_user_type(self, keyspace, user_type, klass):
"""
Registers a class to use to represent a particular user-defined type.
Query parameters for this user-defined type will be assumed to be
instances of `klass`. Result sets for this user-defined type will
be instances of... | 0.002294 |
def _fit_tfa_inner(
self,
data,
R,
template_centers,
template_widths,
template_centers_mean_cov,
template_widths_mean_var_reci):
"""Fit TFA model, the inner loop part
Parameters
----------
data: 2D arra... | 0.000934 |
def on_widget__motion_notify_event(self, widget, event):
'''
Called when mouse pointer is moved within drawing area.
.. versionchanged:: 0.11
Do not trigger `route-electrode-added` event if `ALT` key is
pressed.
'''
if self.canvas is None:
# ... | 0.00164 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.