text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def get_schema(self, filename):
"""
Guess schema using messytables
"""
table_set = self.read_file(filename)
# Have I been able to read the filename
if table_set is None:
return []
# Get the first table as rowset
row_set = table_... | 0.0076 |
def throttle(self, wait):
"""
Returns a function, that, when invoked, will only be triggered
at most once during a given window of time.
"""
ns = self.Namespace()
ns.timeout = None
ns.throttling = None
ns.more = None
ns.result = None
def d... | 0.001938 |
def sample(self, bqm, **kwargs):
"""Sample from the specified binary quadratic model.
Args:
bqm (:obj:`dimod.BinaryQuadraticModel`):
Binary quadratic model to be sampled from.
**kwargs:
Optional keyword arguments for the sampling method, specifie... | 0.006533 |
def get_gmm_pdf(self, x):
"""Calculate the GMM likelihood for a single point.
.. math::
y = \\sum_{i=1}^{N} w_i
\\times \\text{normpdf}(x, x_i, \\sigma_i)/\\sum_{i=1}^{N} w_i
:label: gmm-likelihood
Arguments
---------
x : float
Po... | 0.002151 |
def get_idx(self, node):
"""
Finds the index of the node in the sorted list.
"""
group = self.find_node_group_membership(node)
return self.nodes[group].index(node) | 0.009852 |
def duplicate(self, name=None, location=None):
"""
Duplicate a project
It's the save as feature of the 1.X. It's implemented on top of the
export / import features. It will generate a gns3p and reimport it.
It's a little slower but we have only one implementation to maintain.
... | 0.004024 |
def _maybe_normalize(self, var):
"""normalize variant if requested, and ignore HGVSUnsupportedOperationError
This is better than checking whether the variant is intronic because
future UTAs will support LRG, which will enable checking intronic variants.
"""
if self.normalize:
... | 0.006723 |
def get_name2value_dict(self):
"""returns a dictionary, that maps between `enum` name( key ) and
`enum` value( value )"""
x = {}
for val, num in self._values:
x[val] = num
return x | 0.008621 |
def scan(self, string):
""" Like findall, but also returning matching start and end string locations
"""
return list(self._scanner_to_matches(self.pattern.scanner(string), self.run)) | 0.019417 |
def show_run(**kwargs):
'''
Shortcut to run `show running-config` on the NX-OS device.
.. code-block:: bash
salt '*' nxos.cmd show_run
'''
command = 'show running-config'
info = ''
info = show(command, **kwargs)
if isinstance(info, list):
info = info[0]
return info | 0.003135 |
def fetch_upstream(self):
""" git fetch <upstream> """
set_state(WORKFLOW_STATES.FETCHING_UPSTREAM)
cmd = ["git", "fetch", self.upstream]
self.run_cmd(cmd)
set_state(WORKFLOW_STATES.FETCHED_UPSTREAM) | 0.008368 |
def transferReporter(self, xferId, message):
''' the callback method used by the Aspera sdk during transfer
to notify progress, error or successful completion
'''
if self.is_stopped():
return True
_asp_message = AsperaMessage(message)
if not _asp_message... | 0.004042 |
def find(self):
"""Call the find function"""
options = self.find_options.get_options()
if options is None:
return
self.stop_and_reset_thread(ignore_results=True)
self.search_thread = SearchThread(self)
self.search_thread.sig_finished.connect(self.search... | 0.001679 |
def equal(self, cwd):
""" Returns True if left and right are equal
"""
cmd = ["diff"]
cmd.append("-q")
cmd.append(self.left.get_name())
cmd.append(self.right.get_name())
try:
Process(cmd).run(cwd=cwd, suppress_output=True)
except SubprocessErr... | 0.004357 |
def intersect(self,range2):
"""Return the chunk they overlap as a range.
options is passed to result from this object
:param range2:
:type range2: GenomicRange
:return: Range with the intersecting segement, or None if not overlapping
:rtype: GenomicRange
"""
if not self.overlaps(rang... | 0.021598 |
def convert_jsonld_cdr(doc):
"""
converts json ld output of etk to cdr object
:param doc: the input Knowledge graph in json ld format
:return: a cdr object with embedded knowledge graph and doc_id.
# TODO DIG UI needs a @timestamp_crawl(?) add this too
"""
new_docs = list()
new_doc = dic... | 0.001347 |
def dictionary_validator(key_type, value_type):
"""Validator for ``attrs`` that performs deep type checking of dictionaries."""
def _validate_dictionary(instance, attribute, value):
# pylint: disable=unused-argument
"""Validate that a dictionary is structured as expected.
:raises TypeE... | 0.004325 |
def remove_study(self, first_arg, sec_arg, third_arg, fourth_arg=None, commit_msg=None):
"""Remove a study
Given a study_id, branch and optionally an
author, remove a study on the given branch
and attribute the commit to author.
Returns the SHA of the commit on branch.
""... | 0.006053 |
def edge_style(self, head, tail, **kwargs):
'''
Modifies an edge style to the dot representation.
'''
if tail not in self.nodes:
raise GraphError("invalid node %s" % (tail,))
try:
if tail not in self.edges[head]:
self.edges[head][tail]= {}... | 0.008677 |
def request_signature(self):
"""
The signature passed in the request.
"""
signature = self.query_parameters.get(_x_amz_signature)
if signature is not None:
signature = signature[0]
else:
signature = self.authorization_header_parameters.get(_signatu... | 0.006316 |
def calc_copulas(self,
output_file,
model_names=("start-time", "translation-x", "translation-y"),
label_columns=("Start_Time_Error", "Translation_Error_X", "Translation_Error_Y")):
"""
Calculate a copula multivariate normal distribution from... | 0.005956 |
def plotloc(data, circleinds=[], crossinds=[], edgeinds=[], url_path=None, fileroot=None,
tools="hover,tap,pan,box_select,wheel_zoom,reset", plot_width=450, plot_height=400):
""" Make a light-weight loc figure """
fields = ['l1', 'm1', 'sizes', 'colors', 'snrs', 'key']
if not circleinds: circl... | 0.010628 |
def _compute_all_deletions(self):
"""Returns all minimal edge covers of the set of evil edges.
"""
minimum_evil = []
for disabled_qubits in map(set, product(*self._evil)):
newmin = []
for s in minimum_evil:
if s < disabled_qubits:
... | 0.003731 |
def expand(self, repex_vars, fields):
r"""Receive a dict of variables and a dict of fields
and iterates through them to expand a variable in an field, then
returns the fields dict with its variables expanded.
This will fail if not all variables expand (due to not providing
all n... | 0.000698 |
def up(name, debug=False):
'''
Create servers and containers as required to meet the configuration
specified in _name_.
Args:
* name: The name of the yaml config file (you can omit the .yml extension for convenience)
Example:
fab ensemble.up:wordpress
'''
if debug:
... | 0.00246 |
def WriteClientSnapshotHistory(self, clients, cursor=None):
"""Writes the full history for a particular client."""
client_id = clients[0].client_id
latest_timestamp = max(client.timestamp for client in clients)
query = ""
params = {
"client_id": db_utils.ClientIDToInt(client_id),
"l... | 0.00435 |
def run_migrations_offline():
"""
Run migrations in 'offline' mode.
This configures the context with just a URL
and not an Engine, though an Engine is acceptable
here as well. By skipping the Engine creation
we don't even need a DBAPI to be available.
Calls to context.execute() here emit ... | 0.001783 |
def add_args(parser, positional=False):
"""
Extends a commandline argument parser with arguments for specifying
read sources.
"""
group = parser.add_argument_group("read loading")
group.add_argument("reads" if positional else "--reads",
nargs="+", default=[],
help="Paths to bam f... | 0.003484 |
def to_json(self):
"""
Convert to a JSON string.
"""
obj = {
"vertices": [
{
"id": vertex.id,
"annotation": vertex.annotation,
}
for vertex in self.vertices
],
"ed... | 0.002759 |
def show_clock_output_clock_time_current_time(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
show_clock = ET.Element("show_clock")
config = show_clock
output = ET.SubElement(show_clock, "output")
clock_time = ET.SubElement(output, "clock... | 0.003717 |
def read_data_event(self, whence, complete=False, can_flush=False):
"""Creates a transition to a co-routine for retrieving data as bytes.
Args:
whence (Coroutine): The co-routine to return to after the data is satisfied.
complete (Optional[bool]): True if STREAM_END should be em... | 0.008889 |
def movnam_hdu(self, extname, hdutype=ANY_HDU, extver=0):
"""
Move to the indicated HDU by name
In general, it is not necessary to use this method explicitly.
returns the one-offset extension number
"""
extname = mks(extname)
hdu = self._FITS.movnam_hdu(hdutype,... | 0.005618 |
def _convert_unit(unit):
"""Convert different names into SI units.
Parameters
----------
unit : str
unit to convert to SI
Returns
-------
str
unit in SI format.
Notes
-----
SI unit such as mV (milliVolt, mVolt), μV (microVolt, muV).
"""
if unit is None... | 0.001025 |
def _cleanup_after_optimize_aux(filename, new_filename, old_format,
new_format):
"""
Replace old file with better one or discard new wasteful file.
"""
bytes_in = 0
bytes_out = 0
final_filename = filename
try:
bytes_in = os.stat(filename).st_size
... | 0.00094 |
def HasTable(self, table_name):
"""Determines if a specific table exists.
Args:
table_name (str): table name.
Returns:
bool: True if the table exists.
Raises:
RuntimeError: if the database is not opened.
"""
if not self._connection:
raise RuntimeError(
'Canno... | 0.005629 |
def helper_parallel_lines(start0, end0, start1, end1, filename):
"""Image for :func:`.parallel_lines_parameters` docstring."""
if NO_IMAGES:
return
figure = plt.figure()
ax = figure.gca()
points = stack1d(start0, end0, start1, end1)
ax.plot(points[0, :2], points[1, :2], marker="o")
... | 0.002155 |
def get_img_heatmap(orig_img, activation_map):
"""Draw a heatmap on top of the original image using intensities from activation_map"""
heatmap = cv2.applyColorMap(activation_map, cv2.COLORMAP_COOL)
heatmap = cv2.cvtColor(heatmap, cv2.COLOR_BGR2RGB)
img_heatmap = np.float32(heatmap) + np.float32(orig_img... | 0.00464 |
def zoom_pinch_cb(self, fitsimage, event):
"""Pinch event in the pan window. Just zoom the channel viewer.
"""
chviewer = self.fv.getfocus_viewer()
bd = chviewer.get_bindings()
if hasattr(bd, 'pi_zoom'):
return bd.pi_zoom(chviewer, event)
return False | 0.006369 |
def format_t_into_dhms_format(timestamp):
""" Convert an amount of second into day, hour, min and sec
:param timestamp: seconds
:type timestamp: int
:return: 'Ad Bh Cm Ds'
:rtype: str
>>> format_t_into_dhms_format(456189)
'5d 6h 43m 9s'
>>> format_t_into_dhms_format(3600)
'0d 1h 0... | 0.00198 |
def finditer(self, string, pos=0, endpos=sys.maxint):
"""Return a list of all non-overlapping matches of pattern in string."""
scanner = self.scanner(string, pos, endpos)
return iter(scanner.search, None) | 0.013158 |
def open_file(path):
"""Opens Explorer/Finder with given path, depending on platform"""
if sys.platform=='win32':
os.startfile(path)
#subprocess.Popen(['start', path], shell= True)
elif sys.platform=='darwin':
subprocess.Popen(['open', path])
else:
try:
... | 0.014963 |
def commit(self, snapshot: Tuple[Hash32, UUID]) -> None:
"""
Commit the journal to the point where the snapshot was taken. This
will merge in any changesets that were recorded *after* the snapshot changeset.
"""
_, account_snapshot = snapshot
self._account_db.commit(acco... | 0.009009 |
def surface_constructor(surface):
"""Image for :class`.Surface` docstring."""
if NO_IMAGES:
return
ax = surface.plot(256, with_nodes=True)
line = ax.lines[0]
nodes = surface._nodes
add_patch(ax, nodes[:, (0, 1, 2, 5)], line.get_color())
delta = 1.0 / 32.0
ax.text(
nodes[... | 0.000675 |
def allowed_methods(self, path_info=None):
"""Returns the valid methods that match for a given path.
.. versionadded:: 0.7
"""
try:
self.match(path_info, method="--")
except MethodNotAllowed as e:
return e.valid_methods
except HTTPException:
... | 0.005731 |
def _is_bval_type_a(grouped_dicoms):
"""
Check if the bvals are stored in the first of 2 currently known ways for single frame dti
"""
bval_tag = Tag(0x2001, 0x1003)
bvec_x_tag = Tag(0x2005, 0x10b0)
bvec_y_tag = Tag(0x2005, 0x10b1)
bvec_z_tag = Tag(0x2005, 0x10b2)
for group in grouped_di... | 0.007255 |
def NR_plot(stream, NR_stream, detections, false_detections=False,
size=(18.5, 10), **kwargs):
"""
Plot Network response alongside the stream used.
Highlights detection times in the network response.
:type stream: obspy.core.stream.Stream
:param stream: Stream to plot
:type NR_stre... | 0.000262 |
def weighted_median(d, w):
"""A utility function to find a median of d based on w
Parameters
----------
d : array
(n, 1), variable for which median will be found
w : array
(n, 1), variable on which d's median will be decided
Notes
-----
... | 0.000759 |
def parse_args(args):
"""Uses python argparse to collect positional args"""
Log.info("Input args: %r" % args)
parser = argparse.ArgumentParser()
parser.add_argument("--shard", type=int, required=True)
parser.add_argument("--topology-name", required=True)
parser.add_argument("--topology-id", re... | 0.001471 |
def index():
"""
main function - outputs in following format BEFORE consolidation (which is TODO)
# filename, word, linenumbers
# refAction.csv, ActionTypeName, 1
# refAction.csv, PhysicalType, 1
# goals.csv, Cleanliness, 11
"""
lg = mod_log.Log(mod_cf... | 0.012038 |
def factor_loadings(
r, factors=None, scale=False, pickle_from=None, pickle_to=None
):
"""Security factor exposures generated through OLS regression.
Incorporates a handful of well-known factors models.
Parameters
----------
r : Series or DataFrame
The left-hand-side variable... | 0.000199 |
def fetch_items(self, category, **kwargs):
"""Fetch the issues
:param category: the category of items to fetch
:param kwargs: backend arguments
:returns: a generator of items
"""
from_date = kwargs['from_date']
logger.info("Looking for issues at site '%s', in p... | 0.002933 |
def copy(self, origTypeID, newTypeID):
"""copy(string, string) -> None
Duplicates the vType with ID origTypeID. The newly created vType is assigned the ID newTypeID
"""
self._connection._sendStringCmd(
tc.CMD_SET_VEHICLETYPE_VARIABLE, tc.COPY, origTypeID, newTypeID) | 0.009646 |
def update_fw_local_cache(self, net, direc, start):
"""Update the fw dict with Net ID and service IP. """
fw_dict = self.get_fw_dict()
if direc == 'in':
fw_dict.update({'in_network_id': net, 'in_service_ip': start})
else:
fw_dict.update({'out_network_id': net, 'ou... | 0.005277 |
def _get_help_names(self):
"""Return a mapping of help topic name to `.help_*()` method."""
# Determine the additional help topics, if any.
help_names = {}
token2cmdname = self._get_canonical_map()
for attrname, attr in self._gen_names_and_attrs():
if not attrname.sta... | 0.005988 |
def file_system_service(self):
"""Property providing access to the :class:`.FileSystemServiceAPI`"""
if self._fss_api is None:
self._fss_api = self.get_fss_api()
return self._fss_api | 0.009174 |
def abfSort(IDs):
"""
given a list of goofy ABF names, return it sorted intelligently.
This places things like 16o01001 after 16901001.
"""
IDs=list(IDs)
monO=[]
monN=[]
monD=[]
good=[]
for ID in IDs:
if ID is None:
continue
if 'o' in ID:
m... | 0.01105 |
def build_command(command, parameter_map):
"""
Build command line(s) using the given parameter map.
Even if the passed a single `command`, this function will return a list
of shell commands. It is the caller's responsibility to concatenate them,
likely using the semicolon or double ampersands.
... | 0.002982 |
def base64url_decode(msg):
"""
Decode a base64 message based on JWT spec, Appendix B.
"Notes on implementing base64url encoding without padding"
"""
rem = len(msg) % 4
if rem:
msg += b'=' * (4 - rem)
return base64.urlsafe_b64decode(msg) | 0.003663 |
def ucas_download_playlist(url, output_dir = '.', merge = False, info_only = False, **kwargs):
'''course page'''
html = get_content(url)
parts = re.findall( r'(getplaytitle.do\?.+)"', html)
assert parts, 'No part found!'
for part_path in parts:
ucas_download('http://v.ucas.ac.cn/course/' +... | 0.025773 |
def namedb_name_import_sanity_check( cur, opcode, op_data, history_id, block_id, vtxindex, prior_import, record_table):
"""
Sanity checks on a name-import:
* the opcode must match the op_data
* everything must match the record table.
* if prior_import is None, then the name shouldn't exist
* if ... | 0.011017 |
def serial_starfeatures(lclist,
outdir,
lc_catalog_pickle,
neighbor_radius_arcsec,
maxobjects=None,
deredden=True,
custom_bandpasses=None,
lcformat='hat... | 0.001326 |
def _ParseNamesString(self, names_string):
"""Parses the name string.
Args:
names_string (str): comma separated filenames to filter.
"""
if not names_string:
return
names_string = names_string.lower()
names = [name.strip() for name in names_string.split(',')]
file_entry_filter ... | 0.004706 |
def set_return_listener(self, cb):
'''
Set a callback for basic.return listening. Will be called with a single
Message argument.
The return_info attribute of the Message will have the following
properties:
'channel': Channel instance
'reply_code': reply c... | 0.002183 |
def app_errorhandler(self, code):
"""Like :meth:`Flask.errorhandler` but for a blueprint. This
handler is used for all requests, even if outside of the blueprint.
"""
def decorator(f):
self.record_once(lambda s: s.app.errorhandler(code)(f))
return f
retur... | 0.006042 |
def get_ancestors(self):
"""
:returns: A queryset containing the current node object's ancestors,
starting by the root node and descending to the parent.
"""
if self.is_root():
return get_result_class(self.__class__).objects.none()
return get_result_class(... | 0.004494 |
def drain(self, sid=None):
"""
Drain will put a connection into a drain state. All subscriptions will
immediately be put into a drain state. Upon completion, the publishers
will be drained and can not publish any additional messages. Upon draining
of the publishers, the connectio... | 0.002413 |
def update(self, id, body):
"""Modifies a connection.
Args:
id: Id of the connection.
body (dict): Specifies which fields are to be modified, and to what
values.
See: https://auth0.com/docs/api/management/v2#!/Connections/patch_connections_by_id
... | 0.006726 |
def which(program):
'''
Emulate unix 'which' command. If program is a path to an executable file
(i.e. it contains any directory components, like './myscript'), return
program. Otherwise, if an executable file matching program is found in one
of the directories in the PATH environment variable, re... | 0.000313 |
def _build(self, images):
"""Build dilation module.
Args:
images: Tensor of shape [batch_size, height, width, depth]
and dtype float32. Represents a set of images with an arbitrary depth.
Note that when using the default initializer, depth must equal
num_output_classes.
Retur... | 0.003218 |
def pipe(value, *functions, funcs=None):
"""pipe(value, f, g, h) == h(g(f(value)))"""
if funcs:
functions = funcs
for function in functions:
value = function(value)
return value | 0.004785 |
def revfile_path(self):
"""
:return: The full path of revision file.
:rtype: str
"""
return os.path.normpath(os.path.join(
os.getcwd(),
self.config.revision_file
)) | 0.008475 |
def generate_hash_id(node):
"""
Generates a hash_id for the node in question.
:param node: lxml etree node
"""
try:
content = tostring(node)
except Exception:
logger.exception("Generating of hash failed")
content = to_bytes(repr(node))
hash_id = md5(content).hexdige... | 0.002882 |
def subwave(wave, dep_name=None, indep_min=None, indep_max=None, indep_step=None):
r"""
Return a waveform that is a sub-set of a waveform, potentially re-sampled.
:param wave: Waveform
:type wave: :py:class:`peng.eng.Waveform`
:param dep_name: Independent variable name
:type dep_name: `Non... | 0.001381 |
def read_long_description(readme_file):
""" Read package long description from README file """
try:
import pypandoc
except (ImportError, OSError) as exception:
print('No pypandoc or pandoc: %s' % (exception,))
if sys.version_info.major == 3:
handle = open(readme_file, enc... | 0.001835 |
def _concat(self, other):
"""
Concatenate this with other to one wider value/signal
"""
w = self._dtype.bit_length()
try:
other_bit_length = other._dtype.bit_length
except AttributeError:
raise TypeError("Can not concat bits and", other._dtype)
... | 0.001472 |
def bans_list(self, limit=None, max_id=None, since_id=None, **kwargs):
"https://developer.zendesk.com/rest_api/docs/chat/bans#get-all-bans"
api_path = "/api/v2/bans"
api_query = {}
if "query" in kwargs.keys():
api_query.update(kwargs["query"])
del kwargs["query"]
... | 0.002937 |
def format_container_name(name, special_characters=None):
'''format_container_name will take a name supplied by the user,
remove all special characters (except for those defined by "special-characters"
and return the new image name.
'''
if special_characters is None:
special_characters = []
... | 0.004717 |
def url(section="postGIS", config_file=None):
""" Retrieve the URL used to connect to the database.
Use this if you have your own means of accessing the database and do not
want to use :func:`engine` or :func:`connection`.
Parameters
----------
section : str, optional
The `config.ini` ... | 0.002089 |
def read_dir(directory):
'''Returns the text of all files in a directory.'''
content = dir_list(directory)
text = ''
for filename in content:
text += read_file(directory + '/' + filename)
text += ' '
return text | 0.004049 |
def _update_dict(data, default_data, replace_data=False):
'''Update algorithm definition type dictionaries'''
if not data:
data = default_data.copy()
return data
if not isinstance(data, dict):
raise TypeError('Value not dict type')
if len(data) > 255... | 0.002907 |
def dump_stack_peek(data, separator = ' ', width = 16, arch = None):
"""
Dump data from pointers guessed within the given stack dump.
@type data: str
@param data: Dictionary mapping stack offsets to the data they point to.
@type separator: str
@param separator:
... | 0.00983 |
def write_config(self, cfg, slot=1):
""" Write a configuration to the YubiKey. """
cfg_req_ver = cfg.version_required()
if cfg_req_ver > self.version_num():
raise yubikey_base.YubiKeyVersionError('Configuration requires YubiKey version %i.%i (this is %s)' % \
... | 0.011706 |
def dict_array_bytes(ary, template):
"""
Return the number of bytes required by an array
Arguments
---------------
ary : dict
Dictionary representation of an array
template : dict
A dictionary of key-values, used to replace any
string values in the array with concrete in... | 0.001709 |
def load_file(self, file_name):
"""
Find and return the template with the given file name.
Arguments:
file_name: the file name of the template.
"""
locator = self._make_locator()
path = locator.find_file(file_name, self.search_dirs)
return self.read... | 0.006135 |
def speakerDiarizationEvaluateScript(folder_name, ldas):
'''
This function prints the cluster purity and speaker purity for
each WAV file stored in a provided directory (.SEGMENT files
are needed as ground-truth)
ARGUMENTS:
- folder_name: the full path of the folder ... | 0.007943 |
def cornerplot(results, span=None, quantiles=[0.025, 0.5, 0.975],
color='black', smooth=0.02, hist_kwargs=None,
hist2d_kwargs=None, labels=None, label_kwargs=None,
show_titles=False, title_fmt=".2f", title_kwargs=None,
truths=None, truth_color='red', truth_kwa... | 0.000751 |
def _skew(self, x, z, d=0):
""" returns the kurtosis parameter for direction d, d=0 is rho, d=1 is z """
# get the top bound determined by the kurtosis
kval = (np.tanh(self._poly(z, self._kurtosis_coeffs(d)))+1)/12.
bdpoly = np.array([
-1.142468e+04, 3.0939485e+03, -2.028356... | 0.004847 |
def editPerson(self, person, nickname, edits):
"""
Change the name and contact information associated with the given
L{Person}.
@type person: L{Person}
@param person: The person which will be modified.
@type nickname: C{unicode}
@param nickname: The new value fo... | 0.001221 |
def isTagEqual(self, other):
'''
isTagEqual - Compare if a tag contains the same tag name and attributes as another tag,
i.e. if everything between < and > parts of this tag are the same.
Does NOT compare children, etc. Does NOT compare if these are the same exact t... | 0.004493 |
def cli(ctx, feature_id, organism="", sequence=""):
"""Set the feature to read through the first encountered stop codon
Output:
A standard apollo feature dictionary ({"features": [{...}]})
"""
return ctx.gi.annotations.set_readthrough_stop_codon(feature_id, organism=organism, sequence=sequence) | 0.00639 |
def is_denied(self, role, method, resource):
"""Check wherther role is denied to access resource
:param role: Role to be checked.
:param method: Method to be checked.
:param resource: View function to be checked.
"""
return (role, method, resource) in self._denied | 0.00639 |
def save_segment(self, f, segment, checksum=None):
""" Save the next segment to the image file, return next checksum value if provided """
segment_data = self.maybe_patch_segment_data(f, segment.data)
f.write(struct.pack('<II', segment.addr, len(segment_data)))
f.write(segment_data)
... | 0.007317 |
def operations():
"""
Class decorator stores all calls into list.
Can be used until .invalidate() is called.
:return: decorated class
"""
def decorator(func):
@wraps(func)
def wrapped_func(*args, **kwargs):
self = args[0]
assert self.__can_use, "User oper... | 0.003823 |
def fetch_room_ids(self, names):
""" Fetches the ids of the rooms with the given names """
ret = dict()
names_set = frozenset(names)
for d in json.loads(self.open_url(
'timetables?type=location'))['timetable']:
name = d['hostKey']
if na... | 0.004878 |
def hist(x, bins=10, labels=None, aspect="auto", plot=True, ax=None, range=None):
"""
Creates a histogram of data *x* with a *bins*, *labels* = :code:`[title, xlabel, ylabel]`.
"""
h, edge = _np.histogram(x, bins=bins, range=range)
mids = edge + (edge[1]-edge[0])/2
mids = mids[:-1]
if... | 0.007067 |
def jobs_insert_query(self, sql, table_name=None, append=False,
overwrite=False, dry_run=False, use_cache=True, batch=True,
allow_large_results=False, table_definitions=None, query_params=None):
"""Issues a request to insert a query job.
Args:
sql: the SQL ... | 0.007234 |
def get_op_result_name(left, right):
"""
Find the appropriate name to pin to an operation result. This result
should always be either an Index or a Series.
Parameters
----------
left : {Series, Index}
right : object
Returns
-------
name : object
Usually a string
""... | 0.001887 |
def beta(self):
"""
Fixed-effect sizes.
Returns
-------
effect-sizes : numpy.ndarray
Optimal fixed-effect sizes.
Notes
-----
Setting the derivative of log(p(𝐲)) over effect sizes equal
to zero leads to solutions 𝜷 from equation ::
... | 0.00404 |
def count(self):
"""
Return the number of hits matching the query and filters. Note that
only the actual number is returned.
"""
if hasattr(self, '_response'):
return self._response.hits.total
es = connections.get_connection(self._using)
d = self.to_... | 0.004016 |
def user_factory(self):
"""Retrieve the current user (or None) from the database."""
if this.user_id is None:
return None
return self.user_model.objects.get(pk=this.user_id) | 0.009569 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.