text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def publishMap(self, maps_info, fsInfo=None, itInfo=None):
"""Publishes a list of maps.
Args:
maps_info (list): A list of JSON configuration maps to publish.
Returns:
list: A list of results from :py:meth:`arcrest.manageorg._content.UserItem.updateItem`.... | 0.007123 |
def find_undeclared(nodes, names):
"""Check if the names passed are accessed undeclared. The return value
is a set of all the undeclared names from the sequence of names found.
"""
visitor = UndeclaredNameVisitor(names)
try:
for node in nodes:
visitor.visit(node)
except Visi... | 0.002695 |
def parse_sitelist(sitelist):
"""Return list of Site instances from retrieved sitelist data"""
sites = []
for site in sitelist["Locations"]["Location"]:
try:
ident = site["id"]
name = site["name"]
except KeyError:
ident = site["@id"] # Difference between l... | 0.0048 |
async def revoke(client: Client, revocation_signed_raw: str) -> ClientResponse:
"""
POST revocation document
:param client: Client to connect to the api
:param revocation_signed_raw: Certification raw document
:return:
"""
return await client.post(MODULE + '/revoke', {'revocation': revocati... | 0.005571 |
def get_raw_email(self):
"""
This only applies to raw payloads:
https://sendgrid.com/docs/Classroom/Basics/Inbound_Parse_Webhook/setting_up_the_inbound_parse_webhook.html#-Raw-Parameters
"""
if 'email' in self.payload:
raw_email = email.message_from_string(self.payloa... | 0.005025 |
def interact(self, container: Container) -> None:
"""
Connects to the PTY (pseudo-TTY) for a given container.
Blocks until the user exits the PTY.
"""
cmd = "/bin/bash -c 'source /.environment && /bin/bash'"
cmd = "docker exec -it {} {}".format(container.id, cmd)
... | 0.005682 |
def main(path, pid, queue):
"""
Standalone PSQ worker.
The queue argument must be the full importable path to a psq.Queue
instance.
Example usage:
psqworker config.q
psqworker --path /opt/app queues.fast
"""
setup_logging()
if pid:
with open(os.path.expandus... | 0.001786 |
def copy_file_if_modified(src_path, dest_path):
"""Only copies the file from the source path to the destination path if it doesn't exist yet or it has
been modified. Intended to provide something of an optimisation when a project has large trees of assets."""
# if the destination path is a directory, delet... | 0.004306 |
def not_a_string(obj):
"""It's probably not a string, in the sense
that Python2/3 get confused about these things"""
my_type = str(type(obj))
if is_py3():
is_str = my_type.find('bytes') < 0 and my_type.find('str') < 0
return is_str
return my_type.find('str') < 0 and \
my_typ... | 0.002933 |
def _linux_brshow(br=None):
'''
Internal, returns bridges and enslaved interfaces (GNU/Linux - brctl)
'''
brctl = _tool_path('brctl')
if br:
cmd = '{0} show {1}'.format(brctl, br)
else:
cmd = '{0} show'.format(brctl)
brs = {}
for line in __salt__['cmd.run'](cmd, python... | 0.000823 |
def rmgen(self, idx):
"""
Remove the static generators if their dynamic models exist
Parameters
----------
idx : list
A list of static generator idx
Returns
-------
None
"""
stagens = []
for device, stagen in zip(self.d... | 0.003373 |
def get_info(df, verbose = None,max_cols = None, memory_usage = None, null_counts = None):
""" Returns the .info() output of a dataframe
"""
assert type(df) is pd.DataFrame
buffer = io.StringIO()
df.info(verbose, buffer, max_cols, memory_usage, null_counts)
return buffer.getvalue() | 0.035948 |
def add_context(self, name, context, prefix_char=None):
"""Add a context to the suite.
Args:
name (str): Name to store the context under.
context (ResolvedContext): Context to add.
"""
if name in self.contexts:
raise SuiteError("Context already in sui... | 0.0025 |
def info(self, section='default'):
"""Get information and statistics about the server.
If called without argument will return default set of sections.
For available sections, see http://redis.io/commands/INFO
:raises ValueError: if section is invalid
"""
if not section... | 0.004193 |
def unwrap(self):
"""
Returns a GLFWvidmode object.
"""
size = self.Size(self.width, self.height)
bits = self.Bits(self.red_bits, self.green_bits, self.blue_bits)
return self.GLFWvidmode(size, bits, self.refresh_rate) | 0.007547 |
def _get_methods_that_calculate_outputs(inputs, outputs, methods):
'''
Given iterables of input variable names, output variable names,
and a methods dictionary, returns the subset of the methods dictionary
that can be calculated, doesn't calculate something we already have,
and only contains equatio... | 0.000743 |
def get_web_file(file_url, file_name, auth=None, blocksize=1024*1024):
'''Get a file from the web (HTTP).
file_url: The URL of the file to get
file_name: Local path to save loaded file in
auth: A tuple (httpproxy, proxyuser, proxypass)
blocksize: Block size of file reads
Will try simple ... | 0.001117 |
def favourite_filters(self):
"""Get a list of filter Resources which are the favourites of the currently authenticated user.
:rtype: List[Filter]
"""
r_json = self._get_json('filter/favourite')
filters = [Filter(self._options, self._session, raw_filter_json)
f... | 0.008065 |
def mesh_to_collada(mesh):
'''
Supports per-vertex color, but nothing else.
'''
import numpy as np
try:
from collada import Collada, scene
except ImportError:
raise ImportError("lace.serialization.dae.mesh_to_collade requires package pycollada.")
def create_material(dae):
... | 0.003005 |
def _load_defaults(self, default='settings.py'):
'''
Load the default settings
'''
if default[-3:] == '.py':
default = default[:-3]
self.my_settings = {}
try:
settings = importlib.import_module(default)
self.my_settings = self._convert... | 0.004773 |
def format_graylog_v0(self, record):
'''
Graylog 'raw' format is essentially the raw record, minimally munged to provide
the bare minimum that td-agent requires to accept and route the event. This is
well suited to a config where the client td-agents log directly to Graylog.
'''... | 0.005833 |
def debug(message, level=1):
"""
So we can tune how much debug output we get when we turn it on.
"""
if level <= debug_level:
logging.debug(' ' * (level - 1) * 2 + str(message)) | 0.004975 |
def unpack(packed):
"""
Unpack the function and args then apply the function to the arguments and return result
:param packed: input packed tuple of (func, args)
:return: result of applying packed function on packed args
"""
func, args = serializer.loads(packed)
result = func(*args)
if i... | 0.00495 |
def _load_machines_cache(self):
"""This method should fill up `_machines_cache` from scratch.
It could happen only in two cases:
1. During class initialization
2. When all etcd members failed"""
self._update_machines_cache = True
if 'srv' not in self._config and 'host' ... | 0.005144 |
def _hex_to_rgb(color: str) -> Tuple[int, ...]:
"""Convert hex color to RGB format.
:param color: Hex color.
:return: RGB tuple.
"""
if color.startswith('#'):
color = color.lstrip('#')
return tuple(int(color[i:i + 2], 16) for i in (0, 2, 4)) | 0.006623 |
def line_spacing_rule(self):
"""
A member of the :ref:`WdLineSpacing` enumeration indicating how the
value of :attr:`line_spacing` should be interpreted. Assigning any of
the :ref:`WdLineSpacing` members :attr:`SINGLE`, :attr:`DOUBLE`, or
:attr:`ONE_POINT_FIVE` will cause the val... | 0.003311 |
def docs(recreate, gen_index, run_doctests):
# type: (bool, bool, bool) -> None
""" Build the documentation for the project.
Args:
recreate (bool):
If set to **True**, the build and output directories will be cleared
prior to generating the docs.
gen_index (bool):
... | 0.001367 |
def deserialize(self, obj, encoders=None, embedded=False, create_instance=True):
"""
Deserializes a given object, i.e. converts references to other (known) `Document` objects by lazy instances of the
corresponding class. This allows the automatic fetching of related documents from the database a... | 0.007961 |
def load(self, callables_fname):
r"""
Load traced modules information from a `JSON <http://www.json.org/>`_ file.
The loaded module information is merged with any existing module information
:param callables_fname: File name
:type callables_fname: :ref:`FileNameExists`
... | 0.002342 |
def node_factory(**row_factory_kw):
""" Give new nodes a unique ID. """
if "__table_editor__" in row_factory_kw:
graph = row_factory_kw["__table_editor__"].object
ID = make_unique_name("n", [node.ID for node in graph.nodes])
del row_factory_kw["__table_editor__"]
return godot.no... | 0.002538 |
async def connect_controller(self, controller_name=None):
"""Connect to a controller by name. If the name is empty, it
connect to the current controller.
"""
if not controller_name:
controller_name = self.jujudata.current_controller()
if not controller_name:
... | 0.001969 |
def extension_elements_to_elements(extension_elements, schemas):
""" Create a list of elements each one matching one of the
given extension elements. This is of course dependent on the access
to schemas that describe the extension elements.
:param extension_elements: The list of extension elements
... | 0.000795 |
def calcTightAnchors(args, d, patches):
"""
Recursively generates the number of anchor points specified in the
patches argument, such that all patches are d cells away
from their nearest neighbors.
"""
centerPoint = (int(args.worldSize/2), int(args.worldSize/2))
anchors = []
if patches =... | 0.00088 |
def spell(word: str, engine: str = "pn") -> List[str]:
"""
:param str word: word to check spelling
:param str engine:
* pn - Peter Norvig's algorithm (default)
:return: list of words
"""
return DEFAULT_SPELL_CHECKER.spell(word) | 0.003846 |
def _update(self, data, *args, **kwargs):
"""
The only thing that *should* happen in this function is
1. input sanitization for pandas
2. classification/reclassification.
Using their __init__ methods, all classifiers can re-classify given
different input parameters or ad... | 0.002681 |
def translate(s, table, deletions=""):
"""translate(s,table [,deletions]) -> string
Return a copy of the string s, where all characters occurring
in the optional argument deletions are removed, and the
remaining characters have been mapped through the given
translation table, which must be a string... | 0.001312 |
def fan_maxcfm(ddtt):
"""return the fan max cfm"""
if str(ddtt.Maximum_Flow_Rate).lower() == 'autosize':
# str can fail with unicode chars :-(
return 'autosize'
else:
m3s = float(ddtt.Maximum_Flow_Rate)
return m3s2cfm(m3s) | 0.007634 |
def merge(arg, *rest, **kwargs):
"""Merge a collection, with functions as items, into a single function
that takes a collection and maps its items through corresponding functions.
:param arg: A collection of functions, such as list, tuple, or dictionary
:param default: Optional default function to use ... | 0.001103 |
def get_table_content(self, table):
"""trick to get table content without actually writing it
return an aligned list of lists containing table cells values as string
"""
result = [[]]
cols = table.cols
for cell in self.compute_content(table):
if cols == 0:
... | 0.003534 |
def hr(self):
"""compute (height,round)
We might have multiple rounds before we see consensus for a certain height.
If everything is good, round should always be 0.
"""
assert len(self), 'no votes, can not determine height'
h = set([(v.height, v.round) for v in self.votes... | 0.007895 |
def _IsPresent(item):
"""Given a (FieldDescriptor, value) tuple from _fields, return true if the
value should be included in the list returned by ListFields()."""
if item[0].label == _FieldDescriptor.LABEL_REPEATED:
return bool(item[1])
elif item[0].cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE:
return ... | 0.013405 |
def processPointOfSalePayment(request):
'''
This view handles the callbacks from point-of-sale transactions.
Please note that this will only work if you have set up your callback
URL in Square to point to this view.
'''
print('Request data is: %s' % request.GET)
# iOS transactions put all r... | 0.005854 |
def _format_with_same_year_and_month(format_specifier):
"""
Return a version of `format_specifier` that renders a date
assuming it has the same year and month as another date. Usually this
means ommitting the year and month.
This can be overridden by specifying a format that has
`_SAME_YEAR_S... | 0.005714 |
def p_boolean_expr(self, p):
'''boolean_expr : expr AND expr
| expr AMPERSAND expr
| expr OR expr
| expr IMPLY expr
| expr EQUIV expr
| NOT expr %prec UMINUS
| bool_typ... | 0.003906 |
def extract(self, destination):
"""Extracts the contents of the archive to the specifed directory.
Args:
destination (str):
Path to an empty directory to extract the files to.
"""
if os.path.exists(destination):
raise OSError(20, 'Destination exi... | 0.004376 |
def generator(name):
""" Return generator by its name
:param name: name of hash-generator
:return: WHashGeneratorProto class
"""
name = name.upper()
if name not in WHash.__hash_map__.keys():
raise ValueError('Hash generator "%s" not available' % name)
return WHash.__hash_map__[name] | 0.033113 |
def _detect(ip, _isnm):
"""Function internally used to detect the notation of the
given IP or netmask."""
ip = str(ip)
if len(ip) > 1:
if ip[0:2] == '0x':
if _CHECK_FUNCT[IP_HEX][_isnm](ip):
return IP_HEX
elif ip[0] == '0':
if _CHECK_FUNCT[IP_OCT][... | 0.001364 |
def update_security_group_rule(context, id, security_group_rule):
'''Updates a rule and updates the ports'''
LOG.info("update_security_group_rule for tenant %s" %
(context.tenant_id))
new_rule = security_group_rule["security_group_rule"]
# Only allow updatable fields
new_rule = _filter_... | 0.000901 |
def parse_routing_info(cls, records):
""" Parse the records returned from a getServers call and
return a new RoutingTable instance.
"""
if len(records) != 1:
raise RoutingProtocolError("Expected exactly one record")
record = records[0]
routers = []
rea... | 0.002737 |
def _extract(self): # pragma: no cover
"""
Extract the expiration date from the whois record.
:return: The status of the domain.
:rtype: str
"""
# We try to get the expiration date from the database.
expiration_date_from_database = Whois().get_expiration_date()... | 0.000965 |
def write_phosphopath(df, f, extra_columns=None):
"""
Write out the data frame of phosphosites in the following format::
protein, protein-Rsite, Rsite, multiplicity
Q13619 Q13619-S10 S10 1
Q9H3Z4 Q9H3Z4-S10 S10 1
Q6GQQ9 Q6GQQ9-S100 S100 1
Q86YP4 Q86YP4-S100 S100 1
... | 0.00182 |
def removePeer(self, url):
"""
Remove peers by URL.
"""
q = models.Peer.delete().where(
models.Peer.url == url)
q.execute() | 0.011429 |
def response_add(self, request, obj):
"""
Enforce page permissions and maintain the parent ID in the
querystring.
"""
response = super(PageAdmin, self).response_add(request, obj)
return self._maintain_parent(request, response) | 0.007299 |
def fast_corr(x, y=None, destination=None):
"""calculate the pearson correlation matrix for the columns of x (with dimensions MxN), or optionally, the pearson correlaton matrix
between x and y (with dimensions OxP). If destination is provided, put the results there.
In the language of statistics the colu... | 0.006239 |
def preprocess_with_pca(adata, n_pcs=None, random_state=0):
"""
Parameters
----------
n_pcs : `int` or `None`, optional (default: `None`)
If `n_pcs=0`, do not preprocess with PCA.
If `None` and there is a PCA version of the data, use this.
If an integer, compute the PCA.
"""
... | 0.000754 |
def readf(prompt, default=None, minval=None, maxval=None,
allowed_single_chars=None, question_mark=True):
"""Return integer value read from keyboard
Parameters
----------
prompt : str
Prompt string.
default : float or None
Default value.
minval : float or None
... | 0.001066 |
def snapengage(parser, token):
"""
SnapEngage set-up template tag.
Renders Javascript code to set-up SnapEngage chat. You must supply
your widget ID in the ``SNAPENGAGE_WIDGET_ID`` setting.
"""
bits = token.split_contents()
if len(bits) > 1:
raise TemplateSyntaxError("'%s' takes no... | 0.002703 |
def _load_names(self) -> List[str]:
"""Return list of thirdparty modules from requirements
"""
names = []
for path in self._get_files():
for name in self._get_names(path):
names.append(self._normalize_name(name))
return names | 0.006826 |
def worker_start(obj, queues, name, celery_args):
""" Start a worker process.
\b
CELERY_ARGS: Additional Celery worker command line arguments.
"""
try:
start_worker(queues=queues.split(','),
config=obj['config'],
name=name,
cele... | 0.003571 |
def to_png(data, size, level=6, output=None):
# type: (bytes, Tuple[int, int], int, Optional[str]) -> Optional[bytes]
"""
Dump data to a PNG file. If `output` is `None`, create no file but return
the whole PNG data.
:param bytes data: RGBRGB...RGB data.
:param tuple size: The (width, height) p... | 0.001195 |
def print_code(co, lasti= -1, level=0):
"""Disassemble a code object."""
code = co.co_code
for constant in co.co_consts:
print( '| |' * level, end=' ')
print( 'constant:', constant)
labels = findlabels(code)
linestarts = dict(findlinestarts(co))
n = len... | 0.010601 |
def get_prep_value(self, value):
"""Convert JSON object to a string"""
if self.null and value is None:
return None
return json.dumps(value, **self.dump_kwargs) | 0.010256 |
def log_target_types(all_logs=False, **kwargs):
"""
Log targets for log tasks. A log target defines the log types
that will be affected by the operation. For example, when creating
a DeleteLogTask, you can specify which log types are deleted.
:param bool for_alert_event_log: alert events traces... | 0.003234 |
def remove(name, stop=False):
'''
Remove the named container
.. warning::
This function will remove all data associated with the container. It
will not, however, remove the btrfs subvolumes created by pulling
container images (:mod:`nspawn.pull_raw
<salt.modules.nspawn.pull... | 0.000711 |
def add_greenlet_name(
_logger: str,
_method_name: str,
event_dict: Dict[str, Any],
) -> Dict[str, Any]:
"""Add greenlet_name to the event dict for greenlets that have a non-default name."""
current_greenlet = gevent.getcurrent()
greenlet_name = getattr(current_greenlet, 'name', None... | 0.004211 |
def check_correct_audience(self, audience):
"Assert that Dataporten sends back our own client id as audience"
client_id, _ = self.get_key_and_secret()
if audience != client_id:
raise AuthException('Wrong audience') | 0.008 |
def dump(self, obj, key=None):
"""Write a pickled representation of obj to the open TFile."""
if key is None:
key = '_pickle'
with preserve_current_directory():
self.__file.cd()
if sys.version_info[0] < 3:
pickle.Pickler.dump(self, obj)
... | 0.003565 |
def plot(self, data, color='k', symbol=None, line_kind='-', width=1.,
marker_size=10., edge_color='k', face_color='b', edge_width=1.,
title=None, xlabel=None, ylabel=None):
"""Plot a series of data using lines and markers
Parameters
----------
data : array | tw... | 0.001848 |
def _weightfun_spatial_distance(data, params, report):
"""
Creates the weights for the spatial distance method. See func: teneto.derive.derive.
"""
distance = getDistanceFunction(params['distance'])
weights = np.array([distance(data[n, :], data[t, :]) for n in np.arange(
0, data.shape[0]) fo... | 0.003101 |
def copy(self):
"""
Return a copy of this ProtoFeed, that is, a feed with all the
same attributes.
"""
other = ProtoFeed()
for key in cs.PROTOFEED_ATTRS:
value = getattr(self, key)
if isinstance(value, pd.DataFrame):
# Pandas copy D... | 0.004695 |
def add_error(self, error):
"""Record an error from expect APIs.
This method generates a position stamp for the expect. The stamp is
composed of a timestamp and the number of errors recorded so far.
Args:
error: Exception or signals.ExceptionRecord, the error to add.
... | 0.00431 |
def construct_formset(self):
"""
Overrides construct_formset to attach the model class as
an attribute of the returned formset instance.
"""
formset = super(InlineFormSetFactory, self).construct_formset()
formset.model = self.inline_model
return formset | 0.006472 |
def _set_rsvp_authentication(self, v, load=False):
"""
Setter method for rsvp_authentication, mapped from YANG variable /mpls_config/router/mpls/mpls_cmds_holder/mpls_interface/rsvp/rsvp_authentication (container)
If this variable is read-only (config: false) in the
source YANG file, then _set_rsvp_auth... | 0.005184 |
def nextprefix(self):
"""
Get the next available prefix. This means a prefix starting with 'ns'
with a number appended as (ns0, ns1, ..) that is not already defined
on the wsdl document.
"""
used = [ns[0] for ns in self.prefixes]
used += [ns[0] for ns in self.wsd... | 0.003945 |
def write_file(self, filename, cart_coords=False):
"""
Write the input string into a file
Option: see __str__ method
"""
with zopen(filename, "w") as f:
f.write(self.to_string(cart_coords)) | 0.008264 |
def create_namespaced_event(self, namespace, body, **kwargs):
"""
create an Event
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_namespaced_event(namespace, body, async_req=True)
... | 0.005051 |
def get_key(s):
'''
Get data between [ and ] remove ' if exist
@param s: string to process
'''
start = s.find("[")
end = s.find("]")
if start == -1 or end == -1:
return None
if s[start + 1] == "'":
start += 1
if s[end - 1] == "'":
end -= 1
ret... | 0.002941 |
def Read(self, length):
"""Read from the file."""
if not self.IsFile():
raise IOError("%s is not a file." % self.pathspec.last.path)
available = min(self.size - self.offset, length)
if available > 0:
# This raises a RuntimeError in some situations.
try:
data = self.fd.read_ran... | 0.011706 |
def get_event_question(self, id, question_id, **data):
"""
GET /events/:id/questions/:question_id/
This endpoint will return :format:`question` for a specific question id.
"""
return self.get("/events/{0}/questions/{0}/".format(id,question_id), data=data) | 0.019737 |
def check_grid_aligned(vol, img, offset):
"""Returns (is_aligned, img bounds Bbox, nearest bbox inflated to grid aligned)"""
shape = Vec(*img.shape)[:3]
offset = Vec(*offset)[:3]
bounds = Bbox( offset, shape + offset)
alignment_check = bounds.expand_to_chunk_size(vol.underlying, vol.voxel_offset)
alignment_... | 0.024762 |
def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'dialog_node') and self.dialog_node is not None:
_dict['dialog_node'] = self.dialog_node
if hasattr(self, 'description') and self.description is not None:
_dict... | 0.000731 |
def _to_pandas(ob):
"""Convert an array-like to a pandas object.
Parameters
----------
ob : array-like
The object to convert.
Returns
-------
pandas_structure : pd.Series or pd.DataFrame
The correct structure based on the dimensionality of the data.
"""
if isinstanc... | 0.001689 |
def create_payload(self):
"""Rename the payload key "prior_id" to "prior".
For more information, see `Bugzilla #1238757
<https://bugzilla.redhat.com/show_bug.cgi?id=1238757>`_.
"""
payload = super(LifecycleEnvironment, self).create_payload()
if (_get_version(self._serve... | 0.004274 |
def get_terreinobject_by_id(self, id):
'''
Retrieve a `Terreinobject` by the Id.
:param integer id: the Id of the `Terreinobject`
:rtype: :class:`Terreinobject`
'''
def creator():
res = crab_gateway_request(
self.client,
'GetTe... | 0.002355 |
def find_rows_by_string(tab, names, colnames=['assoc']):
"""Find the rows in a table ``tab`` that match at least one of the
strings in ``names``. This method ignores whitespace and case
when matching strings.
Parameters
----------
tab : `astropy.table.Table`
Table that will be searched.... | 0.002868 |
def int_args(self):
"""
Iterate through all the possible arg positions that can only be used to store integer or pointer values
Does not take into account customizations.
Returns an iterator of SimFunctionArguments
"""
if self.ARG_REGS is None:
raise NotImple... | 0.006494 |
def _init_records(self, record_types):
"""Initalize all records for this form."""
for record_type in record_types:
# This conditional was inserted on 7/11/14. It may prove problematic:
if str(record_type) not in self._my_map['recordTypeIds']:
record_initialized = ... | 0.006397 |
def _expand_possible_file_value(self, value):
"""If the value is a file, returns its contents. Otherwise return the original value."""
if value and os.path.isfile(str(value)):
with open(value, 'r') as f:
return f.read()
return value | 0.011628 |
def index(self, record):
"""Index a record.
The caller is responsible for ensuring that the record has already been
committed to the database. If a newer version of a record has already
been indexed then the provided record will not be indexed. This
behavior can be controlled by... | 0.002522 |
def encrypt(self, plaintext, encoder=encoding.RawEncoder):
"""
Encrypts the plaintext message using a random-generated ephemeral
keypair and returns a "composed ciphertext", containing both
the public part of the keypair and the ciphertext proper,
encoded with the encoder.
... | 0.002191 |
def new_with_fixed_mpi_omp(self, mpi_procs, omp_threads):
"""
Return a new `TaskManager` in which autoparal has been disabled.
The jobs will be executed with `mpi_procs` MPI processes and `omp_threads` OpenMP threads.
Useful for generating input files for benchmarks.
"""
... | 0.006369 |
def _validate_response(self, method, response):
''' Helper method to validate the given to a Wunderlist API request is as expected '''
# TODO Fill this out using the error codes here: https://developer.wunderlist.com/documentation/concepts/formats
# The expected results can change based on API v... | 0.006985 |
def syncStateCall(self, method, url, params={}, **kwargs):
"""
Follow and track sync state URLs provided by an API endpoint, in order to implicitly handle pagination.
In the first call, ``url`` and ``params`` are used as-is. If a ``syncState`` endpoint is provided in the
response, subs... | 0.002954 |
def use_plenary_grade_entry_view(self):
"""Pass through to provider GradeEntryLookupSession.use_plenary_grade_entry_view"""
self._object_views['grade_entry'] = PLENARY
# self._get_provider_session('grade_entry_lookup_session') # To make sure the session is tracked
for session in self._ge... | 0.008511 |
def _GenerateZipInfo(self, arcname=None, compress_type=None, st=None):
"""Generate ZipInfo instance for the given name, compression and stat.
Args:
arcname: The name in the archive this should take.
compress_type: Compression type (zipfile.ZIP_DEFLATED, or ZIP_STORED)
st: An optional stat obj... | 0.004811 |
def enableGroup(self):
"""Enables all radio buttons in the group."""
radioButtonListInGroup = PygWidgetsRadioButton.__PygWidgets__Radio__Buttons__Groups__Dicts__[self.group]
for radioButton in radioButtonListInGroup:
radioButton.enable() | 0.01083 |
def getRenderModelErrorNameFromEnum(self, error):
"""Returns a string for a render model error"""
fn = self.function_table.getRenderModelErrorNameFromEnum
result = fn(error)
return result | 0.009091 |
def remove(self, uids: Iterable[int]) -> None:
"""Remove any session flags for the given message.
Args:
uids: The message UID values.
"""
for uid in uids:
self._recent.discard(uid)
self._flags.pop(uid, None) | 0.00722 |
def _pop_translated_data(self):
"""
Separate data of translated fields from other data.
"""
translated_data = {}
for meta in self.Meta.model._parler_meta:
translations = self.validated_data.pop(meta.rel_name, {})
if translations:
translated... | 0.005181 |
def _numbers_decades(N):
"""
>>> _numbers_decades(45)
' 1 2 3 4'
"""
N = N // 10
lst = range(1, N + 1)
return "".join(map(lambda i: "%10s" % i, lst)) | 0.004785 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.