language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def get_dict_value(dictionary, path):
""" Safely get the value of a dictionary given a key path. For
instance, for the dictionary `{ 'a': { 'b': 1 } }`, the value at
key path ['a'] is { 'b': 1 }, at key path ['a', 'b'] is 1, at
key path ['a', 'b', 'c'] is None.
:para... |
python | def scrypt(password, salt, N=SCRYPT_N, r=SCRYPT_r, p=SCRYPT_p, olen=64):
"""Returns a key derived using the scrypt key-derivarion function
N must be a power of two larger than 1 but no larger than 2 ** 63 (insane)
r and p must be positive numbers such that r * p < 2 ** 30
The default values are:
N... |
java | public int[] getSparseIndices(int component) {
assert (sparse[component]);
int[] indices = new int[pointers[component].length / 2];
for (int i = 0; i < pointers[component].length / 2; i++) {
indices[i] = (int) pointers[component][i * 2];
}
return indices;
} |
java | protected VarRefAssignExpress parseAssingInExp(AssignGeneralInExpContext agc) {
VarRefAssignExpress vas = null;
ExpressionContext expCtx = agc.generalAssignExp().expression();
Expression exp = parseExpress(expCtx);
VarRefContext varRefCtx = agc.generalAssignExp().varRef();
VarRef ref = this.parseVarR... |
java | public synchronized void printResults() throws Exception {
ClientStats stats = fullStatsContext.fetch().getStats();
// 1. Unique Device ID counting results
System.out.println("\n" + HORIZONTAL_RULE + " Unique Device ID Counting Results\n" + HORIZONTAL_RULE);
System.out.printf("A total o... |
java | public static Config load(ClassLoader loader, ConfigParseOptions parseOptions) {
return load(parseOptions.setClassLoader(loader));
} |
python | def delete(self):
"""
Deletes this NIO.
"""
if self._input_filter or self._output_filter:
yield from self.unbind_filter("both")
yield from self._hypervisor.send("nio delete {}".format(self._name))
log.info("NIO {name} has been deleted".format(name=self._name)... |
java | public static void loadAndShow(final Runnable finishAction) {
CmsRpcAction<CmsUserSettingsBean> action = new CmsRpcAction<CmsUserSettingsBean>() {
@Override
public void execute() {
start(200, false);
CmsCoreProvider.getService().loadUserSettings(this);
... |
java | private static ObjectMetadata getObjectMetadataForKey(Key k) {
String[] bk = decodeKey(k);
assert (bk.length == 2);
return getClient().getObjectMetadata(bk[0], bk[1]);
} |
java | private void restoreDefaults(@NonNull final PreferenceGroup preferenceGroup,
@NonNull final SharedPreferences sharedPreferences) {
for (int i = 0; i < preferenceGroup.getPreferenceCount(); i++) {
Preference preference = preferenceGroup.getPreference(i);
... |
python | def get_effective_ecs(self, strain, order=2):
"""
Returns the effective elastic constants
from the elastic tensor expansion.
Args:
strain (Strain or 3x3 array-like): strain condition
under which to calculate the effective constants
order (int): or... |
java | public void ensureTablesExist(final TSDB tsdb) {
final List<Deferred<Object>> deferreds =
new ArrayList<Deferred<Object>>(forward_intervals.size() * 2);
for (RollupInterval interval : forward_intervals.values()) {
deferreds.add(tsdb.getClient()
.ensureTableExists(interval.getTempor... |
python | def estimate_gas_for_function(
address,
web3,
fn_identifier=None,
transaction=None,
contract_abi=None,
fn_abi=None,
block_identifier=None,
*args,
**kwargs,
):
"""Temporary workaround until next web3.py release (5.X.X)"""
estimate_transactio... |
python | def get_eventhub_info(self):
"""
Get details on the specified EventHub.
Keys in the details dictionary include:
-'name'
-'type'
-'created_at'
-'partition_count'
-'partition_ids'
:rtype: dict
"""
alt_creds = {
... |
python | def cmd_save(args):
'''save a graph'''
child = multiproc.Process(target=save_process, args=[mestate.last_graph, mestate.child_pipe_send_console, mestate.child_pipe_send_graph, mestate.status.msgs])
child.start() |
java | public static File createTemporaryEmptyCatalogJarFile(boolean isXDCR) throws IOException {
File emptyJarFile = File.createTempFile("catalog-empty", ".jar");
emptyJarFile.deleteOnExit();
VoltCompiler compiler = new VoltCompiler(isXDCR);
if (!compiler.compileEmptyCatalog(emptyJarFile.getAb... |
java | private void release(PooledConnection<C> pooledConnection) {
long currentTime = System.currentTimeMillis();
long useTime;
synchronized(pooledConnection) {
pooledConnection.releaseTime = currentTime;
useTime = currentTime - pooledConnection.startTime;
if(useTime>0) pooledConnection.totalTime.addAndGet(use... |
java | public T get(String json, OnJsonObjectAddListener listener) throws IOException,
JsonFormatException {
JsonPullParser parser = JsonPullParser.newParser(json);
return get(parser);
} |
python | def encode_constructor_arguments(self, args):
""" Return the encoded constructor call. """
if self.constructor_data is None:
raise ValueError(
"The contract interface didn't have a constructor")
return encode_abi(self.constructor_data['encode_types'], args) |
python | def explain_prediction_tree_classifier(
clf, doc,
vec=None,
top=None,
top_targets=None,
target_names=None,
targets=None,
feature_names=None,
feature_re=None,
feature_filter=None,
vectorized=False):
""" Explain prediction of a tree class... |
java | public static int compare(XtendParameter p1, XtendParameter p2) {
if (p1 != p2) {
if (p1 == null) {
return Integer.MIN_VALUE;
}
if (p2 == null) {
return Integer.MAX_VALUE;
}
final JvmTypeReference t1 = p1.getParameterType();
final JvmTypeReference t2 = p2.getParameterType();
if (t1 != t2)... |
java | protected void processIcons(ArtifactMetadata amd, RepositoryResourceWritable res) throws RepositoryException {
String current = "";
String sizeString = "";
String iconName = "";
String iconNames = amd.getIcons();
if (iconNames != null) {
iconNames.replaceAll("\\s", "... |
python | def code_deparse_around_offset(name, offset, co, out=StringIO(),
version=None, is_pypy=None,
debug_opts=DEFAULT_DEBUG_OPTS):
"""
Like deparse_code(), but given a function/module name and
offset, finds the node closest to offset. If offset is not... |
java | public Env<AttrContext> classEnv(JCClassDecl tree, Env<AttrContext> env) {
Env<AttrContext> localEnv =
env.dup(tree, env.info.dup(WriteableScope.create(tree.sym)));
localEnv.enclClass = tree;
localEnv.outer = env;
localEnv.info.isSelfCall = false;
localEnv.info.lint =... |
java | public boolean isAssignable(Type t, Type s, Warner warn) {
if (t.hasTag(ERROR))
return true;
if (t.getTag().isSubRangeOf(INT) && t.constValue() != null) {
int value = ((Number)t.constValue()).intValue();
switch (s.getTag()) {
case BYTE:
case CH... |
python | def dragEnterEvent(self, event):
"""Determines if the widget under the mouse can recieve the drop"""
super(AbstractDragView, self).dragEnterEvent(event)
if event.mimeData().hasFormat("application/x-protocol"):
event.setDropAction(QtCore.Qt.MoveAction)
event.accept()
... |
python | def unpackage(package_):
'''
Unpackages a payload
'''
return salt.utils.msgpack.loads(package_, use_list=True,
_msgpack_module=msgpack) |
python | def get_rect(self):
"""
Get rectangle of app or desktop resolution
Returns:
RECT(left, top, right, bottom)
"""
if self.handle:
left, top, right, bottom = win32gui.GetWindowRect(self.handle)
return RECT(left, top, right, bottom)
else:
... |
java | @Override
public ServerConfiguration read() throws ConfigurationException {
String defaultXmlLocation = "/appsensor-server-config.xml";
String defaultXsdLocation = "/appsensor_server_config_2.0.xsd";
return read(defaultXmlLocation, defaultXsdLocation);
} |
python | def transform(self, X=None, y=None):
"""
Transform an image using an Affine transform with the given
rotation parameters. Return the transform if X=None.
Arguments
---------
X : ANTsImage
Image to transform
y : ANTsImage (optional)
Anot... |
java | public static TimecodeRange merge(TimecodeRange a, TimecodeRange b)
{
final Timecode start = TimecodeComparator.min(a.getStart(), b.getStart());
final Timecode end = TimecodeComparator.max(a.getEnd(), b.getEnd());
return new TimecodeRange(start, end);
} |
java | public PutPlaybackConfigurationResult withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} |
python | def fetch_bug_details(self, bug_ids):
"""Fetches bug metadata from bugzilla and returns an encoded
dict if successful, otherwise returns None."""
params = {'include_fields': 'product, component, priority, whiteboard, id'}
params['id'] = bug_ids
try:
response = sel... |
java | private RaftServiceContext getOrInitializeService(PrimitiveId primitiveId, PrimitiveType primitiveType, String serviceName, byte[] config) {
// Get the state machine executor or create one if it doesn't already exist.
RaftServiceContext service = raft.getServices().getService(serviceName);
if (service == nu... |
python | def mp_iuwt_recomposition(in1, scale_adjust, core_count, smoothed_array):
"""
This function calls the a trous algorithm code to recompose the input into a single array. This is the
implementation of the isotropic undecimated wavelet transform recomposition for multiple CPU cores.
INPUTS:
in1 ... |
python | def calculate_concat_output_shapes(operator):
'''
Allowed input/output patterns are
1. [N_1, C, H, W], ..., [N_n, C, H, W] ---> [N_1 + ... + N_n, C, H, W]
2. [N, C_1, H, W], ..., [N, C_n, H, W] ---> [N, C_1 + ... + C_n, H, W]
'''
check_input_and_output_numbers(operator, input_count_range... |
python | def merge_radia(job, perchrom_rvs):
"""
This module will merge the per-chromosome radia files created by spawn_radia into a genome vcf.
It will make 2 vcfs, one for PASSing non-germline calls, and one for all calls.
ARGUMENTS
1. perchrom_rvs: REFER RETURN VALUE of spawn_radia()
RETURN VALUES
... |
java | public boolean isJavaSwitchExpression(final XSwitchExpression it) {
boolean _xblockexpression = false;
{
final LightweightTypeReference switchType = this.getSwitchVariableType(it);
if ((switchType == null)) {
return false;
}
boolean _isSubtypeOf = switchType.isSubtypeOf(Integer.T... |
python | def subdispatch_to_all_initiatortransfer(
payment_state: InitiatorPaymentState,
state_change: StateChange,
channelidentifiers_to_channels: ChannelMap,
pseudo_random_generator: random.Random,
) -> TransitionResult[InitiatorPaymentState]:
events = list()
''' Copy and iterate over t... |
python | def __get_header_with_auth(self):
"""
This private method returns the HTTP heder filled with the Authorization information with the user token.
The token validity is monitored whenever this function is called, so according to the swagger page of TheTVDB
(https://api.thetvdb.com/swagger) ... |
java | public WrappedByteBuffer compact() {
int remaining = remaining();
int capacity = capacity();
if (capacity == 0) {
return this;
}
if (remaining <= capacity >>> 2 && capacity > _minimumCapacity) {
int newCapacity = capacity;
int minCapacity = m... |
python | def request(self, config, format='xml', target='candidate', default_operation=None,
test_option=None, error_option=None):
"""Loads all or part of the specified *config* to the *target* configuration datastore.
*target* is the name of the configuration datastore being edited
*config... |
java | public static HELM2Notation getSirnaNotation(String senseSeq, String antiSenseSeq, String rnaDesignType)
throws NotationException, FastaFormatException, HELM2HandledException, RNAUtilsException,
org.helm.notation2.exception.NotationException, ChemistryException, CTKException,
NucleotideLoadingException {
... |
java | public static ConnectionHandler register(final String id,
final StatementHandler handler) {
if (handler == null) {
throw new IllegalArgumentException("Invalid handler: " + handler);
} // end of if
return register(id, new ConnectionHandl... |
python | def unfold(tensor, mode):
"""Returns the mode-`mode` unfolding of `tensor`.
Parameters
----------
tensor : ndarray
mode : int
Returns
-------
ndarray
unfolded_tensor of shape ``(tensor.shape[mode], -1)``
Author
------
Jean Kossaifi <https://github.com/tensorly>
... |
java | protected String tableName(Class<?> entityClass) {
EntityTable entityTable = EntityHelper.getEntityTable(entityClass);
String prefix = entityTable.getPrefix();
if (StringUtil.isEmpty(prefix)) {
//使用全局配置
prefix = mapperHelper.getConfig().getPrefix();
}
if (... |
java | protected DoubleMatrix1D gradFiStepX(DoubleMatrix1D stepX){
DoubleMatrix1D ret = F1.make(getMieq());
for(int i=0; i<getDim(); i++){
ret.setQuick( i, - stepX.getQuick(i));
ret.setQuick(getDim()+i, stepX.getQuick(i));
}
return ret;
} |
python | def jsonmget(self, path, *args):
"""
Gets the objects stored as a JSON values under ``path`` from
keys ``args``
"""
pieces = []
pieces.extend(args)
pieces.append(str_path(path))
return self.execute_command('JSON.MGET', *pieces) |
java | protected void updateMetricCounters(String metricName, Map<String, Integer> metricNameCounters) {
if (metricNameCounters.containsKey(metricName)) {
metricNameCounters.put(metricName, metricNameCounters.get(metricName) + 1);
} else {
metricNameCounters.put(metricName, 1);
... |
java | public boolean isInState(JComponent c) {
Component parent = c;
while (parent.getParent() != null) {
if (parent instanceof RootPaneContainer) {
break;
}
parent = parent.getParent();
}
if (parent instanceof JFrame) {
retur... |
java | private static String keyToGoWithElementsString(String label, DuplicateGroupedAndTyped elements) {
/*
* elements.toString(), which the caller is going to use, includes the homogeneous type (if
* any), so we don't want to include it here. (And it's better to have it in the value, rather
* than in the ... |
python | def _find_base_type(data_type):
"""Find the Nani's base type for a given data type.
This is useful when Nani's data types were subclassed and the original type
is required.
"""
bases = type(data_type).__mro__
for base in bases:
if base in _ALL:
return base
return None |
java | public void deleteLaunchConfiguration(String launchConfigName) {
final AmazonAutoScaling autoScaling = getAmazonAutoScalingClient();
final DeleteLaunchConfigurationRequest deleteLaunchConfigurationRequest = new DeleteLaunchConfigurationRequest()
.withLaunchConfigurationName(launchConfigName);
aut... |
python | def min_date(self, symbol):
"""
Return the minimum datetime stored for a particular symbol
Parameters
----------
symbol : `str`
symbol name for the item
"""
res = self._collection.find_one({SYMBOL: symbol}, projection={ID: 0, START: 1},
... |
python | def spawn_background_process(func, *args, **kwargs):
"""
Run a function in the background
(like rebuilding some costly data structure)
References:
http://stackoverflow.com/questions/2046603/is-it-possible-to-run-function-in-a-subprocess-without-threading-or-writing-a-se
http://stackover... |
python | def fetch(self, obj, include_meta=False, chunk_size=None, size=None,
extra_info=None):
"""
Fetches the object from storage.
If 'include_meta' is False, only the bytes representing the
stored object are returned.
Note: if 'chunk_size' is defined, you must fully read ... |
java | synchronized void computeTrees() {
boolean changed;
try {
createBuffers();
do {
switchBuffers();
changed = computeOneLevel();
//System.out.println("Tree obj. "+heap.idToOffsetMap.treeObj);
//if (changed) System.out.println("Next level "+nextLeve... |
python | def metadata_extractor(self):
"""Returns an instance of proper MetadataExtractor subclass.
Always returns the same instance.
Returns:
The proper MetadataExtractor subclass according to local file
suffix.
"""
if not hasattr(self, '_local_file'):
... |
java | List<Long> includeUpdateBatch(TableKeyBatch batch, long batchOffset, int generation) {
val result = new ArrayList<Long>(batch.getItems().size());
synchronized (this) {
for (TableKeyBatch.Item item : batch.getItems()) {
long itemOffset = batchOffset + item.getOffset();
... |
java | public BeanType<ValidationMappingDescriptor> getOrCreateBean()
{
List<Node> nodeList = model.get("bean");
if (nodeList != null && nodeList.size() > 0)
{
return new BeanTypeImpl<ValidationMappingDescriptor>(this, "bean", model, nodeList.get(0));
}
return createBean();
} |
python | def robust_backtrack(self):
"""Estimate step size L by computing a linesearch that
guarantees that F <= Q according to the robust FISTA
backtracking strategy in :cite:`florea-2017-robust`.
This also updates all the supporting variables.
"""
self.L *= self.L_gamma_d
... |
java | public final void intialize() throws IllegalStateException {
synchronized (this) {
if (tracker != null) {
throw new IllegalStateException(
"DelegatingComponentInstanciationListener [" + this + "] had been initialized.");
}
tracker = new... |
python | def get_vsan_enabled(host, username, password, protocol=None, port=None, host_names=None):
'''
Get the VSAN enabled status for a given host or a list of host_names. Returns ``True``
if VSAN is enabled, ``False`` if it is not enabled, and ``None`` if a VSAN Host Config
is unset, per host.
host
... |
java | protected void initCDIIntegration(
ServletContext servletContext, ExternalContext externalContext)
{
// Lookup bean manager and put it into an application scope attribute to
// access it later. Remember the trick here is do not call any CDI api
// directly, so if no CDI api is ... |
python | def createObjBuilders(env):
"""This is a utility function that creates the StaticObject
and SharedObject Builders in an Environment if they
are not there already.
If they are there already, we return the existing ones.
This is a separate function because soooo many Tools
use this functionality... |
java | int getChainUserIndex(int chain, int index) {
int i = getChainIndex_(chain);
AttributeStreamOfInt32 stream = m_chainIndices.get(index);
if (stream.size() <= i)
return -1;
return stream.read(i);
} |
python | def _find_parent_directory(directory, filename):
"""Find a directory in parent tree with a specific filename
:param directory: directory name to find
:param filename: filename to find
:returns: absolute directory path
"""
parent_directory = directory
absolute_dir... |
java | public static <T> Collection<T> filter(Collection<T> collection, Editor<T> editor) {
if (null == collection || null == editor) {
return collection;
}
Collection<T> collection2 = ObjectUtil.clone(collection);
try {
collection2.clear();
} catch (UnsupportedOperationException e) {
// 克隆后的对象不支持... |
java | public static String stripNonValidXMLCharacters(String input) {
if (input == null || ("".equals(input)))
return "";
StringBuilder out = new StringBuilder();
char current;
for (int i = 0; i < input.length(); i++) {
current = input.charAt(i);
if ((current == 0x9) || (current == 0xA) || (current == 0xD)
... |
python | def get_uid_state(self, id_or_uri):
"""
Retrieves the unit identification (UID) state (on, off, unknown) of the specified power outlet or extension bar
resource. The device must be an HP iPDU component with a locator light (HP Intelligent Load Segment,
HP AC Module, HP Intelligent Outlet... |
python | def probability(self, direction, mechanism, purview):
"""Probability that the purview is in it's current state given the
state of the mechanism.
"""
repertoire = self.repertoire(direction, mechanism, purview)
return self.state_probability(direction, repertoire, purview) |
python | def analyze(self, scratch, **kwargs):
"""Run and return the results from the BroadcastReceive plugin."""
all_scripts = list(self.iter_scripts(scratch))
results = defaultdict(set)
broadcast = dict((x, self.get_broadcast_events(x)) # Events by script
for x in all_... |
python | def get_column(self, column_name, column_type, index, verbose=True):
"""Summary
Args:
column_name (TYPE): Description
column_type (TYPE): Description
index (TYPE): Description
Returns:
TYPE: Description
"""
return LazyOpResult(
... |
python | def span_context_from_string(value):
"""
Decode span ID from a string into a TraceContext.
Returns None if the string value is malformed.
:param value: formatted {trace_id}:{span_id}:{parent_id}:{flags}
"""
if type(value) is list and len(value) > 0:
# sometimes headers are presented as ... |
python | def pandas_df(self):
"""
Returns pandas DataFrame containing pixel counts for all truth classes,
classified classes (for each truth class), and file name of the input
EODataSet.
The data frame thus contains
N = self.n_validation_sets rows
and
M = len(... |
java | public Result<V,E> put(
K key,
Refresher<? super K,? extends V,? extends E> refresher
) {
Result<V,E> result = runRefresher(refresher, key);
put(key, refresher, result);
return result;
} |
python | def request_sync_events(blink, network):
"""
Request events from sync module.
:param blink: Blink instance.
:param network: Sync module network id.
"""
url = "{}/events/network/{}".format(blink.urls.base_url, network)
return http_get(blink, url) |
python | def add_configuration_file(self, file_name):
'''Register a file path from which to read parameter values.
This method can be called multiple times to register multiple files for
querying. Files are expected to be ``ini`` formatted.
No assumptions should be made about the order that th... |
python | def _add_event_in_element(self, element, event):
"""
Add a type of event in element.
:param element: The element.
:type element: hatemile.util.html.htmldomelement.HTMLDOMElement
:param event: The type of event.
:type event: str
"""
if not self.main_scrip... |
java | @Override
public QOr appendSQL(final SQLSelect _sql)
throws EFapsException
{
_sql.addPart(SQLPart.PARENTHESIS_OPEN);
boolean first = true;
for (final AbstractQPart part : getParts()) {
if (first) {
first = false;
} else {
_s... |
python | def _set_interface_PO_ospf_conf(self, v, load=False):
"""
Setter method for interface_PO_ospf_conf, mapped from YANG variable /interface/port_channel/ip/interface_PO_ospf_conf (container)
If this variable is read-only (config: false) in the
source YANG file, then _set_interface_PO_ospf_conf is considere... |
python | def fail(self, key, **kwargs):
"""A helper method that simply raises a `ValidationError`.
"""
try:
msg = self.error_messages[key]
except KeyError:
class_name = self.__class__.__name__
msg = MISSING_ERROR_MESSAGE.format(class_name=class_name,
... |
python | def torrent_from_url(self, url, cache=True, prefetch=False):
"""Create a Torrent object from a given URL.
If the cache option is set, check to see if we already have a Torrent
object representing it. If prefetch is set, automatically query the
torrent's info page to fill in the torrent ... |
python | def _available(name, ret):
'''
Check if the service is available
'''
avail = False
if 'service.available' in __salt__:
avail = __salt__['service.available'](name)
elif 'service.get_all' in __salt__:
avail = name in __salt__['service.get_all']()
if not avail:
ret['resu... |
java | public List<IntentClassifier> listCustomPrebuiltIntents(UUID appId, String versionId) {
return listCustomPrebuiltIntentsWithServiceResponseAsync(appId, versionId).toBlocking().single().body();
} |
java | public SipURI createSipURI(String user, String host) {
if (logger.isDebugEnabled()) {
logger.debug("Creating SipURI from USER[" + user + "] HOST[" + host
+ "]");
}
// Fix for http://code.google.com/p/sipservlets/issues/detail?id=145
if(user != null && user.trim().isEmpty()) {
user = null;
}
t... |
python | def detect_blob(self, img, filters):
"""
"filters" must be something similar to:
filters = {
'R': (150, 255), # (min, max)
'S': (150, 255),
}
"""
acc_mask = ones(img.shape[:2], dtype=uint8) * 255
rgb = img.copy()
... |
java | public Variable createPipelineScheduleVariable(Object projectIdOrPath, Integer pipelineScheduleId,
String key, String value) throws GitLabApiException {
GitLabApiForm formData = new GitLabApiForm()
.withParam("key", key, true)
.withParam("value", value, true);
... |
python | def create_qualification_type(Name=None, Keywords=None, Description=None, QualificationTypeStatus=None, RetryDelayInSeconds=None, Test=None, AnswerKey=None, TestDurationInSeconds=None, AutoGranted=None, AutoGrantedValue=None):
"""
The CreateQualificationType operation creates a new Qualification type, which is ... |
java | protected void logParameterError(final Object caller, final Object[] parameters, final boolean inJavaScriptContext) {
logParameterError(caller, parameters, "Unsupported parameter combination/count in", inJavaScriptContext);
} |
java | @Override
public Stream<T> queued(int queueSize) {
final Iterator<T> iter = iterator();
if (iter instanceof QueuedIterator && ((QueuedIterator<? extends T>) iter).max() >= queueSize) {
return newStream(elements, sorted, cmp);
} else {
return newStream(Stream.p... |
python | def close(self):
"""Disposes of any internal state.
Currently, this closes the PoolManager and any active ProxyManager,
which closes any pooled connections.
"""
self.poolmanager.clear()
for proxy in self.proxy_manager.values():
proxy.clear() |
python | def has_authority_over(self, url):
"""Return True of the current master has authority over url.
In strict mode checks scheme, server and path. Otherwise checks
just that the server names match or the query url is a
sub-domain of the master.
"""
s = urlparse(url)
... |
python | def write_base (self, url_data):
"""Write url_data.base_ref."""
self.writeln(u"<tr><td>"+self.part("base")+u"</td><td>"+
cgi.escape(url_data.base_ref)+u"</td></tr>") |
java | public void accept(XVisitor visitor, XLog log) {
/*
* First call.
*/
visitor.visitTracePre(this, log);
/*
* Visit the attributes.
*/
for (XAttribute attribute: attributes.values()) {
attribute.accept(visitor, this);
}
/*
* Visit the events.
*/
for (XEvent event: this) {
event.accep... |
java | private void checkQueueSize() {
int queueSize = getQueueSize();
if (SEND_QUEUE_SIZE_WARNING_THRESHOLD > 0 && queueSize >= SEND_QUEUE_SIZE_WARNING_THRESHOLD) {
logger.warn("The Gerrit send commands queue contains {} items!"
+ " Something might be stuck, or your system can'... |
python | def read_discrete_trajectory(filename):
"""Read discrete trajectory from ascii file.
The ascii file containing a single column with integer entries is
read into an array of integers.
Parameters
----------
filename : str
The filename of the discrete state trajectory file.
The fi... |
python | def addDocEntity(self, name, type, ExternalID, SystemID, content):
"""Register a new entity for this document. """
ret = libxml2mod.xmlAddDocEntity(self._o, name, type, ExternalID, SystemID, content)
if ret is None:raise treeError('xmlAddDocEntity() failed')
__tmp = xmlEntity(_obj=ret)
... |
python | def view_admin_log():
"""Page for viewing the log of admin activity."""
build = g.build
# TODO: Add paging
log_list = (
models.AdminLog.query
.filter_by(build_id=build.id)
.order_by(models.AdminLog.created.desc())
.all())
return render_template(
'view_admin... |
python | def _carregar(self):
"""Carrega (ou recarrega) a biblioteca SAT. Se a convenção de chamada
ainda não tiver sido definida, será determinada pela extensão do
arquivo da biblioteca.
:raises ValueError: Se a convenção de chamada não puder ser determinada
ou se não for um valor v... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.