text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def ne(self, other, ranks=None):
"""
Compares the card against another card, ``other``, and checks whether
the card is not equal to ``other``, based on the given rank dict.
:arg Card other:
The second Card to compare.
:arg dict ranks:
The ranks to refer t... | 0.002281 |
def filename(self):
"""
:return:
:rtype: str
"""
filename = self.key
if self.has_revision_file() and self.history.current_revision:
filename += "-"
filename += self.history.current_revision.revision_id
filename += ".zip"
return f... | 0.006116 |
def create(self, count=1, commit=True, **kwargs):
'''
Create and return ``count`` model instances. If *commit* is ``False``
the instances will not be saved and many to many relations will not be
processed.
May raise ``CreateInstanceError`` if constraints are not satisfied.
... | 0.003373 |
async def on_capability_sasl_available(self, value):
""" Check whether or not SASL is available. """
if value:
self._sasl_mechanisms = value.upper().split(',')
else:
self._sasl_mechanisms = None
if self.sasl_mechanism == 'EXTERNAL' or (self.sasl_username and self... | 0.007018 |
def slowDown(self, vehID, speed, duration):
"""slowDown(string, double, int) -> None
Changes the speed smoothly to the given value over the given amount
of time in ms (can also be used to increase speed).
"""
self._connection._beginMessage(
tc.CMD_SET_VEHICLE_VARIABL... | 0.007273 |
def optimize(self):
""" Tries to detect peep-hole patterns in this basic block
and remove them.
"""
changed = OPTIONS.optimization.value > 2 # only with -O3 will enter here
while changed:
changed = False
regs = Registers()
if len(self) and s... | 0.003194 |
def update_object_options(self, identifier, options):
"""Update set of typed attributes (options) that are associated with
a given image group. Raises a ValueError if any of the given
attributes violates the attribute definitions associated with image
groups.
Parameters
... | 0.001735 |
def do_uninstall(ctx, verbose, fake):
"""Uninstalls legit git aliases, including deprecated legit sub-commands."""
aliases = cli.list_commands(ctx)
# Add deprecated aliases
aliases.extend(['graft', 'harvest', 'sprout', 'resync', 'settings', 'install', 'uninstall'])
for alias in aliases:
syst... | 0.006462 |
def build_chvatal_graph():
"""Makes a new Chvatal graph.
Ref: http://mathworld.wolfram.com/ChvatalGraph.html"""
# The easiest way to build the Chvatal graph is to start
# with C12 and add the additional 12 edges
graph = build_cycle_graph(12)
edge_tpls = [
(1,7), (1,9), (2,5), (2,11),... | 0.027197 |
def lookup(self, ip_address):
"""Try to do a reverse dns lookup on the given ip_address"""
# Is this already in our cache
if self.ip_lookup_cache.get(ip_address):
domain = self.ip_lookup_cache.get(ip_address)
# Is the ip_address local or special
elif not self.lookup... | 0.002729 |
def make_package_tree(matrix=None,labels=None,width=25,height=10,title=None,font_size=None):
'''make package tree will make a dendrogram comparing a matrix of packages
:param matrix: a pandas df of packages, with names in index and columns
:param labels: a list of labels corresponding to row names, will be
... | 0.008021 |
def finalize_content(self):
""" Finalize the additons """
self.write_closed = True
body = self.raw_body.decode(self.encoding)
self._init_xml(body)
self._form_output() | 0.009709 |
def add_view_file_mapping(self, pattern, cls):
"""Adds a mapping between a file and a view class.
Pattern can be an extension in the form .EXT or a filename.
"""
if isinstance(pattern, str):
if not pattern.endswith("*"):
_, ext = os.path.splitext(pattern)
... | 0.005848 |
def set_formatter(log_formatter):
"""Override the default log formatter with your own."""
# Add our formatter to all the handlers
root_logger = logging.getLogger()
for handler in root_logger.handlers:
handler.setFormatter(logging.Formatter(log_formatter)) | 0.006689 |
def rna_transcript_expression_dict_from_args(args):
"""
Returns a dictionary mapping Ensembl transcript IDs to FPKM expression
values or None if neither Cufflinks tracking file nor StringTie GTF file
were specified.
"""
if args.rna_transcript_fpkm_tracking_file:
return load_cufflinks_fpk... | 0.001859 |
def handle_request(self, filter_name, path):
"""
Handle image request
:param filter_name: filter_name
:param path: image_path
:return:
"""
if filter_name in self._filter_sets:
if self._filter_sets[filter_name]['cached']:
cached_item_pat... | 0.002928 |
def loggray(x, a, b):
"""Auxiliary function that specifies the logarithmic gray scale.
a and b are the cutoffs."""
linval = 10.0 + 990.0 * (x-float(a))/(b-a)
return (np.log10(linval)-1.0)*0.5 * 255.0 | 0.004651 |
def toggle_view(self, *args, **kwargs):
""" Toggles the view between different groups """
group_to_display = self.views.popleft()
self.cur_view.value = group_to_display
for repo in self.tools_tc:
for tool in self.tools_tc[repo]:
t_groups = self.manifest.option... | 0.002372 |
def by_login(cls, session, login, local=True):
"""
Get a user from a given login.
:param session: SQLAlchemy session
:type session: :class:`sqlalchemy.Session`
:param login: the user login
:type login: unicode
:return: the associated user
:rtype: :class... | 0.003101 |
def ip2network(ip):
"""Convert a dotted-quad ip to base network number.
This differs from :func:`ip2long` in that partial addresses as treated as
all network instead of network plus host (eg. '127.1' expands to
'127.1.0.0')
:param ip: dotted-quad ip address (eg. ‘127.0.0.1’).
:type ip: str
... | 0.001686 |
def fetchText(cls, url, data, textSearch, optional):
"""Search text entry for given text pattern in a HTML page."""
if textSearch:
match = textSearch.search(data[0])
if match:
text = match.group(1)
out.debug(u'matched text %r with pattern %s' % (te... | 0.006723 |
def _date_from_match(match_object):
"""
Create a date object from a regular expression match.
The regular expression match is expected to be from _RE_DATE or
_RE_DATETIME.
@param match_object: The regular expression match.
@type match_object: B{re}.I{MatchObject}
@return: A date object.
... | 0.001887 |
def loads(self, value):
'''Returns deserialized `value`.'''
for serializer in reversed(self):
value = serializer.loads(value)
return value | 0.012821 |
def continuousGenerator(self, request):
"""
Returns a generator over the (continuous, nextPageToken) pairs
defined by the (JSON string) request.
"""
compoundId = None
if request.continuous_set_id != "":
compoundId = datamodel.ContinuousSetCompoundId.parse(
... | 0.002793 |
def _import_from_importer(network, importer, basename, skip_time=False):
"""
Import network data from importer.
Parameters
----------
skip_time : bool
Skip importing time
"""
attrs = importer.get_attributes()
current_pypsa_version = [int(s) for s in network.pypsa_version.split... | 0.004078 |
def add_tracks(self, track):
"""
Add a track or iterable of tracks.
Parameters
----------
track : iterable or Track
Iterable of :class:`Track` objects, or a single :class:`Track`
object.
"""
from trackhub import BaseTrack
if isins... | 0.003759 |
def tables(self):
"""Print the existing tables in a database
:example: ``ds.tables()``
"""
if self._check_db() == False:
return
try:
pmodels = self._tables()
if pmodels is None:
return
num = len(pmodels)
... | 0.005051 |
def get_join_cols(by_entry):
""" helper function used for joins
builds left and right join list for join function
"""
left_cols = []
right_cols = []
for col in by_entry:
if isinstance(col, str):
left_cols.append(col)
right_cols.append(col)
else:
left_cols.append(col[0])
right... | 0.026954 |
def filter_spent_outputs(self, outputs):
"""Remove outputs that have been spent
Args:
outputs: list of TransactionLink
"""
links = [o.to_dict() for o in outputs]
txs = list(query.get_spending_transactions(self.connection, links))
spends = {TransactionLink.fro... | 0.004149 |
def daterange(self):
"""
This ``PeriodRange`` represented as a naive
:class:`~spans.types.daterange`.
"""
return daterange(
lower=self.lower,
upper=self.upper,
lower_inc=self.lower_inc,
upper_inc=self.upper_inc) | 0.006667 |
def to_json(self):
"""
Return the individual info in a dictionary for json.
"""
self.logger.debug("Returning json info")
individual_info = {
'family_id': self.family,
'id':self.individual_id,
'sex':str(self.sex),
'phenotype': str(... | 0.016293 |
def register_periodic_tasks(self, tasks: Iterable[Task]):
"""Register tasks that need to be scheduled periodically."""
for task in tasks:
self._scheduler.enter(
int(task.periodicity.total_seconds()),
0,
self._schedule_periodic_task,
... | 0.005634 |
def qualify(self):
"""
Convert attribute values, that are references to other
objects, into I{qref}. Qualfied using default document namespace.
Since many wsdls are written improperly: when the document does
not define a default namespace, the schema target namespace is used
... | 0.00246 |
def lpushx(self, key, *values):
"""
Insert values at the head of an existing list.
:param key: The list's key
:type key: :class:`str`, :class:`bytes`
:param values: One or more positional arguments to insert at the
beginning of the list. Each value is inserted at th... | 0.002077 |
def on_okButton(self, event):
"""
grab user input values, format them, and run huji_magic.py with the appropriate flags
"""
os.chdir(self.WD)
options = {}
HUJI_file = self.bSizer0.return_value()
if not HUJI_file:
pw.simple_warning("You must select a HU... | 0.005692 |
def getdevice_by_uuid(uuid):
"""
Get a HDD device by uuid
Example::
from burlap.disk import getdevice_by_uuid
device = getdevice_by_uuid("356fafdc-21d5-408e-a3e9-2b3f32cb2a8c")
if device:
mount(device,'/mountpoint')
"""
with settings(hide('running', 'warnings',... | 0.002123 |
def is_mac_address(value, **kwargs):
"""Indicate whether ``value`` is a valid MAC address.
:param value: The value to evaluate.
:returns: ``True`` if ``value`` is valid, ``False`` if it is not.
:rtype: :class:`bool <python:bool>`
:raises SyntaxError: if ``kwargs`` contains duplicate keyword param... | 0.003419 |
def update_handles(self, key, axis, element, ranges, style):
"""
Update the elements of the plot.
"""
self.teardown_handles()
plot_data, plot_kwargs, axis_kwargs = self.get_data(element, ranges, style)
with abbreviated_exception():
handles = self.init_artists... | 0.007246 |
def encodeEntitiesReentrant(self, input):
"""Do a global encoding of a string, replacing the predefined
entities and non ASCII values with their entities and
CharRef counterparts. Contrary to xmlEncodeEntities, this
routine is reentrant, and result must be deallocated. """
... | 0.005013 |
def get_broadcast_message(self, rawtx):
"""TODO add docstring"""
tx = deserialize.tx(rawtx)
result = control.get_broadcast_message(self.testnet, tx)
result["signature"] = serialize.signature(result["signature"])
return result | 0.007547 |
def _set_data(self, action):
"""
capture Wikidata API response data
"""
if action == 'labels':
self._set_labels()
if action == 'wikidata':
self._set_wikidata()
self.get_labels(show=False) | 0.007576 |
def content_val(self, ymldata=None, messages=None):
"""Validates the Command Dictionary to ensure the contents for each of the fields
meets specific criteria regarding the expected types, byte ranges, etc."""
self._ymlproc = YAMLProcessor(self._ymlfile, False)
# Turn off the YAML Proce... | 0.004945 |
def add_entry(self, timestamp, data):
"""Adds a new data entry to the TimeSeries.
:param timestamp: Time stamp of the data.
This has either to be a float representing the UNIX epochs
or a string containing a timestamp in the given format.
:param numeric data: Actua... | 0.005908 |
def _match_real(filename, include, exclude, follow, symlinks):
"""Match real filename includes and excludes."""
sep = '\\' if util.platform() == "windows" else '/'
if isinstance(filename, bytes):
sep = os.fsencode(sep)
if not filename.endswith(sep) and os.path.isdir(filename):
filename ... | 0.001364 |
def message(self, message, source, point, ln):
"""Creates a SyntaxError-like message."""
if message is None:
message = "parsing failed"
if ln is not None:
message += " (line " + str(ln) + ")"
if source:
if point is None:
message += "\n"... | 0.00547 |
def is_simpletable(table):
"""test if the table has only strings in the cells"""
tds = table('td')
for td in tds:
if td.contents != []:
td = tdbr2EOL(td)
if len(td.contents) == 1:
thecontents = td.contents[0]
if not isinstance(thecontents, Navi... | 0.002331 |
def addSuffixToExtensions(toc):
"""
Returns a new TOC with proper library suffix for EXTENSION items.
"""
new_toc = TOC()
for inm, fnm, typ in toc:
if typ in ('EXTENSION', 'DEPENDENCY'):
binext = os.path.splitext(fnm)[1]
if not os.path.splitext(inm)[1] == binext:
... | 0.002445 |
def get_session_indexes(request):
"""
Gets the SessionIndexes from the Logout Request
:param request: Logout Request Message
:type request: string|DOMDocument
:return: The SessionIndex value
:rtype: list
"""
elem = OneLogin_Saml2_XML.to_etree(request)
... | 0.006421 |
def get_profile_model():
"""
Returns configured user profile model or None if not found
"""
auth_profile_module = getattr(settings, 'AUTH_PROFILE_MODULE', None)
profile_model = None
if auth_profile_module:
# get the profile model. TODO: super flacky, refactor
app_label, model = a... | 0.005871 |
def parse_ggKbase_tables(tables, id_type):
"""
convert ggKbase genome info tables to dictionary
"""
g2info = {}
for table in tables:
for line in open(table):
line = line.strip().split('\t')
if line[0].startswith('name'):
header = line
h... | 0.005169 |
def _run_vagrant_command(self, args):
'''
Run a vagrant command and return its stdout.
args: A sequence of arguments to a vagrant command line.
e.g. ['up', 'my_vm_name', '--no-provision'] or
['up', None, '--no-provision'] for a non-Multi-VM environment.
'''
# Make... | 0.006826 |
def parameters(self, sequence, value_means, value_ranges, arrangement):
"""Relates the individual to be evolved to the full parameter string.
Parameters
----------
sequence: str
Full amino acid sequence for specification object to be
optimized. Must be equal to t... | 0.001092 |
def tuplewrap(value):
"""
INTENDED TO TURN lists INTO tuples FOR USE AS KEYS
"""
if is_many(value):
return tuple(tuplewrap(v) if is_sequence(v) else v for v in value)
return unwrap(value), | 0.00463 |
def _create_remote_dict_method(dict_method_name: str):
"""
Generates a method for the State class,
that will call the "method_name" on the state (a ``dict``) stored on the server,
and return the result.
Glorified RPC.
"""
def remote_method(self, *args, **kwargs):
return self._s_req... | 0.003311 |
def set_value(request):
"""Set the value and returns *True* or *False*."""
key = request.matchdict['key']
_VALUES[key] = request.json_body
return _VALUES.get(key) | 0.010256 |
def _get_services(self, version='v1'):
'''get version 1 of the google compute and storage service
Parameters
==========
version: version to use (default is v1)
'''
self._bucket_service = storage.Client()
creds = GoogleCredentials.get_application_default()
... | 0.00823 |
def sequence_number(self):
"""
The sequence number of this command. This is the sequence
number assigned by the issuing client.
"""
entry = self._proto.commandQueueEntry
if entry.cmdId.HasField('sequenceNumber'):
return entry.cmdId.sequenceNumber
retur... | 0.006135 |
def get_player_summaries(self, steamids=None, **kwargs):
"""Returns a dictionary containing a player summaries
:param steamids: (list) list of ``32-bit`` or ``64-bit`` steam ids, notice
that api will convert if ``32-bit`` are given
:return: dictionary of player s... | 0.005342 |
def http_methods(self, urls=None, **route_data):
"""Creates routes from a class, where the class method names should line up to HTTP METHOD types"""
def decorator(class_definition):
instance = class_definition
if isinstance(class_definition, type):
instance = clas... | 0.004108 |
def Vc(CASRN, AvailableMethods=False, Method=None, IgnoreMethods=[SURF]):
r'''This function handles the retrieval of a chemical's critical
volume. Lookup is based on CASRNs. Will automatically select a data
source to use if no Method is provided; returns None if the data is not
available.
Prefered ... | 0.001062 |
def to_xml(self):
'''
Returns a DOM representation of the payment.
@return: Element
'''
for n, v in { "amount": self.amount, "date": self.date,
"method":self.method}.items():
if is_empty_or_none(v):
raise PaymentError("'%s' attribu... | 0.009079 |
def excluded(filename):
"""
Check if options.exclude contains a pattern that matches filename.
"""
basename = os.path.basename(filename)
for pattern in options.exclude:
if fnmatch(basename, pattern):
# print basename, 'excluded because it matches', pattern
return True | 0.003125 |
def create_table(self, cursor, target, options):
"Creates the target table."
cursor.execute(
self.create_sql[target].format(self.qualified_names[target])) | 0.010989 |
def row(self, content='', align='left'):
"""
A row of the menu, which comprises the left and right verticals plus the given content.
Returns:
str: A row of this menu component with the specified content.
"""
return u"{lm}{vert}{cont}{vert}".format(lm=' ' * self.margi... | 0.009881 |
def _norm_perm_list_from_perm_dict(self, perm_dict):
"""Return a minimal, ordered, hashable list of subjects and permissions."""
high_perm_dict = self._highest_perm_dict_from_perm_dict(perm_dict)
return [
[k, list(sorted(high_perm_dict[k]))]
for k in ORDERED_PERM_LIST
... | 0.008108 |
def running_jobs(self, exit_on_error=True):
"""Initialize multiprocessing."""
with self.handling_exceptions():
if self.using_jobs:
from concurrent.futures import ProcessPoolExecutor
try:
with ProcessPoolExecutor(self.jobs) as self.executor:... | 0.003883 |
def description_record(self):
"""Return dict describing :class:`condoor.Connection` object.
Example::
{'connections': [{'chain': [{'driver_name': 'eXR',
'family': 'ASR9K',
'hostname': 'vkg3',
'is_console... | 0.001596 |
def parse_timedelta(deltastr):
"""
Parse a string describing a period of time.
"""
matches = TIMEDELTA_REGEX.match(deltastr)
if not matches:
return None
components = {}
for name, value in matches.groupdict().items():
if value:
components[name] = int(value)
for... | 0.001613 |
def airpwn(iffrom, ifto, replace, pattern="", ignorepattern=""):
"""Before using this, initialize "iffrom" and "ifto" interfaces:
iwconfig iffrom mode monitor
iwpriv orig_ifto hostapd 1
ifconfig ifto up
note: if ifto=wlan0ap then orig_ifto=wlan0
note: ifto and iffrom must be set on the same channel
ex:
ifconfig eth... | 0.008009 |
def invokeCompletionIfAvailable(self, requestedByUser=False):
"""Invoke completion, if available. Called after text has been typed in qpart
Returns True, if invoked
"""
if self._qpart.completionEnabled and self._wordSet is not None:
wordBeforeCursor = self._wordBeforeCursor()... | 0.004736 |
def read_value(ftype, prompt, default=None, minval=None, maxval=None,
allowed_single_chars=None, question_mark=True):
"""Return value read from keyboard
Parameters
----------
ftype : int() or float()
Function defining the expected type.
prompt : str
Prompt string.
... | 0.000282 |
def label(self, nid, id_if_null=False):
"""
Fetches label for a node
Arguments
---------
nid : str
Node identifier for entity to be queried
id_if_null : bool
If True and node has no label return id as label
Return
------
s... | 0.002766 |
def vt2esofspy(vesseltree, outputfilename="tracer.txt", axisorder=[0, 1, 2]):
"""
exports vesseltree to esofspy format
:param vesseltree: filename or vesseltree dictionary structure
:param outputfilename: output file name
:param axisorder: order of axis can be specified with this option
:return... | 0.004093 |
def add_extension_if_needed(filepath, ext, check_if_exists=False):
"""Add the extension ext to fpath if it doesn't have it.
Parameters
----------
filepath: str
File name or path
ext: str
File extension
check_if_exists: bool
Returns
-------
File name or path with extension... | 0.001838 |
def start(component, exact):
# type: (str, str) -> None
""" Create a new release branch.
Args:
component (str):
Version component to bump when creating the release. Can be *major*,
*minor* or *patch*.
exact (str):
The exact version to set for the release.... | 0.001978 |
def batch_retrieve_overrides_in_course(self, course_id, assignment_overrides_id, assignment_overrides_assignment_id):
"""
Batch retrieve overrides in a course.
Returns a list of specified overrides in this course, providing
they target sections/groups/students visible to the curren... | 0.004717 |
def transaction(self, transaction_id, expand_merchant=False):
"""
Returns an individual transaction, fetched by its id.
Official docs:
https://monzo.com/docs/#retrieve-transaction
:param transaction_id: Monzo transaction ID
:type transaction_id: str
:param e... | 0.002401 |
def text(length, choices=string.ascii_letters):
""" returns a random (fixed length) string
:param length: string length
:param choices: string containing all the chars can be used to build the string
.. seealso::
:py:func:`rtext`
"""
return ''.join(choice(choices) for x in range(length)... | 0.006231 |
def load_training_roidbs(self, names):
"""
Args:
names (list[str]): name of the training datasets, e.g. ['train2014', 'valminusminival2014']
Returns:
roidbs (list[dict]):
Produce "roidbs" as a list of dict, each dict corresponds to one image with k>=0 instances... | 0.005275 |
def should_generate_summaries():
"""Is this an appropriate context to generate summaries.
Returns:
a boolean
"""
name_scope = tf.contrib.framework.get_name_scope()
if name_scope and "while/" in name_scope:
# Summaries don't work well within tf.while_loop()
return False
if tf.get_variable_scope(... | 0.014052 |
def closed_sets(C, mincount_connectivity=0):
""" Computes the strongly connected closed sets of C """
n = np.shape(C)[0]
S = connected_sets(C, mincount_connectivity=mincount_connectivity, strong=True)
closed = []
for s in S:
mask = np.zeros(n, dtype=bool)
mask[s] = True
if C[... | 0.004739 |
def insert_query(connection, publicId, aead, keyhandle, aeadobj):
"""this functions read the response fields and creates sql query. then
inserts everything inside the database"""
# turn the keyhandle into an integer
keyhandle = key_handle_to_int(keyhandle)
if not keyhandle == aead.key_handle:
... | 0.00277 |
def send_produce_request(self, payloads=None, acks=1,
timeout=DEFAULT_REPLICAS_ACK_MSECS,
fail_on_error=True, callback=None):
"""
Encode and send some ProduceRequests
ProduceRequests will be grouped by (topic, partition) and then
... | 0.002414 |
def smkdirs(dpath, mode=0o777):
"""Safely make a full directory path if it doesn't exist.
Parameters
----------
dpath : str
Path of directory/directories to create
mode : int [default=0777]
Permissions for the new directories
See also
--------
os.makedirs
"""
i... | 0.002591 |
async def send_rpc_message(self, message, context):
"""Handle a send_rpc message.
See :meth:`AbstractDeviceAdapter.send_rpc`.
"""
conn_string = message.get('connection_string')
rpc_id = message.get('rpc_id')
address = message.get('address')
timeout = message.get... | 0.003888 |
def _construct_select_query(**filter_definition):
"""Return SELECT statement that will be used as a filter.
:param filter_definition: definition of a filter that should be used for SELECT construction
:return:
"""
table_name = filter_definition.pop('table')
distinct = filter_definition.pop('dis... | 0.004848 |
def can_delete_post(self, post, user):
"""
Given a forum post, checks whether the user can delete the latter.
"""
checker = self._get_checker(user)
# A user can delete a post if...
# they are a superuser
# they are the original poster of the forum post
... | 0.004484 |
def filenumber_handle(self):
"""Get the number of files in the folder."""
self.__results = []
self.__dirs = []
self.__files = []
self.__ftp = self.connect()
self.__ftp.dir(self.args.path, self.__results.append)
self.logger.debug("dir results: {}".format(self.__res... | 0.001397 |
def attribute(self):
"""Set or reset attributes"""
paint = {
"bold": self.ESC + "1" + self.END,
1: self.ESC + "1" + self.END,
"dim": self.ESC + "2" + self.END,
2: self.ESC + "2" + self.END,
"underlined": self.ESC + "4" + self.END,
... | 0.00149 |
def _is_valid_language(self):
"""
Return True if the value of component in attribute "language" is valid,
and otherwise False.
:returns: True if value is valid, False otherwise
:rtype: boolean
"""
comp_str = self._encoded_value.lower()
lang_rxc = re.comp... | 0.004854 |
def _find_matching_algo(self, region):
"""! @brief Searches for a flash algo covering the regions's address range.'"""
for algo in self._info.algos:
# Both start and size are required attributes.
algoStart = int(algo.attrib['start'], base=0)
algoSize = int(algo.attrib... | 0.009709 |
def delete(self):
"""Delete the resource.
Returns:
True if the delete is successful. Will throw an error if
other errors occur
"""
session = self._session
url = session._build_url(self._resource_path(), self.id)
return session.delete(url, CB.boolean... | 0.006135 |
def id(self, value):
"""The id property.
Args:
value (string). the property value.
"""
if value == self._defaults['ai.device.id'] and 'ai.device.id' in self._values:
del self._values['ai.device.id']
else:
self._values['ai.device.id'] =... | 0.01227 |
def circle_touching_line(center, radius, start, end):
""" Return true if the given circle intersects the given segment. Note
that this checks for intersection with a line segment, and not an actual
line.
:param center: Center of the circle.
:type center: Vector
:param radius: Radius of the c... | 0.006098 |
def warp(source_file, destination_file, dst_crs=None, resolution=None, dimensions=None,
src_bounds=None, dst_bounds=None, src_nodata=None, dst_nodata=None,
target_aligned_pixels=False, check_invert_proj=True,
creation_options=None, resampling=Resampling.cubic, **kwargs):
"""Warp a raster ... | 0.000939 |
def _get_acq_evaluator(self, acq):
"""
Imports the evaluator
"""
from ..core.evaluators import select_evaluator
from copy import deepcopy
eval_args = deepcopy(self.config['acquisition']['evaluator'])
del eval_args['type']
return select_evaluator(self.conf... | 0.007958 |
def stop(self, actor, exc=None, exit_code=None):
"""Gracefully stop the ``actor``.
"""
if actor.state <= ACTOR_STATES.RUN:
# The actor has not started the stopping process. Starts it now.
actor.state = ACTOR_STATES.STOPPING
actor.event('start').clear()
... | 0.001183 |
def sort(ol,**kwargs):
'''
from elist.elist import *
ol = [1,3,4,2]
id(ol)
new = sort(ol)
ol
new
id(ol)
id(new)
####
ol = [1,3,4,2]
id(ol)
rslt = sort(ol,mode="original")
ol
rslt
id(ol)
id... | 0.005329 |
def get_converted(self, symbol, units='CAD', system=None, tag=None):
"""
Uses a Symbol's Dataframe, to build a new Dataframe,
with the data converted to the new units
Parameters
----------
symbol : str or tuple of the form (Dataframe, str)
Str... | 0.005202 |
def transform(self, data):
"""
Transform the SFrame `data` using a fitted model.
Parameters
----------
data : SFrame
The data to be transformed.
Returns
-------
A transformed SFrame.
Returns
-------
out: SFrame
... | 0.004902 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.