text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def download(url, path=None, headers=None, session=None, show_progress=True,
resume=True, auto_retry=True, max_rst_retries=5,
pass_through_opts=None, cainfo=None, user_agent=None, auth=None):
"""Main download function"""
hm = Homura(url, path, headers, session, show_progress, resume,
... | 0.002278 |
def check_path(path):
"""Check that a path is legal.
:return: the path if all is OK
:raise ValueError: if the path is illegal
"""
if path is None or path == b'' or path.startswith(b'/'):
raise ValueError("illegal path '%s'" % path)
if (
(sys.version_info[0] >= 3 and not isinsta... | 0.002033 |
def _remove_rid_from_vrf_list(self, ri):
"""Remove router ID from a VRF list.
This removes a router from the list of routers that's kept
in a map, using a VRF ID as the key. If the VRF exists, the
router is removed from the list if it's present. If the last
router in the list is... | 0.001664 |
def hard_path(path, prefix_dir):
"""Returns an absolute path to either the relative or absolute file."""
relative = abspath("%s/%s" % (prefix_dir, path))
a_path = abspath(path)
if os.path.exists(relative):
LOG.debug("using relative path %s (%s)", relative, path)
return relative
LOG.... | 0.002653 |
def add_job(self, job, merged=False, widened=False):
"""
Appended a new job to this JobInfo node.
:param job: The new job to append.
:param bool merged: Whether it is a merged job or not.
:param bool widened: Whether it is a widened job or not.
"""
job_type = ''
... | 0.004283 |
def get_description(self):
"""Returns description text as provided by the studio"""
if self._description:
return self._description
try:
trailerURL= "http://trailers.apple.com%s" % self.baseURL
response = urllib.request.urlopen(trailerURL)
Reader =... | 0.00861 |
def assemble_bucket(item):
"""Assemble a document representing all the config state around a bucket.
TODO: Refactor this, the logic here feels quite muddled.
"""
factory, b = item
s = factory()
c = s.client('s3')
# Bucket Location, Current Client Location, Default Location
b_location = ... | 0.002254 |
def ns(self, prefix, tag):
"""
Given a prefix and an XML tag, output the qualified name
for proper namespace handling on output.
"""
return etree.QName(self.prefixes[prefix], tag) | 0.009132 |
def autoclear(self):
"""Clear Redis and ThreatConnect data from staging data."""
for sd in self.staging_data:
data_type = sd.get('data_type', 'redis')
if data_type == 'redis':
self.clear_redis(sd.get('variable'), 'auto-clear')
elif data_type == 'redis-... | 0.002407 |
def strace(device, trace_address, breakpoint_address):
"""Implements simple trace using the STrace API.
Args:
device (str): the device to connect to
trace_address (int): address to begin tracing from
breakpoint_address (int): address to breakpoint at
Returns:
``None``
"""
j... | 0.00069 |
def check_pianoroll(arr):
"""
Return True if the array is a standard piano-roll matrix. Otherwise,
return False. Raise TypeError if the input object is not a numpy array.
"""
if not isinstance(arr, np.ndarray):
raise TypeError("`arr` must be of np.ndarray type")
if not (np.issubdtype(ar... | 0.001923 |
def metaseries_description_metadata(description):
"""Return metatata from MetaSeries image description as dict."""
if not description.startswith('<MetaData>'):
raise ValueError('invalid MetaSeries image description')
from xml.etree import cElementTree as etree # delayed import
root = etree.fro... | 0.000912 |
def patch_priority_class(self, name, body, **kwargs):
"""
partially update the specified PriorityClass
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.patch_priority_class(name, body, async... | 0.003682 |
def randint(self, a: int, b: int, n: Optional[int] = None) -> Union[List[int], int]:
""" Generate n numbers as a list or a single one if no n is given.
n is used to minimize the number of requests made and return type changes to be compatible
with :py:mod:`random`'s interface
"""
... | 0.011013 |
def raw_sql(self, query, results=False):
"""
Execute a given query string. Could have unexpected results if the
query modifies the behavior of the session in a way unknown to Ibis; be
careful.
Parameters
----------
query : string
DML or DDL statement
... | 0.00311 |
def dechunk(stream):
"""De-chunk HTTP body stream.
:param file stream: readable file-like object.
:rtype: __generator[bytes]
:raise: DechunkError
"""
# TODO(vovan): Add support for chunk extensions:
# TODO(vovan): http://tools.ietf.org/html/rfc2616#section-3.6.1
while True:
c... | 0.000948 |
def get_labs(format):
"""Gets Fab Lab data from fablabs.io."""
fablabs_json = data_from_fablabs_io(fablabs_io_labs_api_url_v0)
fablabs = {}
# Load all the FabLabs
for i in fablabs_json["labs"]:
current_lab = FabLab()
current_lab.name = i["name"]
current_lab.address_1 = i["a... | 0.001165 |
def Extract_Checkpoints(self):
'''
Extract the checkpoints and store in self.tracking_data
'''
# Make sure page is available
if self.page is None:
raise Exception("The HTML data was not fetched due to some reasons")
soup = BeautifulSoup(self.page,'html.parser')
# Check for invalid tracking number b... | 0.033375 |
def get_all(self, start=0, count=-1, filter='', query='', sort='', view='', fields='', uri=None, scope_uris=''):
"""Gets all items according with the given arguments.
Args:
start: The first item to return, using 0-based indexing.
If not specified, the default is 0 - start wi... | 0.005233 |
def rename_key(self, key_to_rename, strict=True):
"""
Rename the given keys from the given dictionary.
:param key_to_rename:
The key(s) to rename.
Expected format: :code:`{old:new}`
:type key_to_rename: dict
:param strict:
Tell us if we have ... | 0.003388 |
def publish_network(user=None, reset=False):
"""
Generate graph network for a user and plot it using Plotly
"""
username = generate_network(user, reset)
network_file = username_to_file(username)
plot_data = prepare_plot_data(network_file)
data = Data(plot_data)
# hide axis line, grid,... | 0.000913 |
def _merge_two_curves(curve1: Curve, curve2: Curve, qmin, qmax, qsep, use_additive_constant=False):
"""Merge two scattering curves
:param curve1: the first curve (longer distance)
:type curve1: sastool.classes.curve.GeneralCurve
:param curve2: the second curve (shorter distance)
:type curve2: sasto... | 0.003894 |
def get_content_comments(self, content_id, expand=None, parent_version=None, start=None, limit=None,
location=None, depth=None, callback=None):
"""
Returns the comments associated with a piece of content.
:param content_id (string): A string containing the id of the ... | 0.006795 |
def point_on_line(point, line_start, line_end, accuracy=50.):
"""Checks whether a point lies on a line
The function checks whether the point "point" (P) lies on the line defined by its starting point line_start (A) and
its end point line_end (B).
This is done by comparing the distance of [AB] with the ... | 0.004537 |
def call(self, params, _context, **kwargs):
'''Note that we're returning a Promise object here, and bypassing the
helper functionality that normally sets the results struct from the
returned object. Instead, we set _context.results directly inside of
another promise'''
assert le... | 0.005693 |
def save_playlist_file(self, stationFile=''):
""" Save a playlist
Create a txt file and write stations in it.
Then rename it to final target
return 0: All ok
-1: Error writing file
-2: Error renaming file
"""
if self._playlist_format_... | 0.006877 |
def set(self, instance, value, **kw): # noqa
"""Set the value of the uid reference field
"""
ref = []
# The value is an UID
if api.is_uid(value):
ref.append(value)
# The value is a dictionary, get the UIDs.
if u.is_dict(value):
ref = ref.... | 0.001612 |
def decode_varint(f, max_bytes=4):
"""Decode variable integer using algorithm similar to that described
in MQTT Version 3.1.1 line 297.
Parameters
----------
f: file
Object with a read method.
max_bytes: int or None
If a varint cannot be constructed using `max_bytes` or fewer
... | 0.001522 |
def _restore_queue(self):
"""Restore the previous state of the queue.
Note:
The restore currently adds the items back into the queue
using the URI, for items the Sonos system already knows about
this is OK, but for other items, they may be missing some of
... | 0.002717 |
def calculate_positions(self, first_bee_val, second_bee_val, value_range):
'''Calculate the new value/position for two given bee values
Args:
first_bee_val (int or float): value from the first bee
second_bee_val (int or float): value from the second bee
value_ranges ... | 0.00246 |
def index(self, item):
""" Not recommended for use on large lists due to time
complexity, but it works
-> #int list index of @item
"""
for i, x in enumerate(self.iter()):
if x == item:
return i
return None | 0.006897 |
def typeOf(cls, expected_type): #pylint: disable=no-self-argument,invalid-name,no-self-use
"""
(*Type does NOT consider inherited class)
Matcher.mtest(...) will return True if type(...) == expected_type
Return: Matcher
Raise: matcher_type_error
"""
if isinstance(e... | 0.009634 |
def parse_options_header(value):
"""Parse a ``Content-Type`` like header into a tuple with the content
type and the options:
>>> parse_options_header('text/html; charset=utf8')
('text/html', {'charset': 'utf8'})
This should not be used to parse ``Cache-Control`` like headers that use
a slightl... | 0.001034 |
def extract_meta(self, text):
"""
Takes input as the entire file.
Reads the first yaml document as metadata.
and the rest of the document as text
"""
first_line = True
metadata = []
content = []
metadata_parsed = False
for line in text.spl... | 0.002627 |
def clustering_coef_wu(W):
'''
The weighted clustering coefficient is the average "intensity" of
triangles around a node.
Parameters
----------
W : NxN np.ndarray
weighted undirected connection matrix
Returns
-------
C : Nx1 np.ndarray
clustering coefficient vector
... | 0.001736 |
def expandFunction(self, func, args=[]):
"""applies the given function to each of this stimulus's memerships when autoparamters are applied
:param func: callable to execute for each version of the stimulus
:type instancemethod:
:param args: arguments to feed to func
:type args: ... | 0.003786 |
def has_no_password(gpg_secret_keyid):
"""Returns True iif gpg_secret_key has a password"""
if gnupg is None:
return False
gpg = gnupg.GPG()
s = gpg.sign("", keyid=gpg_secret_keyid, passphrase="")
try:
return s.status == "signature created"
except AttributeError:
# Thi... | 0.002353 |
def getUncertainty(self, result=None):
"""Returns the uncertainty for this analysis and result.
Returns the value from Schema's Uncertainty field if the Service has
the option 'Allow manual uncertainty'. Otherwise, do a callback to
getDefaultUncertainty(). Returns None if no result speci... | 0.002002 |
def init_dynamic_structure_factor(self,
Qpoints,
T,
atomic_form_factor_func=None,
scattering_lengths=None,
freq_min=None,
... | 0.002753 |
def expected_cumulative_transactions(
model,
transactions,
datetime_col,
customer_id_col,
t,
datetime_format=None,
freq="D",
set_index_date=False,
freq_multiplier=1,
):
"""
Get expected and actual repeated cumulative transactions.
Parameters
----------
model:
... | 0.002699 |
def parse_intervals(diff_report):
"""
Parse a diff into an iterator of Intervals.
"""
for patch in diff_report.patch_set:
try:
old_pf = diff_report.old_file(patch.source_file)
new_pf = diff_report.new_file(patch.target_file)
except InvalidPythonFile:
... | 0.001053 |
def template_shebang(template, renderers, default, blacklist, whitelist, input_data):
'''
Check the template shebang line and return the list of renderers specified
in the pipe.
Example shebang lines::
#!yaml_jinja
#!yaml_mako
#!mako|yaml
#!jinja|yaml
#!jinja|mako|yaml
... | 0.00337 |
def get_gatk_annotations(config, include_depth=True, include_baseqranksum=True,
gatk_input=True):
"""Retrieve annotations to use for GATK VariantAnnotator.
If include_depth is false, we'll skip annotating DP. Since GATK downsamples
this will undercount on high depth sequencing and ... | 0.000759 |
def render(self, template_name, **kw):
'''
Given a template name and template vars.
Searches a template file based on engine set, and renders it
with corresponding engine.
Returns a string.
'''
logger.debug('Rendering template "%s"', template_name)
vars =... | 0.006329 |
def create(cls, op, *, derivs, vals=None):
"""Instantiate the derivative by repeatedly calling
the :meth:`~QuantumExpression._diff` method of `op` and evaluating the
result at the given `vals`.
"""
# To ensure stable ordering in Expression._get_instance_key, we explicitly
... | 0.0059 |
def sim(
model,
params_file=True,
tmax=None,
branching=None,
nrRealizations=None,
noiseObs=None,
noiseDyn=None,
step=None,
seed=None,
writedir=None,
) -> AnnData:
"""Simulate dynamic gene expression data [Wittmann09]_ [Wolf18]_.
Sample from a stochastic differential equa... | 0.000969 |
def get_transform_vector(self, resx, resy):
""" Given resolution it returns a transformation vector
:param resx: Resolution in x direction
:type resx: float or int
:param resy: Resolution in y direction
:type resy: float or int
:return: A tuple with 6 numbers representin... | 0.006135 |
def update_xml_element(self):
"""
Updates the xml element contents to matches the instance contents.
:returns: Updated XML element.
:rtype: lxml.etree._Element
"""
if not hasattr(self, 'xml_element'):
self.xml_element = etree.Element(self.name, nsmap=NSMAP)
... | 0.002237 |
def _flush(self):
"""
Flush metadata to the backing file
:return:
"""
with open(self.metadata_file, 'w') as f:
json.dump(self.metadata, f) | 0.010526 |
def to_text(data):
"""
Serializes a python object as plain text
If the data can be serialized as JSON, this method will use the to_json
method to format the data, otherwise the data is returned as is.
"""
try:
serialized_content = to_json(data, indent=4)
except Exception, e:
... | 0.00266 |
def summarization(text, cloud=None, batch=False, api_key=None, version=1, **kwargs):
"""
Given input text, returns a `top_n` length sentence summary.
Example usage:
.. code-block:: python
>>> from indicoio import summarization
>>> summary = summarization("https://en.wikipedia.o... | 0.004149 |
def set_multiple(self, **kwargs):
"""Configure multiple app key/value pairs"""
quiet = False
if not kwargs:
return
cmd = ["heroku", "config:set"]
for k in sorted(kwargs):
cmd.append("{}={}".format(k, quote(str(kwargs[k]))))
if self._is_sensitiv... | 0.004073 |
def rowsAfterValue(self, value, count):
"""
Retrieve some rows at or after a given sort-column value.
@param value: Starting value in the index for the current sort column
at which to start returning results. Rows with a column value for the
current sort column which is greater... | 0.002717 |
def status(self, all_instances=None, instance_ids=None, filters=None):
"""List instance info."""
params = {}
if filters:
params["filters"] = make_filters(filters)
if instance_ids:
params['InstanceIds'] = instance_ids
if all_instances is not None:
... | 0.003617 |
def scale_rows(A, v, copy=True):
"""Scale the sparse rows of a matrix.
Parameters
----------
A : sparse matrix
Sparse matrix with M rows
v : array_like
Array of M scales
copy : {True,False}
- If copy=True, then the matrix is copied to a new and different return
... | 0.0005 |
def scale_sfs(s):
"""Scale a site frequency spectrum.
Parameters
----------
s : array_like, int, shape (n_chromosomes,)
Site frequency spectrum.
Returns
-------
sfs_scaled : ndarray, int, shape (n_chromosomes,)
Scaled site frequency spectrum.
"""
k = np.arange(s.si... | 0.002825 |
def decode(self, fp: TextIO) -> BioCCollection:
"""
Deserialize ``fp`` to a BioC collection object.
Args:
fp: a ``.read()``-supporting file-like object containing a BioC collection
Returns:
an object of BioCollection
"""
# utf8_parser = etree.XML... | 0.004808 |
def exception_retry_middleware(make_request, web3, errors, retries=5):
"""
Creates middleware that retries failed HTTP requests. Is a default
middleware for HTTPProvider.
"""
def middleware(method, params):
if check_if_retry_on_failure(method):
for i in range(retries):
... | 0.001587 |
def list_build_configuration_set_records(page_size=200, page_index=0, sort="", q=""):
"""
List all build configuration set records.
"""
data = list_build_configuration_set_records_raw(page_size, page_index, sort, q)
if data:
return utils.format_json_list(data) | 0.010417 |
def apply_extends(self, rules):
"""Run through the given rules and translate all the pending @extends
declarations into real selectors on parent rules.
The list is modified in-place and also sorted in dependency order.
"""
# Game plan: for each rule that has an @extend, add its ... | 0.000718 |
def GetTopLevelContainingType(self):
"""Returns the root if this is a nested type, or itself if its the root."""
desc = self
while desc.containing_type is not None:
desc = desc.containing_type
return desc | 0.00885 |
def contents(self):
"""Return the list of contained directory entries, loading them
if not already loaded."""
if not self.contents_read:
self.contents_read = True
base = self.path
for entry in os.listdir(self.source_path):
source_path = os.path... | 0.002591 |
def update_member_details(self, member_id, payload_member_detail, **kwargs): # noqa: E501
"""Modify member details # noqa: E501
One of the paramters below is needed to modify member information # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchron... | 0.0018 |
def parseFragment(self, stream, container="div", encoding=None,
parseMeta=False, useChardet=True):
"""Parse a HTML fragment into a well-formed tree fragment
container - name of the element we're setting the innerHTML property
if set to None, default to 'div'
strea... | 0.004087 |
def check_nonparametric_sources(fname, smodel, investigation_time):
"""
:param fname:
full path to a source model file
:param smodel:
source model object
:param investigation_time:
investigation_time to compare with in the case of
nonparametric sources
:returns:
... | 0.001143 |
def set_speech_text(self, text):
"""Set response output speech as plain text type.
Args:
text: str. Response speech used when type is 'PlainText'. Cannot exceed
8,000 characters.
"""
self.response.outputSpeech.type = 'PlainText'
self.response.outputSp... | 0.008929 |
def solve_coupled_ecc_solution(F0, e0, gamma0, phase0, mc, q, t):
"""
Compute the solution to the coupled system of equations
from from Peters (1964) and Barack & Cutler (2004) at
a given time.
:param F0: Initial orbital frequency [Hz]
:param e0: Initial orbital eccentricity
:param gam... | 0.012005 |
def day_night_duration(
self,
daybreak: datetime.time = datetime.time(NORMAL_DAY_START_H),
nightfall: datetime.time = datetime.time(NORMAL_DAY_END_H)) \
-> Tuple[datetime.timedelta, datetime.timedelta]:
"""
Returns a ``(day, night)`` tuple of ``datetime.ti... | 0.001657 |
def _sysfs_attr(name, value=None, log_lvl=None, log_msg=None):
'''
Simple wrapper with logging around sysfs.attr
'''
if isinstance(name, six.string_types):
name = [name]
res = __salt__['sysfs.attr'](os.path.join(*name), value)
if not res and log_lvl is not None and log_msg is not None:
... | 0.002688 |
def _MI_setitem(self, args, value):
'Separate __setitem__ function of MIMapping'
indices = self.indices
N = len(indices)
empty = N == 0
if empty: # init the dict
index1, key, index2, index1_last = MI_parse_args(self, args, allow_new=True)
exist_names = [index1]
item = [key]
... | 0.003975 |
def register(self, name, obj):
"""Registers an unique type description"""
if name in self.all:
log.debug('register: %s already existed: %s', name, obj.name)
# code.interact(local=locals())
raise DuplicateDefinitionException(
'register: %s already exist... | 0.004587 |
def retrieve(customer_id):
"""
Retrieve a customer from its id.
:param customer_id: The customer id
:type customer_id: string
:return: The customer resource
:rtype: resources.Customer
"""
http_client = HttpClient()
response, __ = http_client.get(... | 0.007009 |
def datetime(self, timezone=None):
"""Returns a datetime object.
This object retains all information, including timezones.
:param timezone = self.timezone
The timezone (in seconds west of UTC) to return the value in. By
default, the timezone used when constructing the c... | 0.003311 |
def query(self, session=None):
'''Returns a new :class:`Query` for :attr:`Manager.model`.'''
if session is None or session.router is not self.router:
session = self.session()
return session.query(self.model) | 0.008097 |
def builder(sp, authnsign=False, wsign=False, valid_until=None, cache_duration=None, contacts=None, organization=None):
"""
Builds the metadata of the SP
:param sp: The SP data
:type sp: string
:param authnsign: authnRequestsSigned attribute
:type authnsign: string
... | 0.003303 |
def _print_speed(self):
'''Print the current speed.'''
if self._bandwidth_meter.num_samples:
speed = self._bandwidth_meter.speed()
if self._human_format:
file_size_str = wpull.string.format_size(speed)
else:
file_size_str = '{:.1f} b'.... | 0.00363 |
def _can_be_double(x):
"""
Return if the array can be safely converted to double.
That happens when the dtype is a float with the same size of
a double or narrower, or when is an integer that can be safely
converted to double (if the roundtrip conversion works).
"""
return ((np.issubdtype(... | 0.002 |
def FindClassIdInMoMetaIgnoreCase(classId):
""" Methods whether classId is valid or not . Given class is case insensitive. """
if not classId:
return None
if classId in _ManagedObjectMeta:
return classId
lClassId = classId.lower()
for key in _ManagedObjectMeta.keys():
if (key.lower() == lClassId):
... | 0.037572 |
def parseEC2Json2List(jsontext, region):
"""
Takes a JSON and returns a list of InstanceType objects representing EC2 instance params.
:param jsontext:
:param region:
:return:
"""
currentList = json.loads(jsontext)
ec2InstanceList = []
for k, v in iteritems(currentList["products"]):... | 0.004523 |
def _download_file_vizier(cat,filePath,catalogname='catalog.dat'):
'''
Stolen from Jo Bovy's gaia_tools package!
'''
sys.stdout.write('\r'+"Downloading file %s ...\r" \
% (os.path.basename(filePath)))
sys.stdout.flush()
try:
# make all intermediate directories
... | 0.01731 |
def getMaintenanceTypes(self):
""" Return the current list of maintenance types
"""
types = [('Preventive',safe_unicode(_('Preventive')).encode('utf-8')),
('Repair', safe_unicode(_('Repair')).encode('utf-8')),
('Enhancement', safe_unicode(_('Enhancement')).encod... | 0.010929 |
def pop (self, key, *args):
"""Remove lowercase key from dict and return value."""
assert isinstance(key, basestring)
return dict.pop(self, key.lower(), *args) | 0.016393 |
def getInfo(self):
"""
Returns a DevInfo instance, a named tuple with the following items:
- bustype: one of BUS_USB, BUS_HIL, BUS_BLUETOOTH or BUS_VIRTUAL
- vendor: device's vendor number
- product: device's product number
"""
devinfo = _hidraw_devinfo()
... | 0.004587 |
def add_group_mindist(self, group_definitions, group_pairs='all', threshold=None, periodic=True):
r"""
Adds the minimum distance between groups of atoms to the feature list. If the groups of
atoms are identical to residues, use :py:obj:`add_residue_mindist <pyemma.coordinates.data.featurizer.MDF... | 0.006404 |
def get_next_step(self):
"""Find the proper step when user clicks the Next button.
:returns: The step to be switched to.
:rtype: WizardStep instance or None
"""
subcategory = self.parent.step_kw_subcategory.selected_subcategory()
is_raster = is_raster_layer(self.parent.l... | 0.002899 |
def fit(self, features, classes):
"""Constructs the MDR ensemble from the provided training data
Parameters
----------
features: array-like {n_samples, n_features}
Feature matrix
classes: array-like {n_samples}
List of class labels for prediction
... | 0.003086 |
def get_tree_type(tree):
"""Return the (sub)tree type: 'root', 'nucleus', 'satellite', 'text' or 'leaf'
Parameters
----------
tree : nltk.tree.ParentedTree
a tree representing a rhetorical structure (or a part of it)
"""
if is_leaf_node(tree):
return SubtreeType.leaf
tree_t... | 0.004773 |
def confirm(self, token=None):
"""Returns the status of the invoice
STATUSES: pending, completed, cancelled
"""
_token = token if token else self._response.get("token")
return self._process('checkout-invoice/confirm/' + str(_token)) | 0.007326 |
def bokehjsdir(dev=False):
""" Get the location of the bokehjs source files. If dev is True,
the files in bokehjs/build are preferred. Otherwise uses the files
in bokeh/server/static.
"""
dir1 = join(ROOT_DIR, '..', 'bokehjs', 'build')
dir2 = join(serverdir(), 'static')
if dev and isdir(dir1... | 0.002688 |
def populate_db(sql_path):
"""Load data in the `sql_path` file into DATABASES['default']"""
logger.info("Populating DB %s from %s", repr(DB["NAME"]), repr(sql_path))
shell(
'psql -U "{USER}" -h "{HOST}" -d "{NAME}" --file={sql_path}'.format(
sql_path=sql_path, **DB
)
) | 0.003185 |
def install(cls, uninstallable, prefix, path_items, root=None, warning=None):
"""Install an importer for modules found under ``path_items`` at the given import ``prefix``.
:param bool uninstallable: ``True`` if the installed importer should be uninstalled and any
imports it perfo... | 0.006916 |
def unregistercls(self, schemacls=None, data_types=None):
"""Unregister schema class or associated data_types.
:param type schemacls: sub class of Schema.
:param list data_types: data_types to unregister.
"""
if schemacls is not None:
# clean schemas by data type
... | 0.002865 |
def n_way_models(mdr_instance, X, y, n=[2], feature_names=None):
"""Fits a MDR model to all n-way combinations of the features in X.
Note that this function performs an exhaustive search through all feature combinations and can be computationally expensive.
Parameters
----------
mdr_instance: obje... | 0.002897 |
def get_users(self, limit=100, offset=0):
"""
Get all users from your current team
"""
url = self.TEAM_USERS_URL + "?limit=%s&offset=%s" % (limit, offset)
connection = Connection(self.token)
connection.set_url(self.production, url)
return connection.get_request(... | 0.006231 |
def render(self, template, fail='## :todo: add {template}'):
"""
Returns the rendered value for the inputted template name.
:param template | <str>
"""
try:
return self._templates[template].render(scaffold=self)
except KeyError:
retur... | 0.008523 |
def run_shex_manifest(manifest_url, index=0, debug=False):
"""
:param manifest: A url to a manifest that contains all the ingredients to run a shex conformance test
:param index: Manifests are stored in lists. This method only handles one manifest, hence by default the first
manif... | 0.00467 |
def _getDocstringLineno(self, node_type, node):
"""
Get line number of the docstring.
@param node_type: type of node_type
@param node: node of currently checking
@return: line number
"""
docstringStriped = node.as_string().strip()
linenoDocstring = (node.... | 0.003578 |
def info(self, msg, *args, **kwargs) -> Task: # type: ignore
"""
Log msg with severity 'INFO'.
To pass exception information, use the keyword argument exc_info with
a true value, e.g.
await logger.info("Houston, we have an interesting problem", exc_info=1)
"""
... | 0.007874 |
def deprecation(self, message, *args, **kws):
"""Show a deprecation warning."""
self._log(DEPRECATION, message, args, **kws) | 0.007576 |
def delete(self, url, headers=None, **kwargs):
"""Sends a DELETE request to a URL.
:param url: The URL.
:type url: ``string``
:param headers: A list of pairs specifying the headers for the HTTP
response (for example, ``[('Content-Type': 'text/cthulhu'), ('Token': 'boris')]``... | 0.003909 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.