text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def icetea_main():
"""
Main function for running Icetea. Calls sys.exit with the return code to exit.
:return: Nothing.
"""
from icetea_lib import IceteaManager
manager = IceteaManager.IceteaManager()
return_code = manager.run()
sys.exit(return_code) | 0.007067 |
def handle_enterprise_logistration(backend, user, **kwargs):
"""
Perform the linking of user in the process of logging to the Enterprise Customer.
Args:
backend: The class handling the SSO interaction (SAML, OAuth, etc)
user: The user object in the process of being logged in with
**... | 0.004762 |
def read_set_from_file(filename: str) -> Set[str]:
"""
Extract a de-duped collection (set) of text from a file.
Expected file format is one item per line.
"""
collection = set()
with open(filename, 'r') as file_:
for line in file_:
collection.add(line.rstrip())
return col... | 0.003058 |
def _dispatch(self, operation, request, path_args):
"""
Wrapped dispatch method, prepare request and generate a HTTP Response.
"""
# Determine the request and response types. Ensure API supports the requested types
request_type = resolve_content_type(self.request_type_resolvers, ... | 0.003659 |
def compute(self, bottomUpInput, enableLearn, enableInference=None):
"""
Handle one compute, possibly learning.
.. note:: It is an error to have both ``enableLearn`` and
``enableInference`` set to False
.. note:: By default, we don't compute the inference output when learning
... | 0.009357 |
def year(self, value=None):
"""
We do *NOT* know for what year we are converting so lets assume the
year has 365 days.
"""
if value is None:
return self.day() / 365
else:
self.millisecond(self.day(value * 365)) | 0.007092 |
def generate_file(project_dir, infile, context, env):
"""Render filename of infile as name of outfile, handle infile correctly.
Dealing with infile appropriately:
a. If infile is a binary file, copy it over without rendering.
b. If infile is a text file, render its contents and write the
... | 0.000406 |
def render_text(text, preformatted=False):
""" Return text formatted as a HTML
Args:
text: the text to render
preformatted: whether the text should be rendered as preformatted
"""
return IPython.core.display.HTML(_html.HtmlBuilder.render_text(text, preformatted)) | 0.014286 |
def validate(self):
"""Validate the edges."""
for function in compat_itervalues(self.functions):
for callee_id in compat_keys(function.calls):
assert function.calls[callee_id].callee_id == callee_id
if callee_id not in self.functions:
sys.... | 0.006289 |
def get_jar_url(version=None):
"""Get the URL to a Stanford CoreNLP jar file with a specific
version. These jars come from Maven since the Maven version is
smaller than the full CoreNLP distributions. Defaults to
DEFAULT_CORENLP_VERSION."""
if version is None:
version... | 0.002257 |
def string_to_int( s ):
"""Convert a string of bytes into an integer, as per X9.62."""
result = 0
for c in s:
if not isinstance(c, int): c = ord( c )
result = 256 * result + c
return result | 0.04878 |
def update_qos_aggregated_configuration(self, qos_configuration, timeout=-1):
"""
Updates the QoS aggregated configuration for the logical interconnect.
Args:
qos_configuration:
QOS configuration.
timeout:
Timeout in seconds. Wait for task... | 0.005865 |
def write(self, text, fg='black', bg='white'):
'''write to the console'''
if isinstance(text, str):
sys.stdout.write(text)
else:
sys.stdout.write(str(text))
sys.stdout.flush()
if self.udp.connected():
self.udp.writeln(text)
if self.tcp.... | 0.00545 |
def remove_edge(self, u, v):
"""Version of remove_edge that's much like normal networkx but only
deletes once, since the database doesn't keep separate adj and
succ mappings
"""
try:
del self.succ[u][v]
except KeyError:
raise NetworkXError(
... | 0.005076 |
def fftshift(arr_obj, axes = None, res_g = None, return_buffer = False):
"""
gpu version of fftshift for numpy arrays or OCLArrays
Parameters
----------
arr_obj: numpy array or OCLArray (float32/complex64)
the array to be fftshifted
axes: list or None
the axes over which to shif... | 0.012964 |
def _get_tags(self, entity=None, tag_type=None):
"""Generate the tags for a given entity (container or image) according to a list of tag names."""
# Start with custom tags
tags = list(self.custom_tags)
# Collect pod names as tags on kubernetes
if Platform.is_k8s() and KubeUtil.P... | 0.003168 |
def DoesIDExist(tag_name):
"""
Determines if a fully-qualified site.service.tag eDNA tag exists
in any of the connected services.
:param tag_name: fully-qualified (site.service.tag) eDNA tag
:return: true if the point exists, false if the point does not exist
Example:
>>> DoesID... | 0.001592 |
def line(self, node, coords, close=False, **kwargs):
"""Draw a svg line"""
line_len = len(coords)
if len([c for c in coords if c[1] is not None]) < 2:
return
root = 'M%s L%s Z' if close else 'M%s L%s'
origin_index = 0
while origin_index < line_len and None in ... | 0.004802 |
def network_define(name, bridge, forward, **kwargs):
'''
Create libvirt network.
:param name: Network name
:param bridge: Bridge name
:param forward: Forward mode(bridge, router, nat)
:param vport: Virtualport type
:param tag: Vlan tag
:param autostart: Network autostart (default True)
... | 0.000552 |
def diff(x, y, x_only=False, y_only=False):
"""
Retrieve a unique of list of elements that do not exist in both x and y.
Capable of parsing one-dimensional (flat) and two-dimensional (lists of lists) lists.
:param x: list #1
:param y: list #2
:param x_only: Return only unique values from x
... | 0.001404 |
def week_number(date):
"""
Return the Python week number of a date.
The django \|date:"W" returns incompatible value
with the view implementation.
"""
week_number = date.strftime('%W')
if int(week_number) < 10:
week_number = week_number[-1]
return week_number | 0.006689 |
def _send(self, message, read_reply=False):
"""Send a command string to the amplifier."""
sock = None
for tries in range(0, 3):
try:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((self._host, self.PORT))
break
... | 0.00177 |
def attention_lm_moe_base_long_seq():
"""Hyper parameters specifics for long sequence generation."""
hparams = attention_lm_moe_base()
hparams.max_length = 0 # max_length == batch_size
hparams.eval_drop_long_sequences = True
hparams.min_length_bucket = 256 # Avoid cyclic problems for big batches
hparams.... | 0.022472 |
def subontology(self, minimal=False):
"""
Generates a sub-ontology based on associations
"""
return self.ontology.subontology(self.objects, minimal=minimal) | 0.010638 |
def load_from_stream(self, stream, container, **kwargs):
"""
Load config from given file like object 'stream`.
:param stream: Config file or file like object
:param container: callble to make a container object later
:param kwargs: optional keyword parameters to be sanitized ::... | 0.004367 |
def get_user(uwnetid, include_course_summary=True):
"""
Return a list of BridgeUsers objects with custom fields
"""
url = author_uid_url(uwnetid) + "?%s" % CUSTOM_FIELD
if include_course_summary:
url = "%s&%s" % (url, COURSE_SUMMARY)
resp = get_resource(url)
return _process_json_resp... | 0.003021 |
def _reverse_transform_column(self, table, metadata, table_name):
"""Reverses the transformtion on a column from table using the given parameters.
Args:
table (pandas.DataFrame): Dataframe containing column to transform.
metadata (dict): Metadata for given column.
ta... | 0.004968 |
def rlmb_base_stochastic_discrete_noresize():
"""Base setting with stochastic discrete model."""
hparams = rlmb_base()
hparams.generative_model = "next_frame_basic_stochastic_discrete"
hparams.generative_model_params = "next_frame_basic_stochastic_discrete"
hparams.resize_height_factor = 1
hparams.resize_wi... | 0.022792 |
def get_documenter(obj, parent):
"""Get an autodoc.Documenter class suitable for documenting the given
object.
*obj* is the Python object to be documented, and *parent* is an
another Python object (e.g. a module or a class) to which *obj*
belongs to.
"""
from sphinx.ext.autodoc import AutoD... | 0.001699 |
def setProduct(self, cache=False, *args, **kwargs):
"""Adds the product for this loan to a 'product' field.
Product is a MambuProduct object.
cache argument allows to use AllMambuProducts singleton to
retrieve the products. See mambuproduct.AllMambuProducts code
and pydoc for f... | 0.002742 |
def solid_named(self, name):
'''Return the solid named "name". Throws if it does not exist.
Args:
name (str): Name of solid
Returns:
SolidDefinition: SolidDefinition with correct name.
'''
check.str_param(name, 'name')
if name not in self._solid_... | 0.00346 |
def swap(self, c2):
'''
put the order of currencies as market standard
'''
inv = False
c1 = self
if c1.order > c2.order:
ct = c1
c1 = c2
c2 = ct
inv = True
return inv, c1, c2 | 0.007194 |
def docopt(doc, argv=None, help=True, version=None, options_first=False):
"""Parse `argv` based on command-line interface described in `doc`.
`docopt` creates your command-line interface based on its
description that you pass as `doc`. Such description can contain
--options, <positional-argument>, comm... | 0.000951 |
def modified_lines(filename, extra_data, commit=None):
"""Returns the lines that have been modifed for this file.
Args:
filename: the file to check.
extra_data: is the extra_data returned by modified_files. Additionally, a
value of None means that the file was not modified.
commit: th... | 0.001612 |
def extract_grid(self, longmin, longmax, latmin, latmax):
''' Extract part of the image ``img``
Args:
longmin (float): Minimum longitude of the window
longmax (float): Maximum longitude of the window
latmin (float): Minimum latitude of the window
latmax (... | 0.001397 |
def getPartitionId(self, i):
"""
Gets the partition id given an index.
:param i: index of partition
:returns: the partition id associated with pattern i. Returns None if no id
is associated with it.
"""
if (i < 0) or (i >= self._numPatterns):
raise RuntimeError("index out of bound... | 0.00885 |
def _load_corpus(name, data_home=None):
"""
Load a corpus object by name.
"""
info = DATASETS[name]
return Corpus(name, data_home=data_home, **info) | 0.005952 |
def restore(self, checkpoint_path):
"""Restores training state from a given model checkpoint.
These checkpoints are returned from calls to save().
Subclasses should override ``_restore()`` instead to restore state.
This method restores additional metadata saved with the checkpoint.
... | 0.001729 |
def getWorkingPlayAreaRect(self):
"""
Returns the 4 corner positions of the Play Area (formerly named Soft Bounds) from the working copy.
Corners are in clockwise order.
Tracking space center (0,0,0) is the center of the Play Area.
It's a rectangle.
2 sides are parallel t... | 0.006873 |
def log_histograms(self, model: Model, histogram_parameters: Set[str]) -> None:
"""
Send histograms of parameters to tensorboard.
"""
for name, param in model.named_parameters():
if name in histogram_parameters:
self.add_train_histogram("parameter_histogram/" ... | 0.005988 |
def _start(self, my_task, force=False):
"""Returns False when successfully fired, True otherwise"""
if (not hasattr(my_task, 'subprocess')) or my_task.subprocess is None:
my_task.subprocess = subprocess.Popen(self.args,
stderr=subprocess.STDO... | 0.002667 |
def _expectation(p, lin_kern, feat1, rbf_kern, feat2, nghp=None):
"""
Compute the expectation:
expectation[n] = <Ka_{Z1, x_n} Kb_{x_n, Z2}>_p(x_n)
- K_lin_{.,.} :: Linear kernel
- K_rbf_{.,.} :: RBF kernel
Different Z1 and Z2 are handled if p is diagonal and K_lin and K_rbf have disjoint... | 0.007561 |
def _update_staticmethod(self, oldsm, newsm):
"""Update a staticmethod update."""
# While we can't modify the staticmethod object itself (it has no
# mutable attributes), we *can* extract the underlying function
# (by calling __get__(), which returns it) and update it in-place.
#... | 0.004082 |
def parse(text):
"""
Parse the docstring into its components.
:returns: parsed docstring
"""
ret = Docstring()
if not text:
return ret
text = inspect.cleandoc(text)
match = re.search('^:', text, flags=re.M)
if match:
desc_chunk = text[:match.start()]
meta_ch... | 0.000681 |
async def set_message(
self, text=None, reply_to=0, parse_mode=(),
link_preview=None):
"""
Changes the draft message on the Telegram servers. The changes are
reflected in this object.
:param str text: New text of the draft.
Preserved if l... | 0.001304 |
def _writecheck(self, zinfo):
"""Check for errors before writing a file to the archive."""
if zinfo.filename in self.NameToInfo:
if self.debug: # Warning for duplicate names
print "Duplicate name:", zinfo.filename
if self.mode not in ("w", "a"):
raise... | 0.006114 |
def mtz(n,c):
"""mtz: Miller-Tucker-Zemlin's model for the (asymmetric) traveling salesman problem
(potential formulation)
Parameters:
- n: number of nodes
- c[i,j]: cost for traversing arc (i,j)
Returns a model, ready to be solved.
"""
model = Model("atsp - mtz")
x,u = {},... | 0.029894 |
def render_confirm_form(self):
"""
Second step of ExpressCheckout. Display an order confirmation form which
contains hidden fields with the token / PayerID from PayPal.
"""
warn_untested()
initial = dict(token=self.request.GET['token'], PayerID=self.request.GET['PayerID']... | 0.012245 |
def ensure_one_opt_multi_ifo(opt, parser, ifo, opt_list):
""" Check that one and only one in the opt_list is defined in opt
Parameters
----------
opt : object
Result of option parsing
parser : object
OptionParser instance.
opt_list : list of strings
"""
the_one = None
... | 0.00576 |
def send_audio_packet(self, data, *, encode=True):
"""Sends an audio packet composed of the data.
You must be connected to play audio.
Parameters
----------
data: bytes
The :term:`py:bytes-like object` denoting PCM or Opus voice data.
encode: bool
... | 0.004562 |
def _intersect_edge_arrays(self, lines1, lines2):
"""Return the intercepts of all lines defined in *lines1* as they
intersect all lines in *lines2*.
Arguments are of shape (..., 2, 2), where axes are:
0: number of lines
1: two points per line
2: x,y pa... | 0.008966 |
def gain(self, db):
"""gain takes one paramter: gain in dB."""
self.command.append('gain')
self.command.append(db)
return self | 0.012658 |
def like_button_js_tag(context):
""" This tag will check to see if they have the FACEBOOK_LIKE_APP_ID setup
correctly in the django settings, if so then it will pass the data
along to the intercom_tag template to be displayed.
If something isn't perfect we will return False, which will then... | 0.001049 |
def get_object_record(self, pid):
"""Get an object that has already been cached in the object tree.
Caching happens when the object tree is refreshed.
"""
try:
return self._cache['records'][pid]
except KeyError:
raise d1_onedrive.impl.onedrive_exceptions... | 0.008499 |
def VariablesValues(self, variables, t):
"""
Returns the value of given variables at time t.
Linear interpolation is performed between two time steps.
:param variables: one variable or a list of variables
:param t: time of evaluation
"""
# TODO: put interpolatio... | 0.005302 |
def cancel_order(self, multi=False, **order_identifiers):
"""Cancel one or multiple orders via Websocket.
:param multi: bool, whether order_settings contains settings for one, or
multiples orders
:param order_identifiers: Identifiers for the order(s) you with to cancel
... | 0.007921 |
def _remove_io_handler(self, handler):
"""Remove an i/o-handler."""
if handler in self._unprepared_handlers:
old_fileno = self._unprepared_handlers[handler]
del self._unprepared_handlers[handler]
else:
old_fileno = handler.fileno()
if old_fileno is not... | 0.004684 |
def from_url(cls, db_url=ALL_SETS_ZIP_URL):
"""Load card data from a URL.
Uses :func:`requests.get` to fetch card data. Also handles zipfiles.
:param db_url: URL to fetch.
:return: A new :class:`~mtgjson.CardDb` instance.
"""
r = requests.get(db_url)
r.raise_for... | 0.002519 |
def file_list_hosts( blockchain_id, wallet_keys=None, config_path=CONFIG_PATH ):
"""
Given a blockchain ID, find out the hosts the blockchain ID owner has registered keys for.
Return {'status': True, 'hosts': hostnames} on success
Return {'error': ...} on failure
"""
config_dir = os.path.dirname... | 0.009592 |
def append_track(self, track=None, pianoroll=None, program=0, is_drum=False,
name='unknown'):
"""
Append a multitrack.Track instance to the track list or create a new
multitrack.Track object and append it to the track list.
Parameters
----------
trac... | 0.003032 |
def create_source_import(self, vcs, vcs_url, vcs_username=github.GithubObject.NotSet, vcs_password=github.GithubObject.NotSet):
"""
:calls: `PUT /repos/:owner/:repo/import <https://developer.github.com/v3/migration/source_imports/#start-an-import>`_
:param vcs: string
:param vcs_url: str... | 0.004682 |
async def sleep(self, duration: float=0.0) -> None:
'''Simple wrapper around `asyncio.sleep()`.'''
duration = max(0, duration)
if duration > 0:
Log.debug('sleeping task %s for %.1f seconds', self.name, duration)
await asyncio.sleep(duration) | 0.013793 |
def make_spot_fleet_cluster(
security_groupid,
subnet_id,
keypair_name,
iam_instance_profile_arn,
spot_fleet_iam_role,
target_capacity=20,
spot_price=0.4,
expires_days=7,
allocation_strategy='lowestPrice',
instance_types=SPOT_INSTANCE_TYPES... | 0.001575 |
def clean_fail(func):
'''
A decorator to cleanly exit on a failed call to AWS.
catch a `botocore.exceptions.ClientError` raised from an action.
This sort of error is raised if you are targeting a region that
isn't set up (see, `credstash setup`.
'''
def func_wrapper(*args, **kwargs):
... | 0.001961 |
def simulate(self):
""" Section 7 - uwg main section
self.N # Total hours in simulation
self.ph # per hour
self.dayType # 3=Sun, 2=Sat, 1=Weekday
self.ceil_time_step # simulation timestep (dt) fitted to weathe... | 0.004801 |
def chunks(data, chunk_size):
""" Yield chunk_size chunks from data."""
for i in xrange(0, len(data), chunk_size):
yield data[i:i+chunk_size] | 0.006369 |
def check_for_file(self, share_name, directory_name, file_name, **kwargs):
"""
Check if a file exists on Azure File Share.
:param share_name: Name of the share.
:type share_name: str
:param directory_name: Name of the directory.
:type directory_name: str
:param f... | 0.002782 |
def UpdateResourcesFromResFile(dstpath, srcpath, types=None, names=None,
languages=None):
"""
Update or add resources from dll/exe file srcpath in dll/exe file dstpath.
types = a list of resource types to update (None = all)
names = a list of resource names to update... | 0.007797 |
def note_addition(self, key, value):
"""
Updates the change state to reflect the addition of a field. Detects previous
changes and deletions of the field and acts accordingly.
"""
# If we're adding a field we previously deleted, remove the deleted note.
if key in self._de... | 0.008375 |
def Chunks(l, n, all=False):
'''
Returns a generator of consecutive `n`-sized chunks of list `l`.
If `all` is `True`, returns **all** `n`-sized chunks in `l`
by iterating over the starting point.
'''
if all:
jarr = range(0, n - 1)
else:
jarr = [0]
for j in jarr:
... | 0.003846 |
def parse_column_names(text):
"""
Extracts column names from a string containing quoted and comma separated
column names.
:param text: Line extracted from `COPY` statement containing quoted and
comma separated column names.
:type text: str
:return: Tuple containing just the co... | 0.002053 |
def load_config_module():
"""
If the config.py file exists, import it as a module. If it does not exist,
call sys.exit() with a request to run oaepub configure.
"""
import imp
config_path = config_location()
try:
config = imp.load_source('config', config_path)
except IOError:
... | 0.001795 |
def dump(props, output):
"""Dumps a dict of properties to the specified open stream or file path.
:API: public
"""
def escape(token):
return re.sub(r'([=:\s])', r'\\\1', token)
def write(out):
for k, v in props.items():
out.write('%s=%s\n' % (escape(str(k)), escape(str(v))))
... | 0.011532 |
def _read_opt_type(self, kind):
"""Read option type field.
Positional arguments:
* kind -- int, option kind value
Returns:
* dict -- extracted IPv4 option
Structure of option type field [RFC 791]:
Octets Bits Name Des... | 0.002491 |
def create_ip_range(self, network_view, start_ip, end_ip, network,
disable, range_extattrs):
"""Creates IPRange or fails if already exists."""
return obj.IPRange.create(self.connector,
network_view=network_view,
... | 0.00495 |
def rate(self, from_currency, to_currency, date):
"""Get the exchange rate between the specified currencies"""
return (1 / self.backend.get_rate(from_currency, date)) * self.backend.get_rate(
to_currency, date
) | 0.012146 |
def settimeout(self, timeout):
"""
Set the timeout to the websocket.
timeout: timeout time(second).
"""
self.sock_opt.timeout = timeout
if self.sock:
self.sock.settimeout(timeout) | 0.008333 |
def reply_code_tuple(code: int) -> Tuple[int, int, int]:
'''Return the reply code as a tuple.
Args:
code: The reply code.
Returns:
Each item in the tuple is the digit.
'''
return code // 100, code // 10 % 10, code % 10 | 0.003906 |
def wallet_representative_set(self, wallet, representative):
"""
Sets the default **representative** for **wallet**
.. enable_control required
:param wallet: Wallet to set default representative account for
:type wallet: str
:param representative: Representative accoun... | 0.004004 |
def remove_dupes(list_with_dupes):
'''Remove duplicate entries from a list while preserving order
This function uses Python's standard equivalence testing methods in
order to determine if two elements of a list are identical. So if in the list [a,b,c]
the condition a == b is True, then regardless of wh... | 0.005574 |
def validate(self):
""" validate: Makes sure content node is valid
Args: None
Returns: boolean indicating if content node is valid
"""
assert self.role in ROLES, "Assumption Failed: Role must be one of the following {}".format(ROLES)
assert isinstance(self.license... | 0.006557 |
def get_json_report_object(self, key):
"""
Retrieve a JSON report object of the report.
:param key: The key of the report object
:return: The deserialized JSON report object.
"""
con = ConnectionManager().get_connection(self._connection_alias)
return con.get_json... | 0.008021 |
def _process_scalar_value(name, parse_fn, var_type, m_dict, values,
results_dictionary):
"""Update results_dictionary with a scalar value.
Used to update the results_dictionary to be returned by parse_values when
encountering a clause with a scalar RHS (e.g. "s=5" or "arr[0]=5".)
Mu... | 0.007616 |
def concatenate_aiml(path='aiml-en-us-foundation-alice.v1-9.zip', outfile='aiml-en-us-foundation-alice.v1-9.aiml'):
"""Strip trailing </aiml> tag and concatenate all valid AIML files found in the ZIP."""
path = find_data_path(path) or path
zf = zipfile.ZipFile(path)
for name in zf.namelist():
i... | 0.00466 |
def readAxes(self):
""" Read the axes element.
"""
for axisElement in self.root.findall(".axes/axis"):
axis = {}
axis['name'] = name = axisElement.attrib.get("name")
axis['tag'] = axisElement.attrib.get("tag")
axis['minimum'] = float(axisElement.at... | 0.001978 |
def add_logging_handler(handler, format_='file'):
"""
mostly for util_logging internals
"""
global __UTOOL_ROOT_LOGGER__
if __UTOOL_ROOT_LOGGER__ is None:
builtins.print('[WARNING] logger not started, cannot add handler')
return
# create formatter and add it to the handlers
#... | 0.003413 |
async def get_user_data(self):
"""Get Tautulli userdata."""
userdata = {}
sessions = self.session_data.get('sessions', {})
try:
async with async_timeout.timeout(8, loop=self._loop):
for username in self.tautulli_users:
userdata[username] = ... | 0.002022 |
def rel_path_from_chan_path(chan_path, channeldir, windows=False):
"""
Convert `chan_path` as obtained from a metadata provider into a `rel_path`
suitable for accessing the file from the current working directory, e.g.,
>>> rel_path_from_chan_path('Open Stax/Math', 'content/open_stax_zip/Open Stax')
... | 0.003226 |
def makeBiDirectional(d):
"""
Helper for generating tagNameConverter
Makes dict that maps from key to value and back
"""
dTmp = d.copy()
for k in d:
dTmp[d[k]] = k
return dTmp | 0.004739 |
def addTransitions(self, state, transitions):
"""
Create a new L{TransitionTable} with all the same transitions as this
L{TransitionTable} plus a number of new transitions.
@param state: The state for which the new transitions are defined.
@param transitions: A L{dict} mapping i... | 0.00271 |
def _update_column_info(self):
"""
Used for validation during parsing, and additional
book-keeping. For internal use only.
"""
del self.columnnames[:]
del self.columntypes[:]
del self.columnpytypes[:]
for child in self.getElementsByTagName(ligolw.Column.tagName):
if self.validcolumns is not None:
... | 0.022913 |
def install_python_module(name):
""" instals a python module using pip """
with settings(hide('warnings', 'running', 'stdout', 'stderr'),
warn_only=False, capture=True):
run('pip --quiet install %s' % name) | 0.004149 |
def _Fierz_to_EOS_V(Fsbuu,Fsbdd,Fsbcc,Fsbss,Fsbbb,parameters):
p = parameters
V = ckmutil.ckm.ckm_tree(p["Vus"], p["Vub"], p["Vcb"], p["delta"])
Vtb = V[2,2]
Vts = V[2,1]
"""From Fierz to the EOS basis for b -> s transitions.
The arguments are dictionaries of the corresponding Fierz bases """
... | 0.007829 |
def raster(self, path, size, bandtype=gdal.GDT_Byte):
"""Returns a new Raster instance.
gdal.Driver.Create() does not support all formats.
Arguments:
path -- file object or path as str
size -- two or three-tuple of (xsize, ysize, bandcount)
bandtype -- GDAL pixel data t... | 0.00186 |
def _install(archive_filename, install_args=()):
"""Install Setuptools."""
with archive_context(archive_filename):
# installing
log.warn('Installing Setuptools')
if not _python_cmd('setup.py', 'install', *install_args):
log.warn('Something went wrong during the installation.'... | 0.002336 |
def _export_dx(self, filename, type=None, typequote='"', **kwargs):
"""Export the density grid to an OpenDX file.
The file format is the simplest regular grid array and it is
also understood by VMD's and Chimera's DX reader; PyMOL
requires the dx `type` to be set to "double".
F... | 0.00233 |
def search_reference_sets(
self, accession=None, md5checksum=None, assembly_id=None):
"""
Returns an iterator over the ReferenceSets fulfilling the specified
conditions.
:param str accession: If not null, return the reference sets for which
the `accession` matche... | 0.001526 |
def make_cache(self, backend=None):
"""Make a cache to reduce the time of run. Some backends may implemented it.
This is temporary API. It may changed or deprecated."""
if backend is None:
if self._default_backend is None:
backend = DEFAULT_BACKEND_NAME
e... | 0.006652 |
def send_key(self, key):
""" Send a key to the Horizon box. """
cmd = struct.pack(">BBBBBBH", 4, 1, 0, 0, 0, 0, key)
self.con.send(cmd)
cmd = struct.pack(">BBBBBBH", 4, 0, 0, 0, 0, 0, key)
self.con.send(cmd) | 0.008065 |
def get_vpc_id(self):
"""Gets the VPC ID for this EC2 instance
:return: String instance ID or None
"""
log = logging.getLogger(self.cls_logger + '.get_vpc_id')
# Exit if not running on AWS
if not self.is_aws:
log.info('This machine is not running in AWS, exi... | 0.003089 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.