language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | private void delayEnableMyself() {
if (!autoDisable) {
return;
}
setEnabled(false);
postDelayed(new Runnable() {
@Override
public void run() {
setEnabled(true);
}
}, disableDuration);
} |
java | @Override
public DBInstance rebootDBInstance(RebootDBInstanceRequest request) {
request = beforeClientExecution(request);
return executeRebootDBInstance(request);
} |
python | def ToPhotlam(self, wave, flux, **kwargs):
"""Convert to ``photlam``.
.. math::
\\textnormal{photlam} = 10^{-0.4 \\; \\textnormal{vegamag}} \\; f_{\\textnormal{Vega}}
where :math:`f_{\\textnormal{Vega}}` is the flux of
:ref:`pysynphot-vega-spec` resampled at given waveleng... |
java | @SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case AfplibPackage.GRLINE__XPOS:
setXPOS((Integer)newValue);
return;
case AfplibPackage.GRLINE__YPOS:
setYPOS((Integer)newValue);
return;
case AfplibPackage.GRLINE__RG:
getRg... |
java | public static void mult( DMatrix3x3 a , DMatrix3 b , DMatrix3 c) {
c.a1 = a.a11*b.a1 + a.a12*b.a2 + a.a13*b.a3;
c.a2 = a.a21*b.a1 + a.a22*b.a2 + a.a23*b.a3;
c.a3 = a.a31*b.a1 + a.a32*b.a2 + a.a33*b.a3;
} |
java | public static List random(Number min, Number max, long lenMin, long lenMax) {
long len = random(lenMin, lenMax).longValue();
if (len > 0) {
List ret = new ArrayList();
for (int i = 0; i < len; i++) {
ret.add(random(min, max));
}
return ret;
}
return null;
} |
java | public String getPublicCertificateHash()
throws CertificateEncodingException, NoSuchAlgorithmException {
return Base64.encodeBase64String(AsymmetricKeyCredential
.getHash(this.publicCertificate.getEncoded()));
} |
python | def iter_files(root, exts=None, recursive=False):
"""
Iterate over file paths within root filtered by specified extensions.
:param compat.string_types root: Root folder to start collecting files
:param iterable exts: Restrict results to given file extensions
:param bool recursive: Wether to walk the... |
java | public ExtensibleType<TldExtensionType<T>> getOrCreateExtensionElement()
{
List<Node> nodeList = childNode.get("extension-element");
if (nodeList != null && nodeList.size() > 0)
{
return new ExtensibleTypeImpl<TldExtensionType<T>>(this, "extension-element", childNode, nodeList.get(0));
... |
java | public LayoutInfo getLayoutInfo(Container parent) {
synchronized (parent.getTreeLock()) {
initializeColAndRowComponentLists();
Dimension size = parent.getSize();
Insets insets = parent.getInsets();
int totalWidth = size.width - insets.left - insets.right;
... |
java | @Override
public ModifyLaunchTemplateResult modifyLaunchTemplate(ModifyLaunchTemplateRequest request) {
request = beforeClientExecution(request);
return executeModifyLaunchTemplate(request);
} |
java | public JSONObject imageCensorUserDefined(byte[] imgData, HashMap<String, String> options) {
AipRequest request = new AipRequest();
String base64Content = Base64Util.encode(imgData);
request.addBody("image", base64Content);
return imageCensorUserDefinedHelper(request, options);
} |
java | public XmlStringBuilder element(String name, CharSequence content) {
return element(name, content.toString());
} |
java | public ExchangeRate getExchangeRate(String baseCode, String termCode){
return getExchangeRate(Monetary.getCurrency(baseCode), Monetary.getCurrency(termCode));
} |
java | public List<String> getMetaKeywords(TypeElement typeElement) {
ArrayList<String> results = new ArrayList<>();
// Add field and method keywords only if -keywords option is used
if (config.keywords) {
results.addAll(getClassKeyword(typeElement));
results.addAll(getMemberKe... |
python | def get_raw_import_values(self): # pragma: no cover, deprecation
"""
Get some properties of timeperiod (timeperiod is a bit different
from classic item)
TODO: never called anywhere, still useful?
:return: a dictionnary of some properties
:rtype: dict
"""
... |
python | def zero_state(self, batch_size):
""" Initial state of the network """
return torch.zeros(batch_size, self.state_dim, dtype=torch.float32) |
java | public static long address(final ByteBuffer buffer)
{
if (!buffer.isDirect())
{
throw new IllegalArgumentException("buffer.isDirect() must be true");
}
return UNSAFE.getLong(buffer, BYTE_BUFFER_ADDRESS_FIELD_OFFSET);
} |
python | def decode(self, encoding=None, errors='strict'):
"""Decode using the codec registered for encoding. encoding defaults to the default encoding.
errors may be given to set a different error handling scheme. Default is 'strict' meaning that encoding errors
raise a UnicodeDecodeError. Other possib... |
java | public static AddressType guessDeviceAddressType(URL url) {
if (url.getDeviceAddress() == null) {
return AddressType.COMPOSITE;
}
return guessAddressType(url.getDeviceAddress());
} |
python | def verify_refresh_request(request):
"""
Wrapper around JWTIdentityPolicy.verify_refresh which verify
if the request to refresh the token is valid.
If valid it returns the userid which can be used to create to
create an updated identity with ``remember_identity``.
Otherwise it raises an exceptio... |
java | public static <T> Function<T, Boolean> forPredicate (final Predicate<T> predicate)
{
return new Function<T, Boolean>() {
public Boolean apply (T arg) {
return predicate.apply(arg);
}
};
} |
python | def convert_time(time):
"""Convert a time string into 24-hour time."""
split_time = time.split()
try:
# Get rid of period in a.m./p.m.
am_pm = split_time[1].replace('.', '')
time_str = '{0} {1}'.format(split_time[0], am_pm)
except IndexError:
return time
try:
... |
java | boolean write(final int value) {
if (blockLength > blockLengthLimit) {
return false;
}
final int rleCurrentValue = this.rleCurrentValue;
final int rleLength = this.rleLength;
if (rleLength == 0) {
this.rleCurrentValue = value;
this.rleLength =... |
python | def with_known_args(self, **kwargs):
"""Send only known keyword-arguments to the phase when called."""
argspec = inspect.getargspec(self.func)
stored = {}
for key, arg in six.iteritems(kwargs):
if key in argspec.args or argspec.keywords:
stored[key] = arg
if stored:
return self.w... |
python | def citation_count(papers, key='ayjid', verbose=False):
"""
Generates citation counts for all of the papers cited by papers.
Parameters
----------
papers : list
A list of :class:`.Paper` instances.
key : str
Property to use as node key. Default is 'ayjid' (recommended).
verb... |
python | def _rpt_unused_sections(self, prt):
"""Report unused sections."""
sections_unused = set(self.sections_seen).difference(self.section2goids.keys())
for sec in sections_unused:
prt.write(" UNUSED SECTION: {SEC}\n".format(SEC=sec)) |
python | def create_element(self, ns, name):
"""
Create an element as a child of this SLDNode.
@type ns: string
@param ns: The namespace of the new element.
@type name: string
@param name: The name of the new element.
@rtype: L{SLDNode}
@return: The wrapped ... |
python | def clip(self, channels=True):
"""Limit the values of the array to the default [0,1] range. *channels*
says which channels should be clipped."""
if not isinstance(channels, (tuple, list)):
channels = [channels] * len(self.channels)
for i in range(len(self.channels)):
... |
python | def compute_xy(
self, projection: Union[pyproj.Proj, crs.Projection, None] = None
):
"""Computes x and y columns from latitudes and longitudes.
The source projection is WGS84 (EPSG 4326).
The default destination projection is a Lambert Conformal Conical
projection centered o... |
java | @SuppressWarnings("PMD.SwitchStmtsShouldHaveDefault")
public boolean isCompatible(@NonNull EventType eventType) {
switch (eventType) {
case CREATED:
return (listener instanceof CacheEntryCreatedListener<?, ?>);
case UPDATED:
return (listener instanceof CacheEntryUpdatedListener<?, ?>);... |
python | def get_tabix_cmd(config):
"""Retrieve tabix command, handling new bcftools tabix and older tabix.
"""
try:
bcftools = config_utils.get_program("bcftools", config)
# bcftools has terrible error codes and stderr output, swallow those.
bcftools_tabix = subprocess.check_output("{bcftool... |
java | @Override
public void sync(List<Dml> dmls) {
if (dmls == null || dmls.isEmpty()) {
return;
}
try {
rdbSyncService.sync(mappingConfigCache, dmls, envProperties);
rdbMirrorDbSyncService.sync(dmls);
} catch (Exception e) {
throw new Runtim... |
java | public Query insideBoundingBox(float latitudeP1, float longitudeP1, float latitudeP2, float longitudeP2) {
if (insideBoundingBox == null) {
insideBoundingBox = "insideBoundingBox=" + latitudeP1 + "," + longitudeP1 + "," + latitudeP2 + "," + longitudeP2;
} else if (insideBoundingBox.length() > 18) {
... |
python | def _add_initial_value(self, data_id, value, initial_dist=0.0,
fringe=None, check_cutoff=None, no_call=None):
"""
Add initial values updating workflow, seen, and fringe.
:param fringe:
Heapq of closest available nodes.
:type fringe: list[(float | i... |
python | def setup_queue(self, queue_name):
"""Setup the queue on RabbitMQ by invoking the Queue.Declare RPC
command. When it is complete, the on_queue_declareok method will
be invoked by pika.
:param str|unicode queue_name: The name of the queue to declare.
"""
_logger.debug('De... |
python | def info(self, remote_path):
"""Gets information about resource on WebDAV.
More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_PROPFIND
:param remote_path: the path to remote resource.
:return: a dictionary of information attributes and them values with fol... |
python | def createReference(self, fromnode, tonode, edge_data=None):
"""
Create a reference from fromnode to tonode
"""
if fromnode is None:
fromnode = self
fromident, toident = self.getIdent(fromnode), self.getIdent(tonode)
if fromident is None or toident is None:
... |
python | def prep_hla(work_dir, sample, calls, hlas, normal_bam, tumor_bam):
"""Convert HLAs into ABSOLUTE format for use with LOHHLA.
LOHHLA hard codes names to hla_a, hla_b, hla_c so need to move
"""
work_dir = utils.safe_makedir(os.path.join(work_dir, sample, "inputs"))
hla_file = os.path.join(work_dir, ... |
python | def eject_virtual_media(self, device='FLOPPY'):
"""Ejects the Virtual Media image if one is inserted."""
vm_status = self.get_vm_status(device=device)
if vm_status['IMAGE_INSERTED'] == 'NO':
return
dic = {'DEVICE': device.upper()}
self._execute_command(
'... |
java | public final void setValue(int dayOfWeek, int hour, int minute, int second)
{
data = set(dayOfWeek, hour, minute, second, new short[3], 0);
} |
java | @Override
public int open(String path, FuseFileInfo fi) {
final AlluxioURI uri = mPathResolverCache.getUnchecked(path);
// (see {@code man 2 open} for the structure of the flags bitfield)
// File creation flags are the last two bits of flags
final int flags = fi.flags.get();
LOG.trace("open({}, 0x... |
java | private void unlockCompletely(ReentrantLock lockToUnlock){
int counter = lockToUnlock.getHoldCount();
for(int i = 0; i<counter; i++){
lockToUnlock.unlock();
}
} |
python | def sql_program_name_func(command):
"""
Extract program name from `command`.
>>> sql_program_name_func('ls')
'ls'
>>> sql_program_name_func('git status')
'git'
>>> sql_program_name_func('EMACS=emacs make')
'make'
:type command: str
"""
args = command.split(' ')
for pro... |
python | def appendBitPadding(str, blocksize=AES_blocksize):
'''Bit padding a.k.a. One and Zeroes Padding
A single set ('1') bit is added to the message and then as many reset ('0') bits as required (possibly none) are added.
Input: (str) str - String to be padded
(int) blocksize - block size of the algorithm
R... |
java | public static PageRange parse(String pages) {
ANTLRInputStream is = new ANTLRInputStream(pages);
InternalPageLexer lexer = new InternalPageLexer(is);
lexer.removeErrorListeners(); //do not output errors to console
CommonTokenStream tokens = new CommonTokenStream(lexer);
InternalPageParser parser = new Interna... |
java | public SymbolType withName(String name) {
return clone(marker, name, arrayCount, typeVariable, null, null);
} |
java | @Deprecated
public String format(Locale locale, Duration duration, DurationFormat format) {
return format(duration);
} |
python | def label(self):
"""str display-name for this element, '' when absent from cube response.
This property handles numeric, datetime and text variables, but also
subvar dimensions
"""
value = self._element_dict.get("value")
type_name = type(value).__name__
if type_... |
python | def preview(self, request):
"""
Return a occurrences in JSON format up until the configured limit.
"""
recurrence_rule = request.POST.get('recurrence_rule')
limit = int(request.POST.get('limit', 10))
try:
rruleset = rrule.rrulestr(
recurrence_r... |
python | def line(y, thickness, gaussian_width):
"""
Infinite-length line with a solid central region, then Gaussian fall-off at the edges.
"""
distance_from_line = abs(y)
gaussian_y_coord = distance_from_line - thickness/2.0
sigmasq = gaussian_width*gaussian_width
if sigmasq==0.0:
falloff =... |
python | def get_concrete_model(model):
""" Get model defined in Meta.
:param str or django.db.models.Model model:
:return: model or None
:rtype django.db.models.Model or None:
:raise ValueError: model is not found or abstract
"""
if not(inspect.isclass(model) and issubclass(model, models.Model)):
... |
python | def decode_tx_packet(packet: str) -> dict:
"""Break packet down into primitives, and do basic interpretation.
>>> decode_packet('10;Kaku;ID=41;SWITCH=1;CMD=ON;') == {
... 'node': 'gateway',
... 'protocol': 'kaku',
... 'id': '000041',
... 'switch': '1',
... 'command': 'on... |
java | public long getTime() throws NotAvailableException {
synchronized (timeSync) {
try {
if (!isRunning()) {
throw new InvalidStateException("Stopwatch was never started!");
}
if (endTime == -1) {
return System.curr... |
python | def _seconds_as_string(seconds):
"""
Returns seconds as a human-friendly string, e.g. '1d 4h 47m 41s'
"""
TIME_UNITS = [('s', 60), ('m', 60), ('h', 24), ('d', None)]
unit_strings = []
cur = max(int(seconds), 1)
for suffix, size in TIME_UNITS:
if size is not None:
cur, res... |
java | private void setupLoggerFromProperties(final Properties props) {
final String driverLogLevel = PGProperty.LOGGER_LEVEL.get(props);
if (driverLogLevel == null) {
return; // Don't mess with Logger if not set
}
if ("OFF".equalsIgnoreCase(driverLogLevel)) {
PARENT_LOGGER.setLevel(Level.OFF);
... |
java | private void takeLeadership() {
context.setLeader(context.getCluster().member().id());
context.getClusterState().getRemoteMemberStates().forEach(m -> m.resetState(context.getLog()));
} |
python | def on_unsubscribe(self):
# type: () -> Callable
"""Decorate a callback funtion to handle unsubscribtions.
**Usage:**::
@mqtt.unsubscribe()
def handle_unsubscribe(client, userdata, mid)
print('Unsubscribed from topic (id: {})'
.form... |
python | def auth_user_get_url(self):
'Build authorization URL for User Agent.'
if not self.client_id: raise AuthenticationError('No client_id specified')
return '{}?{}'.format(self.auth_url_user, urllib.urlencode(dict(
client_id=self.client_id, state=self.auth_state_check,
response_type='code', redirect_uri=self.au... |
python | def make_timestamp_columns():
"""Return two columns, created_at and updated_at, with appropriate defaults"""
return (
Column('created_at', DateTime, default=func.utcnow(), nullable=False),
Column('updated_at', DateTime, default=func.utcnow(), onupdate=func.utcnow(), nullable=False),
) |
java | public JBBPOut Byte(final String str) throws IOException {
assertNotEnded();
assertStringNotNull(str);
if (this.processCommands) {
for (int i = 0; i < str.length(); i++) {
this.outStream.write(str.charAt(i));
}
}
return this;
} |
python | def next(self):
"""
Provide iteration capabilities
Use a small object cache for performance
"""
if not self._cache:
self._cache = self._get_results()
self._retrieved += len(self._cache)
# If we don't have any other data to return, we just
... |
python | def classmethod(self, encoding):
"""Function decorator for class methods."""
# Add encodings for hidden self and cmd arguments.
encoding = ensure_bytes(encoding)
typecodes = parse_type_encoding(encoding)
typecodes.insert(1, b'@:')
encoding = b''.join(typecodes)
d... |
java | private int[] determineAll_Buckets_Sarray(int q) {
int strLen = length;
int alphabetSize = alphabet.size;
int numberBuckets = kbs_power_Ulong(alphabetSize, q);
int[] buckets = new int[numberBuckets + 1];
for (int i = 0; i < q; i++) {
seq[start + length + i] = alphabe... |
java | @ObjectiveCName("toggleVideoEnabledWithCallId:")
public void toggleVideoEnabled(long callId) {
if (modules.getCallsModule().getCall(callId).getIsVideoEnabled().get()) {
modules.getCallsModule().disableVideo(callId);
} else {
modules.getCallsModule().enableVideo(callId);
... |
java | public synchronized static AminoAcid[] createAAs() {
if (aminoAcids != null) {
return aminoAcids;
}
// Create set of AtomContainers
aminoAcids = new AminoAcid[20];
IChemFile list = new ChemFile();
CMLReader reader = new CMLReader(AminoAcids.class.getClassLoa... |
java | public ResultList<MovieInfo> getTopRatedMovies(Integer page, String language) throws MovieDbException {
return tmdbMovies.getTopRatedMovies(page, language);
} |
java | private boolean isMultiChunked(final String filename) {
final FileCacheKey fileCacheKey = new FileCacheKey(indexName, filename, affinitySegmentId);
final FileMetadata fileMetadata = metadataCache.get(fileCacheKey);
if (fileMetadata==null) {
//This might happen under high load when the metadat... |
java | public static String mergeFromPath(String templatePath, Map<String, ?> values) {
return mergeFromTemplate(readResource(templatePath), values);
} |
java | protected void sendAppendRequest(Connection connection, MemberState member, AppendRequest request) {
long timestamp = System.nanoTime();
logger.trace("{} - Sending {} to {}", context.getCluster().member().address(), request, member.getMember().address());
connection.<AppendRequest, AppendResponse>sendAndRe... |
java | public Status withCause(Throwable cause) {
if (Objects.equal(this.cause, cause)) {
return this;
}
return new Status(this.code, this.description, cause);
} |
python | def _set_fields(self, fields):
"""Set or update the fields value."""
super(_BaseHNVModel, self)._set_fields(fields)
if not self.resource_ref:
endpoint = self._endpoint.format(
resource_id=self.resource_id, parent_id=self.parent_id,
grandparent_id=self.... |
java | public Collection<Event> getEvents(final DateTime start, final DateTime end) {
final Interval interval = new Interval(start, end);
final Predicate<Event> withinInterval = new Predicate<Event>() {
public boolean apply(Event input) {
return interval.contains(input.getStart());
... |
java | public void setColor(Color color)
{
if (null == color)
{
String _message = "The color must be non null.";
Object[] _parameters = {};
throw new IllegalArgumentException(MessageFormat.format(_message, _parameters));
}
myColor = color;
} |
python | def user_has_email(username):
""" make sure, that given user has an email associated """
user = api.user.get(username=username)
if not user.getProperty("email"):
msg = _(
"This user doesn't have an email associated "
"with their account."
)
raise Invalid(msg)
... |
java | public boolean deleteSinkAsync(String sinkName) throws ExecutionException, InterruptedException {
// [START deleteSinkAsync]
Future<Boolean> future = logging.deleteSinkAsync(sinkName);
// ...
boolean deleted = future.get();
if (deleted) {
// the sink was deleted
} else {
// the sink ... |
java | protected static InstallationModificationImpl.InstallationState load(final InstalledIdentity installedIdentity) throws IOException {
final InstallationModificationImpl.InstallationState state = new InstallationModificationImpl.InstallationState();
for (final Layer layer : installedIdentity.getLayers()) ... |
java | protected void parseAsynchronousContinuation(Element element, ActivityImpl activity) {
boolean isAsyncBefore = isAsyncBefore(element);
boolean isAsyncAfter = isAsyncAfter(element);
boolean exclusive = isExclusive(element);
// set properties on activity
activity.setAsyncBefore(isAsyncBefore, exclus... |
java | public void validateConnections()
{
boolean anyDestroyed = false;
ManagedConnectionFactory mcf = pool.getConnectionManager().getManagedConnectionFactory();
if (mcf instanceof ValidatingManagedConnectionFactory)
{
ValidatingManagedConnectionFactory vcf = (ValidatingManagedConnection... |
java | private void onMessageSent(MessageSentEvent event) {
handler.post(() -> listener.onMessageSent(event));
log("Event published " + event.toString());
} |
python | def get_conversation(self, peer_jid, *, current_jid=None):
"""
Get or create a new one-to-one conversation with a peer.
:param peer_jid: The JID of the peer to converse with.
:type peer_jid: :class:`aioxmpp.JID`
:param current_jid: The current JID to lock the conversation to (se... |
java | public <T extends Page> void mountPage(final String path, final Class<T> pageClass,
final IPageParametersEncoder pageParametersEncoder)
{
mount(new MountedMapper(path, pageClass, pageParametersEncoder));
} |
python | def commit_offsets_sync(self, offsets):
"""Commit specific offsets synchronously.
This method will retry until the commit completes successfully or an
unrecoverable error is encountered.
Arguments:
offsets (dict {TopicPartition: OffsetAndMetadata}): what to commit
... |
java | public synchronized void addTask(int taskId) {
Preconditions.checkArgument(!mTaskIdToInfo.containsKey(taskId), "");
mTaskIdToInfo.put(taskId, new TaskInfo().setJobId(mId).setTaskId(taskId)
.setStatus(Status.CREATED).setErrorMessage("").setResult(null));
} |
python | def save(self, *args, **kwargs):
''' Just add "s" if no plural name given. '''
if not self.pluralName:
self.pluralName = self.name + 's'
super(self.__class__, self).save(*args, **kwargs) |
java | public String getSrcSet() {
StringBuffer result = new StringBuffer(128);
if (m_srcSet != null) {
int items = m_srcSet.size();
for (Map.Entry<Integer, CmsJspImageBean> entry : m_srcSet.entrySet()) {
CmsJspImageBean imageBean = entry.getValue();
// ... |
python | def _fill_diagonals(m, diag_indices):
"""Fills diagonals of `nsites` matrices in `m` so rows sum to 0."""
assert m.ndim == 3, "M must have 3 dimensions"
assert m.shape[1] == m.shape[2], "M must contain square matrices"
for r in range(m.shape[0]):
scipy.fill_diagonal(m[r], 0)
m[r][diag_in... |
python | def help(self, command=None):
'''help prints the general function help, or help for a specific command
Parameters
==========
command: the command to get help for, if none, prints general help
'''
from spython.utils import check_install
check_install()
cmd = ['singularit... |
java | public StorageBuilder setUserCredentialsRepository( UserCredentialsRepository userCredentialsRepo, String userId )
{
this.userCredentialsRepo = userCredentialsRepo;
this.userId = userId;
return this;
} |
python | def which_roles_can(self, name):
"""Which role can SendMail? """
targetPermissionRecords = AuthPermission.objects(creator=self.client, name=name).first()
return [{'role': group.role} for group in targetPermissionRecords.groups] |
java | public FailedRemediationBatch withFailedItems(RemediationConfiguration... failedItems) {
if (this.failedItems == null) {
setFailedItems(new com.amazonaws.internal.SdkInternalList<RemediationConfiguration>(failedItems.length));
}
for (RemediationConfiguration ele : failedItems) {
... |
python | def delete_repository(self, repository, params=None):
"""
Removes a shared file system repository.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html>`_
:arg repository: A comma-separated list of repository names
:arg master_timeout: Explicit... |
java | public List<String> findNames(String classname, String[] pkgnames) {
List<String> result;
Class cls;
result = new ArrayList<>();
try {
cls = Class.forName(classname);
result = findNames(cls, pkgnames);
}
catch (Throwable t) {
getLogger().log(Level.SEVERE, "Failed to insta... |
python | def hdf5_col(self, chain=-1):
"""Return a pytables column object.
:Parameters:
chain : integer
The index of the chain.
.. note::
This method is specific to the ``hdf5`` backend.
"""
return self.db._tables[chain].colinstances[self.name] |
python | def GetTARInfo(self):
"""Retrieves the TAR info.
Returns:
tarfile.TARInfo: TAR info or None if it does not exist.
Raises:
PathSpecError: if the path specification is incorrect.
"""
if not self._tar_info:
location = getattr(self.path_spec, 'location', None)
if location is No... |
python | def agg_conc(original_countries,
aggregates,
missing_countries='test',
merge_multiple_string='_&_',
log_missing_countries=None,
log_merge_multiple_strings=None,
coco=None,
as_dataframe='sparse',
original_countries_cl... |
java | private void sendRecordFailedNotify(String reason) {
Status failedStatus = new Status(StatusCodes.NS_RECORD_FAILED);
failedStatus.setLevel(Status.ERROR);
failedStatus.setClientid(getStreamId());
failedStatus.setDetails(getPublishedName());
failedStatus.setDesciption(reason);... |
python | def energy_ratio_by_chunks(x, param):
"""
Calculates the sum of squares of chunk i out of N chunks expressed as a ratio with the sum of squares over the whole
series.
Takes as input parameters the number num_segments of segments to divide the series into and segment_focus
which is the segment numbe... |
python | def create(cls, propertyfile, allow_unknown):
"""
Create a Property instance by attempting to parse the given property file.
@param propertyfile: A file name of a property file
@param allow_unknown: Whether to accept unknown properties
"""
with open(propertyfile) as f:
... |
python | def prox_tv(x, gamma, G, A=None, At=None, nu=1, tol=10e-4, maxit=200, use_matrix=True):
r"""
Total Variation proximal operator for graphs.
This function computes the TV proximal operator for graphs. The TV norm
is the one norm of the gradient. The gradient is defined in the
function :meth:`pygsp.gr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.