text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def handle_starttag(self, tag, attrs):
"""Callback for when a tag gets opened."""
if not tag == 'a':
return
for attr in attrs:
if attr[0] == 'href':
# Links look like: /pub/firefox/nightly/2015/
# We have to trim the fragment down to the l... | 0.005415 |
def group(self, args):
"""
Executes a search
flickr:(credsfile),search,(arg1)=(val1),(arg2)=(val2)...
"""
kwargs = {'group_id': args[0]}
return self._paged_api_call(self.flickr.groups_pools_getPhotos, kwargs) | 0.007782 |
def fetch_next_page(self):
"""Retrieves the next page of data and refreshes Pages instance."""
result = self.request_handler.get(url=self.next_page_url).json()
self.__init__(self.request_handler, result,
self.data_type, self.automatic_pagination) | 0.006849 |
def anyGoodSprintsActive(self):
"""Return True if there are any more good sprints still being explored.
A 'good' sprint is one that is earlier than where we detected an increase
in error from sprint to subsequent sprint.
"""
if self._state['lastGoodSprint'] is not None:
goodSprints = self._sta... | 0.008224 |
def CallDhclient(
interfaces, logger, dhclient_script=None):
"""Configure the network interfaces using dhclient.
Args:
interfaces: list of string, the output device names to enable.
logger: logger object, used to write to SysLog and serial port.
dhclient_script: string, the path to a dhclient scrip... | 0.010114 |
def state(self):
"""Get the device state (i.e. ON or OFF)."""
response = self.SOAPAction('GetSocketSettings', 'OPStatus', self.moduleParameters("1"))
if response is None:
return 'unknown'
elif response.lower() == 'true':
return ON
elif response.lower() ==... | 0.010504 |
def run(self, eps=1e-4, kill=True, max_steps=50, verbose=False):
r"""Perform the clustering on the input components updating the initial
guess. The result is available in the member ``self.g``.
Return the number of iterations at convergence, or None.
:param eps:
If relativ... | 0.003072 |
def send_to_queue(self, message):
"""Add a message to a maildir queue.
In order to handle this, the setting 'mail.queue_path' must be
provided and must point to a valid maildir.
:param message: a 'Message' instance.
"""
if not self.queue_delivery:
raise Runt... | 0.004706 |
def hotkey(*args, **kwargs):
"""Performs key down presses on the arguments passed in order, then performs
key releases in reverse order.
The effect is that calling hotkey('ctrl', 'shift', 'c') would perform a
"Ctrl-Shift-C" hotkey/keyboard shortcut press.
Args:
key(s) (str): The series of ke... | 0.002033 |
def bed(args):
"""
%prog bed contigfile
Prints out the contigs and their associated reads.
"""
p = OptionParser(main.__doc__)
opts, args = p.parse_args(args)
if len(args) != 1:
sys.exit(not p.print_help())
contigfile, = args
bedfile = contigfile.rsplit(".", 1)[0] + ".bed"
... | 0.001789 |
def render_pictures(context, selection='recent', amount=3):
"""Template tag to render a list of pictures."""
pictures = Image.objects.filter(
folder__id__in=Gallery.objects.filter(is_published=True).values_list(
'folder__pk', flat=True))
if selection == 'recent':
context.update({... | 0.001751 |
def get_first_molecule(self):
"""Get the first molecule from the trajectory
This can be useful to configure your program before handeling the
actual trajectory.
"""
title, coordinates = self._first
molecule = Molecule(self.numbers, coordinates, title, symbols=self.... | 0.008523 |
async def get_user_profile_photos(self, user_id: base.Integer, offset: typing.Union[base.Integer, None] = None,
limit: typing.Union[base.Integer, None] = None) -> types.UserProfilePhotos:
"""
Use this method to get a list of profile pictures for a user. Returns a Us... | 0.007732 |
def add_to_manifest(self, manifest):
"""
Add to the manifest to make sure it is bound to the
application.
"""
manifest.add_service(self.service.name)
manifest.write_manifest() | 0.008969 |
def backwards(self, orm):
"Write your backwards methods here."
from django.contrib.auth.models import Group
projects = orm['samples.Project'].objects.all()
names = [PROJECT_GROUP_TEMPLATE.format(p.name) for p in projects]
# Remove groups named after these teams
Group.ob... | 0.005602 |
def copyto(self, query):
"""
Gets data from a table into a Response object that can be iterated
:param query: The "COPY { table_name [(column_name[, ...])] | (query) }
TO STDOUT [WITH(option[,...])]" query to execute
:type query: str
:return: response... | 0.001487 |
def stringify_with_dot_if_path(x):
'''Pathlib never renders a leading './' in front of a local path. That's an
issue because on POSIX subprocess.py (like bash) won't execute scripts in
the current directory without it. In the same vein, we also don't want
Path('echo') to match '/usr/bin/echo' from the $... | 0.001748 |
def create_identity_matcher(matcher='default', blacklist=None, sources=None,
strict=True):
"""Create an identity matcher of the given type.
Factory function that creates an identity matcher object of the type
defined on 'matcher' parameter. A blacklist can also be added to
i... | 0.000938 |
async def setChatStickerSet(self, chat_id, sticker_set_name):
""" See: https://core.telegram.org/bots/api#setchatstickerset """
p = _strip(locals())
return await self._api_request('setChatStickerSet', _rectify(p)) | 0.008439 |
def set_mute(mute_value):
"Browse for mute usages and set value"
all_mutes = ( \
(0x8, 0x9), # LED page
(0x1, 0xA7), # desktop page
(0xb, 0x2f),
)
all_target_usages = [hid.get_full_usage_id(u[0], u[1]) for u in all_mutes]
# usually you'll find and open the target... | 0.00372 |
def create_namespaced_network_policy(self, namespace, body, **kwargs):
"""
create a NetworkPolicy
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_namespaced_network_policy(namespace,... | 0.00484 |
def discard(self, it: Signature) -> bool:
""" Remove it only if present """
txt = it.internal_name()
if txt in self._hsig:
sig = self._hsig[txt]
if isinstance(sig, Scope):
sig.state = StateScope.LINKED
del self._hsig[txt]
return Tru... | 0.005848 |
async def send_message(self, *args, **kwargs):
"""
Sends a message to this dialog. This is just a wrapper around
``client.send_message(dialog.input_entity, *args, **kwargs)``.
"""
return await self._client.send_message(
self.input_entity, *args, **kwargs) | 0.006515 |
def get_flags(self, args):
"""
Checks and retrieves positional and 'always' (keyword) flags
from the many ways in which they may be passed to the
constructor (or the beautify() method on package-level).
Positional arguments can be passed either:
* Individually, where each flag-combination is one position... | 0.030449 |
def loglike(self, endog, mu, freq_weights=1., scale=1.):
r"""
The log-likelihood function in terms of the fitted mean response.
Parameters
----------
endog : array-like
Endogenous response variable
mu : array-like
Fitted mean response variable
... | 0.002398 |
def close(self, virtual_account_id, data={}, **kwargs):
""""
Close Virtual Account from given Id
Args:
virtual_account_id :
Id for which Virtual Account objects has to be Closed
"""
url = "{}/{}".format(self.base_url, virtual_account_id)
data[... | 0.005115 |
def hessfunc(self, p):
"""
The Hessian function that will be passed to the optimizer,
if needed.
"""
self._set_stochastics(p)
for i in xrange(self.len):
di = self.diff(i)
self.hess[i, i] = self.diff(i, 2)
if i < self.len - 1:
... | 0.003831 |
def pause(self, signum, seconds=0, callback_function=None):
"""
Pause execution, execution will resume in X seconds or when the
appropriate resume signal is received. Execution will jump to the
callback_function, the default callback function is the handler
method which will run ... | 0.003534 |
def plot_summary_axes(graph: BELGraph, lax, rax, logx=True):
"""Plots your graph summary statistics on the given axes.
After, you should run :func:`plt.tight_layout` and you must run :func:`plt.show` to view.
Shows:
1. Count of nodes, grouped by function type
2. Count of edges, grouped by relation... | 0.00149 |
def get_tokendefs(cls):
"""
Merge tokens from superclasses in MRO order, returning a single tokendef
dictionary.
Any state that is not defined by a subclass will be inherited
automatically. States that *are* defined by subclasses will, by
default, override that state in... | 0.001961 |
def handler(self):
'Handler function'
from feedjack import filters # shouldn't be imported globally, as they may depend on models
proc_func = getattr(filters, self.handler_name or self.name, None)
if proc_func is None:
if '.' not in self.handler_name:
raise ImportError('Processing function not available:... | 0.028463 |
def activate(paths, skip_local, skip_shared):
'''Activate an environment'''
if not paths:
ctx = click.get_current_context()
if cpenv.get_active_env():
ctx.invoke(info)
return
click.echo(ctx.get_help())
examples = (
'\nExamples: \n'
... | 0.001637 |
def distrib_id():
"""
Get the OS distribution ID.
Example::
from burlap.system import distrib_id
if distrib_id() != 'Debian':
abort(u"Distribution is not supported")
"""
with settings(hide('running', 'stdout')):
kernel = (run('uname -s') or '').strip().lower(... | 0.001278 |
def percentAt(self, value):
"""
Returns the percentage where the given value lies between this rulers
minimum and maximum values. If the value equals the minimum, then the
percent is 0, if it equals the maximum, then the percent is 1 - any
value between will be a floating p... | 0.007308 |
def gencode(data, output=None, tab=" ", indent=0, overwrite=False):
"""Generate code.
:param data: must be list of class data, see a valid data example below
:param output: default None, the python script file name you want to create
:param tab: default " "
:param indent: global indent se... | 0.005533 |
def changed_roles(self):
"""Returns a :class:`list` of :class:`Roles` that have been overridden from
their default values in the :attr:`Guild.roles` attribute."""
ret = []
g = self.guild
for overwrite in filter(lambda o: o.type == 'role', self._overwrites):
role = g.g... | 0.005376 |
def window_features(idx, window_size=100, overlap=10):
""" Generate indexes for a sliding window with overlap
:param array idx: The indexes that need to be windowed.
:param int window_size: The size of the window.
:param int overlap: How much should each window overlap.
... | 0.008264 |
def read_config(filename):
"""Reads and flattens a configuration file into a single
dictionary for ease of use. Works with both ``.config`` and
``.yaml`` files. Files should look like this::
search_rules:
from-date: 2017-06-01
to-date: 2017-09-01 01:01
pt-rule: k... | 0.000461 |
def cli(main, conf_dir=None, commands_dir=None):
"""Convenience function for initialising a Command CLI
For parameter definitions see :class:`.Command`
"""
return Command(main, conf_dir=conf_dir, commands_dir=commands_dir)() | 0.004149 |
def writer_trampoline(start):
"""Provides the co-routine trampoline for a writer state machine.
The given co-routine is a state machine that yields :class:`Transition` and takes
a :class:`Transition` with a :class:`amazon.ion.core.IonEvent` and the co-routine itself.
Notes:
A writer delimits i... | 0.006439 |
def get_load_balancer(self, id):
"""
Returns a Load Balancer object by its ID.
Args:
id (str): Load Balancer ID
"""
return LoadBalancer.get_object(api_token=self.token, id=id) | 0.008333 |
def view(filepath):
"""Open filepath with its default viewing application (platform-specific).
Args:
filepath: Path to the file to open in viewer.
Raises:
RuntimeError: If the current platform is not supported.
"""
try:
view_func = getattr(view, PLATFORM)
except Attribut... | 0.002392 |
def do_bd(self, arg):
"""
[~process] bd <address> - disable a code breakpoint
[~thread] bd <address> - disable a hardware breakpoint
[~process] bd <address-address> - disable a memory breakpoint
[~process] bd <address> <size> - disable a memory breakpoint
"""
toke... | 0.001792 |
def bastos_ohagen(mat, eps=1e-16):
"""
Bastos-O'Hagen algorithm for modified Cholesky decomposition.
Args:
mat (numpy.ndarray):
Input matrix to decompose. Assumed to close to positive definite.
eps (float):
Tolerance value for the eigenvalues. Values smaller
... | 0.000407 |
def main():
'''main routine'''
# Load Azure app defaults
try:
with open('azurermconfig.json') as config_file:
config_data = json.load(config_file)
except FileNotFoundError:
sys.exit('Error: Expecting azurermconfig.json in current folder')
tenant_id = config_data['tenantI... | 0.000918 |
def get_courses_in_account(self, account_id, params={}):
"""
Returns a list of courses for the passed account ID.
https://canvas.instructure.com/doc/api/accounts.html#method.accounts.courses_api
"""
if "published" in params:
params["published"] = "true" if params["pu... | 0.003571 |
def to_dict(self):
"""
Return a dictionary representation of the dataset.
"""
d = dict(individual_doses=self.individual_doses, responses=self.responses)
d.update(self.kwargs)
return d | 0.012987 |
def nonzero(self):
"""
Return the *integer* indices of the elements that are non-zero.
.. deprecated:: 0.24.0
Please use .to_numpy().nonzero() as a replacement.
This method is equivalent to calling `numpy.nonzero` on the
series data. For compatibility with NumPy, the... | 0.001538 |
def as_python(self, name: str) -> str:
""" Return the python representation of the class represented by this object """
if self._map_valuetype:
return self.map_as_python(name)
else:
return self.obj_as_python(name) | 0.011494 |
def put(self, key, data):
"""Implementation of :meth:`~simplekv.KeyValueStore.put`.
Will store the value in the backing store. After a successful or
unsuccessful store, the cache will be invalidated by deleting the key
from it.
"""
try:
return self._dstore.pu... | 0.005208 |
def primitive(self, primitive):
"""Record from Python primitive."""
self.entry = Entry()
self.entry.primitive = primitive
primitive = copy(primitive)
for field in self.entry.fields:
del primitive[field]
self.item = Item()
self.item.primitive = primit... | 0.006192 |
def trimquality(self):
"""Uses bbduk from the bbmap tool suite to quality and adapter trim"""
logging.info("Trimming fastq files")
# Iterate through strains with fastq files
with progressbar(self.metadata) as bar:
for sample in bar:
# As the metadata can be po... | 0.005654 |
def _load_from_file(self, filename):
"""Find filename in tar, and load it"""
if filename in self.fdata:
return self.fdata[filename]
else:
filepath = find_in_tarball(self.tarloc, filename)
return read_from_tarball(self.tarloc, filepath) | 0.00678 |
def _check_table(self):
"""Ensure that an incorrect table doesn't exist
If a bad (old) table does exist, return False
"""
cursor = self._db.execute("PRAGMA table_info(%s)"%self.table)
lines = cursor.fetchall()
if not lines:
# table does not exist
... | 0.008226 |
def proj_units_to_meters(proj_str):
"""Convert projection units from kilometers to meters."""
proj_parts = proj_str.split()
new_parts = []
for itm in proj_parts:
key, val = itm.split('=')
key = key.strip('+')
if key in ['a', 'b', 'h']:
val = float(val)
if ... | 0.001852 |
def image_search(
self, custom_config, query, accept_language=None, user_agent=None, client_id=None, client_ip=None, location=None, aspect=None, color=None, country_code=None, count=None, freshness=None, height=None, id=None, image_content=None, image_type=None, license=None, market=None, max_file_size=None... | 0.001048 |
def cli_login(self, username='', password=''):
"""Generates CLI prompts to complete the login process
:param username: optionally provide username
:type username: :class:`str`
:param password: optionally provide password
:type password: :class:`str`
:return: logon resu... | 0.004969 |
def _partialParseTimeStd(self, s, sourceTime):
"""
test if giving C{s} matched CRE_TIMEHMS, used by L{parse()}
@type s: string
@param s: date/time text to evaluate
@type sourceTime: struct_time
@param sourceTime: C{struct_time} value to use as the bas... | 0.001357 |
def make_cookie(name, load, seed, expire=0, domain="", path="",
timestamp=""):
"""
Create and return a cookie
:param name: Cookie name
:param load: Cookie load
:param seed: A seed for the HMAC function
:param expire: Number of minutes before this cookie goes stale
:param dom... | 0.001026 |
def add_udev_info(self, device, attrs=False):
"""Collect udevadm info output for a given device
:param device: A string or list of strings of device names or sysfs
paths. E.G. either '/sys/class/scsi_host/host0' or
'/dev/sda' is valid.
:param attrs:... | 0.002845 |
def update(self, server):
"""Update existing challenge on the server"""
return server.put(
'challenge_admin',
self.as_payload(),
replacements={'slug': self.slug}) | 0.009302 |
def generate_random_upload_path(instance, filename):
"""
Pass this function to upload_to argument of FileField to store the file on an unguessable path.
The format of the path is class_name/hash/original_filename.
"""
return os.path.join(instance.__class__.__name__.lower(), uuid().hex, filename) | 0.009494 |
def SetColumns( self, columns, sortOrder=None ):
"""Set columns to a set of values other than the originals and recreates column controls"""
self.columns = columns
self.sortOrder = [(x.defaultOrder,x) for x in self.columns if x.sortDefault]
self.CreateColumns() | 0.027211 |
def _message_address_parse(self, message, invert_hello=False):
""" Read address from beacon message. If no address is specified then "nullable" WIPV4SocketInfo returns
:param message: message to parse
:param invert_hello: defines whether message header is the original one or reversed.
:return: WIPV4SocketInfo
... | 0.02343 |
def from_str(cls, string):
"""
Creates a mapping from a string
Parameters
----------
string : str
String of the form `target<-clause` where `clause` is a valid string for :class:`caspo.core.clause.Clause`
Returns
-------
caspo.core.mapping.Ma... | 0.005128 |
def M(self):
"""
Contact frequency matrix. Each cell contains how many inter-contig
links between i-th and j-th contigs.
"""
N = self.N
tig_to_idx = self.tig_to_idx
M = np.zeros((N, N), dtype=int)
for (at, bt), links in self.contacts.items():
i... | 0.003891 |
def _encode_params(**kw):
'''
do url-encode parameters
>>> _encode_params(a=1, b='R&D')
'a=1&b=R%26D'
>>> _encode_params(a=u'\u4e2d\u6587', b=['A', 'B', 123])
'a=%E4%B8%AD%E6%96%87&b=A&b=B&b=123'
'''
args = []
for k, v in kw.iteritems():
if isinstance(v, basestring):
... | 0.001299 |
def scale(obj, multiplier, **kwargs):
""" Scales curves, surfaces or volumes by the input multiplier.
Keyword Arguments:
* ``inplace``: if False, operation applied to a copy of the object. *Default: False*
:param obj: input geometry
:type obj: abstract.SplineGeometry, multi.AbstractGeometry
... | 0.001988 |
def write(self, filename=None):
"""Write the PE file.
This function will process all headers and components
of the PE file and include all changes made (by just
assigning to attributes in the PE objects) and write
the changes back to a file whose name is provided as
an a... | 0.005819 |
def get_es_requirements(es_version):
'''Get the requirements string for elasticsearch-py library
Returns a suitable requirements string for the elsaticsearch-py library
according to the elasticsearch version to be supported (es_version)'''
# accepts version range in the form `2.x`
es_version = es_... | 0.001493 |
def cache_clear(self):
"""Clear local cache by deleting all cached resources and their
downloaded files.
"""
# Delete content of local cache directory
for f in os.listdir(self.directory):
f = os.path.join(self.directory, f)
if os.path.isfile(f):
... | 0.004367 |
def base_ws_uri():
"""Base websocket URL that is advertised to external clients.
Useful when the websocket URL advertised to the clients needs to be
customized (typically when running behind NAT, firewall, etc.)
"""
scheme = config['wsserver']['advertised_scheme']
host = config['wsserver']['ad... | 0.002299 |
def is_error(self):
""" Checks to see if the job errored out. """
qstat = self._grep_qstat('error')
err = self._grep_status('error')
if qstat and err:
return True
return False | 0.008811 |
def update(self, source_zip=None, no_upload=False):
"""
Repackage and update the function code.
"""
if not source_zip:
# Make sure we're in a venv.
self.check_venv()
# Execute the prebuild script
if self.prebuild_script:
s... | 0.003939 |
def value(self):
"""gets the color value"""
return {
"type" : self._type,
"style" : self._style,
"color" : self._color.value,
"width" : self._width
} | 0.027149 |
def ping(destination, source=None, ttl=None, timeout=None, size=None, count=None, vrf=None, **kwargs): # pylint: disable=unused-argument
'''
Executes a ping on the network device and returns a dictionary as a result.
destination
Hostname or IP address of remote host
source
Source add... | 0.001571 |
def match_tuple(self):
"""return a tuple which can be used as *args for
ofproto_v1_0_parser.OFPMatch.__init__().
see Datapath.send_flow_mod.
"""
assert self.flow_format() == ofproto_v1_0.NXFF_OPENFLOW10
wildcards = ofproto_v1_0.OFPFW_ALL
if not self.wc.wildcards ... | 0.000952 |
def has_attr(cls, attr_name):
"""Check to see if an attribute is defined for the model."""
if attr_name in cls.attrs:
return True
if isinstance(cls.primary_key_name, str) and cls.primary_key_name == attr_name:
return True
if isinstance(cls.primary_key_name, tuple) and attr_name in cls.prim... | 0.015385 |
def _build_from(self, address, root, base_address, depth=2):
"""Build gadgets recursively.
"""
if depth == 0:
return
end_addr = address
for step in range(1, self._max_bytes + 1):
start_addr = address - step
if start_addr < 0 or start_addr < ... | 0.004364 |
def datetime2yeardec(time: Union[str, datetime.datetime, datetime.date]) -> float:
"""
Convert a datetime into a float. The integer part of the float should
represent the year.
Order should be preserved. If adate<bdate, then d2t(adate)<d2t(bdate)
time distances should be preserved: If bdate-adate=dd... | 0.001986 |
async def azureAccounts(self, *args, **kwargs):
"""
List Accounts Managed by Auth
Retrieve a list of all Azure accounts managed by Taskcluster Auth.
This method gives output: ``v1/azure-account-list-response.json#``
This method is ``stable``
"""
return await s... | 0.007792 |
def institute(self, institute_id):
"""Featch a single institute from the backend
Args:
institute_id(str)
Returns:
Institute object
"""
LOG.debug("Fetch institute {}".format(institute_id))
institute_obj = self.institute_collection.... | 0.003906 |
def t(i18n_msg):
"""Safely translate and convert to UTF8, any zope i18n msgid returned from
a bikaMessageFactory _
"""
text = to_unicode(i18n_msg)
try:
request = api.get_request()
domain = getattr(i18n_msg, "domain", "senaite.core")
text = translate(text, domain=domain, conte... | 0.002041 |
def get_room_id(self, room_alias):
"""Get room id from its alias.
Args:
room_alias (str): The room alias name.
Returns:
Wanted room's id.
"""
content = self._send("GET", "/directory/room/{}".format(quote(room_alias)))
return content.get("room_id"... | 0.009174 |
def play_station(self, station):
"""Play the station until something ends it
This function will run forever until termintated by calling
end_station.
"""
for song in iterate_forever(station.get_playlist):
try:
self.play(song)
except StopIt... | 0.005277 |
def colors(self, brew=None, range_=None):
"""Convenience method for adding color brewer scales to charts with a
color scale, such as stacked or grouped bars.
See the colors here: http://colorbrewer2.org/
Or here: http://bl.ocks.org/mbostock/5577023
This assumes that a 'color' ... | 0.002688 |
def same(d1, d2):
"""! @brief Test whether two sequences contain the same values.
Unlike a simple equality comparison, this function works as expected when the two sequences
are of different types, such as a list and bytearray. The sequences must return
compatible types from indexing.
"""
i... | 0.008715 |
def dispatch(self, request, *args, **kwargs):
'''
Require session data to be set to proceed, otherwise go back to step 1.
Because they have the same expiration date, this also implies that the
TemporaryRegistration object is not yet expired.
'''
if REG_VALIDATION_STR not ... | 0.009828 |
def gps_rtcm_data_send(self, flags, len, data, force_mavlink1=False):
'''
WORK IN PROGRESS! RTCM message for injecting into the onboard GPS
(used for DGPS)
flags : LSB: 1 means message is fragmented (uint8_t)
len ... | 0.010417 |
def _write_with_fallback(s, write, fileobj):
"""Write the supplied string with the given write function like
``write(s)``, but use a writer for the locale's preferred encoding in case
of a UnicodeEncodeError. Failing that attempt to write with 'utf-8' or
'latin-1'.
"""
if IPythonIOStream is no... | 0.000718 |
def _update_chime_status(self, message=None, status=None):
"""
Uses the provided message to update the Chime state.
:param message: message to use to update
:type message: :py:class:`~alarmdecoder.messages.Message`
:param status: chime status, overrides message bits.
:ty... | 0.002407 |
def clear_response(self, assessment_section_id, item_id):
"""Clears the response to an item The item appears as unanswered.
If no response exists, the method simply returns.
arg: assessment_section_id (osid.id.Id): ``Id`` of the
``AssessmentSection``
arg: item_id ... | 0.002357 |
def retrieve(self, identifier, *criterion):
"""
Retrieve a model by primary key and zero or more other criteria.
:raises `NotFound` if there is no existing model
"""
return self._retrieve(
self.model_class.id == identifier,
*criterion
) | 0.006452 |
def add_flanking_seqs(self, ref_seq, new_start, new_end):
'''Adds new_start many nucleotides at the start, and new_end many nucleotides
at the end from the appropriate nucleotides in reference sequence ref_seq.'''
if new_start > self.POS or new_end < self.ref_end_pos():
raise Error('... | 0.007595 |
def memory_objects_for_hash(self, n):
"""
Returns a set of :class:`SimMemoryObjects` that contain expressions that contain a variable with the hash
`h`.
"""
return set([self[i] for i in self.addrs_for_hash(n)]) | 0.012 |
def get(self, key):
'''Return the object named by `key. Follows links.'''
value = super(SymlinkDatastore, self).get(key)
return self._follow_link(value) | 0.006098 |
def show(x):
"""Display the data attributes of an object in a readable format"""
print("data attributes of %r" % (x,))
names = dir(x)
maxlen = max([0] + [len(n) for n in names])
for k in names:
v = getattr(x, k)
if isinstance(v, types.MethodType):
continue
if k[:2... | 0.001311 |
def get_domain_event(self, originator_id, position):
"""
Gets a domain event from the sequence identified by `originator_id`
at position `eq`.
:param originator_id: ID of a sequence of events
:param position: get item at this position
:return: domain event
"""
... | 0.003906 |
def add_access_control_headers(self, env=None):
"""Adds Access-Control* HTTP headers to this WbResponse's HTTP headers.
:param dict env: The WSGI environment dictionary
:return: The same WbResponse but with the values for the Access-Control* HTTP header added
:rtype: WbResponse
... | 0.005629 |
def GetMessages(self, formatter_mediator, event):
"""Determines the formatted message strings for an event object.
Args:
formatter_mediator (FormatterMediator): mediates the interactions
between formatters and other components, such as storage and Windows
EventLog resources.
eve... | 0.006217 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.