language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | public static void setMatrix(final double[][] m1, final int[] r, final int c0, final int c1, final double[][] m2) {
assert c0 <= c1 : ERR_INVALID_RANGE;
assert c1 <= m1[0].length : ERR_MATRIX_DIMENSIONS;
for(int i = 0; i < r.length; i++) {
System.arraycopy(m2[i], 0, m1[r[i]], c0, c1 - c0);
}
} |
python | def get_field_lookups(field_type, nullable):
"""
Return lookup table value and append isnull if
this is a nullable field
"""
return LOOKUP_TABLE.get(field_type) + ['isnull'] if nullable else LOOKUP_TABLE.get(field_type) |
java | public final SrvPage lazyGetSrvPage() throws Exception {
String beanName = getSrvPageName();
SrvPage srvPage = (SrvPage) this.beansMap.get(beanName);
if (srvPage == null) {
srvPage = new SrvPage();
this.beansMap.put(beanName, srvPage);
lazyGetLogger().info(null, AFactoryAppBeans.class, bea... |
python | def rank_types(types):
"""
Takes a list of binary numbers and returns a dictionary mapping each
binary number to an integer indicating it's rank within the list.
This is basically the better alternative to cluster_types, that works
in that perfect world where we have few enough types to represent e... |
python | def addCmdClass(self, ctor, **opts):
'''
Add a Cmd subclass to this cli.
'''
item = ctor(self, **opts)
name = item.getCmdName()
self.cmds[name] = item |
python | def from_point(cls, point, network=BitcoinMainNet, **kwargs):
"""Create a PublicKey from a point on the SECP256k1 curve.
:param point: A point on the SECP256k1 curve.
:type point: SECP256k1.point
"""
verifying_key = VerifyingKey.from_public_point(point, curve=SECP256k1)
... |
python | def get_timemachine_instance(self, key):
"""Return a TimeMachine for a related object.
Take a string argument representing a ForeignKey field name, find what
object was related to this one at the time of this TimeMachine and
return a TimeMachine for that related object.
"""
... |
java | public void free()
{
m_strQueueName = null;
m_strQueueType = null;
m_source = null;
m_mxProperties = null;
m_intFilterID = null;
} |
java | @Override
public String format(Long position) {
Date date = AbsoluteTimeGranularityUtil.asDate(position);
return DATE_FORMAT.get().format(date);
} |
python | def fit_transform(self, X, y=None, **fit_params):
"""Fit label encoder and return encoded labels
Parameters
----------
y : array-like of shape [n_samples]
Target values.
Returns
-------
y : array-like of shape [n_samples]
"""
y = colu... |
java | void validatePackage(EntityType entityType) {
Package pack = entityType.getPackage();
if (pack != null
&& isSystemPackage(pack)
&& !systemEntityTypeRegistry.hasSystemEntityType(entityType.getId())) {
throw new MolgenisValidationException(
new ConstraintViolation(
fo... |
java | private ExtensionUserManagement getExtensionUserManagement() {
if (extensionUsers == null) {
extensionUsers = Control.getSingleton().getExtensionLoader().getExtension(ExtensionUserManagement.class);
}
return extensionUsers;
} |
java | @Override
public Map<String, Object> getQueryParameters() {
HashMap<String, Object> params = new HashMap<String, Object>();
params.put("itemType", this.itemType.toString());
params.put("itemId", this.itemId.toString());
return params;
} |
java | void addDisjoint(MutableBigInteger addend, int n) {
if (addend.isZero())
return;
int x = intLen;
int y = addend.intLen + n;
int resultLen = (intLen > y ? intLen : y);
int[] result;
if (value.length < resultLen)
result = new int[resultLen];
... |
python | def fit(self, X, y):
"""Fit the model
Parameters
----------
X : array-like of shape = [n_samples, n_features]
The training input samples.
y : array-like, shape = [n_samples]
The target values
Returns
-------
self : object
... |
python | def grid(children=[], sizing_mode=None, nrows=None, ncols=None):
"""
Conveniently create a grid of layoutable objects.
Grids are created by using ``GridBox`` model. This gives the most control over
the layout of a grid, but is also tedious and may result in unreadable code in
practical applications... |
python | def selecttrue(table, field, complement=False):
"""Select rows where the given field evaluates `True`."""
return select(table, field, lambda v: bool(v), complement=complement) |
java | void validate(ServerResponse serverResponse) throws GeneralSecurityException {
byte[] response = validateChallenge(authNonce, serverResponse.response);
byte[] expected = rawResponse(challenge);
Preconditions.checkArgument(Arrays.equals(expected, response));
byte[] nonce = decrypt(serverResponse.nonce)... |
java | public void setSourceCredentialsInfos(java.util.Collection<SourceCredentialsInfo> sourceCredentialsInfos) {
if (sourceCredentialsInfos == null) {
this.sourceCredentialsInfos = null;
return;
}
this.sourceCredentialsInfos = new java.util.ArrayList<SourceCredentialsInfo>(so... |
python | def base_url(self, base_url=None):
"""Return or set `base_url`.
Args:
base_url (str, optional): If set, updates the `base_url`. Otherwise
returns current `base_url`.
Note:
This does not update the `username` attribute. Separately update
the u... |
python | def search(self, query, mediatype=None, limit=None):
""" Returns a list of media items or filter categories from the resulting
`Hub Search <https://www.plex.tv/blog/seek-plex-shall-find-leveling-web-app/>`_
against all items in your Plex library. This searches genres, actors, directors,
... |
java | private String handleCompositeColumnName(final String columnName) {
final String columnKey = columnName.substring(columnName.lastIndexOf(":") + 1);
return columnKey.equals("") ? columnName : columnKey;
} |
python | def create(vm_):
'''
get the system build going
'''
creds = get_creds()
clc.v1.SetCredentials(creds["token"], creds["token_pass"])
cloud_profile = config.is_provider_configured(
__opts__,
__active_provider_name__ or __virtualname__,
('token',)
)
group = config.get... |
java | public ServiceFuture<Void> beginStopAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(beginStopWithServiceResponseAsync(resourceGroupName, labAccountName, ... |
python | def simple_lmm(snps,pheno,K=None,covs=None, test='lrt',NumIntervalsDelta0=100,NumIntervalsDeltaAlt=0,searchDelta=False):
"""
Univariate fixed effects linear mixed model test for all SNPs
Args:
snps: [N x S] SP.array of S SNPs for N individuals
pheno: [N x 1] SP.array of 1 phenotype for N... |
python | def _pick_selected_option(cls):
"""
Select handler for authors.
"""
for option in cls.select_el:
# if the select is empty
if not hasattr(option, "selected"):
return None
if option.selected:
return option.value
... |
java | private boolean validateNoLoopDetected(DefaultHttpSession acceptSession) {
List<String> viaHeaders = acceptSession.getReadHeaders(HEADER_VIA);
if (viaHeaders != null && viaHeaders.stream().anyMatch(h -> h.equals(viaHeader))) {
LOGGER.warn("Connection to " + getConnectURIs().iterator().ne... |
python | def calc_outuh_quh_v1(self):
"""Calculate the unit hydrograph output (convolution).
Required derived parameters:
|UH|
Required flux sequences:
|Q0|
|Q1|
|InUH|
Updated log sequence:
|QUH|
Calculated flux sequence:
|OutUH|
Examples:
Pr... |
java | private String doPasswdAuth(HttpServletRequest request, String authType)
throws HttpAuthenticationException {
String userName = getUsername(request, authType);
// No-op when authType is NOSASL
if (!authType.equalsIgnoreCase(HiveAuthFactory.AuthTypes.NOSASL.toString())) {
try {
AuthMethod... |
python | def release(self):
"increment the counter, waking up a waiter if there was any"
if self._waiters:
scheduler.state.awoken_from_events.add(self._waiters.popleft())
else:
self._value += 1 |
java | private void onOK() {
host = host_text.getText().trim();
user = user_text.getText();
password = password_text.getText();
if (host.length() == 0) {
warn("Proxy host is not set!");
return;
}
if (socks_group.getSelectedCheckbox() == socks4radio) {
if (user.length() == 0) {
warn("User name is not ... |
python | def type_with_ranges(self, tchain, p_elem, rangekw, gen_data):
"""Handle types with 'range' or 'length' restrictions.
`tchain` is the chain of type definitions from which the
ranges may need to be extracted. `rangekw` is the statement
keyword determining the range type (either 'range' o... |
java | public static int deserializeTaskId(byte[] ser) {
Input _kryoInput = new Input(1);
_kryoInput.setBuffer(ser);
return _kryoInput.readInt();
} |
python | def _GetDisplayPath(self, path_spec, full_path, data_stream_name):
"""Retrieves a path to display.
Args:
path_spec (dfvfs.PathSpec): path specification of the file entry.
full_path (str): full path of the file entry.
data_stream_name (str): name of the data stream.
Returns:
str: pa... |
python | def syllabify(self, unsyllabified_tokens):
"""Helper class for calling syllabification-related methods.
:param unsyllabified_tokens:
:return: List of syllables.
:rtype : list
"""
syllables = self.make_syllables(unsyllabified_tokens)
qu_fixed_syllables = self._qu_f... |
java | public static int decodeValue(final short encodedSize) {
final int value = encodedSize & 0xFFFF;
if (value > MAX_ENC_VALUE) {
throw new SketchesArgumentException("Maximum valid encoded value is "
+ Integer.toHexString(MAX_ENC_VALUE) + ", found: " + value);
}
final int p = (value >>... |
java | public String getElement(int elementIndex, Form form) {
CharSequence element = this.elements.get(elementIndex);
ElementType type = this.elements.getType(elementIndex);
if (type.isIndexed()) {
return element.toString();
}
if (form == Form.ORIGINAL) {
if (type != ElementType.NON_UNIFORM) {
return elem... |
python | def compute_hulls(S, fS, domain):
"""
(Re-)compute upper and lower hull given
the segment points `S` with function values
`fS` and the `domain` of the logpdf.
Parameters
----------
S : np.ndarray (N, 1)
Straight-line segment points accumulated thus far.
fS : tuple
Value ... |
python | def from_dir(dirpath: Path, feat_type: str) -> None:
""" Performs feature extraction from the WAV files in a directory.
Args:
dirpath: A `Path` to the directory where the WAV files reside.
feat_type: The type of features that are being used.
"""
logger.info("Extracting features from di... |
java | @Override
public String visit(final JmesPathFunction function,
final Void aVoid) throws InvalidTypeException {
final String prefix = "new " + function.getClass()
.getSimpleName() + "( ";
return function.getExpressions().stream()
.map(a -> a.acc... |
python | def execute(self, context, goals):
"""Executes the supplied goals and their dependencies against the given context.
:param context: The pants run context.
:param list goals: A list of ``Goal`` objects representing the command line goals explicitly
requested.
:returns int: An exit... |
java | public Operation zCombinedAnd(Operation op)
{
if (op instanceof IsNotNullOperation)
{
return zCombineWithNotNullOperation((IsNotNullOperation) op);
}
if (op instanceof IsNullOperation)
{
return zCombineWithNullOperation((IsNullOperation) op);
... |
python | def register_client(provider_info, redirect_uris):
"""
This function registers a new client with the specified OpenID Provider,
and then returns the regitered client ID and other information.
:param provider_info: The contents of the discovery endpoint as
specified by the OpenID Connect Discove... |
python | def calculateAgreement(publicKey, privateKey):
"""
:type publicKey: ECPublicKey
:type privateKey: ECPrivateKey
"""
if publicKey.getType() != privateKey.getType():
raise InvalidKeyException("Public and private keys must be of the same type!")
if publicKey.getT... |
python | def print_summary(self):
"""Print a summary of the form.
May help finding which fields need to be filled-in.
"""
for input in self.form.find_all(
("input", "textarea", "select", "button")):
input_copy = copy.copy(input)
# Text between the opening ... |
python | def json_serial(obj):
"""JSON serializer for objects not serializable by default json code"""
if isinstance(obj, LegipyModel):
return obj.to_json()
elif isinstance(obj, (datetime.date, datetime.datetime)):
return obj.isoformat()
raise TypeError("Type {0} not serializable".format(repr(typ... |
java | public void transform(DataPipe cr) {
for (Map.Entry<String, String> entry : cr.getDataMap().entrySet()) {
String value = entry.getValue();
if (value.equals("#{customplaceholder}")) {
// Generate a random number
int ran = rand.nextInt();
en... |
java | public Observable<Page<StorageAccountInformationInner>> listByAccountAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count) {
return listByAccountWithServiceResponseAsync(resource... |
java | protected CmsResource createRelations(CmsObject cms, CmsSecurityManager securityManager, String resourceName)
throws CmsException {
CmsResource resource = securityManager.readResource(
cms.getRequestContext(),
resourceName,
CmsResourceFilter.ALL);
I_CmsResourceTy... |
python | def wait(self):
''' wait for the done event to be set - no timeout'''
self._done_event.wait(MAXINT)
return self._status, self._exception |
java | public static Object invoke(final Object obj, final String methodName, final Class<?>[] argTypes, final Object[] args)
throws InvokeMethodFailedException {
checkNotNull("obj", obj);
checkNotNull("methodName", methodName);
final Class<?>[] argTypesIntern;
final Object... |
python | def strip_namespaces(file_or_xml):
"""
Removes all namespaces from the XML file or string passed in.
If file_or_xml is not a file or string, it is returned as is.
"""
xml_content = _xml_content_to_string(file_or_xml)
if not isinstance(xml_content, string_types):
return xml_content
... |
java | public static Object dtoFromScratch(DTO dtoTemplate) throws HyalineException {
return dtoFromScratch(new Object(), dtoTemplate, "Hyaline$Proxy$" + System.currentTimeMillis());
} |
java | protected void setScrollPosition(final int pos) {
getList().setVerticalScrollPosition(pos);
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
/**
* @see com.google.gwt.core.client.Scheduler.ScheduledCommand#execute()
*/
public void execute() {
... |
java | public static String toTimeString(int hour, int minute, int second) {
String hourStr;
String minuteStr;
String secondStr;
if (hour < 10) {
hourStr = "0" + hour;
} else {
hourStr = "" + hour;
}
if (minute < 10) {
minuteStr = "0" + minute;
} else {
minuteStr = "" + minute;
}
... |
java | public static String hash(char[] password, int cost)
{
String salt = BCryptImpl.gensalt(cost);
return BCryptImpl.hashpw(new String(password), salt);
} |
python | def find_preset(self, preset):
"""Find a preset profile matching the specified preset string.
:param preset: a string containing a preset profile name.
:returns: a matching PresetProfile.
"""
# FIXME: allow fuzzy matching?
for match in self.presets.keys():
... |
java | protected <JavaTypeT> TypeCodec<JavaTypeT> codecFor(
GenericType<JavaTypeT> javaType, boolean isJavaCovariant) {
LOG.trace(
"[{}] Looking up codec for Java type {} (covariant = {})",
logPrefix,
javaType,
isJavaCovariant);
for (TypeCodec<?> primitiveCodec : primitiveCodecs) ... |
python | def getTriggerStrings(self, parScope, parName):
""" For a given item (scope + name), return all strings (in a tuple)
that it is meant to trigger, if any exist. Returns None is none. """
# The data structure of _allTriggers was chosen for how easily/quickly
# this particular access can b... |
java | @Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case SarlPackage.SARL_AGENT__EXTENDS:
return extends_ != null;
}
return super.eIsSet(featureID);
} |
java | public boolean isEventNotificationPropertySet() {
String thisMethodName = "isEventNotificationPropertySet";
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
SibTr.entry(tc, thisMethodName, this);
}
boolean enabled = true;
if (TraceComponent.isAny... |
python | def ChunkBy(self, f=None):
"""
[
{
'self': [1, 1, 3, 3, 1, 1],
'f': lambda x: x%2,
'assert': lambda ret: ret == [[1, 1], [3, 3], [1, 1]]
}
]
"""
if f is None:
return _chunk(self)
if is_to_destruct(f):
f = destruct_func(f)
r... |
java | public static Object invokeMethod(Method method, Object target, Object... args) {
try {
return method.invoke(target, args);
} catch (Exception ex) {
handleReflectionException(ex);
}
throw new IllegalStateException("Should never get here");
} |
java | public void curveTo(double x1, double y1, double z1,
double x2, double y2, double z2,
double x3, double y3, double z3) {
ensureSlots(true, 9);
this.types[this.numTypesProperty.get()] = PathElementType.CURVE_TO;
this.numTypesProperty.set(this.numTypesProperty.get()+1);
this.coordsProperty[this.numCoords... |
python | async def _request(self, method: str, url: str, headers: Mapping[str, str],
body: bytes = b'') -> Tuple[int, Mapping[str, str], bytes]:
"""Make an HTTP request."""
if method == "GET" and not body:
real_body = None
else:
real_body = body
requ... |
python | def constant(cls,
value: Value,
dtype: tf.DType = tf.float32) -> 'TensorFluent':
'''Returns a constant `value` TensorFluent with given `dtype`.
Args:
value: The constant value.
dtype: The output's data type.
Returns:
A constant Tensor... |
java | public Set<String> postProcessingFields() {
Set<String> fields = new LinkedHashSet<>();
if (!StringUtils.isBlank(defaultField)) {
fields.add(defaultField);
}
for (String term : query.split("[ ]")) {
if (term.contains(":")) {
fields.add(term.split("... |
python | def _gen_weldobj(self, arr):
'''
Generating a new weldarray from a given arr for self.
@arr: weldarray or ndarray.
- weldarray: Just update the weldobject with the context from the
weldarray.
- ndarray: Add the given array to the context of the weldobject.
... |
java | public static Date setMilliseconds(@NotNull final Date date, int amount) {
return DateUtils.setMilliseconds(date, amount);
} |
java | public boolean removeElement(Node s)
{
if (!m_mutable)
throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");
if (null == m_map)
return false;
for (int i = 0; i < m_firstFree; i++)
{
Node node... |
java | public static DatasetResolver getResolver(Config config) {
// ConfigException.Missing will throw if DATASET_RESOLVER_FACTORY is absent
String resolverFactory = config.getString(DATASET_RESOLVER_FACTORY);
if (resolverFactory.toUpperCase().equals(NoopDatasetResolver.FACTORY)) {
return NoopDatasetResolv... |
python | def do_application_actions_plus(parser, token):
""" Render actions available with extra text. """
nodelist = parser.parse(('end_application_actions',))
parser.delete_first_token()
return ApplicationActionsPlus(nodelist) |
java | public UpdateIntegrationResponseResult withResponseParameters(java.util.Map<String, String> responseParameters) {
setResponseParameters(responseParameters);
return this;
} |
python | def read_utf8_string(self, length):
"""
Reads a UTF-8 string from the stream.
@rtype: C{unicode}
"""
s = struct.unpack("%s%ds" % (self.endian, length), self.read(length))[0]
return s.decode('utf-8') |
java | protected final String getForRetrieveForEditDelete(final Class<?> pClass,
final String pAction) {
if (this.sharedEntities.contains(pClass)) {
return null;
} else if (IHasSeSeller.class.isAssignableFrom(pClass)) {
return PrcEntityRetrieve.class.getSimpleName();
}
return null;
} |
java | @Nullable
public OfflineDownloadOptions getActiveDownloadForOfflineRegion(OfflineRegion offlineRegion) {
OfflineDownloadOptions offlineDownload = null;
if (!offlineDownloads.isEmpty()) {
for (OfflineDownloadOptions download : offlineDownloads) {
if (download.uuid() == offlineRegion.getID()) {
... |
python | def delete(self):
"""Deletes a selection if any else deletes the cursor cell
Refreshes grid after deletion
"""
if self.grid.IsSelection():
# Delete selection
self.grid.actions.delete_selection()
else:
# Delete cell at cursor
cur... |
java | public static Map<DataSourceWrapper, List<ShardRouteInfo>> groupRouteInfosByDataSource(DDRDataSource ddrDataSource,
boolean readOnly,
List... |
python | def process_line(self, record):
"Process a single record. This assumes only a single sample output."
cleaned = []
for key in self.vcf_fields:
out = self.process_column(key, getattr(record, key))
if isinstance(out, (list, tuple)):
cleaned.extend(out)
... |
python | def build_helpers_module_registry_dependencies(registry_name='calmjs.module'):
"""
Return a tuple of funtions that will provide the functions that
return the relevant sets of module registry records based on the
dependencies defined for the provided packages.
"""
def get_module_registry_depende... |
python | def resolve(self, ref, document=None):
"""Resolve a ref within the schema.
This is just a convenience method, since RefResolver returns both a URI
and the resolved value, and we usually just need the resolved value.
:param str ref: URI to resolve.
:param dict document: Optional... |
python | def _pywrap_tensorflow():
"""Provide pywrap_tensorflow access in TensorBoard.
pywrap_tensorflow cannot be accessed from tf.python.pywrap_tensorflow
and needs to be imported using
`from tensorflow.python import pywrap_tensorflow`. Therefore, we provide
a separate accessor function for it here.
NOTE: pywrap... |
java | static void validateConfigurations(Configuration conf) throws ValidationException {
if (null == conf.getHandlers()) {
Log.error(
"Handler should not be null, One or more handler implementation shuld be configured in the configuration",
ErrorGuide.getGuide(Erro... |
python | def get_insider_roster(self):
"""Insider Roster
Returns the top 10 insiders, with the most recent information.
Reference: https://iexcloud.io/docs/api/#insider-roster
Data Weighting: ``5000`` per symbol
Returns
-------
list or pandas.DataFrame
... |
java | private boolean isWrapper( Class<?> cls ) {
if ( null == cls )
return false;
if ( Boolean.class.isAssignableFrom(cls) ) switch ( kind ) {
case EQ: case NE: case BOOL_OR: case BOOL_ORX: case BOOL_AND:
case BOOL_ANDX: case BIT_AND: case BIT_ANDX: case BIT_OR:
... |
java | public InstanceFailoverGroupInner beginCreateOrUpdate(String resourceGroupName, String locationName, String failoverGroupName, InstanceFailoverGroupInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, locationName, failoverGroupName, parameters).toBlocking().single().body();... |
python | def get_language_title(language_code):
"""
Return the verbose_name for a language code.
Fallback to language_code if language is not found in settings.
"""
from parler import appsettings
# Avoid weird lookup errors.
if not language_code:
raise ValueError("Missing language_code in ge... |
java | public static Job[] jobs() {
final Value val = DKV.get(LIST);
if( val==null ) return new Job[0];
JobList jl = val.get();
Job[] jobs = new Job[jl._jobs.length];
int j=0;
for( int i=0; i<jl._jobs.length; i++ ) {
final Value job = DKV.get(jl._jobs[i]);
if( job != null ) jobs[j++] = job.... |
java | public String getXML(boolean bIncludeHeader)
{
if (bIncludeHeader == false)
{
if (ManualMessage.MANUAL_MESSAGE_CODE.equals(this.get(TrxMessageHeader.MESSAGE_CODE)));
{
String strMessage = this.getString(ManualMessage.MESSAGE_PARAM);
if (strMess... |
java | @Nonnull
public Query whereEqualTo(@Nonnull FieldPath fieldPath, @Nullable Object value) {
Preconditions.checkState(
options.startCursor == null && options.endCursor == null,
"Cannot call whereEqualTo() after defining a boundary with startAt(), "
+ "startAfter(), endBefore() or endAt()... |
python | def PMF(samples, y):
""" Compute the probability mass function.
The set of samples defines a probability density P(y),
which is computed using a kernel density estimator.
From :math:`P(y)` we define:
:math:`\mathrm{pmf}(p) = \int_{P(y)<p} P(y) dy`
This is the cumulative d... |
python | def _call_init_upload(file_name, file_size, metadata, tags, project, samples_resource):
"""Call init_upload at the One Codex API and return data used to upload the file.
Parameters
----------
file_name : `string`
The file_name you wish to associate this fastx file with at One Codex.
file_si... |
java | public static List<Specification> parseSpecification(File file) {
List<Specification> monitorables = new ArrayList<>();
try {
InputStream stream = new FileInputStream(file);
monitorables = parseInputSpecification(stream);
} catch (Exception e) {
logger.error(S... |
python | def print_help(self, file=None):
""" recursively call all command parsers' helps """
output = file or self.stderr
CustomStderrOptionParser.print_help(self, output)
output.write("\nCommands:\n")
for command_def in self.command_definitions.values():
command_def.opt_pars... |
python | def sort_elements_by_child_values(obj_pyxb, child_name_list):
"""In-place sort simple or complex elements in a PyXB object by values they contain
in child elements.
Args:
obj_pyxb: PyXB object
child_name_list: list of str
List of element names that are direct children of the PyXB objec... |
java | @SideOnly(Side.CLIENT)
public static EntityPlayer getClientPlayer()
{
return Minecraft.getMinecraft() != null ? Minecraft.getMinecraft().player : null;
} |
java | public void setReplicationSubnetGroups(java.util.Collection<ReplicationSubnetGroup> replicationSubnetGroups) {
if (replicationSubnetGroups == null) {
this.replicationSubnetGroups = null;
return;
}
this.replicationSubnetGroups = new java.util.ArrayList<ReplicationSubnetGr... |
python | def parse_url_path(self, url_path: str) -> str:
"""Converts a static URL path into a filesystem path.
``url_path`` is the path component of the URL with
``static_url_prefix`` removed. The return value should be
filesystem path relative to ``static_path``.
This is the inverse o... |
java | public static int crossCubic (float x1, float y1, float cx1, float cy1, float cx2,
float cy2, float x2, float y2, float x, float y) {
// LEFT/RIGHT/UP/EMPTY
if ((x < x1 && x < cx1 && x < cx2 && x < x2) || (x > x1 && x > cx1 && x > cx2 && x > x2)
|| (y > ... |
java | @Override
public void deleteTemporaryDestination(
SIDestinationAddress destinationAddress)
throws SIConnectionDroppedException,
SIConnectionUnavailableException, SIConnectionLostException,
SINotAuthorizedException... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.