text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def removeAllEntitlements(self, appId):
"""
This operation removes all entitlements from the portal for ArcGIS
Pro or additional products such as Navigator for ArcGIS and revokes
all entitlements assigned to users for the specified product. The
portal is no longer a licensing por... | 0.003774 |
def encode(self, text):
r"""Perform encoding of run-length-encoding (RLE).
Parameters
----------
text : str
A text string to encode
Returns
-------
str
Word decoded by RLE
Examples
--------
>>> rle = RLE()
... | 0.002079 |
def print_datetime_object(dt):
"""prints a date-object"""
print(dt)
print('ctime :', dt.ctime())
print('tuple :', dt.timetuple())
print('ordinal:', dt.toordinal())
print('Year :', dt.year)
print('Mon :', dt.month)
print('Day :', dt.day) | 0.003597 |
def setup_handler(setup_fixtures_fn, setup_fn):
"""Returns a function that adds fixtures handling to the setup method.
Makes sure that fixtures are setup before calling the given setup method.
"""
def handler(obj):
setup_fixtures_fn(obj)
setup_fn(obj)
ret... | 0.009063 |
def connect(self, config):
"""Connect to database with given configuration, which may be a dict or
a path to a pymatgen-db configuration.
"""
if isinstance(config, str):
conn = dbutil.get_database(config_file=config)
elif isinstance(config, dict):
conn = d... | 0.003724 |
def libvlc_media_set_meta(p_md, e_meta, psz_value):
'''Set the meta of the media (this function will not save the meta, call
L{libvlc_media_save_meta} in order to save the meta).
@param p_md: the media descriptor.
@param e_meta: the meta to write.
@param psz_value: the media's meta.
'''
f = ... | 0.003731 |
def portal(self, portalID=None):
"""returns a specific reference to a portal"""
if portalID is None:
portalID = self.portalSelf.id
url = "%s/%s" % (self.root, portalID)
return Portal(url=url,
securityHandler=self._securityHandler,
proxy_url... | 0.014354 |
def get_all_roles(self, view = None):
"""
Get all roles in the service.
@param view: View to materialize ('full' or 'summary')
@return: A list of ApiRole objects.
"""
return roles.get_all_roles(self._get_resource_root(), self.name,
self._get_cluster_name(), view) | 0.013514 |
def bait(self, maskmiddle='f', k='19'):
"""
Use bbduk to perform baiting
:param maskmiddle: boolean argument treat the middle base of a kmer as a wildcard; increases sensitivity
in the presence of errors.
:param k: keyword argument for length of kmers to use in the analyses
... | 0.005291 |
def getModel(self, modelIdentifier):
"""
Return the requested model.
:param modelIdentifier: <str> model identifier
:return: <object> model instance
"""
if modelIdentifier in self._models:
return self._models[modelIdentifier]
else:
message... | 0.00396 |
def changes(self):
"""
Return a tuple with the removed and added facts since last run.
"""
try:
return self.added, self.removed
finally:
self.added = list()
self.removed = list() | 0.007874 |
def load_shellcode(shellcode, arch, start_offset=0, load_address=0):
"""
Load a new project based on a string of raw bytecode.
:param shellcode: The data to load
:param arch: The name of the arch to use, or an archinfo class
:param start_offset: The offset into the data to start... | 0.002933 |
def primitive(self):
"""
Returns a primitive object representation for this container (which is a dict).
WARNING: The returned container does not contain any markup or formatting metadata.
"""
raw_container = raw.to_raw(self._navigable)
# Collapsing the anonymous table ... | 0.009862 |
def matchSubset(**kwargs):
"""extract matches from player's entire match history given matching criteria kwargs"""
ret = []
for m in self.matches:
allMatched = True
for k,v in iteritems(kwargs):
mVal = getattr(m, k)
try:
... | 0.016129 |
def validate(self, schema=None):
"""
Validate that we have a valid object.
On error, this will raise a `ScrapeValueError`
This also expects that the schemas assume that omitting required
in the schema asserts the field is optional, not required. This is
due to upstream ... | 0.004575 |
def get_peak_pos(im, wrap=False):
"""Get the peak position with subpixel precision
Parameters
----------
im: 2d array
The image containing a peak
wrap: boolean, defaults False
True if the image reoresents a torric world
Returns
-------
[y,x]: 2 numbers
The posit... | 0.00049 |
def run_external_commands(self, cmds):
"""Run external commands Arbiter/Receiver sent
:param cmds: commands to run
:type cmds: list
:return: None
"""
if not self.external_commands_manager:
return
try:
_t0 = time.time()
logger.... | 0.004266 |
def get_resources(self, collections):
""" Get resources that correspond to values from :collections:.
:param collections: Collection names for which resources should be
gathered
:type collections: list of str
:return: Gathered resources
:rtype: list of Resource insta... | 0.003378 |
def cancel_instruction(bet_id, size_reduction=None):
"""
Instruction to fully or partially cancel an order (only applies to LIMIT orders)
:param str bet_id: identifier of the bet to cancel.
:param float size_reduction: If supplied then this is a partial cancel.
:returns: cancellation report detaili... | 0.005769 |
def standard_output(self, ds, limit, check_name, groups):
"""
Generates the Terminal Output for Standard cases
Returns the dataset needed for the verbose output, as well as the failure flags.
"""
score_list, points, out_of = self.get_points(groups, limit)
issue_count = ... | 0.004409 |
def _list(env, key, more, loader, _all=False, output=None):
"""Lists all user defined config values
and if `--all` is passed it also shows dynaconf internal variables.
"""
if env:
env = env.strip()
if key:
key = key.strip()
if loader:
loader = loader.strip()
if env:
... | 0.000509 |
def check_error(self):
"""Check if the async response is an error.
Take care to call `is_done` before calling `error`. Note that the error
messages are always encoded as strings.
:raises CloudUnhandledError: When not checking `is_done` first
:return: status_code, error_msg, pay... | 0.004261 |
def safe_unicode_stdin(string):
"""
Safely convert the given string to a Unicode string,
decoding using ``sys.stdin.encoding`` if needed.
If running from a frozen binary, ``utf-8`` encoding is assumed.
:param variant string: the byte string or Unicode string to convert
:rtype: string
"""
... | 0.002907 |
async def filter_by(cls, db, offset=None, limit=None, **kwargs):
"""Query by attributes iteratively. Ordering is not supported
Example:
User.get_by(db, age=[32, 54])
User.get_by(db, age=23, name="guido")
"""
if limit and type(limit) is not int:
raise ... | 0.002053 |
def ismethod(func):
'''this function should return the information gathered on a function
@param func: this is the function we want to get info on
@return a tuple where:
0 = indicates whether the parameter passed is a method or not
1 = a list of classes 'Info', with the info gathered from t... | 0.008333 |
def run(self, N=100):
"""
Parameter
---------
N: int
number of particles
Returns
-------
wgts: Weights object
The importance weights (with attributes lw, W, and ESS)
X: ThetaParticles object
The N particles (wi... | 0.004155 |
def initialize(self, training_info, model, environment, device):
""" Initialize policy gradient from reinforcer settings """
self.target_model = self.model_factory.instantiate(action_space=environment.action_space).to(device)
self.target_model.load_state_dict(model.state_dict())
self.tar... | 0.008929 |
def _iexplode_path(path):
"""Iterate over all the parts of a path.
Splits path recursively with os.path.split().
"""
(head, tail) = os.path.split(path)
if not head or (not tail and head == path):
if head:
yield head
if tail or not head:
yield tail
ret... | 0.002571 |
def add_item(self, item, index=True):
# pylint: disable=too-many-branches, too-many-locals, too-many-nested-blocks
"""
Add an item into our containers, and index it depending on the `index` flag.
:param item: object to add
:type item: alignak.objects.item.Item
:param ind... | 0.003942 |
def is_verified(self):
"""
Verifies an SES bounce message.
"""
if self._verified is None:
signature = self._data.get('Signature')
if not signature:
self._verified = False
return self._verified
# Decode the signature fr... | 0.00189 |
def create(self, bucket, descriptor, force=False):
"""https://github.com/frictionlessdata/tableschema-pandas-py#storage
"""
# Make lists
buckets = bucket
if isinstance(bucket, six.string_types):
buckets = [bucket]
descriptors = descriptor
if isinstanc... | 0.002139 |
def _set_status_data(self, userdata):
"""Set status properties from userdata response.
Response values:
d3: On Mask
d4: Off Mask
d5: X10 House Code
d6: X10 Unit
d7: Ramp Rate
d8: On-Level
d9: LED Brightness
... | 0.002014 |
def p_string_list(self, p):
'''string_list : string_list COMMA IDENT
| IDENT
| empty'''
if p[1] is None:
p[0] = []
elif len(p) == 4:
p[1].append(p[3])
p[0] = p[1]
elif len(p) == 2:
p[0] = [p[1]] | 0.00625 |
def _parse_list(element, definition):
"""Parse xml element by definition given by list.
Find all elements matched by the string given as the first value
in the list (as XPath or @attribute).
If there is a second argument it will be handled as a definitions
for the elements matched or the text when... | 0.001252 |
def calculate_squared_differences(image_tile_dict, transformed_array, template, sq_diff_tolerance=0.1):
"""As above, but for when the squared differences matching method is used
"""
template_norm_squared = np.sum(template**2)
image_norms_squared = {(x,y):np.sum(image_tile_dict[(x,y)]**2) for (x,y) in im... | 0.013757 |
def show_correlation_matrix(sync_output_dynamic, iteration = None):
"""!
@brief Shows correlation matrix between oscillators at the specified iteration.
@param[in] sync_output_dynamic (sync_dynamic): Output dynamic of the Sync network.
@param[in] iteration (uint): Number of... | 0.029904 |
def plot_fermi_surface(data, structure, cbm, energy_levels=[],
multiple_figure=True,
mlab_figure=None, kpoints_dict={}, color=(0, 0, 1),
transparency_factor=[], labels_scale_factor=0.05,
points_scale_factor=0.02, interative=True... | 0.002978 |
def do_allowrep(self, line):
"""allowrep Allow new objects to be replicated."""
self._split_args(line, 0, 0)
self._command_processor.get_session().get_replication_policy().set_replication_allowed(
True
)
self._print_info_if_verbose("Set replication policy to allow rep... | 0.012121 |
def __MaxSizeToInt(self, max_size):
"""Convert max_size to an int."""
size_groups = re.match(r'(?P<size>\d+)(?P<unit>.B)?$', max_size)
if size_groups is None:
raise ValueError('Could not parse maxSize')
size, unit = size_groups.group('size', 'unit')
shift = 0
... | 0.003436 |
def hash_and_stat_file(self, path, saltenv='base'):
'''
Return the hash of a file, to get the hash of a file in the pillar_roots
prepend the path with salt://<file on server> otherwise, prepend the
file with / for a local file.
Additionally, return the stat result of the file, o... | 0.002841 |
def derivable(self):
"""
Whether the spec (only valid for derived specs) can be derived
given the inputs and switches provided to the study
"""
try:
# Just need to iterate all study inputs and catch relevant
# exceptions
list(self.pipeline.stud... | 0.004264 |
def all(self, *, collection, attribute, word, func=None, operation=None):
""" Performs a filter with the OData 'all' keyword on the collection
For example:
q.any(collection='email_addresses', attribute='address',
operation='eq', word='george@best.com')
will transform to a filte... | 0.002041 |
def checker(location, receiver):
"""Construct a function that checks a directory for process configuration
The function checks for additions or removals
of JSON process configuration files and calls the appropriate receiver
methods.
:param location: string, the directory to monitor
:param rece... | 0.000719 |
def add(self,dimlist,dimvalues):
'''
add dimensions
:parameter dimlist: list of dimensions
:parameter dimvalues: list of values for dimlist
'''
for i,d in enumerate(dimlist):
self[d] = dimvalues[i]
self.set_ndims() | 0.022581 |
def transitionStates(self,state):
"""
Return the indices of new states and their rates.
"""
newstates,rates = self.transition(state)
newindices = self.getStateIndex(newstates)
return newindices,rates | 0.031802 |
def multipart_uploadpart(self, multipart):
"""Upload a part.
:param multipart: A :class:`invenio_files_rest.models.MultipartObject`
instance.
:returns: A Flask response.
"""
content_length, part_number, stream, content_type, content_md5, tags =\
current_f... | 0.001609 |
def add_virtual_columns_equatorial_to_galactic_cartesian(self, alpha, delta, distance, xname, yname, zname, radians=True, alpha_gp=np.radians(192.85948), delta_gp=np.radians(27.12825), l_omega=np.radians(32.93192)):
"""From http://arxiv.org/pdf/1306.2945v2.pdf"""
if not radians:
alpha = "pi/180.*%s" % a... | 0.006281 |
def get_content_id(self, content_metadata_item):
"""
Return the id for the given content_metadata_item, `uuid` for programs or `key` for other content
"""
content_id = content_metadata_item.get('key', '')
if content_metadata_item['content_type'] == 'program':
content_... | 0.007732 |
def _sigmainf(N, h, m, dW, Km0, Pm0):
"""Asymptotic covariance matrix \Sigma_\infty Wiktorsson2001 eqn (4.5)"""
M = m*(m-1)//2
Im = broadcast_to(np.eye(m), (N, m, m))
IM = broadcast_to(np.eye(M), (N, M, M))
Ims0 = np.eye(m**2)
factor1 = broadcast_to((2.0/h)*np.dot(Km0, Ims0 - Pm0), (N, M, m**2)... | 0.006173 |
def verify_classification(self, classification):
"""
Mark the given ClassifiedFailure as verified.
Handles the classification not currently being related to this
TextLogError and no Metadata existing.
"""
if classification not in self.classified_failures.all():
... | 0.002584 |
def _update_header_size(self):
"""Update the column width of the header."""
column_count = self.table_header.model().columnCount()
for index in range(0, column_count):
if index < column_count:
column_width = self.dataTable.columnWidth(index)
self... | 0.004866 |
def _check_for_uploads_from_md5(self):
# type: (Uploader) -> None
"""Check queue for a file to upload
:param Uploader self: this
"""
cv = self._md5_offload.done_cv
while not self.termination_check_md5:
result = None
cv.acquire()
while T... | 0.003584 |
def CheckRedundantVirtual(filename, clean_lines, linenum, error):
"""Check if line contains a redundant "virtual" function-specifier.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The functio... | 0.013736 |
def median(self):
"""Computes the median of a log-normal distribution built with the stats data."""
mu = self.mean()
ret_val = math.exp(mu)
if math.isnan(ret_val):
ret_val = float("inf")
return ret_val | 0.011858 |
def pdfa_status(self):
"""Returns the PDF/A conformance level claimed by this PDF, or False
A PDF may claim to PDF/A compliant without this being true. Use an
independent verifier such as veraPDF to test if a PDF is truly
conformant.
Returns:
str: The conformance le... | 0.002755 |
def bring_gpio_interrupt_into_userspace(): # activate gpio interrupt
"""Bring the interrupt pin on the GPIO into Linux userspace."""
try:
# is it already there?
with open(GPIO_INTERRUPT_DEVICE_VALUE):
return
except IOError:
# no, bring it into userspace
with open... | 0.002105 |
def read(self, frames=-1, dtype='float64', always_2d=False,
fill_value=None, out=None):
"""Read from the file and return data as NumPy array.
Reads the given number of frames in the given data format
starting at the current read/write position. This advances the
read/write... | 0.000756 |
def __setAttributeDefaults(self):
"""Looks for default values for unset attributes. If
class variable representing attribute is None, then
it must be defined as an instance variable.
"""
for k,v in self.__class__.attributes.items():
if v is not None and self.at... | 0.007737 |
def ae_latent_softmax(latents_pred, latents_discrete, hparams):
"""Latent prediction and loss."""
vocab_size = 2 ** hparams.z_size
if hparams.num_decode_blocks < 2:
latents_logits = tf.layers.dense(latents_pred, vocab_size,
name="extra_logits")
if hparams.logit_normali... | 0.01059 |
def add_missing(self, distribution, requirement):
"""
Add a missing *requirement* for the given *distribution*.
:type distribution: :class:`distutils2.database.InstalledDistribution`
or :class:`distutils2.database.EggInfoDistribution`
:type requirement: ``str... | 0.004264 |
def scroll(self, clicks):
"""Zoom using a mouse scroll wheel motion.
Parameters
----------
clicks : int
The number of clicks. Positive numbers indicate forward wheel
movement.
"""
target = self._target
ratio = 0.90
mult = 1.0
... | 0.001938 |
def default_blocks(self):
"""
Return a list of default block tuples (appname.ModelName, verbose name).
Next to the dropdown list of block types, a small number of common blocks which are
frequently used can be added immediately to a column with one click. This method defines
the... | 0.004437 |
def open(self):
"""This is the only way to open a file resource."""
self.__sf = _sftp_open(self.__sftp_session_int,
self.__filepath,
self.access_type_int,
self.__create_mode)
if self.access_type_is_... | 0.012225 |
def apply_ctx(fn, ctx):
"""Return fn with ctx partially applied, if requested.
If the `fn` callable accepts an argument named "ctx", returns a
functools.partial object with ctx=ctx applied, else returns `fn` unchanged.
For this to work, the 'ctx' argument must come after any arguments that are
pas... | 0.001443 |
def invoke_controller(self, controller, args, kwargs, state):
'''
The main request handler for Pecan applications.
'''
cfg = _cfg(controller)
content_types = cfg.get('content_types', {})
req = state.request
resp = state.response
pecan_state = req.pecan
... | 0.00078 |
def download_file_content(self, file_id, etag=None):
'''Download file content.
Args:
file_id (str): The UUID of the file whose content is requested
etag (str): If the content is not changed since the provided ETag,
the content won't be downloaded. If the content ... | 0.001722 |
def a2b_hashed_base58(s):
"""
If the passed string is hashed_base58, return the binary data.
Otherwise raises an EncodingError.
"""
data = a2b_base58(s)
data, the_hash = data[:-4], data[-4:]
if double_sha256(data)[:4] == the_hash:
return data
raise EncodingError("hashed base58 ha... | 0.002915 |
def _execute_request(self, request):
"""Helper method to execute a request, since a lock should be used
to not fire up multiple requests at the same time.
:return: Result of `request.execute`
"""
with GoogleCloudProvider.__gce_lock:
return request.execute(http=self._... | 0.006061 |
def infer_complexes(stmts):
"""Return inferred Complex from Statements implying physical interaction.
Parameters
----------
stmts : list[indra.statements.Statement]
A list of Statements to infer Complexes from.
Returns
-------
linked_stmts : list[ind... | 0.003901 |
def create_bucket(self, bucket):
"""
Create a new bucket.
"""
details = self._details(
method=b"PUT",
url_context=self._url_context(bucket=bucket),
)
query = self._query_factory(details)
return self._submit(query) | 0.006826 |
def _create_dataset(self, *data):
"""Converts input data to the appropriate Dataset"""
# Make sure data is a tuple of dense tensors
data = [self._to_torch(x, dtype=torch.FloatTensor) for x in data]
return TensorDataset(*data) | 0.007782 |
def get_video_url_from_video_id(video_id):
"""Splicing URLs according to video ID to get video details"""
# from js
data = [""] * 256
for index, _ in enumerate(data):
t = index
for i in range(8):
t = -306674912 ^ unsigned_right_shitf(t, 1) if 1 & t else unsigned_right_shitf(t... | 0.006533 |
def boxplot(self, **vargs):
"""Plots a boxplot for the table.
Every column must be numerical.
Kwargs:
vargs: Additional arguments that get passed into `plt.boxplot`.
See http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.boxplot
for addition... | 0.003679 |
def post(fqdn, package, result, entry, bound, ekey, *argl, **argd):
"""Adds logging for the post-call result of calling the method externally.
Args:
fqdn (str): fully-qualified domain name of the function being logged.
package (str): name of the package we are logging for. Usually the first
... | 0.002323 |
def run_collection(self, conf, rm_conf, branch_info):
'''
Run specs and collect all the data
'''
if rm_conf is None:
rm_conf = {}
logger.debug('Beginning to run collection spec...')
exclude = None
if rm_conf:
try:
exclude = ... | 0.001486 |
def length(self):
"""Gets the length of this Vector"""
return math.sqrt((self.X * self.X) + (self.Y * self.Y)) | 0.015873 |
def remove(self, element):
"""
Remove an element from the bag.
>>> s = pbag([1, 1, 2])
>>> s2 = s.remove(1)
>>> s3 = s.remove(2)
>>> s2
pbag([1, 2])
>>> s3
pbag([1, 1])
"""
if element not in self._counts:
raise KeyError... | 0.003774 |
def plot_confidence(self, lower=2.5, upper=97.5, plot_limits=None, fixed_inputs=None,
resolution=None, plot_raw=False,
apply_link=False, visible_dims=None,
which_data_ycols='all', label='gp confidence',
predict_kw=None,
**kwargs):
"""
Plot th... | 0.007853 |
def anglesep_meeus(lon0: float, lat0: float,
lon1: float, lat1: float, deg: bool = True) -> float:
"""
Parameters
----------
lon0 : float or numpy.ndarray of float
longitude of first point
lat0 : float or numpy.ndarray of float
latitude of first point
lon1 : f... | 0.00073 |
def CMOVNO(cpu, dest, src):
"""
Conditional move - Not overflow.
Tests the status flags in the EFLAGS register and moves the source operand
(second operand) to the destination operand (first operand) if the given
test condition is true.
:param cpu: current CPU.
... | 0.012245 |
def add_response(self, req, resp):
"""Adds the response from sending to `req` to this instance's cache.
Args:
req (`ServicecontrolServicesAllocateQuotaRequest`): the request
resp (AllocateQuotaResponse): the response from sending the request
"""
if self._cache is Non... | 0.002312 |
def _isNewTxn(self, identifier, reply, txnId) -> bool:
"""
If client is not in `processedRequests` or requestId is not there in
processed requests and txnId is present then its a new reply
"""
return (identifier not in self.processedRequests or
reply.reqId not in ... | 0.005115 |
def padto8(data):
"""Pads data to the multiplies of 8 bytes.
This makes x86_64 faster and prevents
undefined behavior on other platforms"""
length = len(data)
return data + b'\xdb' * (roundto8(length) - length) | 0.004219 |
def get_repository_lookup_session(self, proxy, *args, **kwargs):
"""Gets the repository lookup session.
arg proxy (osid.proxy.Proxy): a proxy
return: (osid.repository.RepositoryLookupSession) - a
RepositoryLookupSession
raise: OperationFailed - unable to complete re... | 0.003077 |
def dump_tables_to_tskit(pop):
"""
Converts fwdpy11.TableCollection to an
tskit.TreeSequence
"""
node_view = np.array(pop.tables.nodes, copy=True)
node_view['time'] -= node_view['time'].max()
node_view['time'][np.where(node_view['time'] != 0.0)[0]] *= -1.0
edge_view = np.array(pop.tables... | 0.000421 |
def get_prob(self, src, tgt, mask, pre_compute, return_logits=False):
'''
:param s: [src_sequence_length, batch_size, src_dim]
:param h: [batch_size, tgt_dim] or [tgt_sequence_length, batch_size, tgt_dim]
:param mask: [src_sequence_length, batch_size]\
or [tgt_sequence_lengt... | 0.001273 |
def dynamize_request_items(self, batch_list):
"""
Convert a request_items parameter into the data structure
required for Layer1.
"""
d = None
if batch_list:
d = {}
for batch in batch_list:
batch_dict = {}
key_list = ... | 0.002053 |
def interpolate_linear(self, lons, lats, data):
"""
Interpolate using linear approximation
Returns the same as interpolate(lons,lats,data,order=1)
"""
return self.interpolate(lons, lats, data, order=1) | 0.008299 |
def parse_color(self, color):
'''
color : string, eg: '#rrggbb' or 'none'
(where rr, gg, bb are hex digits from 00 to ff)
returns a triple of unsigned bytes, eg: (0, 128, 255)
'''
if color == 'none':
return None
return (
int(color[1:3], 16)... | 0.005168 |
def forward(self,
input_ids: torch.LongTensor,
offsets: torch.LongTensor = None,
token_type_ids: torch.LongTensor = None) -> torch.Tensor:
"""
Parameters
----------
input_ids : ``torch.LongTensor``
The (batch_size, ..., max_sequ... | 0.006534 |
def remove(name, conf_file=default_conf):
'''
Remove log pattern from logadm
CLI Example:
.. code-block:: bash
salt '*' logadm.remove myapplog
'''
command = "logadm -f {0} -r {1}".format(conf_file, name)
result = __salt__['cmd.run_all'](command, python_shell=False)
if result['re... | 0.001976 |
def concat_t_vars_np(self, vars_idx=None):
"""
Concatenate `self.np_t` with `self.np_vars` and return a single matrix.
The first column corresponds to time, and the rest of the matrix is the variables.
Returns
-------
np.array : concatenated matrix
"""
s... | 0.005059 |
def close(self):
"""
OPTIONAL COMMIT-AND-CLOSE
IF THIS IS NOT DONE, THEN THE THREAD THAT SPAWNED THIS INSTANCE
:return:
"""
self.closed = True
signal = _allocate_lock()
signal.acquire()
self.queue.add(CommandItem(COMMIT, None, signal, None, None))
... | 0.005051 |
def db_alter(name, user=None, host=None, port=None, maintenance_db=None,
password=None, tablespace=None, owner=None, owner_recurse=False,
runas=None):
'''
Change tablespace or/and owner of database.
CLI Example:
.. code-block:: bash
salt '*' postgres.db_alter dbname ... | 0.000741 |
def find_package_docs(package_dir, skippedNames=None):
"""Find documentation directories in a package using ``manifest.yaml``.
Parameters
----------
package_dir : `str`
Directory of an EUPS package.
skippedNames : `list` of `str`, optional
List of package or module names to skip whe... | 0.000186 |
def from_vocabfile(filename):
""" Construct a CountedVocabulary out of a vocabulary file.
Note:
File has the following format word1 count1
word2 count2
"""
word_count = [x.strip().split() for x in _open(filename, 'r').read().splitlines()]
word_count = {w:in... | 0.010025 |
def dl_files(db, dl_dir, files, keep_subdirs=True, overwrite=False):
"""
Download specified files from a Physiobank database.
Parameters
----------
db : str
The Physiobank database directory to download. eg. For database:
'http://physionet.org/physiobank/database/mitdb', db='mitdb'.... | 0.0009 |
def setExpandedIcon( self, column, icon ):
"""
Sets the icon to be used when the item is expanded.
:param column | <int>
icon | <QtGui.QIcon> || None
"""
self._expandedIcon[column] = QtGui.QIcon(icon) | 0.017668 |
def decode_bytes(f):
"""Decode a buffer length from a 2-byte unsigned int then read the
subsequent bytes.
Parameters
----------
f: file
File-like object with read method.
Raises
------
UnderflowDecodeError
When the end of stream is encountered before the end of the
... | 0.001248 |
def reflex_correct(coords, galactocentric_frame=None):
"""Correct the input Astropy coordinate object for solar reflex motion.
The input coordinate instance must have distance and radial velocity information. If the radial velocity is not known, fill the
Parameters
----------
coords : `~astropy.co... | 0.001989 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.