language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def identifier(self):
"""Get the identifier for this node.
Extended keys can be identified by the Hash160 (RIPEMD160 after SHA256)
of the public key's `key`. This corresponds exactly to the data used in
traditional Bitcoin addresses. It is not advised to represent this data
in b... |
python | def add_file(self, kitchen, recipe, message, api_file_key, file_contents):
"""
returns True for success or False for failure
'/v2/recipe/create/<string:kitchenname>/<string:recipename>', methods=['PUT']
:param self: DKCloudAPI
:param kitchen: basestring
:param recipe: bas... |
java | public final void addAreaListener(@NonNull final AreaListener listener) {
Condition.INSTANCE.ensureNotNull(listener, "The listener may not be null");
this.areaListeners.add(listener);
} |
java | public float getSpanPercent(ILexNameToken name)
{
int hits = 0;
int misses = 0;
ILexLocation span = null;
synchronized (nameSpans)
{
span = nameSpans.get(name);
}
synchronized (allLocations)
{
for (ILexLocation l : allLocations)
{
if (l.getExecutable() && l.within(span))
{
if (... |
java | public BatchReadResult withResponses(BatchReadOperationResponse... responses) {
if (this.responses == null) {
setResponses(new java.util.ArrayList<BatchReadOperationResponse>(responses.length));
}
for (BatchReadOperationResponse ele : responses) {
this.responses.add(ele);... |
java | public void setHashFunction(HashFunction<byte[]> hashFunction) {
if(hashFunction == null) {
throw new IllegalArgumentException("Invalid hashFunction: " + hashFunction);
}
this._hashFunction = hashFunction;
this._properties.setProperty(PARAM_HASH_FUNCTION_CLASS, hashF... |
java | public void run(Collection<Runnable> tasks) {
// Create a semphore that the wrapped runnables will execute
int numTasks = tasks.size();
CountDownLatch latch = new CountDownLatch(numTasks);
for (Runnable r : tasks) {
if (r == null)
throw new NullPointerExceptio... |
python | def unregister(self, cleanup_mode):
"""Unregisters a machine previously registered with
:py:func:`IVirtualBox.register_machine` and optionally do additional
cleanup before the machine is unregistered.
This method does not delete any files. It only changes the machine configurat... |
java | Rule Gracing() {
return FirstOf(String("."),
String("!>!"),
String("!<!"),
String("!+!"),
String("+>+"),
String("+<+"),
SequenceS(String("!"),
OptionalS(AnyOf("^<>_@").label(Position)),
LongGracing(),
String("!")),
//for compatibility
SequenceS(String("+")... |
python | def colorize_log_entry(self, string):
"""
Apply various heuristics to return a colorized version of a string.
If these fail, simply return the string in plaintext.
"""
final_string = string
try:
# First, do stuff in square brackets
inside_squares... |
java | protected Coordinate getWorldPosition(MouseEvent<?> event) {
Coordinate world = super.getWorldPosition(event);
if (snappingActive) {
return snapper.snap(world);
}
return world;
} |
java | public WePayOrder queryByTransactionId(String transactionId){
checkNotNullAndEmpty(transactionId, "transactionId");
Map<String, String> queryParams = new TreeMap<>();
put(queryParams, WepayField.TRANSACTION_ID, transactionId);
return doQueryOrder(queryParams);
} |
java | @Inline(value = "VMCommandLine.launchVMWithClassPath(($1), System.getProperty(\"java.class.path\"), ($2))",
imported = {VMCommandLine.class}, statementExpression = true)
public static Process launchVM(String classToLaunch, String... additionalParams) throws IOException {
return launchVMWithClassPath(
classToL... |
java | private void put(
K key,
Refresher<? super K,? extends V,? extends E> refresher,
Result<V,E> result
) {
CacheEntry entry = new CacheEntry(key, refresher, result);
map.put(key, entry);
timer.schedule(entry, new Date(System.currentTimeMillis() + refreshInterval), refreshInterval);
} |
java | public static <T> Single<Boolean> put(CacheConfigBean cacheConfigBean, String key, String field, T value) {
return SingleRxXian.call(CacheService.CACHE_SERVICE, "cacheMapPut", new JSONObject() {{
put("cacheConfig", cacheConfigBean);
put("key", key);
put("field", field);
... |
java | @VisibleForTesting
public static FileSystemContext create(Subject subject, MasterInquireClient masterInquireClient,
AlluxioConfiguration alluxioConf) {
FileSystemContext context = new FileSystemContext(subject, alluxioConf);
context.init(masterInquireClient);
return context;
} |
java | @Override
public UpdateIntegrationResult updateIntegration(UpdateIntegrationRequest request) {
request = beforeClientExecution(request);
return executeUpdateIntegration(request);
} |
java | public Vector2d mulDirection(Matrix3x2dc mat, Vector2d dest) {
double rx = mat.m00() * x + mat.m10() * y;
double ry = mat.m01() * x + mat.m11() * y;
dest.x = rx;
dest.y = ry;
return dest;
} |
python | async def connect_controller(self, controller_name=None):
"""Connect to a controller by name. If the name is empty, it
connect to the current controller.
"""
if not controller_name:
controller_name = self.jujudata.current_controller()
if not controller_name:
... |
java | @Override
public void update(IPermission perm) throws AuthorizationException {
Connection conn = null;
try {
conn = RDBMServices.getConnection();
String sQuery = getUpdatePermissionSql();
if (log.isDebugEnabled()) log.debug("RDBMPermissionImpl.update(): " + sQuer... |
python | def autodiscover_modules():
"""
Goes and imports the permissions submodule of every app in INSTALLED_APPS
to make sure the permission set classes are registered correctly.
"""
import imp
from django.conf import settings
for app in settings.INSTALLED_APPS:
try:
__import__... |
python | def _handle_display_data(self, msg):
"""
Reimplemented to handle communications between the figure explorer
and the kernel.
"""
img = None
data = msg['content']['data']
if 'image/svg+xml' in data:
fmt = 'image/svg+xml'
img = data['image/svg... |
python | def get(self, key, default=None):
"""Get value with optional default."""
try:
key = self.get_key(key)
except KeyError:
return default
return super(DatasetDict, self).get(key, default) |
python | def persistent_modprobe(module):
"""Load a kernel module and configure for auto-load on reboot."""
if not os.path.exists('/etc/rc.modules'):
open('/etc/rc.modules', 'a')
os.chmod('/etc/rc.modules', 111)
with open('/etc/rc.modules', 'r+') as modules:
if module not in modules.read():
... |
python | def list_catalogs(results=30, start=0):
"""
Returns list of all catalogs created on this API key
Args:
Kwargs:
results (int): An integer number of results to return
start (int): An integer starting value for the result set
Returns:
A list of catalog objects
Example:
... |
python | def _set_system_monitor_mail(self, v, load=False):
"""
Setter method for system_monitor_mail, mapped from YANG variable /system_monitor_mail (container)
If this variable is read-only (config: false) in the
source YANG file, then _set_system_monitor_mail is considered as a private
method. Backends lo... |
python | def actionAngle_physical_input(method):
"""Decorator to convert inputs to actionAngle functions from physical
to internal coordinates"""
@wraps(method)
def wrapper(*args,**kwargs):
if len(args) < 3: # orbit input
return method(*args,**kwargs)
ro= kwargs.get('ro',None)
... |
python | def to_digital(d, num):
"""
进制转换,从10进制转到指定机制
:param d:
:param num:
:return:
"""
if not isinstance(num, int) or not 1 < num < 10:
raise ValueError('digital num must between 1 and 10')
d = int(d)
result = []
x = d % num
d = d - x
result.append(str(x))
while d >... |
java | private int nextNonWhitespace(boolean throwOnEof)
{
/*
* This code uses ugly local variables 'p' and 'l' representing the 'pos'
* and 'limit' fields respectively. Using locals rather than fields saves
* a few field reads for each whitespace character in a pretty-printed
* document, resulting i... |
python | def convert(libsvm_model, feature_names, target, input_length, probability):
"""Convert a svm model to the protobuf spec.
This currently supports:
* C-SVC
* nu-SVC
* Epsilon-SVR
* nu-SVR
Parameters
----------
model_path: libsvm_model
Libsvm representation of the mode... |
java | public List<JAXBElement<Object>> get_GenericApplicationPropertyOfTexture() {
if (_GenericApplicationPropertyOfTexture == null) {
_GenericApplicationPropertyOfTexture = new ArrayList<JAXBElement<Object>>();
}
return this._GenericApplicationPropertyOfTexture;
} |
java | public ServiceFuture<List<SourceControlInner>> listSourceControlsNextAsync(final String nextPageLink, final ServiceFuture<List<SourceControlInner>> serviceFuture, final ListOperationCallback<SourceControlInner> serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listSourceControlsNextSing... |
python | def _get_fs(self, key: str, dms: bool = False) -> Union[str, float]:
"""Get float number.
:param key: Key (`lt` or `lg`).
:param dms: DMS format.
:return: Float number
"""
# Default range is a range of longitude.
rng = (-90, 90) if key == 'lt' else (-180, 180)
... |
java | private void checkFirmwareVersion() {
Log.i(TAG, "Checking Firmware version...");
setState(OADState.CHECKING_FW_VERSION);
mGattClient.getDeviceProfile().getFirmwareVersion(new DeviceProfile.VersionCallback() {
@Override
public void onComplete(String version) {
... |
python | def _activity_helper(modifier: str, location=None):
"""Make an activity dictionary.
:param str modifier:
:param Optional[dict] location: An entity from :func:`pybel.dsl.entity`
:rtype: dict
"""
rv = {MODIFIER: modifier}
if location:
rv[LOCATION] = location
return rv |
java | public void set( long x ) {
CAT newcat = new CAT(null,4,x);
// Spin until CAS works
while( !CAS_cat(_cat,newcat) ) {/*empty*/}
} |
python | def _default_client(jws_client, reactor, key, alg):
"""
Make a client if we didn't get one.
"""
if jws_client is None:
pool = HTTPConnectionPool(reactor)
agent = Agent(reactor, pool=pool)
jws_client = JWSClient(HTTPClient(agent=agent), key, alg)
return jws_client |
python | def get_rec_dtype(self, **keys):
"""
Get the dtype for the specified columns
parameters
----------
colnums: integer array
The column numbers, 0 offset
vstorage: string, optional
See docs in read_columns
"""
colnums = keys.get('coln... |
java | private static final boolean filterTerminal(Atom[] ca1, Atom[] ca2, int p1b, int p1e, int p2b, int p2e, int fragLen, int minLen)
{
int d1 = (p1b < p2b)?p1b:p2b;
int d2 = (ca1.length - p1e) < (ca2.length - p2e)?(ca1.length - p1e):(ca2.length - p2e);
int d3 = d1 + d2 + fragLen; //maximum alignment len... |
java | public static void addThreadIdentityService(ThreadIdentityService tis) {
if (tis != null) {
threadIdentityServices.add(tis);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "A ThreadIdentityService implementation was added.", tis.getClass()... |
java | public ServiceFuture<CertificateBundle> mergeCertificateAsync(String vaultBaseUrl, String certificateName, List<byte[]> x509Certificates, final ServiceCallback<CertificateBundle> serviceCallback) {
return ServiceFuture.fromResponse(mergeCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, x509Cert... |
python | def modify(self, current_modified_line, anchors, file_path, file_lines=None,
index=None):
"""
Replace all AnchorHub tag-using inline links in this line and edit
them to use
:param current_modified_line: string representing the the line at
file_lines[index] _af... |
python | def poll_parser(poll):
"""
Parses a poll object
"""
if __is_deleted(poll):
return deleted_parser(poll)
if poll['type'] not in poll_types:
raise Exception('Not a poll type')
return Poll(
poll['id'],
poll['by'],
__check_key('kids', poll), # poll and pollopt... |
java | private boolean runMulti(boolean auto, RateLimiter rateLimiter)
{
if (settings.command.targetUncertainty >= 0)
output.println("WARNING: uncertainty mode (err<) results in uneven workload between thread runs, so should be used for high level analysis only");
int prevThreadCount = -1;
... |
python | def parse_string_expr(self, string_expr_node):
""" Parse a string node content. """
string_expr_node_value = string_expr_node['value']
string_expr_str = string_expr_node_value[1:-1]
# Care escaped string literals
if string_expr_node_value[0] == "'":
string_expr_str =... |
java | public static CoreDictionary.Attribute getAttribute(String word)
{
CoreDictionary.Attribute attribute = CoreDictionary.get(word);
if (attribute != null) return attribute;
return CustomDictionary.get(word);
} |
java | public static <E> ArraySet<E> newArraySet(E... elements) {
int capacity = elements.length * 4 / 3 + 1;
ArraySet<E> set = new ArraySet<E>(capacity);
Collections.addAll(set, elements);
return set;
} |
java | public static String locateOrCreateDirectory(String dirName) throws IOException {
String path = locateDirectory(dirName);
if (path == null) {
File file = new File(dirName);
file.mkdirs();
path = file.getCanonicalPath();
}
return path;
} |
java | public static SSLSessionStrategy build(String trustStore,
String trustStorePassword,
String keyStore,
String keyStorePassword,
String[] keyAliases,
String keyPassword,
String[] allowedProtocols,
String[] allowedCiphers,
bool... |
java | public void endDiff() throws DiffException {
DOMSource source = new DOMSource(doc);
try {
transformer.transform(source, result);
} catch (TransformerException te) {
throw new DiffException(te);
}
} |
python | def from_rotation_vector(rot):
"""Convert input 3-vector in axis-angle representation to unit quaternion
Parameters
----------
rot: (Nx3) float array
Each vector represents the axis of the rotation, with norm
proportional to the angle of the rotation in radians.
Returns
-------... |
java | private String parse(Matrix matrix) {
String transform = "";
if (matrix != null) {
double dx = matrix.getDx();
double dy = matrix.getDy();
if (matrix.getXx() != 0 && matrix.getYy() != 0 && matrix.getXx() != 1 && matrix.getYy() != 1) {
transform += "scale(" + matrix.getXx() + ", " + matrix.getYy() + ")"... |
python | def subcorpus(self, selector):
"""
Generates a new :class:`.Corpus` using the criteria in ``selector``.
Accepts selector arguments just like :meth:`.Corpus.select`\.
.. code-block:: python
>>> corpus = Corpus(papers)
>>> subcorpus = corpus.subcorpus(('date', 199... |
python | def _all_params(arr):
"""
Ensures that the argument is a list that either is empty or contains only GPParamSpec's
:param arr: list
:return:
"""
if not isinstance([], list):
raise TypeError("non-list value found for parameters")
return all(isinstance(x,... |
java | @Override
public R visitErroneous(ErroneousTree node, P p) {
return defaultAction(node, p);
} |
python | def close(self):
"""
Disconnect and error-out all requests.
"""
with self.lock:
if self.is_closed:
return
self.is_closed = True
log.debug("Closing connection (%s) to %s", id(self), self.endpoint)
reactor.callFromThread(self.connect... |
python | def __raise_file_system_exception(self, item, directory):
"""
Raises a common fileSystem exception.
:param item: Name of the item generating the exception.
:type item: unicode
:param directory: Name of the target directory.
:type directory: unicode
"""
p... |
java | protected void subAppend(final LoggingEvent event) {
// The rollover check must precede actual writing. This is the
// only correct behavior for time driven triggers.
AccessController.doPrivileged(new PrivilegedAction<Void>() {
@Override
public Void run() {
... |
java | private static DefaultDirectedGraph<ClassExpression,DefaultEdge> getClassGraph (OntologyImpl.UnclassifiedOntologyTBox ontology,
DefaultDirectedGraph<ObjectPropertyExpression,DefaultEdge> objectPropertyGraph,
DefaultDirectedGraph<DataPropertyExpression,DefaultEdge> dataPropertyG... |
java | public void detachEdge(SquareEdge edge) {
edge.a.edges[edge.sideA] = null;
edge.b.edges[edge.sideB] = null;
edge.distance = 0;
edgeManager.recycleInstance(edge);
} |
python | def _dispatch(self):
"""Run the dispatch() method on all ingredients."""
for ingredient in self.ingredients:
result = ingredient.dispatch(self.context)
if result is not None:
return result |
python | def main(args=None):
"""Main command-line interface entrypoint.
Runs the given subcommand or argument that were specified. If not given a
``args`` parameter, assumes the arguments are passed on the command-line.
Args:
args (list): list of command-line arguments
Returns:
Zero on succe... |
python | def get_resource_allocation(self):
"""Get the :py:class:`ResourceAllocation` element tance.
Returns:
ResourceAllocation: Resource allocation used to access information about the resource where this PE is running.
.. versionadded:: 1.9
"""
if hasattr(self, 'resourceA... |
python | def fit(self, train_X, train_Y, val_X=None, val_Y=None, graph=None):
"""Fit the model to the data.
Parameters
----------
train_X : array_like, shape (n_samples, n_features)
Training data.
train_Y : array_like, shape (n_samples, n_classes)
Training label... |
python | def get_value_from_schema(schema, definition: dict, key: str,
definition_key: str):
"""Gets a value from a schema and definition.
If the value has references it will recursively attempt to resolve them.
:param ResourceSchema schema: The resource schema.
:param dict definition... |
python | def encode_to_sha(msg):
"""coerce numeric list inst sha-looking bytearray"""
if isinstance(msg, str):
msg = msg.encode('utf-8')
return (codecs.encode(msg, "hex_codec") + (b'00' * 32))[:64] |
python | def read_csv_as_integer(csv_name, integer_columns, usecols=None):
"""Returns a DataFrame from a .csv file stored in /data/raw/.
Converts columns specified by 'integer_columns' to integer.
"""
csv_path = os.path.join(DATA_FOLDER, csv_name)
csv = pd.read_csv(csv_path, low_memory=False, usecols=usecols... |
python | def create_api_key(self, api_id, stage_name):
"""
Create new API key and link it with an api_id and a stage_name
"""
response = self.apigateway_client.create_api_key(
name='{}_{}'.format(stage_name, api_id),
description='Api Key for {}'.format(api_id),
... |
java | public List<CallbackMetadata> getCallbacks(CallbackType callbackType) {
return callbacks == null ? null : callbacks.get(callbackType);
} |
java | public static int cs_fkeep(Scs A, Scs_ifkeep fkeep, Object other) {
int j, p, nz = 0, n, Ap[], Ai[];
float Ax[];
if (!Scs_util.CS_CSC(A))
return (-1); /* check inputs */
n = A.n;
Ap = A.p;
Ai = A.i;
Ax = A.x;
for (j = 0; j < n; j++) {
... |
python | def API520_F2(k, P1, P2):
r'''Calculates coefficient F2 for subcritical flow for use in API 520
subcritical flow relief valve sizing.
.. math::
F_2 = \sqrt{\left(\frac{k}{k-1}\right)r^\frac{2}{k}
\left[\frac{1-r^\frac{k-1}{k}}{1-r}\right]}
.. math::
r = \frac{P_2}{P_1}
Par... |
python | def point_within_radius(self, points, pt, canvas_radius,
scales=(1.0, 1.0)):
"""Points `points` and point `pt` are in data coordinates.
Return True for points within the circle defined by
a center at point `pt` and within canvas_radius.
"""
scale_x, sc... |
java | public int getThisTaskIndex() {
List<Integer> tasks = new ArrayList<>(getComponentTasks(getThisComponentId()));
Collections.sort(tasks);
for (int i = 0; i < tasks.size(); i++) {
if (tasks.get(i) == getThisTaskId()) {
return i;
}
}
throw new... |
python | def update_average_model(self, model):
""" Update weights of the average model with new model observation """
for model_param, average_param in zip(model.parameters(), self.average_model.parameters()):
# EWMA average model update
average_param.data.mul_(self.average_model_alpha).... |
java | protected List<String> getCandidateConfigurations(AnnotationMetadata metadata,
AnnotationAttributes attributes) {
List<String> configurations = SpringFactoriesLoader.loadFactoryNames(
getSpringFactoriesLoaderFactoryClass(), getBeanClassLoader());
Assert.notEmpty(configurations,
"No auto configuration cla... |
python | def add_env(self, name, val):
'''Add an environment variable to the docker run invocation
'''
if name in self.env_vars:
raise KeyError(name)
self.env_vars[name] = val |
python | def _get_system():
'''
Get Pure Storage FlashArray configuration
1) From the minion config
pure_tags:
fa:
san_ip: management vip or hostname for the FlashArray
api_token: A valid api token for the FlashArray being managed
2) From environment (PUREFA_IP and PURE... |
java | public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case ID:
return isSetId();
case CATEGORY:
return isSetCategory();
case LABEL:
return isSetLabel();
case THRESHOLD:
return isSetThreshold();
c... |
java | public static <T extends Comparable<? super T>> int compare(T c1, T c2, boolean isNullGreater) {
if (c1 == c2) {
return 0;
} else if (c1 == null) {
return isNullGreater ? 1 : -1;
} else if (c2 == null) {
return isNullGreater ? -1 : 1;
}
return c1.compareTo(c2);
} |
python | def sortByTotal(requestContext, seriesList):
"""
Takes one metric or a wildcard seriesList.
Sorts the list of metrics by the sum of values across the time period
specified.
"""
return list(sorted(seriesList, key=safeSum, reverse=True)) |
python | def create_task(coro, loop):
# pragma: no cover
"""Compatibility wrapper for the loop.create_task() call introduced in
3.4.2."""
if hasattr(loop, 'create_task'):
return loop.create_task(coro)
return asyncio.Task(coro, loop=loop) |
python | def _parse_comma_list(self):
"""Parse a comma seperated list."""
if self._cur_token['type'] not in self._literals:
raise Exception(
"Parser failed, _parse_comma_list was called on non-literal"
" {} on line {}.".format(
repr(self._cur_token[... |
java | private boolean containsCompositeKey(TableInfo tableInfo)
{
return tableInfo.getTableIdType() != null && tableInfo.getTableIdType().isAnnotationPresent(Embeddable.class);
} |
java | @Override
public List<CommerceShipment> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} |
java | public PutRecordsResult withRecords(PutRecordsResultEntry... records) {
if (this.records == null) {
setRecords(new com.amazonaws.internal.SdkInternalList<PutRecordsResultEntry>(records.length));
}
for (PutRecordsResultEntry ele : records) {
this.records.add(ele);
... |
java | public static synchronized IAsyncProvider createInstance() throws AsyncException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(tc, "createInstance");
}
if (instance == null) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()... |
java | public static byte[] streamOut(Object object, boolean compressed) throws IOException {
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
streamOut(bytes, object, compressed);
bytes.flush();
bytes.close();
return bytes.toByteArray();
} |
python | def action_rename(self, courseid, taskid, path, new_path):
""" Delete a file or a directory """
# normalize
path = path.strip()
new_path = new_path.strip()
if not path.startswith("/"):
path = "/" + path
if not new_path.startswith("/"):
new_path = "... |
java | @PUT
@Path("/{repoName}/{repoPath:.*}/")
public Response put(@PathParam("repoName") String repoName, @PathParam("repoPath") String repoPath,
@HeaderParam(ExtHttpHeaders.LOCKTOKEN) String lockTokenHeader, @HeaderParam(ExtHttpHeaders.IF) String ifHeader,
@HeaderParam(ExtHttpHeaders.FILE_NODETYPE) St... |
java | protected String getDnForUser(String userId) {
LdapUserEntity user = (LdapUserEntity) createUserQuery(org.camunda.bpm.engine.impl.context.Context.getCommandContext())
.userId(userId)
.singleResult();
if(user == null) {
return "";
} else {
return user.getDn();
}
} |
java | public void clearCache()
{
// XXX: see if can remove this, and rely on the invocation cache existing
LruCache<Object,I> invocationCache = _invocationCache;
if (invocationCache != null) {
invocationCache.clear();
}
} |
java | @Override
public void deleteProcessInstancesByProcessDefinition(String processDefinitionId, String deleteReason, boolean cascade) {
List<String> processInstanceIds = executionDataManager.findProcessInstanceIdsByProcessDefinitionId(processDefinitionId);
for (String processInstanceId : processInstanceIds) {
... |
python | def eventFilter(self, object, event):
"""
Filters the events for the editors to control how the cursor
flows between them.
:param object | <QtCore.QObject>
event | <QtCore.QEvent>
:return <bool> | consumed
"""
inde... |
java | protected synchronized ClientProtocol createNameNodeProxy(UnixUserGroupInformation ugi
) throws IOException {
if (nnProxy != null) {
return nnProxy;
}
ServletContext context = getServletContext();
InetSocketAddress nnAddr = (InetSocketAddress)context.getAttribute("name.node.address");
if... |
java | public final ValueWithPos<String> formatDin5008WithPos(final ValueWithPos<String> pphoneNumber,
final String pcountryCode) {
return valueWithPosDefaults(this.formatDin5008WithPos(
this.parsePhoneNumber(pphoneNumber, pcountryCode), CreatePhoneCountryConstantsClass.create()
.countryMap().get... |
python | def simultaneous_listen(self):
"""
This function is called by passive simultaneous nodes who
wish to establish themself as such. It sets up a connection
to the Rendezvous Server to monitor for new hole punching requests.
"""
# Close socket.
if self.server... |
python | def read_bits(self, num):
'''
Read several bits packed into the same field. Will return as a list.
The bit field itself is little-endian, though the order of the
returned array looks big-endian for ease of decomposition.
Reader('\x02').read_bits(2) -> [False,True]
Reader... |
python | def _ensure_index_cache(self, db_uri, db_name, collection_name):
"""Adds a collections index entries to the cache if not present"""
if not self._check_indexes or db_uri is None:
return {'indexes': None}
if db_name not in self.get_cache():
self._internal_map[db_name] = {}
... |
python | def _make_tempy_tag(self, tag, attrs, void):
"""Searches in tempy.tags for the correct tag to use, if does not exists uses the TempyFactory to
create a custom tag."""
tempy_tag_cls = getattr(self.tempy_tags, tag.title(), None)
if not tempy_tag_cls:
unknow_maker = [self.unknow... |
python | def manifold(self, transformer):
"""
Creates the manifold estimator if a string value is passed in,
validates other objects passed in.
"""
if not is_estimator(transformer):
if transformer not in self.ALGORITHMS:
raise YellowbrickValueError(
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.