text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def split_pem(pem_bytes):
"""
Split a give PEM file with multiple certificates
:param pem_bytes: The pem data in bytes with multiple certs
:return: yields a list of certificates contained in the pem file
"""
started, pem_data = False, b''
for line in pem_bytes.splitlines(False):
... | 0.001399 |
def cross(self, vec):
"""Cross product with another Vector3Array"""
if not isinstance(vec, Vector3Array):
raise TypeError('Cross product operand must be a Vector3Array')
if self.nV != 1 and vec.nV != 1 and self.nV != vec.nV:
raise ValueError('Cross product operands must h... | 0.004598 |
def cli(ctx, packages, all, list, platform):
"""Uninstall packages."""
if packages:
_uninstall(packages, platform)
elif all: # pragma: no cover
packages = Resources(platform).packages
_uninstall(packages, platform)
elif list:
Resources(platform).list_packages(installed=... | 0.002558 |
def save_user_config(username, conf_dict, path=settings.LOGIN_FILE):
"""
Save user's configuration to otherwise unused field ``full_name`` in passwd
file.
"""
users = load_users(path=path)
users[username]["full_name"] = _encode_config(conf_dict)
save_users(users, path=path) | 0.003311 |
def read_folder(folder, ext='*', uppercase=False, replace_dot='.', parent=''):
"""
This will read all of the files in the folder with the extension equal
to ext
:param folder: str of the folder name
:param ext: str of the extension
:param uppercase: bool if True will uppercase all the fi... | 0.000863 |
def _extract_from_subworkflow(vs, step):
"""Remove internal variable names when moving from sub-workflow to main.
"""
substep_ids = set([x.name for x in step.workflow])
out = []
for var in vs:
internal = False
parts = var["id"].split("/")
if len(parts) > 1:
if par... | 0.002096 |
def removeItems(self, items):
"""
Removes all the inputed items from the scene at once. The \
list of items will be stored in an internal cache. When \
updating a node or connection's prepareToRemove method, \
any additional items that need to be removed as a result \
o... | 0.007047 |
def _parse_pubkey(stream, packet_type='pubkey'):
"""See https://tools.ietf.org/html/rfc4880#section-5.5 for details."""
p = {'type': packet_type}
packet = io.BytesIO()
with stream.capture(packet):
p['version'] = stream.readfmt('B')
p['created'] = stream.readfmt('>L')
p['algo'] = ... | 0.000484 |
def flattened(self, pred=flattened_pred_default):
"""Flattens nodes by hoisting children up to ancestor nodes.
A node is hoisted if pred(node) returns True.
"""
if self.is_value:
return self
new_children = []
for child in self.children:
if child.is_empty:
continue
n... | 0.008584 |
def functions(self):
"""
Returns all documented module level functions in the module
sorted alphabetically as a list of `pydoc.Function`.
"""
p = lambda o: isinstance(o, Function) and self._docfilter(o)
return sorted(filter(p, self.doc.values())) | 0.010204 |
def proxy_alias(alias_name, node_type):
"""Get a Proxy from the given name to the given node type."""
proxy = type(
alias_name,
(lazy_object_proxy.Proxy,),
{
"__class__": object.__dict__["__class__"],
"__instancecheck__": _instancecheck,
},
)
retur... | 0.00289 |
def make_regex(separator):
"""Utility function to create regexp for matching escaped separators
in strings.
"""
return re.compile(r'(?:' + re.escape(separator) + r')?((?:[^' +
re.escape(separator) + r'\\]|\\.)+)') | 0.003968 |
def _process_state(self):
"""Process the application state configuration.
Google Alerts manages the account information and alert data through
some custom state configuration. Not all values have been completely
enumerated.
"""
self._log.debug("Capturing state from the r... | 0.002525 |
def _getScalesRand(self):
"""
Internal function for parameter initialization
Return a vector of random scales
"""
if self.P>1:
scales = []
for term_i in range(self.n_randEffs):
_scales = sp.randn(self.diag[term_i].shape[0])
... | 0.011364 |
def close(self):
"""
Closes this VPCS VM.
"""
if not (yield from super().close()):
return False
nio = self._ethernet_adapter.get_nio(0)
if isinstance(nio, NIOUDP):
self.manager.port_manager.release_udp_port(nio.lport, self._project)
if s... | 0.006935 |
def init_read_line(self):
"""init_read_line() initializes fields relevant to input matching"""
format_list = self._format_list
self._re_cvt = self.match_input_fmt(format_list)
regexp0_str = "".join([subs[0] for subs in self._re_cvt])
self._regexp_str = regexp0_str
self._r... | 0.004412 |
def _writer(func):
"""
Decorator for a custom writer, but a default reader
"""
name = func.__name__
return property(fget=lambda self: getattr(self, '_%s' % name), fset=func) | 0.005155 |
def create_bucket(self, bucket_name, headers=None,
location=Location.DEFAULT, policy=None):
"""
Creates a new located bucket. By default it's in the USA. You can pass
Location.EU to create an European bucket.
:type bucket_name: string
:param bucket_name: Th... | 0.005214 |
def saveXml(self, xml):
"""
Saves this view's content to XML.
:param xml | <str>
"""
xscript = ElementTree.SubElement(xml, 'script')
xscript.text = escape(self._edit.toPlainText()) | 0.012048 |
def _watchdog_switch(self):
"""
切换页面线程
"""
# init
self.current_controller = self.view_control_map['main']
self.current_controller.run(self.switch_queue)
while not self.quit_quit:
key = self.switch_queue.get()
if key == 'quit_quit':
... | 0.003584 |
def _credentials_from_request(request):
"""Gets the authorized credentials for this flow, if they exist."""
# ORM storage requires a logged in user
if (oauth2_settings.storage_model is None or
request.user.is_authenticated()):
return get_storage(request).get()
else:
return No... | 0.003106 |
def get(self, status_code):
"""
Returns the requested status.
:param int status_code: the status code to return
:queryparam str reason: optional reason phrase
"""
status_code = int(status_code)
if status_code >= 400:
kwargs = {'status_code': status_c... | 0.002933 |
def _load(self, load_dict):
"""Loads the data and exploration range from the `load_dict`.
The `load_dict` needs to be in the same format as the result of the
:func:`~pypet.parameter.Parameter._store` method.
"""
if self.v_locked:
raise pex.ParameterLockedException('... | 0.005834 |
def cancel(self, event):
"""Remove an event from the queue.
This must be presented the ID as returned by enter().
If the event is not in the queue, this raises ValueError.
"""
with self._lock:
self._queue.remove(event)
heapq.heapify(self._queue) | 0.006431 |
def from_outcars(cls, outcars, structures, **kwargs):
"""
Initializes an NEBAnalysis from Outcar and Structure objects. Use
the static constructors, e.g., :class:`from_dir` instead if you
prefer to have these automatically generated from a directory of NEB
calculations.
... | 0.001538 |
def fix_config(self, options):
"""
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.
:param options: the options to fix
:type options: dict
:return: the (potentially) fixed options
:rtype: dict
"""
options = super(Act... | 0.005034 |
def UpdateClientsFromFleetspeak(clients):
"""Updates ApiClient records to include info from Fleetspeak."""
if not fleetspeak_connector.CONN or not fleetspeak_connector.CONN.outgoing:
# FS not configured, or an outgoing connection is otherwise unavailable.
return
id_map = {}
for client in clients:
if... | 0.010962 |
def _apply_search_backrefs(pattern, flags=0):
"""Apply the search backrefs to the search pattern."""
if isinstance(pattern, (str, bytes)):
re_verbose = bool(VERBOSE & flags)
re_unicode = None
if bool((ASCII | LOCALE) & flags):
re_unicode = False
elif bool(UNICODE & f... | 0.004907 |
def inasafe_analysis_summary_field_value(field, feature, parent):
"""Retrieve a value from a field in the analysis summary layer.
e.g. inasafe_analysis_summary_field_value('total_not_exposed') -> 3
"""
_ = feature, parent # NOQA
project_context_scope = QgsExpressionContextUtils.projectScope(
... | 0.001284 |
def OnToggle(self, event):
"""Toggle button event handler"""
if self.selection_toggle_button.GetValue():
self.entry_line.last_selection = self.entry_line.GetSelection()
self.entry_line.last_selection_string = \
self.entry_line.GetStringSelection()
sel... | 0.002717 |
def _extract_rows(self, rows):
"""
Extract an array of rows from an input scalar or sequence
"""
if rows is not None:
rows = numpy.array(rows, ndmin=1, copy=False, dtype='i8')
# returns unique, sorted
rows = numpy.unique(rows)
maxrow = sel... | 0.004158 |
def _notebook_dir_changed(self, name, old, new):
"""do a bit of validation of the notebook dir"""
if os.path.exists(new) and not os.path.isdir(new):
raise TraitError("notebook dir %r is not a directory" % new)
if not os.path.exists(new):
self.log.info("Creating notebook d... | 0.006342 |
def set_dataset(self):
'''
Retrieves the designated dataset, creates NCSS object, and
creates a NCSS query object.
'''
keys = list(self.model.datasets.keys())
labels = [item.split()[0].lower() for item in keys]
if self.set_type == 'best':
self.dataset... | 0.002653 |
def add_namespace(self, module):
"""Add item uri:prefix for `module` to `self.namespaces`.
The prefix to be actually used for `uri` is returned. If the
namespace is already present, the old prefix is used. Prefix
clashes are resolved by disambiguating `prefix`.
"""
uri... | 0.004914 |
def bind(nodemask):
"""
Binds the current thread and its children to the nodes specified in nodemask.
They will only run on the CPUs of the specified nodes and only be able to allocate memory from them.
@param nodemask: node mask
@type nodemask: C{set}
"""
mask = set_to_numa_nodemask(nodema... | 0.006012 |
def nvrtcDestroyProgram(self, prog):
"""
Destroys the given NVRTC program object.
"""
code = self._lib.nvrtcDestroyProgram(byref(prog))
self._throw_on_error(code)
return | 0.009217 |
def get_stats_daily(start=None, end=None, last=None, **kwargs):
"""
MOVED to iexfinance.iexdata.get_stats_daily
"""
import warnings
warnings.warn(WNG_MSG % ("get_stats_daily", "iexdata.get_stats_daily"))
start, end = _sanitize_dates(start, end)
return DailySummaryReader(start=start, e... | 0.002584 |
def _parse_sentencetree(self, tree, parent_node_id=None, ignore_traces=True):
"""parse a sentence Tree into this document graph"""
def get_nodelabel(node):
if isinstance(node, nltk.tree.Tree):
return node.label()
elif isinstance(node, unicode):
ret... | 0.002793 |
def firmware_download_input_protocol_type_ftp_protocol_ftp_directory(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
firmware_download = ET.Element("firmware_download")
config = firmware_download
input = ET.SubElement(firmware_download, "input")
... | 0.004348 |
def server_poweron(host=None,
admin_username=None,
admin_password=None,
module=None):
'''
Powers up the managed server.
host
The chassis host.
admin_username
The username used to access the chassis.
admin_password
Th... | 0.0012 |
def extract_user(user_value):
"""
Extract the user for running a container from the following possible input formats:
* Integer (UID)
* User name string
* Tuple of ``user, group``
* String in the format ``user:group``
:param user_value: User name, uid, user-group tuple, or user:group strin... | 0.002825 |
def export(self):
"""Returns requirements XML."""
top = self._top_element()
properties = self._properties_element(top)
self._fill_requirements(top)
self._fill_lookup_prop(properties)
return utils.prettify_xml(top) | 0.007663 |
def groups_filter_from_query(query, field_map={}):
"""Creates an F object for the groups of a search query."""
f = None
# filter groups
for group in query.get("groups", []):
group_f = MatchAll()
for condition in group.get("conditions", []):
field_name = condition["field"]
... | 0.002182 |
def devname_from_index(self, if_index):
"""Return interface name from interface index"""
for devname, iface in self.items():
if iface.win_index == if_index:
return iface.name
raise ValueError("Unknown network interface index %r" % if_index) | 0.006849 |
def metadata(self):
"""
Retrieves the remote database metadata dictionary.
:returns: Dictionary containing database metadata details
"""
resp = self.r_session.get(self.database_url)
resp.raise_for_status()
return response_to_json_dict(resp) | 0.006734 |
def rewrite_links(self, func):
"""
Add a callback for rewriting links.
The callback should take a single argument, the url, and
should return a replacement url. The callback function is
called everytime a ``[]()`` or ``<link>`` is processed.
You can use this method as ... | 0.002571 |
def bindex(start, stop=None, dim=1, sort="G", cross_truncation=1.):
"""
Generator for creating multi-indices.
Args:
start (int):
The lower order of the indices
stop (:py:data:typing.Optional[int]):
the maximum shape included. If omitted: stop <- start; start <- 0
... | 0.000797 |
def _set_optional_tlv(self, v, load=False):
"""
Setter method for optional_tlv, mapped from YANG variable /protocol/lldp/advertise/optional_tlv (container)
If this variable is read-only (config: false) in the
source YANG file, then _set_optional_tlv is considered as a private
method. Backends lookin... | 0.005907 |
def dictFlat(l):
"""Given a list of list of dicts, return just the dicts."""
if type(l) is dict:
return [l]
if "numpy" in str(type(l)):
return l
dicts=[]
for item in l:
if type(item)==dict:
dicts.append(item)
elif type(item)==list:
for item2 in... | 0.013193 |
def detectIphone(self):
"""Return detection of an iPhone
Detects if the current device is an iPhone.
"""
# The iPad and iPod touch say they're an iPhone! So let's disambiguate.
return UAgentInfo.deviceIphone in self.__userAgent \
and not self.detectIpad() \
... | 0.005747 |
def extract_from_stack(stack, template, length, pre_pick, pre_pad,
Z_include=False, pre_processed=True, samp_rate=None,
lowcut=None, highcut=None, filt_order=3):
"""
Extract a multiplexed template from a stack of detections.
Function to extract a new template f... | 0.00025 |
def get_rules_from_disk():
''' Recursively traverse the yara/rules directory for rules '''
# Try to find the yara rules directory relative to the worker
my_dir = os.path.dirname(os.path.realpath(__file__))
yara_rule_path = os.path.join(my_dir, 'yara/rules')
if not os.path.exists(yara_rule_path):
... | 0.003571 |
def polytropic_exponent(k, n=None, eta_p=None):
r'''Calculates one of:
* Polytropic exponent from polytropic efficiency
* Polytropic efficiency from the polytropic exponent
.. math::
n = \frac{k\eta_p}{1 - k(1-\eta_p)}
.. math::
\eta_p = \frac{\left(\frac{n}{n-1}\right... | 0.001523 |
def python_executable(check=True, short=False):
r"""
Args:
short (bool): (default = False)
Returns:
str:
Example:
>>> # ENABLE_DOCTEST
>>> from utool.util_cplat import * # NOQA
>>> short = False
>>> result = python_executable(short)
>>> print(re... | 0.001019 |
def set_regex(self, regex=None, reset=False):
"""Update the regex text for the shortcut finder."""
if reset:
text = ''
else:
text = self.finder.text().replace(' ', '').lower()
self.proxy_model.set_filter(text)
self.source_model.update_search_lette... | 0.004065 |
def check_dynamic_route_exists(pattern, routes_to_check, parameters):
"""
Check if a URL pattern exists in a list of routes provided based on
the comparison of URL pattern and the parameters.
:param pattern: URL parameter pattern
:param routes_to_check: list of dynamic routes ei... | 0.002628 |
def _handle_successor(self, job, successor, successors):
"""
Returns a new CFGJob instance for further analysis, or None if there is no immediate state to perform the
analysis on.
:param CFGJob job: The current job.
"""
state = successor
all_successor_states = s... | 0.005297 |
def general_conv(x,
num_filters=64,
filter_size=7,
stride=1,
stddev=0.02,
padding="VALID",
name="conv",
do_norm="instance",
do_relu=True,
relufactor=0):
"""Generaliz... | 0.00791 |
def status(self, job_id):
"""
Check the status of a job.
## Arguments
* `job_id` (int): The job to check.
## Returns
* `code` (int): The status.
* `status` (str): The human-readable name of the current status.
"""
params = {"jobid": job_id}
... | 0.004132 |
def read_plink(file_prefix, verbose=True):
r"""Read PLINK files into Pandas data frames.
Parameters
----------
file_prefix : str
Path prefix to the set of PLINK files. It supports loading many BED
files at once using globstrings wildcard.
verbose : bool
``True`` for progress... | 0.00024 |
def create_custom_field(connection, cf_type, cf_name, auto_attached, value_names=None, bundle_policy="0"):
"""
Creates custom field prototype(if not exist) and sets default values bundle if needed
Args:
connection: An opened Connection instance.
cf_type: Type of custom field to be created
... | 0.00361 |
def from_flowcell(run_folder, lane_details, out_dir=None):
"""Convert a flowcell into a samplesheet for demultiplexing.
"""
fcid = os.path.basename(run_folder)
if out_dir is None:
out_dir = run_folder
out_file = os.path.join(out_dir, "%s.csv" % fcid)
with open(out_file, "w") as out_handl... | 0.003082 |
def render_thread(self):
"""A render loop that pulls observations off the queue to render."""
obs = True
while obs: # Send something falsy through the queue to shut down.
obs = self._obs_queue.get()
if obs:
for alert in obs.observation.alerts:
self._alerts[sc_pb.Alert.Name(ale... | 0.010502 |
def _element(self):
"""
Return XML form of this content types item, suitable for storage as
``[Content_Types].xml`` in an OPC package. Although the sequence of
elements is not strictly significant, as an aid to testing and
readability Default elements are sorted by extension and ... | 0.002928 |
def make_logging_undefined(logger=None, base=None):
"""Given a logger object this returns a new undefined class that will
log certain failures. It will log iterations and printing. If no
logger is given a default logger is created.
Example::
logger = logging.getLogger(__name__)
Loggi... | 0.000381 |
def __stream_format_allowed(self, stream):
"""
Check whether a stream allows formatting such as coloring.
Inspired from Python cookbook, #475186
"""
# curses isn't available on all platforms
try:
import curses as CURSES
except:
return False... | 0.008791 |
def delete_local_operator(self, onnx_name):
'''
Remove the operator whose onnx_name is the input onnx_name
'''
if onnx_name not in self.onnx_operator_names or onnx_name not in self.operators:
raise RuntimeError('The operator to be removed not found')
self.onnx_operato... | 0.007813 |
def add_spaces(self, spaces, ret=False):
"""
Add ``pyny.Spaces`` to the current space. In other words, it
merges multiple ``pyny.Spaces`` in this instance.
:param places: ``pyny.Spaces`` to add.
:type places: list of pyny.Spaces
:param ret: If True, returns the... | 0.017296 |
def from_neighbor_throats(target, throat_prop='throat.seed', mode='min'):
r"""
Adopt a value from the values found in neighboring throats
Parameters
----------
target : OpenPNM Object
The object which this model is associated with. This controls the
length of the calculated array, a... | 0.000692 |
def tags(self):
""" Returns a dict containing tags and their localized labels as values """
return dict([(t, self._catalog.tags.get(t, t)) for t in self._asset.get("tags", [])]) | 0.020725 |
def to_dict(self):
"""
Return a transmission-safe dictionary representation of the API message properties.
"""
d = {field: getattr(self, field) for field in self._top_fields if hasattr(self, field)}
# set values of data fields
d['data'] = {}
for field in self._fi... | 0.005202 |
def load_template(template_name=None,
template_source=None,
context=None,
defaults=None,
template_engine='jinja',
saltenv='base',
template_hash=None,
template_hash_name=None,
s... | 0.002393 |
def wait(self, timeout):
"""Calling thread waits for a given number of milliseconds or
until notified."""
self.condition.acquire()
self.condition.wait(timeout // 1000)
self.condition.release() | 0.008621 |
def range_interleave(ranges, sizes={}, empty=False):
"""
Returns the ranges in between the given ranges.
>>> ranges = [("1", 30, 40), ("1", 45, 50), ("1", 10, 30)]
>>> range_interleave(ranges)
[('1', 41, 44)]
>>> ranges = [("1", 30, 40), ("1", 42, 50)]
>>> range_interleave(ranges)
[('1'... | 0.000684 |
def convert_p(element, text):
"""
Adds 2 newlines to the end of text
"""
depth = -1
while element:
if (not element.name == '[document]' and
not element.parent.get('id') == '__RESTRUCTIFY_WRAPPER__'):
depth += 1
element = element.parent
if text:
... | 0.002725 |
def register_event(self):
"""
注册事件
"""
event_bus = Environment.get_instance().event_bus
event_bus.prepend_listener(EVENT.PRE_BEFORE_TRADING, self._pre_before_trading)
event_bus.prepend_listener(EVENT.POST_SETTLEMENT, self._post_settlement) | 0.013937 |
def _call_pyfftw(self, x, out, **kwargs):
"""Implement ``self(x[, out, **kwargs])`` for pyfftw back-end.
Parameters
----------
x : `numpy.ndarray`
Array representing the function to be transformed
out : `numpy.ndarray`
Array to which the output is written... | 0.00069 |
def prev(self):
"""Fetch a set of items with IDs greater than current set."""
if self.limit and self.limit == self.num_tweets:
raise StopIteration
self.index -= 1
if self.index < 0:
# There's no way to fetch a set of tweets directly 'above' the
# curr... | 0.003929 |
def setup_ci():
# type: () -> None
""" Setup AppEngine SDK on CircleCI """
gcloud_path = shell.run('which gcloud', capture=True).stdout.strip()
sdk_path = normpath(join(gcloud_path, '../../platform/google_appengine'))
gcloud_cmd = gcloud_path + ' --quiet'
if not exists(sdk_path):
log.in... | 0.001255 |
def _jsonld(graph, format, *args, **kwargs):
"""Return formatted graph in JSON-LD ``format`` function."""
import json
from pyld import jsonld
from renku.models._jsonld import asjsonld
output = getattr(jsonld, format)([
asjsonld(action) for action in graph.activities.values()
])
ret... | 0.002841 |
def get_notebook_app_versions():
"""
Get the valid version numbers of the notebook app.
"""
notebook_apps = dxpy.find_apps(name=NOTEBOOK_APP, all_versions=True)
versions = [str(dxpy.describe(app['id'])['version']) for app in notebook_apps]
return versions | 0.007168 |
def add_extra_model_fields(sender, **kwargs):
"""
Injects custom fields onto the given sender model as defined
by the ``EXTRA_MODEL_FIELDS`` setting. This is a closure over
the "fields" variable.
"""
model_key = sender._meta.app_label, sender._meta.model_name
for field_name, field in fields.... | 0.002545 |
def add(self, *items):
"""
Add items to be sorted.
@param items: One or more items to be added.
@type items: I{item}
@return: self
@rtype: L{DepList}
"""
for item in items:
self.unsorted.append(item)
key = item[0]
self.i... | 0.005618 |
def builds(self, confs):
"""For retro compatibility directly assigning builds"""
self._named_builds = {}
self._builds = []
for values in confs:
if len(values) == 2:
self._builds.append(BuildConf(values[0], values[1], {}, {}, self.reference))
elif l... | 0.007742 |
def get_issuers(self):
"""
Gets the issuers (from message and from assertion)
:returns: The issuers
:rtype: list
"""
issuers = set()
message_issuer_nodes = OneLogin_Saml2_XML.query(self.document, '/samlp:Response/saml:Issuer')
if len(message_issuer_nodes... | 0.003849 |
def communicate(self):
"""Retrieve information."""
self._communicate_first = True
self._process.waitForFinished()
enco = self._get_encoding()
if self._partial_stdout is None:
raw_stdout = self._process.readAllStandardOutput()
stdout = handle_qbytearray(ra... | 0.002451 |
def insert(cls, jobs_data, queue=None, statuses_no_storage=None, return_jobs=True, w=None, j=None):
""" Insert a job into MongoDB """
now = datetime.datetime.utcnow()
for data in jobs_data:
if data["status"] == "started":
data["datestarted"] = now
no_storage... | 0.003263 |
def get_multi_causal_downstream(graph, nbunch: Union[BaseEntity, Iterable[BaseEntity]]):
"""Get the union of all of the 2-level deep causal downstream subgraphs from the nbunch.
:param pybel.BELGraph graph: A BEL graph
:param nbunch: A BEL node or list of BEL nodes
:return: A subgraph of the original B... | 0.006198 |
def _warn_about_problematic_credentials(credentials):
"""Determines if the credentials are problematic.
Credentials from the Cloud SDK that are associated with Cloud SDK's project
are problematic because they may not have APIs enabled and have limited
quota. If this is the case, warn about it.
"""
... | 0.002101 |
def scramble_string(s, key):
"""
s is the puzzle's solution in column-major order, omitting black squares:
i.e. if the puzzle is:
C A T
# # A
# # R
solution is CATAR
Key is a 4-digit number in the range 1000 <= key <= 9999
"""
key = key_digits(key)
for k in key... | 0.00173 |
def _format_usage_without_prefix(parser):
"""
Use private argparse APIs to get the usage string without
the 'usage: ' prefix.
"""
fmt = parser._get_formatter()
fmt.add_usage(parser.usage, parser._actions,
parser._mutually_exclusive_groups, prefix='')
return fmt.format_help(... | 0.00304 |
def replace_cluster_custom_object_status(self, group, version, plural, name, body, **kwargs): # noqa: E501
"""replace_cluster_custom_object_status # noqa: E501
replace status of the cluster scoped specified custom object # noqa: E501
This method makes a synchronous HTTP request by default. T... | 0.001362 |
def listAcquisitionEras_CI(self, acq=''):
"""
Returns all acquistion eras in dbs
"""
try:
acq = str(acq)
except:
dbsExceptionHandler('dbsException-invalid-input', 'aquistion_era_name given is not valid : %s'%acq)
conn = self.dbi.connection()
... | 0.015317 |
def closeEvent(self, event):
"""
Saves dirty editors on close and cancel the event if the user choosed
to continue to work.
:param event: close event
"""
dirty_widgets = []
for w in self.widgets(include_clones=False):
if w.dirty:
dirty... | 0.001508 |
def _versions_from_changelog(changelog):
"""
Return all released versions from given ``changelog``, sorted.
:param dict changelog:
A changelog dict as returned by ``releases.util.parse_changelog``.
:returns: A sorted list of `semantic_version.Version` objects.
"""
versions = [Version(x... | 0.002506 |
def check_dihedral(self, construction_table):
"""Checks, if the dihedral defining atom is colinear.
Checks for each index starting from the third row of the
``construction_table``, if the reference atoms are colinear.
Args:
construction_table (pd.DataFrame):
Return... | 0.002869 |
def process_raw_data(cls, raw_data):
"""Create a new model using raw API response."""
properties = raw_data["properties"]
ip_pools = []
for raw_content in properties.get("ipPools", []):
raw_content["parentResourceID"] = raw_data["resourceId"]
raw_content["grandPa... | 0.001854 |
def plot_prof_2(self, mod, species, xlim1, xlim2):
"""
Plot one species for cycle between xlim1 and xlim2
Parameters
----------
mod : string or integer
Model to plot, same as cycle number.
species : list
Which species to plot.
xlim1, xlim... | 0.019031 |
def render(self, **kwargs):
""" Plots the surface and the control points grid. """
# Calling parent function
super(VisSurface, self).render(**kwargs)
# Initialize a list to store VTK actors
vtk_actors = []
# Start plotting
for plot in self._plots:
# ... | 0.004676 |
def smartparse(cls, toparse, tzinfo=None):
"""Method which uses dateutil.parse and extras to try and parse the string.
Valid dates are found at:
http://labix.org/python-dateutil#head-1443e0f14ad5dff07efd465e080d1110920673d8-2
Other valid formats include:
"now" or "today"
"yesterday"
... | 0.012513 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.