text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def explain_text(self, labels, instance, column_name=None, num_features=10, num_samples=5000):
"""Explain a text field of a prediction.
It analyze the prediction by LIME, and returns a report of which words are most impactful
in contributing to certain labels.
Args:
labels: a... | 0.00647 |
def put(self, deviceId):
"""
Puts a new device into the device store
:param deviceId:
:return:
"""
device = request.get_json()
logger.debug("Received /devices/" + deviceId + " - " + str(device))
self._deviceController.accept(deviceId, device)
retur... | 0.006042 |
def generate(env):
"""Add Builders and construction variables for Ghostscript to an
Environment."""
global GhostscriptAction
# The following try-except block enables us to use the Tool
# in standalone mode (without the accompanying pdf.py),
# whenever we need an explicit call of gs via the Gs()
... | 0.009375 |
def _UnregisterDatastoreArtifacts(self):
"""Remove artifacts that came from the datastore."""
to_remove = []
for name, artifact in iteritems(self._artifacts):
if artifact.loaded_from.startswith("datastore"):
to_remove.append(name)
for key in to_remove:
self._artifacts.pop(key) | 0.009585 |
async def run_task(context, to_cancellable_process):
"""Run the task, sending stdout+stderr to files.
https://github.com/python/asyncio/blob/master/examples/subprocess_shell.py
Args:
context (scriptworker.context.Context): the scriptworker context.
to_cancellable_process (types.Callable): ... | 0.003587 |
def _manual_repartition(self, axis, repartition_func, **kwargs):
"""This method applies all manual partitioning functions.
Args:
axis: The axis to shuffle data along.
repartition_func: The function used to repartition data.
Returns:
A `BaseFrameManager` obje... | 0.004435 |
def setParameter(self, parameterName, index, parameterValue):
"""
Overrides :meth:`~nupic.bindings.regions.PyRegion.PyRegion.setParameter`.
Set the value of a Spec parameter. Most parameters are handled
automatically by PyRegion's parameter set mechanism. The ones that need
special treatment are ex... | 0.011838 |
def _add_gradient_scalar(self, name:str, scalar_value)->None:
"Writes a single scalar value for a gradient statistic to Tensorboard."
tag = self.name + '/gradients/' + name
self.tbwriter.add_scalar(tag=tag, scalar_value=scalar_value, global_step=self.iteration) | 0.017544 |
def _body(self):
"""
The |_Body| instance containing the content for this document.
"""
if self.__body is None:
self.__body = _Body(self._element.body, self)
return self.__body | 0.008772 |
def set_var(self, name, value, user=None):
"""
Set a global or user variable
:param name: The name of the variable to set
:type name: str
:param value: The value of the variable to set
:type value: str
:param user: If defining a user variable, the user identif... | 0.002789 |
def write_skycatalog(self, filename, show_flux=False, show_id=False):
""" Write out the all_radec catalog for this image to a file.
"""
f = open(filename,'w')
f.write("#Sky positions for cumulative reference catalog. Initial catalog from: "+self.name+'\n')
header1 = "#RA D... | 0.006611 |
def track_exception(self, type=None, value=None, tb=None, properties=None, measurements=None):
""" Send information about a single exception that occurred in the application.
Args:
type (Type). the type of the exception that was thrown.\n
value (:class:`Exception`). the exceptio... | 0.00497 |
def to_csv(args):
"""Take a sqlite filled database of results and return a csv file
:param str result_file: the path of the sqlite database
:param str output_file: the path of the csv output file
:param str delimiter: the desired delimiter for the output csv file
"""
result_file = args.result_f... | 0.000662 |
def _merge_csv_model(models, pc, csvs):
"""
Add csv data to each column in chron model
:param dict models: Metadata
:return dict models: Metadata
"""
logger_csvs.info("enter merge_csv_model")
try:
for _name, _model in models.items():
if "summaryTable" in _model:
... | 0.005794 |
def write(self, text="", xy=(0,0), align="left", font=None, fontName=None, fontSize = 10, fill = 1, spacing = 0, screenCenter = False):
"""!
\~english
Print one line text or multi-line text on the screen
@param text: Text to be drawn. eg. "Hello World!" or "Hello/nWorld!"
@param... | 0.011575 |
def _buffered_generation_process(source_gen, buffer_, sentinal):
""" helper for buffered_generator """
for data in source_gen:
buffer_.put(data, block=True)
# sentinel: signal the end of the iterator
buffer_.put(sentinal)
# unfortunately this does not suffice as a signal: if buffer_.get() wa... | 0.002398 |
def smart_pull(self):
"""
'git log --merges origin/master..master'
"""
branch = self.get_current_branch_name()
self.git_exec(['fetch', self.remote.name])
return self.smart_merge('{0}/{1}'.format(self.remote.name, branch),
self.smart_merge... | 0.006042 |
def create_assignment( # pylint: disable=too-many-arguments
self,
name,
short_name,
weight,
max_points,
due_date_str,
gradebook_id='',
**kwargs
):
"""Create a new assignment.
Create a new assignment. By... | 0.000875 |
def escapeQueryTerm(self, term):
"""
+ - && || ! ( ) { } [ ] ^ " ~ * ? : \
"""
reserved = [
'+',
'-',
'&',
'|',
'!',
'(',
')',
'{',
'}',
'[',
']',
'^',
... | 0.005464 |
def idatdecomp(self, lenient=False, max_length=0):
"""Iterator that yields decompressed ``IDAT`` strings."""
# Currently, with no max_length paramter to decompress, this
# routine will do one yield per IDAT chunk. So not very
# incremental.
d = zlib.decompressobj()
# Eac... | 0.003175 |
def _query(path, method='GET', data=None, params=None, header_dict=None, decode=True):
'''
Perform a query directly against the Vultr REST API
'''
api_key = config.get_cloud_config_value(
'api_key',
get_configured_provider(),
__opts__,
search_global=False,
)
manag... | 0.001813 |
def btc_privkey_scriptsig_classify(private_key_info):
"""
What kind of scriptsig can this private key make?
"""
if btc_is_singlesig(private_key_info):
return 'p2pkh'
if btc_is_multisig(private_key_info):
return 'p2sh'
if btc_is_singlesig_segwit(private_key_info):
return... | 0.002331 |
def _get_inbound_stream(self, stream_id):
"""
Get or create the inbound stream with the specified ID.
"""
if stream_id not in self._inbound_streams:
self._inbound_streams[stream_id] = InboundStream()
return self._inbound_streams[stream_id] | 0.006873 |
def on_for_rotations(self, speed, rotations, brake=True, block=True):
"""
Rotate the motor at ``speed`` for ``rotations``
``speed`` can be a percentage or a :class:`ev3dev2.motor.SpeedValue`
object, enabling use of other units.
"""
speed_sp = self._speed_native_units(spe... | 0.003378 |
def run(self, fitness_function, n=None):
"""
Runs NEAT's genetic algorithm for at most n generations. If n
is None, run until solution is found or extinction occurs.
The user-provided fitness_function must take only two arguments:
1. The population as a list of (genome id, ... | 0.004595 |
def maximum_independent_set(G, sampler=None, lagrange=2.0, **sampler_args):
"""Returns an approximate maximum independent set.
Defines a QUBO with ground states corresponding to a
maximum independent set and uses the sampler to sample from
it.
An independent set is a set of nodes such that the sub... | 0.002369 |
def new_signal(celf, path, iface, name) :
"creates a new DBUS.MESSAGE_TYPE_SIGNAL message."
result = dbus.dbus_message_new_signal(path.encode(), iface.encode(), name.encode())
if result == None :
raise CallFailed("dbus_message_new_signal")
#end if
return \
... | 0.021021 |
def create_transformation(self, rotation=None, translation=None):
"""
Creates a transformation matrix woth rotations and translation.
Args:
rotation: 3 component vector as a list, tuple, or :py:class:`pyrr.Vector3`
translation: 3 component vector as a list, tuple, or :py... | 0.005044 |
def create_task_spec_def():
"""Returns the a :class:`TaskSpecDef` based on the environment variables for distributed training.
References
----------
- `ML-engine trainer considerations <https://cloud.google.com/ml-engine/docs/trainer-considerations#use_tf_config>`__
- `TensorPort Distributed Comput... | 0.00727 |
def WriteRow(self, values):
"""Writes a single row to the underlying buffer.
Args:
values: A dictionary mapping column names to values to be inserted into
the CSV output.
"""
precondition.AssertDictType(values, text, text)
row = []
for column in self._columns:
try:
... | 0.007984 |
def cursors(self):
"""Cursors for rectangular selection.
1 cursor for every line
"""
cursors = []
if self._start is not None:
startLine, startVisibleCol = self._start
currentLine, currentCol = self._qpart.cursorPosition
if abs(startLine - curre... | 0.004487 |
def deviance(self, y, mu, scaled=True):
"""
model deviance
for a gaussian linear model, this is equal to the SSE
Parameters
----------
y : array-like of length n
target values
mu : array-like of length n
expected values
scaled : b... | 0.003384 |
def apply_fit_filters(self, choosers, alternatives):
"""
Filter `choosers` and `alternatives` for fitting.
Parameters
----------
choosers : pandas.DataFrame
Table describing the agents making choices, e.g. households.
alternatives : pandas.DataFrame
... | 0.00317 |
def get_canonical_link(self):
"""
if the article has meta canonical link set in the url
"""
if self.article.final_url:
kwargs = {'tag': 'link', 'attr': 'rel', 'value': 'canonical'}
meta = self.parser.getElementsByTag(self.article.doc, **kwargs)
if meta... | 0.002448 |
def quadrect(f, n, a, b, kind='lege', *args, **kwargs):
"""
Integrate the d-dimensional function f on a rectangle with lower and
upper bound for dimension i defined by a[i] and b[i], respectively;
using n[i] points.
Parameters
----------
f : function
The function to integrate over. ... | 0.000425 |
def getHelpFileAsString(taskname,taskpath):
"""
This functions will return useful help as a string read from a file
in the task's installed directory called "<module>.help".
If no such file can be found, it will simply return an empty string.
Notes
-----
The location of the actual help fil... | 0.011194 |
def startAlertListener(self, callback=None):
""" Creates a websocket connection to the Plex Server to optionally recieve
notifications. These often include messages from Plex about media scans
as well as updates to currently running Transcode Sessions.
NOTE: You need websock... | 0.009485 |
def from_request(cls, header_data, ignore_bad_cookies=False):
"Construct a Cookies object from request header data."
cookies = cls()
cookies.parse_request(
header_data, ignore_bad_cookies=ignore_bad_cookies)
return cookies | 0.007519 |
def vrrp_vip(self, **kwargs):
"""Set VRRP VIP.
Args:
int_type (str): Type of interface. (gigabitethernet,
tengigabitethernet, etc).
name (str): Name of interface. (1/0/5, 1/0/10, etc).
vrid (str): VRRPv3 ID.
vip (str): IPv4/IPv6 Virtual IP ... | 0.000359 |
def word_counts(self):
"""Dictionary of word frequencies in this text.
"""
counts = defaultdict(int)
for word in self.words:
counts[word] += 1
return counts | 0.005435 |
def _analyse_status_type(line):
'''
Figure out the sections in drbdadm status
'''
spaces = _count_spaces_startswith(line)
if spaces is None:
return ''
switch = {
0: 'RESOURCE',
2: {' disk:': 'LOCALDISK', ' role:': 'PEERNODE', ' connection:': 'PEERNODE'},
4: {' p... | 0.004831 |
def check_vmware_version(self):
"""
Check VMware version
"""
if sys.platform.startswith("win"):
# look for vmrun.exe using the directory listed in the registry
ws_version = self._find_vmware_version_registry(r"SOFTWARE\Wow6432Node\VMware, Inc.\VMware Workstation"... | 0.006698 |
def create_factories(fs_provider, task_problem_types, hook_manager=None, course_class=Course, task_class=Task):
"""
Shorthand for creating Factories
:param fs_provider: A FileSystemProvider leading to the courses
:param hook_manager: an Hook Manager instance. If None, a new Hook Manager is created
:... | 0.008219 |
def add_ds_ids_from_files(self):
"""Check files for more dynamically discovered datasets."""
for file_handlers in self.file_handlers.values():
try:
fh = file_handlers[0]
avail_ids = fh.available_datasets()
except NotImplementedError:
... | 0.002165 |
def getTarget(self):
""" Returns the location of the match click target (center by default, but may be offset) """
return self.getCenter().offset(self._target.x, self._target.y) | 0.015544 |
def value_from_person(self, array, role, default = 0):
"""
Get the value of ``array`` for the person with the unique role ``role``.
``array`` must have the dimension of the number of persons in the simulation
If such a person does not exist, return ``default`` instead
... | 0.007813 |
def _apply(self, ctx: ExtensionContext) -> AugmentedDict:
"""
Replaces any {{var::*}} directives with it's actual variable value or a default.
Args:
ctx: The processing context.
Returns:
Returns the altered node key and value.
"""
node_key, node_... | 0.003534 |
def modify_symbol(sym: ast.Symbol, scope: ast.InstanceClass) -> None:
"""
Apply a modification to a symbol if the scope matches (or is None)
:param sym: symbol to apply modifications for
:param scope: scope of modification
"""
# We assume that we do not screw up the order of applying modificati... | 0.003864 |
def clear(self, actors=()):
"""Delete specified list of actors, by default delete all."""
if not utils.isSequence(actors):
actors = [actors]
if len(actors):
for a in actors:
self.removeActor(a)
else:
for a in settings.collectable_actors... | 0.002232 |
def outlineColor(self, value):
"""gets/sets the outlineColor"""
if isinstance(value, Color) and \
not self._outline is None:
self._outline['color'] = value | 0.015464 |
def get_filename(page, content_type, data):
"""
Generate a stable filename using the original filename of the type.
"""
avoid_collision = uuid.uuid4().hex[:8]
name_parts = data.name.split('.')
if len(name_parts) > 1:
name = slugify('.'.join(name_parts[:-1]), allow_unicode=True)
... | 0.001647 |
def new_transaction(self, timeout, durability, transaction_type):
"""
Creates a Transaction object with given timeout, durability and transaction type.
:param timeout: (long), the timeout in seconds determines the maximum lifespan of a transaction.
:param durability: (int), the durabili... | 0.009512 |
def _is_orphan(scc, graph):
"""
Return False iff the given scc is reachable from elsewhere.
"""
return all(p in scc for v in scc for p in graph.parents(v)) | 0.005814 |
def shuffle_egg(egg):
""" Shuffle an Egg's recalls"""
from .egg import Egg
pres, rec, features, dist_funcs = parse_egg(egg)
if pres.ndim==1:
pres = pres.reshape(1, pres.shape[0])
rec = rec.reshape(1, rec.shape[0])
features = features.reshape(1, features.shape[0])
for ilist ... | 0.007859 |
def _install(self, args):
'''
Install a package from a repo
'''
if len(args) < 2:
raise SPMInvocationError('A package must be specified')
caller_opts = self.opts.copy()
caller_opts['file_client'] = 'local'
self.caller = salt.client.Caller(mopts=caller... | 0.001458 |
def set_attributes(self, doc, fields, parent_type=None):
"""
See :meth:`Composite.set_attributes` for parameter definitions.
"""
if parent_type:
assert isinstance(parent_type, Struct)
self.subtypes = []
# These are only set if this struct enumerates subtype... | 0.00495 |
def has_field(self, dotted_name):
"""
Checks whether the layer has the given field name.
Can get a dotted name, i.e. layer.sublayer.subsublayer.field
"""
parts = dotted_name.split('.')
cur_layer = self
for part in parts:
if part in cur_layer.field_name... | 0.004515 |
def prepend_status(func):
"""Prepends the output of `func` with the status."""
@ft.wraps(func)
def wrapper(self, *args, **kwargs):
"""Wrapper stub."""
res = func(self, *args, **kwargs)
if self.status is not StepResult.UNSET:
res = "[{status}]".format(status=self.status.n... | 0.00271 |
def render_code(self):
""" Try to load the previous code (if we had a crash or something)
I should allow saving.
"""
tmp_dir = os.environ.get('TMP','')
view_code = os.path.join(tmp_dir,'view.enaml')
if os.path.exists(view_code):
try:
with o... | 0.011236 |
def _connection(self):
'''
Return a connection from the pool
'''
try:
return self._pool.get(False)
except Empty:
args = [
self._host, self._port, self._keyspace
]
kwargs = {
'user' : None,
'password' : None,
'cql_version' ... | 0.017518 |
def get_or_none(cls, **filter_kwargs):
"""
Returns a video or None.
"""
try:
video = cls.objects.get(**filter_kwargs)
except cls.DoesNotExist:
video = None
return video | 0.008299 |
def upload(self):
"""
Upload all po files to GDocs ignoring conflicts.
This method looks for all msgids in po_files and sends them
as ods to GDocs Spreadsheet.
"""
local_ods_path = os.path.join(self.temp_path, LOCAL_ODS)
try:
po_to_ods(self.languages, ... | 0.003656 |
def start(self):
""" Starts the agent. Among other things, this means connecting
to the master agent, if configured that way. """
if self._status != netsnmpAgentStatus.CONNECTED \
and self._status != netsnmpAgentStatus.RECONNECTING:
self._status = netsnmpAgentStatus.FIRSTCONNECT
libnsa.init_snmp(b(se... | 0.028716 |
def __execute_str(self, instr):
"""Execute STR instruction.
"""
op0_val = self.read_operand(instr.operands[0])
self.write_operand(instr.operands[2], op0_val)
return None | 0.009479 |
def status(cwd, opts=None, user=None):
'''
Show changed files of the given repository
cwd
The path to the Mercurial repository
opts : None
Any additional options to add to the command line
user : None
Run hg as a user other than what the minion runs as
CLI Example:
... | 0.000797 |
def remove_mea(mea_name):
'''Adds the mea design defined by the yaml file in the install folder
Parameters
----------
mea_yaml_file
Returns
-------
'''
this_dir, this_filename = os.path.split(__file__)
electrodes = [f for f in os.listdir(os.path.join(this_dir, "electrodes"))]
... | 0.007729 |
def get_catalog(self, query):
"""Fetch a parsed THREDDS catalog from the radar server.
Requests a catalog of radar data files data from the radar server given the
parameters in `query` and returns a :class:`~siphon.catalog.TDSCatalog` instance.
Parameters
----------
que... | 0.004771 |
def list(self):
'''
Create a dictionary with the details for the updates in the collection.
Returns:
dict: Details about each update
.. code-block:: cfg
List of Updates:
{'<GUID>': {'Title': <title>,
'KB': <KB>,
... | 0.001082 |
def pop_option (ident, argv=None):
"""A lame routine for grabbing command-line arguments. Returns a boolean
indicating whether the option was present. If it was, it's removed from
the argument string. Because of the lame behavior, options can't be
combined, and non-boolean options aren't supported. Oper... | 0.006024 |
def int_to_var_bytes(x):
"""Converts an integer to a bitcoin variable length integer as a bytearray
:param x: the integer to convert
"""
if x < 253:
return intbytes.to_bytes(x, 1)
elif x < 65536:
return bytearray([253]) + intbytes.to_bytes(x, 2)[::-1]
elif x < 4294967296:
... | 0.002217 |
def firstChild(self):
'''
firstChild - property, Get the first child block, text or tag.
@return <str/AdvancedTag/None> - The first child block, or None if no child blocks
'''
blocks = object.__getattribute__(self, 'blocks')
# First block is empty string for ... | 0.01049 |
def handle_response(self, response, **kwargs):
"""Takes the given response and tries kerberos-auth, as needed."""
num_401s = kwargs.pop('num_401s', 0)
# Check if we have already tried to get the CBT data value
if not self.cbt_binding_tried and self.send_cbt:
# If we haven't ... | 0.002917 |
def security_rule_delete(security_rule, security_group, resource_group,
**kwargs):
'''
.. versionadded:: 2019.2.0
Delete a security rule within a specified security group.
:param name: The name of the security rule to delete.
:param security_group: The network security gr... | 0.001862 |
def image_files_list(self, limit=-1, offset=-1):
"""Retrieve list of all images in the data store.
Parameters
----------
limit : int
Limit number of results in returned object listing
offset : int
Set offset in list (order as defined by object store)
... | 0.004107 |
def run_top_task(self, task_name=None, sort=None, **kwargs):
"""Finds and runs a pending task that in the first of the sorting list.
Parameters
-----------
task_name : str
The task name.
sort : List of tuple
PyMongo sort comment, search "PyMongo find one ... | 0.003164 |
def fix(self):
"""
Fix the parameters with the coordinates (either ra,dec or l,b depending on how the class
has been instanced)
"""
if self._coord_type == 'equatorial':
self.ra.fix = True
self.dec.fix = True
else:
self.l.fi... | 0.011173 |
def pretty(d, indent=0):
"""A prettier way to print nested dicts
"""
for key, value in d.items():
print(' ' * indent + str(key))
if isinstance(value, dict):
pretty(value, indent+1)
else:
sys.stderr.write(' ' * (indent+1) + str(value) + '\n') | 0.0033 |
def input_list_parser(infile_list):
"""Always return a list of files with varying input.
>>> input_list_parser(['/path/to/folder/'])
['/path/to/folder/file1.txt', '/path/to/folder/file2.txt', '/path/to/folder/file3.txt']
>>> input_list_parser(['/path/to/file.txt'])
['/path/to/file.txt']
>>> i... | 0.002463 |
def _validate_targets(self, targets):
"""turn any valid targets argument into a list of integer ids"""
if targets is None:
# default to all
return self.ids
if isinstance(targets, (int,str,unicode)):
# only one target specified
targets = [targets]
... | 0.008516 |
def _getMultiClassMap(self):
""" Relief algorithms handle the scoring updates a little differently for data with multiclass outcomes. In ReBATE we implement multiclass scoring in line with
the strategy described by Kononenko 1994 within the RELIEF-F variant which was suggested to outperform the RELIEF-E... | 0.005952 |
def geo_lines(self, edges):
"""
Utility function to convert a list of edges into a list of
:class:`openquake.hazardlib.geo.Line` instances.
:param edge: a node describing an edge
"""
lines = []
for edge in edges:
with context(self.fname, edge):
... | 0.004264 |
def reconstructed_data_vector_from_blurred_mapping_matrix_and_solution_vector(blurred_mapping_matrix, solution_vector):
""" Compute the reconstructed hyper vector from the blurrred mapping matrix *f* and solution vector *S*.
Parameters
-----------
blurred_mapping_matrix : ndarray
The matrix rep... | 0.006974 |
def next_state(self):
"""This is a method that will be called when the time remaining ends.
The current state can be: roasting, cooling, idle, sleeping, connecting,
or unkown."""
if(self.roaster.get_roaster_state() == 'roasting'):
self.roaster.time_remaining = 20
... | 0.006944 |
def get_relative_path(self, domain, locale):
"""
Gets the relative file path using the template.
@type domain: str
@param domain: The domain
@type locale: str
@param locale: The locale
@rtype: string
@return: The relative file path
"""
r... | 0.004274 |
def buildcontent(self):
"""build HTML content only, no header or body tags"""
self.buildcontainer()
self.option = json.dumps(self.options, cls = HighchartsEncoder)
self.setoption = json.dumps(self.setOptions, cls = HighchartsEncoder)
self.data = json.dumps(self.data_temp, cls = ... | 0.018713 |
def readLocationElement(self, locationElement):
""" Format 0 location reader """
loc = Location()
for dimensionElement in locationElement.findall(".dimension"):
dimName = dimensionElement.attrib.get("name")
xValue = yValue = None
try:
xValue = ... | 0.003272 |
def search(self, search_term, num_results, **kwargs):
"""Gets x number of Google image result urls for
a given search term.
Arguments
search_term: str
tearm to search for
num_results: int
number of url results to return
return ['url','url']
... | 0.001842 |
def syscall_direct(*events):
'''
Directly process these events. This should never be used for normal events.
'''
def _syscall(scheduler, processor):
for e in events:
processor(e)
return _syscall | 0.004274 |
def create_video(video_data):
"""
Called on to create Video objects in the database
create_video is used to create Video objects whose children are EncodedVideo
objects which are linked to Profile objects. This is an alternative to the HTTP
requests so it can be used internally. The VideoSerializer... | 0.002046 |
def image(self, well_row, well_column, field_row, field_column):
"""Get path of specified image.
Parameters
----------
well_row : int
Starts at 0. Same as --U in files.
well_column : int
Starts at 0. Same as --V in files.
field_row : int
... | 0.005938 |
def from_xdr_object(cls, op_xdr_object):
"""Creates a :class:`PathPayment` object from an XDR Operation
object.
"""
if not op_xdr_object.sourceAccount:
source = None
else:
source = encode_check(
'account', op_xdr_object.sourceAccount[0].ed... | 0.001533 |
def get_interfaces_status():
"""Get the status of all the interfaces"""
status = {}
for driverClass in CLASSES:
try:
instance = driverClass()
status[instance.get_name()] = instance.get_status()
except Exception:
raise
return status | 0.003344 |
def fork_exec(cmd_list, input_data=None):
"""
Like the subprocess.check_*() helper functions, but tailored to bang.
``cmd_list`` is the command to run, and its arguments as a list of strings.
``input_data`` is the optional data to pass to the command's stdin.
On success, returns the output (i.e. ... | 0.002255 |
def get_child_by_name(self, inst_name):
"""
Returns an immediate child :class:`~Node` whose instance name matches ``inst_name``
Returns ``None`` if ``inst_name`` does not match
Parameters
----------
inst_name: str
Name of immediate child to get
Retu... | 0.005025 |
def create_shipfile(target, source, env):
"""Create a .ship file with all dependencies."""
source_dir = os.path.dirname(str(source[0]))
recipe_name = os.path.basename(str(source[0]))[:-5]
resman = RecipeManager()
resman.add_recipe_actions(env['CUSTOM_STEPS'])
resman.add_recipe_folder(source_d... | 0.004454 |
def value(self):
""" returns the class as a dictionary """
val = {}
for k in self.__allowed_keys:
v = getattr(self, "_" + k)
if v is not None:
val[k] = v
return val | 0.008475 |
def line_props(event):
"""
Get information for a pick event on a Line2D artist (as created with
``plot``.)
This will yield x and y values that are interpolated between vertices
(instead of just being the position of the mouse) or snapped to the nearest
vertex if only the vertices are drawn.
... | 0.001244 |
def validate_column_specs(events, next_value_columns, previous_value_columns):
"""
Verify that the columns of ``events`` can be used by an EventsLoader to
serve the BoundColumns described by ``next_value_columns`` and
``previous_value_columns``.
"""
required = required_event_fields(next_value_co... | 0.001242 |
def setData(self, index, value, role=QtCore.Qt.EditRole):
"""Reimplemented from QtCore.QAbstractItemModel
You can only set the value.
:param index: the index to edit, column should be 1.
:type index: :class:`PySide.QtCore.QModelIndex`
:param value: the new value for the configo... | 0.001528 |
def QA_fetch_get_hkfund_list(ip=None, port=None):
"""[summary]
Keyword Arguments:
ip {[type]} -- [description] (default: {None})
port {[type]} -- [description] (default: {None})
# 港股 HKMARKET
27 5 香港指数 FH
31 2 香港主板 KH
48 ... | 0.001522 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.