text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def add_record(self, msg_id, rec):
"""Add a new Task Record, by msg_id."""
if self._records.has_key(msg_id):
raise KeyError("Already have msg_id %r"%(msg_id))
self._records[msg_id] = rec | 0.018018 |
def run_cli(
executable,
mets_url=None,
resolver=None,
workspace=None,
page_id=None,
log_level=None,
input_file_grp=None,
output_file_grp=None,
parameter=None,
working_dir=None,
):
"""
Create a workspace for mets_url and run MP CLI ... | 0.001075 |
def grid_select(self, grid, clear_selection=True):
"""Selects cells of grid with selection content"""
if clear_selection:
grid.ClearSelection()
for (tl, br) in zip(self.block_tl, self.block_br):
grid.SelectBlock(tl[0], tl[1], br[0], br[1], addToSelected=True)
f... | 0.003215 |
def get_vmpolicy_macaddr_output_vmpolicy_macaddr_port_nn(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vmpolicy_macaddr = ET.Element("get_vmpolicy_macaddr")
config = get_vmpolicy_macaddr
output = ET.SubElement(get_vmpolicy_macaddr, "output"... | 0.003407 |
def compile_foreign(self, blueprint, command, _):
"""
Compile a foreign key command.
:param blueprint: The blueprint
:type blueprint: Blueprint
:param command: The command
:type command: Fluent
:rtype: str
"""
table = self.wrap_table(blueprint)
... | 0.00309 |
def load_project(self, path, load=True):
"""
Load a project from a .gns3
:param path: Path of the .gns3
:param load: Load the topology
"""
topo_data = load_topology(path)
topo_data.pop("topology")
topo_data.pop("version")
topo_data.pop("revision")... | 0.004161 |
def get_comments_content_object(parser, token):
"""
Get a limited set of comments for a given object.
Defaults to a limit of 5. Setting the limit to -1 disables limiting.
usage:
{% get_comments_content_object for form_object as variable_name %}
"""
keywords = token.contents.split()
... | 0.001239 |
def libvlc_media_get_mrl(p_md):
'''Get the media resource locator (mrl) from a media descriptor object.
@param p_md: a media descriptor object.
@return: string with mrl of media descriptor object.
'''
f = _Cfunctions.get('libvlc_media_get_mrl', None) or \
_Cfunction('libvlc_media_get_mrl', (... | 0.004938 |
def sort_idx(m, reverse=False):
"""Return the indices of m in sorted order (default: ascending order)"""
return sorted(range(len(m)), key=lambda k: m[k], reverse=reverse) | 0.005618 |
def andeshelp(group=None,
category=None,
model_list=None,
model_format=None,
model_var=None,
quick_help=None,
help_option=None,
help_config=None,
export='plain',
**kwargs):
"""
Print the... | 0.000171 |
def plot(self):
""" Graphical summary of pointwise pareto-k importance-sampling indices
Pareto-k tail indices are plotted (on the y axis) for each observation unit (on the x axis)
"""
seaborn.pointplot(
y = self.pointwise.pareto_k,
x = self.pointwise.index,
... | 0.026393 |
def t_INITIAL_SHARP(self, t):
r'\#'
if self.find_column(t) == 1:
t.lexer.begin('preproc')
else:
self.t_INITIAL_preproc_error(t) | 0.011364 |
def restart(self):
"""
Tells the HAProxy control object to restart the process.
If it's been fewer than `restart_interval` seconds since the previous
restart, it will wait until the interval has passed. This staves off
situations where the process is constantly restarting, as i... | 0.003106 |
def parse_bdstoken(content):
'''从页面中解析出bdstoken等信息.
这些信息都位于页面底部的<script>, 只有在授权后的页面中才出现.
这里, 为了保证兼容性, 就不再使用cssselect模块解析了.
@return 返回bdstoken
'''
bdstoken = ''
bds_re = re.compile('"bdstoken"\s*:\s*"([^"]+)"', re.IGNORECASE)
bds_match = bds_re.search(content)
if bds_match:
... | 0.010724 |
def gff3_verifier(entries, line=None):
"""Raises error if invalid GFF3 format detected
Args:
entries (list): A list of GFF3Entry instances
line (int): Line number of first entry
Raises:
FormatError: Error when GFF3 format incorrect with descriptive message
"""
regex = r'^... | 0.000477 |
def traceback_plot(self,fsize=(6,4)):
"""
Plots a path of the possible last 4 states.
Parameters
----------
fsize : Plot size for matplotlib.
Examples
--------
>>> import matplotlib.pyplot as plt
>>> from sk_dsp_comm.fec_conv import fe... | 0.007013 |
def update(self, columnIndex, vector):
""" Wraps setRowFromDense()"""
return super(_SparseMatrixCorticalColumnAdapter, self).setRowFromDense(
columnIndex, vector
) | 0.005525 |
def search_news(q, start=1, count=10, wait=10, asynchronous=False, cached=False):
""" Returns a Yahoo news query formatted as a YahooSearch list object.
"""
service = YAHOO_NEWS
return YahooSearch(q, start, count, service, None, wait, asynchronous, cached) | 0.01773 |
def memoized_parse_block(code):
"""Memoized version of parse_block."""
success, result = parse_block_memo.get(code, (None, None))
if success is None:
try:
parsed = COMPILER.parse_block(code)
except Exception as err:
success, result = False, err
else:
... | 0.002114 |
def to_basestring(value):
"""Converts a string argument to a subclass of basestring.
In python2, byte and unicode strings are mostly interchangeable,
so functions that deal with a user-supplied argument in combination
with ascii string constants can use either and should return the type
the user su... | 0.001704 |
def admin_tools_render_menu_item(context, item, index=None):
"""
Template tag that renders a given menu item, it takes a ``MenuItem``
instance as unique parameter.
"""
item.init_with_context(context)
context.update({
'template': item.template,
'item': item,
'index': inde... | 0.002088 |
def redo(self):
"""
Performs the top group on the redo stack, if present. Creates an undo
group with the same name. Raises RuntimeError if called while undoing.
"""
if self._undoing or self._redoing:
raise RuntimeError
if not self._redo:
return
... | 0.003591 |
def pop_marker(self, reset):
""" Pop a marker off of the marker stack. If reset is True then the
iterator will be returned to the state it was in before the
corresponding call to push_marker().
"""
marker = self.markers.pop()
if reset:
# Make the values ava... | 0.004484 |
def cmd_gasheli(self, args):
'''gas help commands'''
usage = "Usage: gasheli <start|stop|set>"
if len(args) < 1:
print(usage)
return
if args[0] == "start":
self.start_motor()
elif args[0] == "stop":
self.stop_motor()
elif ar... | 0.004695 |
def fol_fc_ask(KB, alpha):
"""Inefficient forward chaining for first-order logic. [Fig. 9.3]
KB is a FolKB and alpha must be an atomic sentence."""
while True:
new = {}
for r in KB.clauses:
ps, q = parse_definite_clause(standardize_variables(r))
raise NotImplementedEr... | 0.003096 |
def list_versions(self, layer_id):
"""
Filterable list of versions of a layer, always ordered newest to oldest.
If the version’s source supports revisions, you can get a specific revision using
``.filter(data__source__revision=value)``. Specific values depend on the source type.
... | 0.012103 |
def handle_version(self, message_header, message):
"""
This method will handle the Version message and
will send a VerAck message when it receives the
Version message.
:param message_header: The Version message header
:param message: The Version message
"""
... | 0.004231 |
def unionfs(rw='rw', ro=None, union='union'):
"""
Decorator for the UnionFS feature.
This configures a unionfs for projects. The given base_dir and/or image_dir
are layered as follows:
image_dir=RW:base_dir=RO
All writes go to the image_dir, while base_dir delivers the (read-only)
versions... | 0.000297 |
def poke(self, context):
"""
Pokes for a mail attachment on the mail server.
:param context: The context that is being provided when poking.
:type context: dict
:return: True if attachment with the given name is present and False if not.
:rtype: bool
"""
... | 0.004732 |
def write(self, destination, filename, content):
""" Write a file at the specific destination with the content.
Args:
destination (string): the destination location
filename (string): the filename that will be written
content (string): the content of ... | 0.004478 |
def filter(self, filters=None, keep=True, inplace=False, **kwargs):
"""Return a filtered IamDataFrame (i.e., a subset of current data)
Parameters
----------
keep: bool, default True
keep all scenarios satisfying the filters (if True) or the inverse
inplace: bool, def... | 0.001056 |
def flags(self):
"""Return set of flags."""
return set((name.lower() for name in sorted(TIFF.FILE_FLAGS)
if getattr(self, 'is_' + name))) | 0.011561 |
def merge(cls, trees):
"""
Merge a collection of AttrTree objects.
"""
first = trees[0]
for tree in trees:
first.update(tree)
return first | 0.010101 |
def merge_maps(m, base):
"""
Merge in undefined map entries from given map.
@param m: Map to be merged into.
@type m: lems.util.Map
@param base: Map to be merged into.
@type base: lems.util.Map
"""
for k in base.keys():
if k not in m:
m[k] = base[k] | 0.012658 |
async def _workaround_1695335(self, delta, old, new, model):
"""
This is a (hacky) temporary work around for a bug in Juju where the
instance status and agent version fields don't get updated properly
by the AllWatcher.
Deltas never contain a value for `data['agent-status']['ver... | 0.000667 |
def add_advisor(self, name, ids=None, degree_type=None, record=None, curated=False):
"""Add an advisor.
Args:
:param name: full name of the advisor.
:type name: string
:param ids: list with the IDs of the advisor.
:type ids: list
:param degr... | 0.004864 |
def encrypt_report(self, device_id, root, data, **kwargs):
"""Encrypt a buffer of report data on behalf of a device.
Args:
device_id (int): The id of the device that we should encrypt for
root (int): The root key type that should be used to generate the report
data (... | 0.006609 |
def delete_service(self, service_id):
"""Deletes a service from the loadbal_id.
:param int service_id: The id of the service to delete
"""
svc = self.client['Network_Application_Delivery_Controller_'
'LoadBalancer_Service']
return svc.deleteObject(id=... | 0.006042 |
def _client_connection(self, conn, addr):
'''
Handle the connecition with one client.
'''
log.debug('Established connection with %s:%d', addr[0], addr[1])
conn.settimeout(self.socket_timeout)
try:
while self.__up:
msg = conn.recv(self.buffer_si... | 0.002988 |
def run(self):
"""
Perform build_cmake before doing the 'normal' stuff
"""
for extension in self.extensions:
if extension.name == "bpy":
self.build_cmake(extension)
super().run() | 0.008 |
def find():
"""Find the configuration file if any."""
names = ('archan.yml', 'archan.yaml', '.archan.yml', '.archan.yaml')
current_dir = os.getcwd()
configconfig_file = os.path.join(current_dir, '.configconfig')
default_config_dir = os.path.join(current_dir, 'config')
if ... | 0.001745 |
def chat_react(self, msg_id, emoji='smile', **kwargs):
"""Updates the text of the chat message."""
return self.__call_api_post('chat.react', messageId=msg_id, emoji=emoji, kwargs=kwargs) | 0.014851 |
def apply_option(self, cmd, option, active=True):
"""Apply a command-line option."""
return re.sub(r'{{{}\:(?P<option>[^}}]*)}}'.format(option),
'\g<option>' if active else '', cmd) | 0.013699 |
def get_attachment_content(self, ticket_id, attachment_id):
""" Get content of attachment without headers.
This function is necessary to use for binary attachment,
as it can contain ``\\n`` chars, which would disrupt parsing
of message if :py:meth:`~Rt.get_attachment` is used.
... | 0.00273 |
def upload(sess_id_or_alias, files):
"""
Upload files to user's home folder.
\b
SESSID: Session ID or its alias given when creating the session.
FILES: Path to upload.
"""
if len(files) < 1:
return
with Session() as session:
try:
print_wait('Uploading files..... | 0.001825 |
def generator_name(cls):
""" :meth:`.WHashGeneratorProto.generator_name` implementation
"""
if cls.__generator_name__ is None:
raise ValueError('"__generator_name__" should be override in a derived class')
if isinstance(cls.__generator_name__, str) is False:
raise TypeError('"__generator_name__" should be... | 0.026525 |
def __pack_message(operation, data):
"""Takes message data and adds a message header based on the operation.
Returns the resultant message string.
"""
request_id = _randint()
message = struct.pack("<i", 16 + len(data))
message += struct.pack("<i", request_id)
message += _ZERO_32 # response... | 0.002463 |
def _set_client(self):
"""Set client property if not set."""
if self._client is None:
if mongo_proxy:
self._client = mongo_proxy.MongoProxy(
pymongo.MongoClient(self.connection_string),
logger=LOG)
else:
LOG.... | 0.002924 |
def file(self, owner=None, **kwargs):
"""
Create the File TI object.
Args:
owner:
**kwargs:
Return:
"""
return File(self.tcex, owner=owner, **kwargs) | 0.008929 |
def prepare_worker(self):
"""
Prepare the worker, ready to be launched: prepare options, create a
log handler if none, and manage dry_run options
"""
worker_options = self.prepare_worker_options()
self.worker = self.options.worker_class(**worker_options)
if self.u... | 0.002344 |
def covariance_between_points(self, kern, X, X1, X2):
"""
Computes the posterior covariance between points.
:param kern: GP kernel
:param X: current input observations
:param X1: some input observations
:param X2: other input observations
"""
# ndim == 3 ... | 0.004115 |
def base_url(klass, space_id, parent_resource_id, resource_url='entries', resource_id=None, environment_id=None):
"""
Returns the URI for the snapshot.
"""
return "spaces/{0}{1}/{2}/{3}/snapshots/{4}".format(
space_id,
'/environments/{0}'.format(environment_id) i... | 0.008264 |
def cli(env, package_keyname, location, preset, verify, billing, complex_type,
quantity, extras, order_items):
"""Place or verify an order.
This CLI command is used for placing/verifying an order of the specified package in
the given location (denoted by a datacenter's long name). Orders made via t... | 0.002338 |
def get_fs(path):
"""Find the file system implementation for this path."""
scheme = ''
if '://' in path:
scheme = path.partition('://')[0]
for schemes, fs_class in FILE_EXTENSIONS:
if scheme in schemes:
return fs_class
return FileSystem | 0.003497 |
def fromProfileName(cls, name):
"""Return a `SessionAPI` from a given configuration profile name.
:see: `ProfileStore`.
"""
with profiles.ProfileStore.open() as config:
return cls.fromProfile(config.load(name)) | 0.007843 |
def ip_rtm_config_route_static_bfd_bfd_static_route_bfd_static_route_src(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
ip = ET.SubElement(config, "ip", xmlns="urn:brocade.com:mgmt:brocade-common-def")
rtm_config = ET.SubElement(ip, "rtm-config", xmlns=... | 0.007128 |
def connected_channel(self):
""" Returns the voice channel the player is connected to. """
if not self.channel_id:
return None
return self._lavalink.bot.get_channel(int(self.channel_id)) | 0.008772 |
def _get_view_infos(
self,
trimmed=False):
"""query the sherlock-catalogues database view metadata
"""
self.log.debug('starting the ``_get_view_infos`` method')
sqlQuery = u"""
SELECT v.*, t.description as "master table" FROM crossmatch_catalogues.tcs... | 0.002639 |
def start(self, any_zone):
"""Start the event listener listening on the local machine at port 1400
(default)
Make sure that your firewall allows connections to this port
Args:
any_zone (SoCo): Any Sonos device on the network. It does not
matter which device.... | 0.001149 |
def iter_schemas(self, schema: Schema) -> Iterable[Tuple[str, Any]]:
"""
Build zero or more JSON schemas for a marshmallow schema.
Generates: name, schema pairs.
"""
if not schema:
return
yield self.to_tuple(schema)
for name, field in self.iter_fie... | 0.002886 |
def keep_episodes(show, keep):
""" Delete all but last count episodes in show. """
deleted = 0
print('%s Cleaning %s to %s episodes.' % (datestr(), show.title, keep))
sort = lambda x:x.originallyAvailableAt or x.addedAt
items = sorted(show.episodes(), key=sort, reverse=True)
for episode in items... | 0.0075 |
def lazy_load_font(font_size=default_font_size):
"""
Lazy loading font according to system platform
"""
if font_size not in _font_cache:
if _platform.startswith("darwin"):
font_path = "/Library/Fonts/Arial.ttf"
elif _platform.startswith("linux"):
font_path = "/usr... | 0.003413 |
def isTemporal(inferenceType):
""" Returns True if the inference type is 'temporal', i.e. requires a
temporal memory in the network.
"""
if InferenceType.__temporalInferenceTypes is None:
InferenceType.__temporalInferenceTypes = \
set([InferenceType.TemporalNextStep... | 0.002959 |
def sentry_reraise(exc):
"""Re-raise an exception after logging it to Sentry
Use this for top-level exceptions when you want the user to see the traceback.
Must be called from within an exception handler.
"""
sentry_exc(exc)
# this will messily add this "reraise" function to the stack trace
... | 0.004938 |
def _call_command(self, name, *args, **kwargs):
"""
Add lock management and call parent.
"""
meth = super(RedisField, self)._call_command
if self.indexable and name in self.available_modifiers:
with FieldLock(self):
try:
result = me... | 0.004754 |
def oauth2decorator_from_clientsecrets(filename, scope,
message=None, cache=None):
"""Creates an OAuth2Decorator populated from a clientsecrets file.
Args:
filename: string, File name of client secrets.
scope: string or list of strings, scope(s) of the cre... | 0.001042 |
def all_modules_subpattern():
u"""
Builds a pattern for all toplevel names
(urllib, http, etc)
"""
names_dot_attrs = [mod.split(u".") for mod in MAPPING]
ret = u"( " + u" | ".join([dotted_name % (simple_name % (mod[0]),
simple_attr % (mod[1])) for mod ... | 0.008299 |
def deserialize(self,
node: SchemaNode,
cstruct: Union[str, ColanderNullType]) \
-> Optional[Pendulum]:
"""
Deserializes string representation to Python object.
"""
if not cstruct:
return colander.null
try:
... | 0.006339 |
def setExpanded( self, state ):
"""
Sets whether or not this rollout is in the expanded state.
:param state | <bool>
"""
self._expanded = state
self._widget.setVisible(state)
if ( state ):
ico = projexui.resources.find('img/treev... | 0.016477 |
def pauseProducing(self):
"""
Pause the reception of messages by canceling all existing consumers.
This does not disconnect from the server.
Message reception can be resumed with :meth:`resumeProducing`.
Returns:
Deferred: fired when the production is paused.
... | 0.004399 |
def data(self):
"""bytes: value data as a byte string.
Raises:
WinRegistryValueError: if the value data cannot be read.
"""
try:
return self._pyregf_value.data
except IOError as exception:
raise errors.WinRegistryValueError(
'Unable to read data from value: {0:s} with er... | 0.007692 |
def create_driver_script(driver, script_create=None): # noqa: E501
"""Create a new script
Create a new script # noqa: E501
:param driver: The driver to use for the request. ie. github
:type driver: str
:param script_create: The data needed to create this script
:type script_create: dict | byt... | 0.00243 |
def _record_revisit(self, payload_offset: int):
'''Record the revisit if possible.'''
fields = self._response_record.fields
ref_record_id = self._url_table.get_revisit_id(
fields['WARC-Target-URI'],
fields.get('WARC-Payload-Digest', '').upper().replace('SHA1:', '')
... | 0.001764 |
def write_bed_with_trackline(bed, out, trackline, add_chr=False):
"""
Read a bed file and write a copy with a trackline. Here's a simple trackline
example: 'track type=bed name="cool" description="A cool track."'
Parameters
----------
bed : str
Input bed file name.
out : str
... | 0.004662 |
def evaluate_block(self, comments):
"""Evaluate block comments."""
if self.jsdocs:
m1 = RE_JSDOC.match(comments)
if m1:
lines = []
for line in m1.group(1).splitlines(True):
l = line.lstrip()
lines.append(l[1... | 0.008571 |
def is_protected_type(obj):
"""Determine if the object instance is of a protected type.
Objects of protected types are preserved as-is when passed to
force_text(strings_only=True).
"""
return isinstance(obj, six.integer_types + (type(None), float, Decimal,
datetime.datetime, datetime.date, ... | 0.00597 |
def main(self):
"""
Main entry point
:return:
"""
parser = self.init_parser()
if len(sys.argv) < 2:
parser.print_usage()
sys.exit(0)
self.args = parser.parse_args()
self.roca.args.flatten = self.args.flatten
self.roca.args.... | 0.004098 |
def fit(self, t, y, dy=None):
"""Fit the multiterm Periodogram model to the data.
Parameters
----------
t : array_like, one-dimensional
sequence of observation times
y : array_like, one-dimensional
sequence of observed values
dy : float or array_l... | 0.003797 |
def plot_histogram(data, figsize=(7, 5), color=None, number_to_keep=None,
sort='asc', target_string=None,
legend=None, bar_labels=True, title=None):
"""Plot a histogram of data.
Args:
data (list or dict): This is either a list of dictionaries or a single
... | 0.000868 |
def getUniqueFeaturesLocationsInObject(self, name):
"""
Return two sets. The first set contains the unique locations Ids in the
object. The second set contains the unique feature Ids in the object.
"""
uniqueFeatures = set()
uniqueLocations = set()
for pair in self.objects[name]:
uniqu... | 0.006466 |
def add_dependent_assembly(self, manifestVersion=None, noInheritable=False,
noInherit=False, type_=None, name=None, language=None,
processorArchitecture=None, version=None,
publicKeyToken=None, description=None,
requestedExecutionLevel=None, uiAcce... | 0.015385 |
def main():
"""Parse the command-line arguments and run the bot."""
parser = argparse.ArgumentParser(description = 'XMPP echo bot',
parents = [XMPPSettings.get_arg_parser()])
parser.add_argument('jid', metavar = 'JID',
help = 'The ... | 0.019038 |
def clean(self, *args, **kwargs):
""" from_user and to_user must differ """
if self.from_user and self.from_user_id == self.to_user_id:
raise ValidationError(_('A user cannot send a notification to herself/himself')) | 0.012295 |
def patch_apply(self, patches, text):
"""Merge a set of patches onto the text. Return a patched text, as well
as a list of true/false values indicating which patches were applied.
Args:
patches: Array of Patch objects.
text: Old text.
Returns:
Two element Array, containing the new t... | 0.008438 |
def run_in_subprocess(code, filename_suffix, arguments, working_directory):
"""Return None on success."""
temporary_file = tempfile.NamedTemporaryFile(mode='wb',
suffix=filename_suffix)
temporary_file.write(code.encode('utf-8'))
temporary_file.flush()
... | 0.001274 |
def _rescanSizes(self, force=True):
""" Zero and recalculate quota sizes to subvolume sizes will be correct. """
status = self.QUOTA_CTL(cmd=BTRFS_QUOTA_CTL_ENABLE).status
logger.debug("CTL Status: %s", hex(status))
status = self.QUOTA_RESCAN_STATUS()
logger.debug("RESCAN Status... | 0.005556 |
def load(filename):
"""Load variable from Pickle file
Args:
path (str): path of the file to load
Returns:
variable read from path
"""
fileObj = open(filename, 'rb')
variable = pickle.load(fileObj)
fileObj.close()
return variable | 0.007092 |
def leastsq_NxN(x, y, fit_offset=False, perc=None):
"""Solution to least squares: gamma = cov(X,Y) / var(X)
"""
if perc is not None:
if not fit_offset and isinstance(perc, (list, tuple)): perc = perc[1]
weights = csr_matrix(get_weight(x, y, perc)).astype(bool)
x, y = weights.multiply... | 0.001756 |
def _validate(self):
"""
Ensure that our expression string has variables of the form x_0, x_1,
... x_(N - 1), where N is the length of our inputs.
"""
variable_names, _unused = getExprNames(self._expr, {})
expr_indices = []
for name in variable_names:
... | 0.002148 |
def _sanitize_resources(cls, resources):
"""Loops over incoming data looking for base64 encoded data and
converts them to a readable format."""
try:
for resource in cls._loop_raw(resources):
cls._sanitize_resource(resource)
except (KeyError, TypeError):
... | 0.005115 |
def draw_text(data, obj):
"""Paints text on the graph.
"""
content = []
properties = []
style = []
if isinstance(obj, mpl.text.Annotation):
_annotation(obj, data, content)
# 1: coordinates
# 2: properties (shapes, rotation, etc)
# 3: text style
# 4: the text
# ... | 0.001001 |
def __Script_Editor_Output_plainTextEdit_contextMenuEvent(self, event):
"""
Reimplements the :meth:`QPlainTextEdit.contextMenuEvent` method.
:param event: QEvent.
:type event: QEvent
"""
menu = self.Script_Editor_Output_plainTextEdit.createStandardContextMenu()
... | 0.006768 |
def recentEvents(self):
'''
Get the set of recent and upcoming events to which this list applies.
'''
return Event.objects.filter(
Q(pk__in=self.individualEvents.values_list('pk',flat=True)) |
Q(session__in=self.eventSessions.all()) |
Q(publicevent__ca... | 0.005137 |
async def _submit(self, req_json: str) -> str:
"""
Submit (json) request to ledger; return (json) result.
Raise AbsentPool for no pool, ClosedPool if pool is not yet open, or BadLedgerTxn on failure.
:param req_json: json of request to sign and submit
:return: json response
... | 0.005645 |
def pretty_str(self, indent=0):
"""Return a human-readable string representation of this object.
Kwargs:
indent (int): The amount of spaces to use as indentation.
"""
if self.parenthesis:
return '{}({})'.format(' ' * indent, pretty_str(self.value))
return... | 0.005587 |
def unzip(self, payload):
"""
Unzips a file
:param payload:
zip_with_rel_path: string
remove_original_zip: boolean
:return: (object)
unzipped_path: string
"""
zip_with_rel_path = payload.pop('zip_with_rel_path')
ur... | 0.003552 |
def list_api_keys(self, **kwargs):
"""List the API keys registered in the organisation.
List api keys Example:
.. code-block:: python
account_management_api = AccountManagementAPI()
# List api keys
api_keys_paginated_response = account_management_api.list_... | 0.003735 |
def raw_chroma_accuracy(ref_voicing, ref_cent, est_voicing, est_cent,
cent_tolerance=50):
"""Compute the raw chroma accuracy given two pitch (frequency) sequences
in cents and matching voicing indicator sequences. The first pitch and
voicing arrays are treated as the reference (truth... | 0.000314 |
def add_app_template_global(self, func: Callable, name: Optional[str]=None) -> None:
"""Add an application wide template global.
This is designed to be used on the blueprint directly, and
has the same arguments as
:meth:`~quart.Quart.add_template_global`. An example usage,
.. c... | 0.010363 |
def transactional(wrapped):
"""
A decorator to denote that the content of the decorated function or
method is to be ran in a transaction.
The following code is equivalent to the example for
:py:func:`dbkit.transaction`::
import sqlite3
import sys
from dbkit import connect, ... | 0.000714 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.