text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def match(self, key=None, year=None, event=None, type='qm', number=None, round=None, simple=False):
"""
Get data on a match.
You may either pass the match's key directly, or pass `year`, `event`, `type`, `match` (the match number), and `round` if applicable (playoffs only). The event year may b... | 0.007839 |
def GetPatternIdTripDict(self):
"""Return a dictionary that maps pattern_id to a list of Trip objects."""
d = {}
for t in self._trips:
d.setdefault(t.pattern_id, []).append(t)
return d | 0.009709 |
def orbit(self, orbit):
"""Initialize the propagator
Args:
orbit (Orbit)
"""
self._orbit = orbit
tle = Tle.from_orbit(orbit)
lines = tle.text.splitlines()
if len(lines) == 3:
_, line1, line2 = lines
else:
line1, line2... | 0.005263 |
def _load_resources(self):
""" Load all the native goldman resources.
The route or API endpoint will be automatically determined
based on the resource object instance passed in.
INFO: Only our Model based resources are supported when
auto-generating API endpoints.
... | 0.002375 |
def _string_like(self, patterns):
"""
Wildcard fuzzy matching function equivalent to the SQL LIKE directive. Use
% as a multiple-character wildcard or _ (underscore) as a single-character
wildcard.
Use re_search or rlike for regex-based matching.
Parameters
----------
pattern : str or ... | 0.001307 |
def _parse(cls, xml_path):
"""Parse .xml file and return parsed text as a DOM Document.
:param string xml_path: File path of xml file to be parsed.
:returns xml.dom.minidom.Document parsed_xml: Document instance containing parsed xml.
"""
try:
parsed_xml = parse(xml_path)
# Minidom is a f... | 0.011278 |
def angular_errors(hyp_axes):
"""
Minimum and maximum angular errors
corresponding to 1st and 2nd axes
of PCA distribution.
Ordered as [minimum, maximum] angular error.
"""
# Not quite sure why this is sqrt but it is empirically correct
ax = N.sqrt(hyp_axes)
return tuple(N.arctan2(a... | 0.00597 |
def get_cpu_info(self) -> str:
'''Show device CPU information.'''
output, _ = self._execute(
'-s', self.device_sn, 'shell', 'cat', '/proc/cpuinfo')
return output | 0.010152 |
def call(self):
'''show a file dialog'''
from MAVProxy.modules.lib.wx_loader import wx
# remap flags to wx descriptors
flag_map = {
'open': wx.FD_OPEN,
'save': wx.FD_SAVE,
'overwrite_prompt': wx.FD_OVERWRITE_PROMPT,
}
flagsMapped = map... | 0.007634 |
def validate_deprecation_semver(version_string, version_description):
"""Validates that version_string is a valid semver.
If so, returns that semver. Raises an error otherwise.
:param str version_string: A pantsbuild.pants version which affects some deprecated entity.
:param str version_description: A string... | 0.012651 |
def compile_fund(workbook, sheet, row, col):
"""
Compile funding entries. Iter both rows at the same time. Keep adding entries until both cells are empty.
:param obj workbook:
:param str sheet:
:param int row:
:param int col:
:return list of dict: l
"""
logger_excel.info("enter compi... | 0.005054 |
def make_certifier():
"""
Decorator that can wrap raw functions to create a certifier function.
Certifier functions support partial application. If a function wrapped by
`make_certifier` is called with a value as its first argument it will be
certified immediately. If no value is passed, then it ... | 0.000955 |
def keep_entry_range(entry, lows, highs, converter, regex):
"""
Check if an entry falls into a desired range.
Every number in the entry will be extracted using *regex*,
if any are within a given low to high range the entry will
be kept.
Parameters
----------
entry : str
lows : iter... | 0.001145 |
def append(self, value):
""" Adds certificate to stack """
if not self.need_free:
raise ValueError("Stack is read-only")
if not isinstance(value, X509):
raise TypeError('StackOfX509 can contain only X509 objects')
sk_push(self.ptr, libcrypto.X509_dup(value.cert)) | 0.00627 |
def read(self, path, params=None):
"""Read the result at the given path (GET) from the CRUD API, using the optional params dictionary
as url parameters."""
return self.handleresult(self.r.get(urljoin(self.url + CRUD_PATH,
path),
... | 0.008242 |
def _cf_string_to_unicode(value):
"""
Creates a Unicode string from a CFString object. Used entirely for error
reporting.
Yes, it annoys me quite a lot that this function is this complex.
"""
value_as_void_p = ctypes.cast(value, ctypes.POINTER(ctypes.c_void_p))
string = CoreFoundation.CFSt... | 0.001164 |
def as_dict(self):
"""
Returns the CTRL as a dictionary. "SITE" and "CLASS" are of
the form {'CATEGORY': {'TOKEN': value}}, the rest is of the
form 'TOKEN'/'CATEGORY': value. It gets the conventional standard
structure because primitive cells use the conventional
a-lattic... | 0.000903 |
def beacon(config):
'''
Check if installed packages are the latest versions
and fire an event for those that have upgrades.
.. code-block:: yaml
beacons:
pkg:
- pkgs:
- zsh
- apache2
- refresh: True
'''
ret = []
_re... | 0.001176 |
def _loadlib(lib='standard'):
"""Load rabit library."""
global _LIB
if _LIB is not None:
warnings.warn('rabit.int call was ignored because it has'\
' already been initialized', level=2)
return
if lib == 'standard':
_LIB = ctypes.cdll.LoadLibrary(WRAPPER_... | 0.005405 |
def convert(self, chain_id, residue_id, from_scheme, to_scheme):
'''The API conversion function. This converts between the different residue ID schemes.'''
# At the cost of three function calls, we ignore the case of the scheme parameters to be more user-friendly.
from_scheme = from_scheme.lowe... | 0.007353 |
def _ip_is_usable(self, current_ip):
"""
Check if the current Tor's IP is usable.
:argument current_ip: current Tor IP
:type current_ip: str
:returns bool
"""
# Consider IP addresses only.
try:
ipaddress.ip_address(current_ip)
except ... | 0.003478 |
def pad(self, esp):
"""
Add the correct amount of padding so that the data to encrypt is
exactly a multiple of the algorithm's block size.
Also, make sure that the total ESP packet length is a multiple of 4
bytes.
@param esp: an unencrypted _ESPPlain packet
... | 0.001464 |
def require_app(app_name, api_style=False):
"""
Request the application to be automatically loaded.
If this is used for "api" style modules, which is imported by a client
application, set api_style=True.
If this is used for client application module, set api_style=False.
"""
iterable = (in... | 0.001401 |
def _filter_gte(self, term, field_name, field_type, is_not):
"""
Private method that returns a xapian.Query that searches for any term
that is greater than `term` in a specified `field`.
"""
vrp = XHValueRangeProcessor(self.backend)
pos, begin, end = vrp('%s:%s' % (field_... | 0.005731 |
def transformChildrenToNative(self):
"""
Recursively replace children with their native representation.
Sort to get dependency order right, like vtimezone before vevent.
"""
for childArray in (self.contents[k] for k in self.sortChildKeys()):
for child in childArray:
... | 0.004773 |
def has_documented_type_or_fields(self, include_inherited_fields=False):
"""Returns whether this type, or any of its fields, are documented.
Use this when deciding whether to create a block of documentation for
this type.
"""
if self.doc:
return True
else:
... | 0.005141 |
def _report_exc_info(exc_info, request, extra_data, payload_data, level=None):
"""
Called by report_exc_info() wrapper
"""
if not _check_config():
return
filtered_level = _filtered_level(exc_info[1])
if level is None:
level = filtered_level
filtered_exc_info = events.on_ex... | 0.000963 |
def compute_jacobian(ics, coordinates):
"""Construct a Jacobian for the given internal and Cartesian coordinates
Arguments:
| ``ics`` -- A list of internal coordinate objects.
| ``coordinates`` -- A numpy array with Cartesian coordinates,
shape=(N,3)
The ... | 0.002628 |
def getLong(t):
"""If t is of type long, return it, otherwise raise InvalidTypeError.
"""
i = c_long()
if PL_get_long(t, byref(i)):
return i.value
else:
raise InvalidTypeError("long") | 0.004566 |
def slithir_operations(self):
"""
list(Operation): List of the slithir operations
"""
if self._slithir_operations is None:
operations = [n.irs for n in self.nodes]
operations = [item for sublist in operations for item in sublist if item]
self._slit... | 0.007752 |
def tune(self, verbose=None):
"""
Tuning initial slice width parameter
"""
if not self._tune:
return False
else:
self.w_tune.append(
abs(self.stochastic.last_value - self.stochastic.value))
self.w = 2 * (sum(self.w_tune) / len(s... | 0.005618 |
def send_signal(self, sig):
"""Send a signal to process (see signal module constants).
On Windows only SIGTERM is valid and is treated as an alias
for kill().
"""
# safety measure in case the current process has been killed in
# meantime and the kernel reused its PID
... | 0.001854 |
def get_matrix(self):
"""Copies the pattern’s transformation matrix.
:retuns: A new :class:`Matrix` object.
"""
matrix = Matrix()
cairo.cairo_pattern_get_matrix(self._pointer, matrix._pointer)
self._check_status()
return matrix | 0.007018 |
def _get_cu_and_fu_status(self):
"""Submit GET request to update information."""
# adjust headers
headers = HEADERS.copy()
headers['Accept'] = '*/*'
headers['X-Requested-With'] = 'XMLHttpRequest'
headers['X-CSRFToken'] = self._parent.csrftoken
args = '?controller... | 0.002532 |
def docker_job(self, image, config=None,
input=None, output=None, msdir=None,
shared_memory='1gb', build_label=None,
**kw):
"""
Add a task to a stimela recipe
image : stimela cab name, e.g. 'cab/simms'
name : This name will be part of the nam... | 0.007899 |
def _read_header(f, header_param):
"""
Read and parse data from 1st line of a file.
:param f: :func:`file` or :class:`~StringIO.StringIO` object from which to
read 1st line.
:type f: file
:param header_param: Parameters used to parse the data from the header.
Contains "delimiter" an... | 0.000296 |
def get_health_check(name, region=None, key=None, keyid=None, profile=None):
'''
Get the health check configured for this ELB.
CLI example:
.. code-block:: bash
salt myminion boto_elb.get_health_check myelb
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
... | 0.000842 |
def DeleteGroupTags(r, group, tags, dry_run=False):
"""
Deletes tags from a node group.
@type group: str
@param group: group to delete tags from
@type tags: list of string
@param tags: tags to delete
@type dry_run: bool
@param dry_run: whether to perform a dry run
@rtype: string
... | 0.002049 |
def get_group_permissions(self, user_obj, obj=None):
"""
Returns a set of permission strings that this user has through his/her
groups.
"""
if user_obj.is_anonymous() or obj is not None:
return set()
if not hasattr(user_obj, '_group_perm_cache'):
i... | 0.007503 |
def _get_valid_formats():
''' Calls SoX help for a lists of audio formats available with the current
install of SoX.
Returns:
--------
formats : list
List of audio file extensions that SoX can process.
'''
if NO_SOX:
return []
so = subprocess.check_output(['sox', '-h']... | 0.001838 |
def validate(self, value):
"""Validate value."""
if self.exclusive:
if value <= self.minimum_value:
tpl = "'{value}' is lower or equal than minimum ('{min}')."
raise ValidationError(
tpl.format(value=value, min=self.minimum_value))
... | 0.00369 |
def And(*args: Union[Bool, bool]) -> Bool:
"""Create an And expression."""
union = []
args_list = [arg if isinstance(arg, Bool) else Bool(arg) for arg in args]
for arg in args_list:
union.append(arg.annotations)
return Bool(z3.And([a.raw for a in args_list]), union) | 0.003401 |
def grid_coords_from_corners(upper_left_corner, lower_right_corner, size):
''' Points are the outer edges of the UL and LR pixels. Size is rows, columns.
GC projection type is taken from Points. '''
assert upper_left_corner.wkt == lower_right_corner.wkt
geotransform = np.array([upper_left_corner.lon, -(... | 0.009763 |
def get_fieldsets(self):
"""
Hook for specifying fieldsets. If 'self.fieldsets' is
empty this will default to include all the fields in
the form with a title of None.
"""
if self.fieldsets:
return self.fieldsets
form_class = self.get_form_class()
... | 0.003527 |
def authorization_url(self, url, request_token=None, **kwargs):
"""Create an authorization URL by appending request_token and optional
kwargs to url.
This is the second step in the OAuth 1 workflow. The user should be
redirected to this authorization URL, grant access to you, and then
... | 0.001634 |
def create_symlink(source, link_name):
"""
Creates symbolic link for either operating system.
http://stackoverflow.com/questions/6260149/os-symlink-support-in-windows
"""
os_symlink = getattr(os, "symlink", None)
if isinstance(os_symlink, collections.Callable):
os_symlink(source... | 0.001479 |
def _build_protobuf(self):
"""Build a query protobuf.
Relies on the current state of the iterator.
:rtype:
:class:`.query_pb2.Query`
:returns: The query protobuf object for the current
state of the iterator.
"""
pb = _pb_from_query(self._qu... | 0.001757 |
def main() -> None:
"""Run command line"""
try:
_real_main()
except GuesslangError as error:
LOGGER.critical("Failed: %s", error)
sys.exit(-1)
except KeyboardInterrupt:
LOGGER.critical("Cancelled!")
sys.exit(-2) | 0.003745 |
def filter_package_list(package_list):
"""
Filter a list of packages into local and remotes.
"""
remote_pkgs = []
local_pkgs = []
possible_remotes = filter(lambda i: not os.path.exists(i), package_list)
juicer.utils.Log.log_debug("Considering %s possible remotes" % len(possible_remotes))
... | 0.003064 |
def filter_data_columns(data):
"""
Given a dict of data such as those in :py:class:`~.ProjectStats` attributes,
made up of :py:class:`datetime.datetime` keys and values of dicts of column
keys to counts, return a list of the distinct column keys in sorted order.
:param data: data dict as returned b... | 0.003534 |
def cli(ctx):
"""Shows the saved commands."""
json_path = os.path.join(os.path.expanduser('~'), '.keep', 'commands.json')
if not os.path.exists(json_path):
click.echo('No commands to show. Add one by `keep new`.')
else:
utils.list_commands(ctx) | 0.003623 |
def to_record(cls, attr_names, values):
"""
Convert values to a record to be inserted into a database.
:param list attr_names:
List of attributes for the converting record.
:param values: Values to be converted.
:type values: |dict|/|namedtuple|/|list|/|tuple|
... | 0.003243 |
def validated_type(base_type, name=None, validate=None):
"""Convenient way to create a new type by adding validation to existing type.
Example: ::
Ipv4Address = validated_type(
String, 'Ipv4Address',
# regexp simplified for demo purposes
Regexp('^\d+\.\d+\.\d+\.\d+$... | 0.010253 |
def mlength(message, N=1, word_spaced=True):
"""
Returns Morse length
>>> message = "PARIS"
>>> mlength(message)
50
>>> mlength(message, 5)
250
"""
message = _repeat_word(message, N)
if word_spaced:
message = message + " E"
lst_bin = _encode_binary(message)
N = l... | 0.002421 |
def get_position(directory, identifier):
"""
Extracts the position of a paragraph from the identifier, and the parent directory of the
paragraph.
Parameters
----------
directory : Path
A parent directory of a paragraph.
identifier : str
An identifier of a paragraph.
Ret... | 0.003663 |
def get_config_applied_machine_groups(self, project_name, config_name):
""" get machine group names where the logtail config applies to
Unsuccessful opertaion will cause an LogException.
:type project_name: string
:param project_name: the Project name
:type config_name:... | 0.00646 |
def _assertion(self, assertion, verified=False):
"""
Check the assertion
:param assertion:
:return: True/False depending on if the assertion is sane or not
"""
if not hasattr(assertion, 'signature') or not assertion.signature:
logger.debug("unsigned")
... | 0.001013 |
def update(name,
cpu=0,
mem=0,
disk_profile=None,
disks=None,
nic_profile=None,
interfaces=None,
graphics=None,
live=True,
**kwargs):
'''
Update the definition of an existing domain.
:param name: Name of the ... | 0.003164 |
def periodic_distance(a, b, periodic):
'''Periodic distance between two arrays. Periodic is a 3
dimensional array containing the 3 box sizes.
'''
delta = np.abs(a - b)
delta = np.where(delta > 0.5 * periodic, periodic - delta, delta)
return np.sqrt((delta ** 2).sum(axis=-1)) | 0.003333 |
def _process_methods(self, req, resp, resource):
"""Adds the Access-Control-Allow-Methods header to the response,
using the cors settings to determine which methods are allowed.
"""
requested_method = self._get_requested_method(req)
if not requested_method:
return Fal... | 0.001696 |
def store_widget_properties(self, widget, widget_name):
"""Sets configuration values for widgets
If the widget is a window, then the size and position are stored. If the widget is a pane, then only the
position is stored. If the window is maximized the last insert position before being maximize... | 0.006691 |
def plot(self, label=None, colour='g', style='-'): # pragma: no cover
'''Plot the time series.'''
pylab = LazyImport.pylab()
pylab.plot(self.dates, self.values, '%s%s' % (colour, style), label=label)
if label is not None:
pylab.legend()
pylab.show() | 0.013289 |
def add_noise(Y, sigma):
"""Adds noise to Y"""
return Y + np.random.normal(0, sigma, Y.shape) | 0.009709 |
def user_agent(self):
"""Return the formatted user agent string."""
components = ["/".join(x) for x in self.user_agent_components.items()]
return " ".join(components) | 0.010526 |
def _set_module_names_for_sphinx(modules: List, new_name: str):
""" Trick sphinx into displaying the desired module in these objects' documentation. """
for obj in modules:
obj.__module__ = new_name | 0.009346 |
def info(self):
"""
Property for accessing :class:`InfoManager` instance, which is used to general server info.
:rtype: yagocd.resources.info.InfoManager
"""
if self._info_manager is None:
self._info_manager = InfoManager(session=self._session)
return self._i... | 0.009063 |
def send_capabilities_request(self, vehicle, name, m):
'''Request an AUTOPILOT_VERSION packet'''
capability_msg = vehicle.message_factory.command_long_encode(0, 0, mavutil.mavlink.MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES, 0, 1, 0, 0, 0, 0, 0, 0)
vehicle.send_mavlink(capability_msg) | 0.009868 |
def get_applications():
"""
:return: all knows applications
"""
LOGGER.debug("ApplicationService.get_applications")
args = {'http_operation': 'GET', 'operation_path': ''}
response = ApplicationService.requester.call(args)
ret = None
if response.rc == 0:
... | 0.004813 |
def main():
'''main routine'''
# process arguments
if len(sys.argv) < 3:
usage()
rgname = sys.argv[1]
vmss_name = sys.argv[2]
# Load Azure app defaults
try:
with open('azurermconfig.json') as config_file:
config_data = json.load(config_file)
except FileNotF... | 0.003381 |
def get(self, path, params=None):
"""Make a GET request, optionally including a parameters, to a path.
The path of the request is the full URL.
Parameters
----------
path : str
The URL to request
params : DataQuery, optional
The query to pass whe... | 0.003231 |
def is_resource_class_terminal_attribute(rc, attr_name):
"""
Checks if the given attribute name is a terminal attribute of the given
registered resource.
"""
attr = get_resource_class_attribute(rc, attr_name)
return attr.kind == RESOURCE_ATTRIBUTE_KINDS.TERMINAL | 0.003497 |
def partLon(ID, chart):
""" Returns the longitude of an arabic part. """
# Get diurnal or nocturnal formula
abc = FORMULAS[ID][0] if chart.isDiurnal() else FORMULAS[ID][1]
a = objLon(abc[0], chart)
b = objLon(abc[1], chart)
c = objLon(abc[2], chart)
return c + b - a | 0.003401 |
def decrypt(private_key, message, label=b'', hash_class=hashlib.sha1,
mgf=mgf.mgf1):
'''Decrypt a byte message using a RSA private key and the OAEP wrapping
algorithm
Parameters:
public_key - an RSA public key
message - a byte string
label - a label a per-se PKCS#1 st... | 0.000607 |
def finish_statistics(self):
"""
Prepare/modify data for plotting
"""
# params = self.stat.setup_params(self.data)
self.stat.finish_layer(self.data, self.stat.params) | 0.009709 |
def safely_decode(unicode_or_str, encoding='utf-8'):
''' Decodes byte <str> into <unicode>. Ignores any non-utf8 chars in <str>s '''
if isinstance(unicode_or_str, unicode):
ustr = unicode_or_str
elif isinstance(unicode_or_str, str):
ustr = unicode_or_str.decode(encoding, 'ignore')
else:
raise Except... | 0.01897 |
def _wrap_jinja_filter(self, function):
"""Propagate exceptions as undefined values filter."""
def wrapper(*args, **kwargs):
"""Filter wrapper."""
try:
return function(*args, **kwargs)
except Exception: # pylint: disable=broad-except
r... | 0.003431 |
def rsquare(obsvalues, # type: Union[numpy.ndarray, List[Union[float, int]]]
simvalues # type: Union[numpy.ndarray, List[Union[float, int]]]
):
# type: (...) -> Union[float, numpy.ScalarType]
"""Calculate Coefficient of determination.
Same as the square of the ... | 0.005201 |
def add_exposure(self, layer):
"""Add an exposure layer in the analysis.
:param layer: An exposure layer to be used for the analysis.
:type layer: QgsMapLayer
"""
self._exposures.append(layer)
self._is_ready = False | 0.007576 |
def copy_ccube(ccube, outsrcmap, hpx_order):
"""Copy a counts cube into outsrcmap file
reducing the HEALPix order to hpx_order if needed.
"""
sys.stdout.write(" Copying counts cube from %s to %s\n" % (ccube, outsrcmap))
try:
hdulist_in = fits.open(ccube)
exce... | 0.005484 |
def sampleset(self, step=0.01, minimal=False):
"""Return ``x`` array that samples the feature.
Parameters
----------
step : float
Distance of first and last points w.r.t. bounding box.
minimal : bool
Only return the minimal points needed to define the bo... | 0.002946 |
def eventFilter(self, widget, event):
"""A filter to control the zooming and panning of the figure canvas."""
# ---- Zooming
if event.type() == QEvent.Wheel:
modifiers = QApplication.keyboardModifiers()
if modifiers == Qt.ControlModifier:
if event.angleDe... | 0.001236 |
def semidetached(b, component, solve_for=None, **kwargs):
"""
Create a constraint to force requiv to be semidetached
"""
comp_ps = b.get_component(component=component)
requiv = comp_ps.get_parameter(qualifier='requiv')
requiv_critical = comp_ps.get_parameter(qualifier='requiv_max')
if solv... | 0.002041 |
def make_query_plan(self, working_keyspace=None, query=None):
"""
Defers to the child policy's
:meth:`.LoadBalancingPolicy.make_query_plan` and filters the results.
Note that this filtering may break desirable properties of the wrapped
policy in some cases. For instance, imagine... | 0.002162 |
def _health_check_thread(self):
"""
Health checker thread that pings the service every 30 seconds
:return: None
"""
while self._run_health_checker:
response = self._health_check(Health_pb2.HealthCheckRequest(service='predix-event-hub.grpc.health'))
logging... | 0.007299 |
def verify_fft_options(opt,parser):
"""Parses the FFT options and verifies that they are
reasonable.
Parameters
----------
opt : object
Result of parsing the CLI with OptionParser, or any object with the
required attributes.
parser : object
OptionParser instance.
... | 0.012276 |
def upsert_license_requests(cursor, uuid_, roles):
"""Given a ``uuid`` and list of ``roles`` (user identifiers)
create a license acceptance entry. If ``has_accepted`` is supplied,
it will be used to assign an acceptance value to all listed ``uids``.
"""
if not isinstance(roles, (list, set, tuple,)):... | 0.000493 |
def compatible_staticpath(path):
"""
Try to return a path to static the static files compatible all
the way back to Django 1.2. If anyone has a cleaner or better
way to do this let me know!
"""
if VERSION >= (1, 10):
# Since Django 1.10, forms.Media automatically invoke static
#... | 0.001205 |
def user(self, user):
"""
Sets the user of this WebCredentials.
The name of the account to login to.
:param user: The user of this WebCredentials.
:type: str
"""
if user is None:
raise ValueError("Invalid value for `user`, must not be `None`")
... | 0.00611 |
def geo2d(self, name, min=None, max=None):
""" Create a 2d index. See:
http://www.mongodb.org/display/DOCS/Geospatial+Indexing
:param name: Name of the indexed column
:param min: minimum value for the index
:param max: minimum value for the index
"""
... | 0.00463 |
def SetParserProp(self, prop, value):
"""Change the parser processing behaviour by changing some of
its internal properties. Note that some properties can only
be changed before any read has been done. """
ret = libxml2mod.xmlTextReaderSetParserProp(self._o, prop, value)
ret... | 0.006116 |
def createResults(config,srcfile,section='source',samples=None):
""" Create an MCMC instance """
source = ugali.analysis.source.Source()
source.load(srcfile,section=section)
loglike = ugali.analysis.loglike.createLoglike(config,source)
results = Results(config,loglike,samples)
if samples is no... | 0.020779 |
def get_port_bindings(binding_key=None):
"""Returns filtered list of port bindings that may be relevant on CVX
This query is a little complex as we need all binding levels for any
binding that has a single managed physnet, but we need to filter bindings
that have no managed physnets. In order to achiev... | 0.000244 |
def map_keys(f, dct):
"""
Calls f with each key of dct, possibly returning a modified key. Values are unchanged
:param f: Called with each key and returns the same key or a modified key
:param dct:
:return: A dct with keys possibly modifed but values unchanged
"""
f_dict = {}
for k, ... | 0.005263 |
def _getTPDynamicState(self,):
"""
Parameters:
--------------------------------------------
retval: A dict with all the dynamic state variable names as keys and
their values at this instant as values.
"""
tpDynamicState = dict()
for variableName in self._getTPDynamicS... | 0.004484 |
def create_property_nod_worksheets(workbook, data_list, result_info_key, identifier_keys):
"""Creates two worksheets out of the property/nod data because the data
doesn't come flat enough to make sense on one sheet.
Args:
workbook: the main workbook to add the sheets to
data_l... | 0.003439 |
def rnd_datetime_array(self,
size, start=datetime(1970, 1, 1), end=datetime.now()):
"""Array or Matrix of random datetime generator.
"""
if isinstance(start, string_types):
start = self.str2datetime(start)
if isinstance(end, str):
end = ... | 0.007905 |
def handleError(self, record):
"""
Handles any errors raised during the :meth:`emit` method. Will only try to pass exceptions to fallback notifier
(if defined) in case the exception is a sub-class of :exc:`~notifiers.exceptions.NotifierException`
:param record: :class:`logging.LogRecord... | 0.006766 |
def get_input_list(self):
"""
Description:
Get input list
Returns an ordered list of all available input keys and names
"""
inputs = [' '] * len(self.command['input'])
for key in self.command['input']:
inputs[self.command['input'][key]['order... | 0.012438 |
def dispatch_queue(self):
"""
Dispatch any queued requests.
Called by the debugger when it stops.
"""
self.queue_lock.acquire()
q = list(self.queue)
self.queue = []
self.queue_lock.release()
log.debug("Dispatching requests: {}".format(q))
... | 0.004608 |
def gabc(key, value, fmt, meta): # pylint:disable=I0011,W0613
"""Handle gabc file inclusion and gabc code block."""
if key == 'Code':
[[ident, classes, kvs], contents] = value # pylint:disable=I0011,W0612
kvs = {key: value for key, value in kvs}
if "gabc" in classes:
... | 0.000499 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.