text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def getIRData(self):
'''
Returns last LaserData.
@return last JdeRobotTypes LaserData saved
'''
if self.hasproxy():
self.lock.acquire()
ir = self.ir
self.lock.release()
return ir
return None | 0.013559 |
def _strip_column_name(col_name, keep_paren_contents=True):
"""
Utility script applying several regexs to a string.
Intended to be used by `strip_column_names`.
This function will:
1. replace informative punctuation components with text
2. (optionally) remove text within parentheses
... | 0.00204 |
def parse_filename_meta(filename):
"""
taken from suvi code by vhsu
Parse the metadata from a product filename, either L1b or l2.
- file start
- file end
- platform
- product
:param filename: string filename of product
:return: (start ... | 0.005161 |
def devices(self):
"""Manages users enrolled u2f devices"""
self.verify_integrity()
if session.get('u2f_device_management_authorized', False):
if request.method == 'GET':
return jsonify(self.get_devices()), 200
elif request.method == 'DELETE':
... | 0.003247 |
def email_queue():
"""Checks for emails, that fill up the queue without getting sent."""
status = SERVER_STATUS['OK']
count = Message.objects.exclude(priority=PRIORITY_DEFERRED).filter(
when_added__lte=now() - timedelta(minutes=QUEUE_TIMEOUT)).count()
if QUEUE_WARNING_THRESHOLD <= count < QUEUE... | 0.00157 |
def pack(self, value=None):
"""Pack the value as a binary representation.
:attr:`data` is packed before the calling :meth:`.GenericMessage.pack`.
After that, :attr:`data`'s value is restored.
Returns:
bytes: The binary representation.
Raises:
:exc:`~.ex... | 0.002008 |
def render_docstring(self):
"""make a nice docstring for ipython"""
res = '{{{self.method}}} {self.uri} {self.title}\n'.format(self=self)
if self.params:
for group, params in self.params.items():
res += '\n' + group + ' params:\n'
for param in params.v... | 0.005013 |
def variational_expectations(self, Y, m, v, gh_points=None, Y_metadata=None):
"""
Use Gauss-Hermite Quadrature to compute
E_p(f) [ log p(y|f) ]
d/dm E_p(f) [ log p(y|f) ]
d/dv E_p(f) [ log p(y|f) ]
where p(f) is a Gaussian with mean m and variance v. The shapes... | 0.012048 |
def change_ssh_port():
"""
For security woven changes the default ssh port.
"""
host = normalize(env.host_string)[1]
after = env.port
before = str(env.DEFAULT_SSH_PORT)
host_string=join_host_strings(env.user,host,before)
with settings(host_string=host_string, user=env.user):
... | 0.020313 |
def comments(recid):
"""Display comments."""
from invenio_access.local_config import VIEWRESTRCOLL
from invenio_access.mailcookie import \
mail_cookie_create_authorize_action
from .api import check_user_can_view_comments
auth_code, auth_msg = check_user_can_view_comments(current_user, recid)... | 0.000864 |
def has_rotational(self):
"""Return true if any of the drive is HDD"""
for member in self._drives_list():
if member.media_type == constants.MEDIA_TYPE_HDD:
return True
return False | 0.008621 |
def attach_tasks(self, tasks: Tasks):
"""Attach a set of tasks.
A task cannot be scheduled or executed before it is attached to an
Engine.
>>> tasks = Tasks()
>>> spin.attach_tasks(tasks)
"""
if tasks._spin is not None and tasks._spin is not self:
lo... | 0.004535 |
def _prep_components(component_list: Sequence[str]) -> List[Tuple[str, Tuple[str]]]:
"""Transform component description strings into tuples of component paths and required arguments.
Parameters
----------
component_list :
The component descriptions to transform.
Returns
-------
Lis... | 0.005128 |
def insert(self, stim, position):
"""Inserts a new stimulus into the list at the given position
:param stim: stimulus to insert into protocol
:type stim: :class:`StimulusModel<sparkle.stim.stimulus_model.StimulusModel>`
:param position: index (row) of location to insert to
:type... | 0.006494 |
def _verify(waiveredHdul):
"""
Verify that the input HDUList is for a waivered FITS file.
Parameters:
waiveredHdul HDUList object to be verified
Returns: None
Exceptions:
ValueError Input HDUList is not for a waivered FITS file
"""
if len... | 0.002322 |
def read_bytes(fh, byteorder, dtype, count, offsetsize):
"""Read tag data from file and return as byte string."""
dtype = 'B' if dtype[-1] == 's' else byteorder+dtype[-1]
count *= numpy.dtype(dtype).itemsize
data = fh.read(count)
if len(data) != count:
log.warning('read_bytes: failed to read... | 0.002525 |
def process_host_check_result(self, host, status_code, plugin_output):
"""Process host check result
Format of the line that triggers function call::
PROCESS_HOST_CHECK_RESULT;<host_name>;<status_code>;<plugin_output>
:param host: host to process check to
:type host: alignak.obj... | 0.002643 |
def log(message: str, *args: str, category: str='info', logger_name: str='pgevents'):
"""Log a message to the given logger.
If debug has not been enabled, this method will not log a message.
Parameters
----------
message: str
Message, with or without formatters, to print.
args: Any
... | 0.005489 |
def create(self, section, article):
"""
Create (POST) an Article - See: Zendesk API `Reference
<https://developer.zendesk.com/rest_api/docs/help_center/articles#create-article>`__.
:param section: Section ID or object
:param article: Article to create
"""
return ... | 0.005319 |
def get_version():
"""Extracts the version number from the version.py file.
"""
VERSION_FILE = os.path.join(module_name, 'version.py')
txt = open(VERSION_FILE).read()
mo = re.search(r'^__version__ = [\'"]([^\'"]*)[\'"]', txt, re.M)
if mo:
version = mo.group(1)
bs_version = os.env... | 0.001445 |
def toxml(self):
"""
Exports this object into a LEMS XML object
"""
return '<Tunnel name="{0}"'.format(self.name) + \
' endA="{0}"'.format(self.end_a) + \
' endB="{0}"'.format(self.end_b) + \
' componentA="{0}"'.format(self.component_a) + \
... | 0.005195 |
def mock(self, tst_name, tst_type):
"""
Mock appearance/disappearance to force changes in interface , via setting local cache.
:param tst_name:
:param tst_type:
:return:
"""
print(" -> Mock {tst_name} appear".format(**locals()))
# Service appears
s... | 0.006012 |
def get_controller(self, state):
'''
Retrieves the actual controller name from the application
Specific to Pecan (not available in the request object)
'''
path = state.request.pecan['routing_path'].split('/')[1:]
return state.controller.__str__().split()[2] | 0.006557 |
def spectrum(self, ref=None, segmentLengthMultiplier=1, mode=None, **kwargs):
"""
analyses the source to generate the linear spectrum.
:param ref: the reference value for dB purposes.
:param segmentLengthMultiplier: allow for increased resolution.
:param mode: cq or none.
... | 0.004102 |
def _add(self, name, *args, **kw):
"""
Add an argument to the underlying parser and grow the list
.all_arguments and the set .names
"""
argname = list(self.argdict)[self._argno]
if argname != name:
raise NameError(
'Setting argument %s, but it ... | 0.003992 |
def _sub(cmd, *sections):
"""Build Subcmd instance."""
cmd_func = cmd if isfunction(cmd) else cmd.cmd
return Subcmd(baredoc(cmd), *sections, func=cmd_func) | 0.005988 |
def create(clients_num, clients_host, clients_port, people_num, throttle):
"""
Prepare clients to execute
:return: Modules to execute, cmd line function
:rtype: list[WrapperClient], (str, object) -> str | None
"""
res = []
for number in range(clients_num):
sc = EchoClient({
... | 0.0025 |
def cap(self):
"""
"Caps" the construction of the pipeline, signifying that no more inputs
and outputs are expected to be added and therefore the input and output
nodes can be created along with the provenance.
"""
to_cap = (self._inputnodes, self._outputnodes, self._prov... | 0.00243 |
def dicom_diff(file1, file2):
""" Shows the fields that differ between two DICOM images.
Inspired by https://code.google.com/p/pydicom/source/browse/source/dicom/examples/DicomDiff.py
"""
datasets = compressed_dicom.read_file(file1), compressed_dicom.read_file(file2)
rep = []
for dataset in ... | 0.004525 |
def reduce_lists(d):
"""Replace single item lists in a dictionary with the single item."""
for field in d:
old_data = d[field]
if len(old_data) == 1:
d[field] = old_data[0] | 0.004808 |
def wsdl2py(args=None):
"""Utility for automatically generating client/service interface code from
a wsdl definition, and a set of classes representing element declarations
and type definitions. By default invoking this script produces three files,
each named after the wsdl definition name, in the cu... | 0.009998 |
def open_issue(self):
"""Changes the state of issue to 'open'.
"""
self.github_request.update(issue=self, state='open')
self.state = 'open' | 0.011696 |
def load_string(self, string_data, share_name, directory_name, file_name, **kwargs):
"""
Upload a string to Azure File Share.
:param string_data: String to load.
:type string_data: str
:param share_name: Name of the share.
:type share_name: str
:param directory_n... | 0.003942 |
def _modify_new_lines(code_to_modify, offset, code_to_insert):
"""
Update new lines: the bytecode inserted should be the last instruction of the previous line.
:return: bytes sequence of code with updated lines offsets
"""
# There's a nice overview of co_lnotab in
# https://github.com/python/cpy... | 0.003834 |
def print_summary_stats(counter):
"""
Prints summary statistics about which writer strategies were used,
and how much they were used.
:param counter: A list of lists. The first entry on the inner list is a
number count of how many times a WriterStrategy was used, and the
second entry is... | 0.001212 |
def _add_ttl_ns(self, line):
""" takes one prefix line from the turtle file and binds the namespace
to the class
Args:
line: the turtle prefix line string
"""
lg = logging.getLogger("%s.%s" % (self.ln, inspect.stack()[0][3]))
lg.setLevel(self.log_level)
... | 0.004098 |
def parse(self, rrstr):
# type: (bytes) -> None
'''
Parse a Rock Ridge Time Stamp record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.P... | 0.004747 |
def scroll_cb(self, viewer, direction, amt, data_x, data_y):
"""Called when the user scrolls in the color bar viewer.
Pan up or down to show additional bars.
"""
bd = viewer.get_bindings()
direction = bd.get_direction(direction)
pan_x, pan_y = viewer.get_pan()[:2]
... | 0.003521 |
def list_attached_partitions(self, name=None, status=None):
"""
Return the partitions to which this storage group is currently
attached, optionally filtered by partition name and status.
Authorization requirements:
* Object-access permission to this storage group.
* Tas... | 0.000934 |
def call(args):
"""
Call terminal command and return exit_code and stdout
Parameters
----------
args : list
A command and arguments list
Returns
-------
list : [exit_code, stdout]
exit_code indicate the exit code of the command and stdout indicate the
output of ... | 0.00278 |
def _extract_cookies(self, response: Response):
'''Load the cookie headers from the Response.'''
self._cookie_jar.extract_cookies(
response, response.request, self._get_cookie_referrer_host()
) | 0.008734 |
def add_download(self, info, future):
"""
Hand off a download to the Downloads plugin, if it is present.
Parameters
----------
info : `~ginga.misc.Bunch.Bunch`
A bunch of information about the URI as returned by
`ginga.util.iohelper.get_fileinfo()`
... | 0.002339 |
def wrap_with_try(self, node):
"""Wrap an ast node in a 'try' node to enter debug on exception."""
handlers = []
if self.ignore_exceptions is None:
handlers.append(ast.ExceptHandler(type=None,
name=None,
... | 0.001068 |
def open_window(self, widget, data=None):
"""
Function opens Main Window and in case of previously created
project is switches to /home directory
This is fix in case that da creats a project
and project was deleted and GUI was not closed yet
"""
if data is not Non... | 0.004396 |
def read_requirements_file(path):
"""
reads requirements.txt file and handles PyPI index URLs
:param path: (str) path to requirements.txt file
:return: (tuple of lists)
"""
last_pypi_url = None
with open(path) as f:
requires = []
pypi_urls = []
for line in f.readlines... | 0.001178 |
def stage_http_request(self, conn_id, version, url, target, method, headers,
payload):
"""Log request HTTP information including url, headers, etc."""
if self.enabled and self.http_detail_level is not None and \
self.httplogger.isEnabledFor(logging.DEBUG):
... | 0.002244 |
def write(self, vendor_id=None, log_type=None, json=None, **kwargs):
"""Write log records to the Logging Service.
This API requires a JSON array in its request body, each element
of which represents a single log record. Log records are
provided as JSON objects. Every log record must inc... | 0.002625 |
def reconnect(self):
"""
Reconnect session with device.
Args:
None
Returns:
bool: True if reconnect succeeds, False if not.
Raises:
None
"""
if self._auth_method is "userpass":
self._mgr = manager.connect(host=sel... | 0.001826 |
def creation_dates(self, sort=True):
"""
Return a list of (file_path, creation_date) tuples created from list of walked paths.
:param sort: Bool, sorts file_paths on created_date from newest to oldest.
:return: List of (file_path, created_date) tuples.
"""
if not sort:
... | 0.007752 |
def instantiate(self, **extra_args):
""" Instantiate the model """
input_block = self.input_block.instantiate()
backbone = self.backbone.instantiate(**extra_args)
return StochasticPolicyModel(input_block, backbone, extra_args['action_space']) | 0.010909 |
def regression():
"""
Run regression testing - lint and then run all tests.
"""
# HACK: Start using hitchbuildpy to get around this.
Command("touch", DIR.project.joinpath("pathquery", "__init__.py").abspath()).run()
storybook = _storybook({}).only_uninherited()
#storybook.with_params(**{"pyt... | 0.014159 |
def compile(self, X, verbose=False):
"""method to validate and prepare data-dependent parameters
Parameters
---------
X : array-like
Input dataset
verbose : bool
whether to show warnings
Returns
-------
None
"""
f... | 0.006144 |
def __vCmdConnectCameras(self, args):
'''ToDo: Validate the argument as a valid port'''
if len(args) >= 1:
self.WirelessPort = args[0]
print ("Connecting to Cameras on %s" % self.WirelessPort)
self.__vRegisterCameras() | 0.01145 |
def new(self):
# type: () -> None
'''
A method to create a new UDF Terminating Descriptor.
Parameters:
None.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('UDF Terminating Descriptor already ... | 0.008316 |
def inverted(self):
"""Return the inverse of the transform."""
# This is a bit of hackery so that we can put a single "inverse"
# function here. If we just made "self._inverse_type" point to the class
# in question, it wouldn't be defined yet. This way, it's done at
# at runtime ... | 0.004666 |
def _get_script_nflows(self):
"""
Write the submission script. Return (script, num_flows_in_batch)
"""
flows_torun = [f for f in self.flows if not f.all_ok]
if not flows_torun:
return "", 0
executable = [
'export _LOG=%s' % self.log_file.path,
... | 0.003399 |
def update_file_status(self):
"""Update the status of all the files in the archive"""
nfiles = len(self.cache.keys())
status_vect = np.zeros((6), int)
sys.stdout.write("Updating status of %i files: " % nfiles)
sys.stdout.flush()
for i, key in enumerate(self.cache.keys()):... | 0.001791 |
def off(self):
"""Send an OFF message to device group."""
off_command = ExtendedSend(self._address,
COMMAND_LIGHT_OFF_0X13_0X00,
self._udata)
off_command.set_checksum()
self._send_method(off_command, self._off_message_... | 0.006079 |
def _right_join(left, right, left_key_fn, right_key_fn, join_fn=union_join):
"""
:param left: left iterable to be joined
:param right: right iterable to be joined
:param function left_key_fn: function that produces hashable value from left objects
:param function right_key_fn: function that produces... | 0.006221 |
def _convert(self, pos):
""" For QPainter coordinate system, reflect over X axis and
translate from center to top-left
"""
px = pos[0] + self.logical_size.width() / 2
py = self.logical_size.height() / 2 - pos[1]
return px, py | 0.007326 |
def preferred_width(self, cli, max_available_width):
"""
Report the width of the longest meta text as the preferred width of this control.
It could be that we use less width, but this way, we're sure that the
layout doesn't change when we select another completion (E.g. that
com... | 0.006547 |
def refresh(self, *args, **kwargs):
"""
Updates/upgrades all system packages.
"""
r = self.local_renderer
packager = self.packager
if packager == APT:
r.sudo('DEBIAN_FRONTEND=noninteractive apt-get -yq update --fix-missing')
elif packager == YUM:
... | 0.008316 |
def import_submodules(package_name):
"""
Import all submodules of a module.
"""
import importlib, pkgutil
package = importlib.import_module(package_name)
return {
name: importlib.import_module(package_name + '.' + name)
for _, name, _ in pkgutil.iter_modules(package.__path__)
... | 0.006211 |
def open_default_resource_manager(library):
"""This function returns a session to the Default Resource Manager resource.
Corresponds to viOpenDefaultRM function of the VISA library.
:param library: the visa library wrapped by ctypes.
:return: Unique logical identifier to a Default Resource Manager ses... | 0.00565 |
def format_epilog(self, ctx, formatter):
"""Writes the epilog into the formatter if it exists."""
if self.epilog:
formatter.write_paragraph()
with formatter.indentation():
formatter.write_text(self.epilog) | 0.007663 |
def main(args=None):
"""Script entry point."""
if args is None:
parser = get_argument_parser()
args = parser.parse_args()
#series_matrix_file = newstr(args.series_matrix_file, 'utf-8')
#output_file = newstr(args.output_file, 'utf-8')
#encoding = newstr(args.encoding, 'utf-8')
s... | 0.004975 |
def plot_connectivity_topos(self, fig=None):
""" Plot scalp projections of the sources.
This function only plots the topos. Use in combination with connectivity plotting.
Parameters
----------
fig : {None, Figure object}, optional
Where to plot the topos. f set to *... | 0.006818 |
def bounding_square_polygon(self, inscribed_circle_radius_km=10.0):
"""
Returns a square polygon (bounding box) that circumscribes the circle having this geopoint as centre and
having the specified radius in kilometers.
The polygon's points calculation is based on theory exposed by: ... | 0.004646 |
def get_ticket(self, ticket_id):
"""Fetches the ticket for the given ticket ID"""
url = 'tickets/%d' % ticket_id
ticket = self._api._get(url)
return Ticket(**ticket) | 0.010152 |
def assign_asset_to_repository(self, asset_id, repository_id):
"""Adds an existing ``Asset`` to a ``Repository``.
arg: asset_id (osid.id.Id): the ``Id`` of the ``Asset``
arg: repository_id (osid.id.Id): the ``Id`` of the
``Repository``
raise: AlreadyExists - ``ass... | 0.00175 |
def get_single_file_info(f_path, int_path):
""" Gets the creates and last change times for a single file,
f_path is the path to the file on disk, int_path is an internal
path relative to a root directory. """
return { 'path' : force_unicode(int_path),
'created' : os.path.getctime(f_pa... | 0.013298 |
def get_device(name, device_dict, loader, resource_dict):
"""Get a device from a device dictionary.
:param name: name of the device
:param device_dict: device dictionary
:rtype: Device
"""
device = Device(name, device_dict.get('delimiter', ';').encode('utf-8'))
device_dict = get_bases(devi... | 0.001232 |
def create_textinput(self, name, field, value, **extra_attrs):
'''Generate and render a :class:`django.forms.widgets.TextInput` for
a single year, month, or day input.
If size is specified in the extra attributes, it will also be used to
set the maximum length of the field.
:pa... | 0.002755 |
def delete(self, *, if_unused=True):
"""
Delete the exchange.
This method is a :ref:`coroutine <coroutine>`.
:keyword bool if_unused: If true, the exchange will only be deleted if
it has no queues bound to it.
"""
self.sender.send_ExchangeDelete(self.name, i... | 0.004739 |
def refresh(self, document):
""" Load a new copy of a document from the database. does not
replace the old one """
try:
old_cache_size = self.cache_size
self.cache_size = 0
obj = self.query(type(document)).filter_by(mongo_id=document.mongo_id).one()
finally:
self.cache_size = old_cache_size
self... | 0.034286 |
def copy(self):
"""Create a copy of this pen."""
pen = Pen()
pen.__dict__ = self.__dict__.copy()
return pen | 0.014388 |
def log_trial(args):
''''get trial log path'''
trial_id_path_dict = {}
nni_config = Config(get_config_filename(args))
rest_port = nni_config.get_config('restServerPort')
rest_pid = nni_config.get_config('restServerPid')
if not detect_process(rest_pid):
print_error('Experiment is not runn... | 0.001577 |
def random_filtered_sources(sources, srcfilter, seed):
"""
:param sources: a list of sources
:param srcfilte: a SourceFilter instance
:param seed: a random seed
:returns: an empty list or a list with a single filtered source
"""
random.seed(seed)
while sources:
src = random.choic... | 0.002212 |
def resultcallback(self, replace=False):
"""Adds a result callback to the chain command. By default if a
result callback is already registered this will chain them but
this can be disabled with the `replace` parameter. The result
callback is invoked with the return value of the subcomm... | 0.002152 |
def randstring(length=1):
"""
Generate a random string consisting of letters, digits and punctuation
:type length: integer
:param length: The length of the generated string.
"""
charstouse = string.ascii_letters + string.digits + string.punctuation
newpass = ''
for _ in range(length):
... | 0.002427 |
def _get_assignment_target_end(self, ast_module):
"""Returns position of 1st char after assignment traget.
If there is no assignment, -1 is returned
If there are more than one of any ( expressions or assigments)
then a ValueError is raised.
"""
if len(ast_module.body)... | 0.002786 |
def parse_tle(fileobj):
"""Parse a file of TLE satellite element sets.
Builds an Earth satellite from each pair of adjacent lines in the
file that start with "1 " and "2 " and have 69 or more characters
each. If the preceding line is exactly 24 characters long, then it
is parsed as the satellite's... | 0.001695 |
def c32encode(input_hex, min_length=None):
"""
>>> c32encode('a46ff88886c2ef9762d970b4d2c63678835bd39d')
'MHQZH246RBQSERPSE2TD5HHPF21NQMWX'
>>> c32encode('')
''
>>> c32encode('0000000000000000000000000000000000000000', 20)
'00000000000000000000'
>>> c32encode('000000000000000000000000000... | 0.000776 |
def stratSRS2(f, G, y0, tspan, Jmethod=Jkpw, dW=None, J=None):
"""Use the Roessler2010 order 1.0 strong Stochastic Runge-Kutta algorithm
SRS2 to integrate a Stratonovich equation dy = f(y,t)dt + G(y,t)\circ dW(t)
where y is d-dimensional vector variable, f is a vector-valued function,
G is a d x m matr... | 0.001032 |
def recv(self, stream, crc_mode=1, retry=16, timeout=60, delay=1, quiet=0):
'''
Receive a stream via the XMODEM protocol.
>>> stream = file('/etc/issue', 'wb')
>>> print modem.recv(stream)
2342
Returns the number of bytes received on success or ``None`` in c... | 0.002396 |
def add_suffix(fullname, suffix):
""" Add suffix to a full file name"""
name, ext = os.path.splitext(fullname)
return name + '_' + suffix + ext | 0.006452 |
def worker(job):
"""Run a single download job."""
ret = False
try:
if job.full_url is not None:
req = requests.get(job.full_url, stream=True)
ret = save_and_check(req, job.local_file, job.expected_checksum)
if not ret:
return ret
ret = crea... | 0.001776 |
def _get_resources(rtype='resources'):
""" resource types from state summary include: resources, used_resources
offered_resources, reserved_resources, unreserved_resources
The default is resources.
:param rtype: the type of resources to return
:type rtype: str
:param role: the name of the role... | 0.001179 |
def enable_runtime_notifications(self, resourceids):
"""Enable notification for specified resource ids"""
idsarr = ""
for ihcid in resourceids:
idsarr += "<a:arrayItem>{id}</a:arrayItem>".format(id=ihcid)
payload = """<enableRuntimeValueNotifications1 xmlns=\"utcs\"
... | 0.002342 |
def find_last(fileobj, serial, finishing=False):
"""Find the last page of the stream 'serial'.
If the file is not multiplexed this function is fast. If it is,
it must read the whole the stream.
This finds the last page in the actual file object, or the last
page in the stream (... | 0.001024 |
def limit_pos(p, se_pos, nw_pos):
"""
Limits position p to stay inside containing state
:param p: Position to limit
:param se_pos: Bottom/Right boundary
:param nw_pos: Top/Left boundary
:return:
"""
if p > se_pos:
_update(p, se_pos)
eli... | 0.005495 |
def set_inifile(self, current, previous):
"""Set the configobj to the current index of the files_lv
This is a slot for the currentChanged signal
:param current: the modelindex of a inifilesmodel that should be set for the configobj_treev
:type current: QModelIndex
:param previo... | 0.004184 |
def fit_creatine(self, reject_outliers=3.0, fit_lb=2.7, fit_ub=3.5):
"""
Fit a model to the portion of the summed spectra containing the
creatine and choline signals.
Parameters
----------
reject_outliers : float or bool
If set to a float, this is the z score ... | 0.00613 |
def task_property_present_predicate(service, task, prop):
""" True if the json_element passed is present for the task specified.
"""
try:
response = get_service_task(service, task)
except Exception as e:
pass
return (response is not None) and (prop in response) | 0.003356 |
def replace_cluster_role(self, name, body, **kwargs):
"""
replace the specified ClusterRole
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.replace_cluster_role(name, body, async_req=True)
... | 0.003891 |
def train_set_producer(socket, train_archive, patch_archive, wnid_map):
"""Load/send images from the training set TAR file or patch images.
Parameters
----------
socket : :class:`zmq.Socket`
PUSH socket on which to send loaded images.
train_archive : str or file-like object
Filenam... | 0.000545 |
async def unixlisten(path, onlink):
'''
Start an PF_UNIX server listening on the given path.
'''
info = {'path': path, 'unix': True}
async def onconn(reader, writer):
link = await Link.anit(reader, writer, info=info)
link.schedCoro(onlink(link))
return await asyncio.start_unix_se... | 0.005831 |
def pretty_tree(x, kids, show):
"""(a, (a -> list(a)), (a -> str)) -> str
Returns a pseudographic tree representation of x similar to the tree command
in Unix.
"""
(MID, END, CONT, LAST, ROOT) = (u'|-- ', u'`-- ', u'| ', u' ', u'')
def rec(x, indent, sym):
line = indent + sym + sh... | 0.002451 |
def create(self, data):
"""
Create a temporary directory for the tar file that will be removed at
the end of the operation.
"""
try:
floyd_logger.info("Making create request to server...")
post_body = data.to_dict()
post_body["resumable"] = Tru... | 0.003341 |
def compile_dictionary(self, lang, wordlists, encoding, output):
"""Compile user dictionary."""
cmd = [
self.binary,
'--lang', lang,
'--encoding', codecs.lookup(filters.PYTHON_ENCODING_NAMES.get(encoding, encoding).lower()).name,
'create',
'ma... | 0.002602 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.