language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | private static int processVelocity(VERTICAL_DIRECTION direction, float sensorReading, float maxSensorReading) {
switch (direction) {
case UP: return (int) (-1 * (maxSensorReading + sensorReading));
case DOWN: return (int) sensorReading;
case NONE: default: return 0;
}
} |
python | def remove_delegate(self, callback):
""" Unregisters a registered delegate function or a method.
Args:
callback(function): method to trigger when push center receives events
"""
if callback not in self._delegate_methods:
return
self._delegate_me... |
python | def get_head_form_html(req: "Request", forms: List[Form]) -> str:
"""
Returns the extra HTML that needs to be injected into the ``<head>``
section for a Deform form to work properly.
"""
# https://docs.pylonsproject.org/projects/deform/en/latest/widget.html#widget-requirements
js_resources = [] ... |
python | def merge_elisions(elided: List[str]) -> str:
"""
Given a list of strings with different space swapping elisions applied, merge the elisions,
taking the most without compounding the omissions.
:param elided:
:return:
>>> merge_elisions([
... "ignavae agua multum hiatus", "ignav agua mult... |
java | private void doResume(long id) {
if (paused) {
log.debug(String.format("%s - Resumed connection to %s", this, context.target()));
paused = false;
checkDrain();
}
} |
python | def get_user_last_submissions(self, limit=5, request=None):
""" Get last submissions of a user """
if request is None:
request = {}
request.update({"username": self._user_manager.session_username()})
# Before, submissions were first sorted by submission date, then grouped
... |
java | @Nonnull
public static <R> LBoolFunction<R> boolFunctionFrom(Consumer<LBoolFunctionBuilder<R>> buildingFunction) {
LBoolFunctionBuilder builder = new LBoolFunctionBuilder();
buildingFunction.accept(builder);
return builder.build();
} |
java | @SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case AfplibPackage.BDD__UBASE:
setUBASE((Integer)newValue);
return;
case AfplibPackage.BDD__RESERVED:
setReserved((Integer)newValue);
return;
case AfplibPackage.BDD__XUPUB:
s... |
python | def show(self, n=20, truncate=True, vertical=False):
"""Prints the first ``n`` rows to the console.
:param n: Number of rows to show.
:param truncate: If set to True, truncate strings longer than 20 chars by default.
If set to a number greater than one, truncates long strings to len... |
java | protected TextService getServiceInstance(Map<String,String> headers) throws ServiceException {
try {
String requestPath = headers.get(Listener.METAINFO_REQUEST_PATH);
String[] pathSegments = requestPath != null ? requestPath.split("/") : null;
if (pathSegments == null)
... |
java | public void pushEvent(final String attributeName, final AttributeValue value, final EventType eventType)
throws DevFailed {
switch (eventType) {
case CHANGE_EVENT:
case ARCHIVE_EVENT:
case USER_EVENT:
// set attribute value
final At... |
java | public AuditSink create(Config config, ValueAuditRuntimeMetadata auditRuntimeMetadata) {
String sinkClassName = DEFAULT_AUDIT_SINK_CLASS;
if (config.hasPath(AUDIT_SINK_CLASS_NAME_KEY)) {
sinkClassName = config.getString(AUDIT_SINK_CLASS_NAME_KEY);
}
log.info("Using audit sink class name/alias " +... |
python | def showDataDirectoriesData(peInstance):
""" Prints the DATA_DIRECTORY fields. """
print "[+] Data directories:\n"
dirs = peInstance.ntHeaders.optionalHeader.dataDirectory
counter = 1
for dir in dirs:
print "[%d] --> Name: %s -- RVA: 0x%08x -- SIZE: 0x%08x" % (counter, dir.name.value, ... |
java | private Map<String, CmsGalleryTypeInfo> readGalleryInfosByTypeNames(List<String> resourceTypes) {
Map<String, CmsGalleryTypeInfo> galleryTypeInfos = new HashMap<String, CmsGalleryTypeInfo>();
for (String typeName : resourceTypes) {
try {
addGalleriesForType(galleryTypeInfos,... |
java | public ChronicleMapBuilder<K, V> valueReaderAndDataAccess(
SizedReader<V> valueReader, @NotNull DataAccess<V> valueDataAccess) {
valueBuilder.reader(valueReader);
valueBuilder.dataAccess(valueDataAccess);
return this;
} |
python | def update(self, delta_seconds):
"""update tweeners. delta_seconds is time in seconds since last frame"""
for obj in tuple(self.current_tweens):
for tween in tuple(self.current_tweens[obj]):
done = tween.update(delta_seconds)
if done:
self... |
java | @Nullable
public T get(int deviceId) {
try {
locksMap.get(deviceId).readLock().lock();
return backingMap.get(deviceId);
} finally {
locksMap.get(deviceId).readLock().unlock();
}
} |
java | @POST
@Path("/retry")
@ApiOperation("Retry the last failed task for each workflow from the list")
public BulkResponse retry(List<String> workflowIds) {
return workflowBulkService.retry(workflowIds);
} |
java | public void setInputMap(final URI map) {
assert !map.isAbsolute();
setProperty(INPUT_DITAMAP_URI, map.toString());
// Deprecated since 2.2
setProperty(INPUT_DITAMAP, toFile(map).getPath());
} |
java | public void showProgress(boolean show) {
Log.v(TAG, show ? "Disabling the button while showing progress" : "Enabling the button and hiding progress");
setEnabled(!show);
progress.setVisibility(show ? VISIBLE : GONE);
if (show) {
icon.setVisibility(INVISIBLE);
labe... |
python | def _sysfs_attr(name, value=None, log_lvl=None, log_msg=None):
'''
Simple wrapper with logging around sysfs.attr
'''
if isinstance(name, six.string_types):
name = [name]
res = __salt__['sysfs.attr'](os.path.join(*name), value)
if not res and log_lvl is not None and log_msg is not None:
... |
python | def reject_sv(m, s, y):
""" Sample from N(m, s^2) times SV likelihood using rejection.
SV likelihood (in x) corresponds to y ~ N(0, exp(x)).
"""
mp = m + 0.5 * s**2 * (-1. + y**2 * np.exp(-m))
ntries = 0
while True:
ntries += 1
x = stats.norm.rvs(loc=mp, scale=s)
u = st... |
python | def _add_replace_pair(self, name, value, quote):
"""
Adds a replace part to the map of replace pairs.
:param name: The name of the replace pair.
:param value: The value of value of the replace pair.
"""
key = '@' + name + '@'
key = key.lower()
class_name... |
python | def set_automaster(
name,
device,
fstype,
opts='',
config='/etc/auto_salt',
test=False,
**kwargs):
'''
Verify that this mount is represented in the auto_salt, change the mount
to match the data passed, or add the mount if it is not present.
CLI Ex... |
java | public int getSubscribersCount(EventPublisher source) {
GenericEventDispatcher<?> dispatcherObject = dispatchers.get(source);
if (dispatcherObject == null) {
return 0;
} else {
return dispatcherObject.getListenersCount();
}
} |
java | public static StreamShardMetadata convertToStreamShardMetadata(KinesisStreamShard kinesisStreamShard) {
StreamShardMetadata streamShardMetadata = new StreamShardMetadata();
streamShardMetadata.setStreamName(kinesisStreamShard.getStreamName());
streamShardMetadata.setShardId(kinesisStreamShard.getShard().getShard... |
python | def _rotate(n, x, y, rx, ry):
"""Rotate and flip a quadrant appropriately
Based on the implementation here:
https://en.wikipedia.org/w/index.php?title=Hilbert_curve&oldid=797332503
"""
if ry == 0:
if rx == 1:
x = n - 1 - x
y = n - 1 - y
return y, x
r... |
python | def check_docstring_missing(self, definition, docstring):
"""D10{0,1,2,3}: Public definitions should have docstrings.
All modules should normally have docstrings. [...] all functions and
classes exported by a module should also have docstrings. Public
methods (including the __init__ co... |
java | public void setRowMargin(int l, int t, int r, int b) {
mRowMargin[0] = l; mRowMargin[1] = t; mRowMargin[2] = r; mRowMargin[3] = b;
} |
python | def set_env(self, key, value):
"""Sets environment variables by prepending the app_name to `key`. Also registers the
environment variable with the instance object preventing an otherwise-required call to
`reload()`.
"""
os.environ[make_env_key(self.appname, key)] = str(value) # ... |
python | def get_methods(self):
"""
Retrieves the list of tuples (command, method) for this command handler
"""
return [
("levels", self.print_levels),
("make", self.make_report),
("clear", self.clear_report),
("show", self.show_report),
... |
python | def merge_google_napoleon_docs(prnt_doc=None, child_doc=None):
""" Merge two google-style docstrings into a single docstring, according to napoleon docstring sections.
Given the google-style docstrings from a parent and child's attributes, merge the docstring
sections such that the child's section ... |
python | def leaves(self, name):
"""
RETURN LEAVES OF GIVEN PATH NAME
pull leaves, considering query_path and namespace
pull all first-level properties
pull leaves, including parent leaves
pull the head of any tree by name
:param name:
:return:
"""
... |
java | protected void initModule() {
Object o;
CmsModule module;
if (CmsStringUtil.isEmpty(getParamAction()) || CmsDialog.DIALOG_INITIAL.equals(getParamAction())) {
// this is the initial dialog call
if (CmsStringUtil.isNotEmpty(m_paramModule)) {
// edit an exi... |
python | def add_service(self, zeroconf, srv_type, srv_name):
"""Method called when a new Zeroconf client is detected.
Return True if the zeroconf client is a Glances server
Note: the return code will never be used
"""
if srv_type != zeroconf_type:
return False
logger... |
python | def delete_message(self, chat_id, message_id):
"""
Use this method to delete message. Returns True on success.
:param chat_id: in which chat to delete
:param message_id: which message to delete
:return: API reply.
"""
return apihelper.delete_message(self.token, ch... |
java | private void rejectHandshake(Conversation conversation, int requestNumber, String rejectedField) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "rejectHandshake",
new Object[] { conversation, requestNumber, rejected... |
java | protected void processCollectionRequest(HyperionContext hyperionContext)
{
EndpointRequest request = hyperionContext.getEndpointRequest();
EndpointResponse response = hyperionContext.getEndpointResponse();
ApiVersionPlugin<ApiObject<Serializable>,PersistentObject<Serializable>,Serializable>... |
java | private void clearDeployments(final Handler<AsyncResult<Void>> doneHandler) {
context.execute(new Action<Void>() {
@Override
public Void perform() {
Collection<String> sdeploymentsInfo = deployments.get(group);
for (String sdeploymentInfo : sdeploymentsInfo) {
JsonObject deploy... |
python | def first(iterable = None, *, name = None, metric = call_default):
"""Measure time elapsed to produce first item of an iterable
:arg iterable: any iterable
:arg function metric: f(name, 1, time)
:arg str name: name for the metric
"""
if iterable is None:
return _first_decorator(name, me... |
java | public int ENgetlinkindex( String id ) throws EpanetException {
int[] index = new int[1];
int error = epanet.ENgetlinkindex(id, index);
checkError(error);
return index[0];
} |
java | @Override
public EObject create(EClass eClass)
{
switch (eClass.getClassifierID())
{
case XtypePackage.XFUNCTION_TYPE_REF: return createXFunctionTypeRef();
case XtypePackage.XCOMPUTED_TYPE_REFERENCE: return createXComputedTypeReference();
case XtypePackage.XIMPORT_SECTION: return createXImportSection();
... |
java | @SuppressWarnings("rawtypes")
public static <E extends Exception> DataSet loadCSV(final File csvFile, final long offset, final long count, final Try.Predicate<String[], E> filter,
final Map<String, ? extends Type> columnTypeMap) throws UncheckedIOException, E {
InputStream csvInputStream = nu... |
python | def alias(self, *alias, **kwargs):
"""
Returns this column aliased with a new name or names (in the case of expressions that
return more than one column, such as explode).
:param alias: strings of desired column names (collects all positional arguments passed)
:param metadata: a... |
java | public List<Group> getGroups(GroupFilter filter) throws GitLabApiException {
return (getGroups(filter, getDefaultPerPage()).all());
} |
java | private Set<String> getEnvironments(Properties props) {
Set<String> environments = new HashSet<>();
for (Object k : props.keySet()) {
String environment = k.toString().split("\\.")[0];
environments.add(environment);
}
return new TreeSet<>(environments);
} |
java | public static final boolean contains(char[] characters, char[] array)
{
for (int i = array.length; --i >= 0;)
{
for (int j = characters.length; --j >= 0;)
{
if (array[i] == characters[j])
{
return true;
}
}
}
return false;
} |
java | private InputStream getMostSpecificStream(
String key, String l, String c, String v) {
String filePath = baseName.replace('.', '/') + '/' + key
+ ((l == null) ? "" : ("_" + l))
+ ((c == null) ? "" : ("_" + c))
+ ((v == null) ? "" : ("_" + v))
... |
python | def get_samples(self, sample_count):
"""
Fetch a number of samples from self.wave_cache
Args:
sample_count (int): Number of samples to fetch
Returns: ndarray
"""
if self.amplitude.value <= 0:
return None
# Build samples by rolling the per... |
java | public InputStream getBinaryStream(final int columnIndex) throws SQLException {
if(protocol.supportsPBMS()) {
try {
return getValueObject(columnIndex).getPBMSStream(protocol);
} catch (QueryException e) {
throw SQLExceptionMapper.get(e);
} catc... |
python | def body_encode(self, string):
"""Body-encode a string by converting it first to bytes.
The type of encoding (base64 or quoted-printable) will be based on
self.body_encoding. If body_encoding is None, we assume the
output charset is a 7bit encoding, so re-encoding the decoded
s... |
python | def _update_dPrxy(self):
"""Update `dPrxy`."""
if 'kappa' in self.freeparams:
scipy.copyto(self.dPrxy['kappa'], self.Prxy / self.kappa,
where=CODON_TRANSITION)
_fill_diagonals(self.dPrxy['kappa'], self._diag_indices)
if 'omega' in self.freeparams:
... |
python | def _add_attr_values_from_insert_to_original(original_code, insert_code, insert_code_list, attribute_name, op_list):
"""
This function appends values of the attribute `attribute_name` of the inserted code to the original values,
and changes indexes inside inserted code. If some bytecode instruction in the ... |
python | def tail(self, fname, encoding, window, position=None):
"""Read last N lines from file fname."""
if window <= 0:
raise ValueError('invalid window %r' % window)
encodings = ENCODINGS
if encoding:
encodings = [encoding] + ENCODINGS
for enc in encodings:
... |
java | static DoubleDistributionSummary get(Registry registry, Id id) {
DoubleDistributionSummary instance = INSTANCES.get(id);
if (instance == null) {
final Clock c = registry.clock();
DoubleDistributionSummary tmp = new DoubleDistributionSummary(c, id, RESET_FREQ);
instance = INSTANCES.putIfAbsent(... |
python | def atlas_peer_get_zonefile_inventory_range( my_hostport, peer_hostport, bit_offset, bit_count, timeout=None, peer_table=None ):
"""
Get the zonefile inventory bit vector for a given peer.
The returned range will be [bit_offset, bit_offset+count]
Update peer health information as well.
bit_off... |
python | def OnButtonApply(self, event):
"""Updates the preview_textctrl"""
try:
dialect, self.has_header = self.csvwidgets.get_dialect()
except TypeError:
event.Skip()
return 0
self.preview_textctrl.fill(data=self.data, dialect=dialect)
event.Skip() |
java | public static int primitiveToGL(
final JCGLPrimitives p)
{
switch (p) {
case PRIMITIVE_LINES:
return GL11.GL_LINES;
case PRIMITIVE_LINE_LOOP:
return GL11.GL_LINE_LOOP;
case PRIMITIVE_TRIANGLES:
return GL11.GL_TRIANGLES;
case PRIMITIVE_TRIANGLE_STRIP:
ret... |
python | def run_simulation(c1, c2):
"""
using character and planet, run the simulation
"""
print('running simulation...')
traits = character.CharacterCollection(character.fldr)
c1 = traits.generate_random_character()
c2 = traits.generate_random_character()
print(c1)
print(c2)
rules = bat... |
python | def ReadClientFullInfo(self, client_id):
"""Reads full client information for a single client.
Args:
client_id: A GRR client id string, e.g. "C.ea3b2b71840d6fa7".
Returns:
A `ClientFullInfo` instance for given client.
Raises:
UnknownClientError: if no client with such id was found.
... |
java | public Element createElementNS(String namespaceURI, String qualifiedName)
throws DOMException
{
error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
return null;
} |
python | def parse_path(path):
"""Parse path string."""
version, project = path[1:].split('/')
return dict(version=int(version), project=project) |
java | public static TSSLTransportParameters getTSSLTransportParameters() {
String SSLTrustStore = System.getProperty("ssl.truststore");
if (SSLTrustStore == null)
return null;
String SSLTrustStorePassword = System.getProperty("ssl.truststore.password");
String SSLProtocol = System.getProperty("ssl.prot... |
python | def get_port(self, id_or_uri, port_id_or_uri):
"""
Gets an interconnect port.
Args:
id_or_uri: Can be either the interconnect id or uri.
port_id_or_uri: The interconnect port id or uri.
Returns:
dict: The interconnect port.
"""
uri = ... |
java | public static void populateModuleSpecWithAppImports(ModuleSpec.Builder moduleSpecBuilder,
ClassLoader appClassLoader,
Set<String> appPackages) {
Objects.requireNonNull(moduleSpecBuilder, "moduleSpecBuilder");
Objects.requireNonNull(appClassLoader, "classLoader");
moduleSp... |
python | def consolidate(self, volume, source, dest, *args, **kwargs):
"""
Consolidate will move a volume of liquid from a list of sources
to a single target location. See :any:`Transfer` for details
and a full list of optional arguments.
Returns
-------
This instance of... |
java | public static synchronized OmemoManager getInstanceFor(XMPPConnection connection) {
TreeMap<Integer, OmemoManager> managers = INSTANCES.get(connection);
if (managers == null) {
managers = new TreeMap<>();
INSTANCES.put(connection, managers);
}
OmemoManager manage... |
java | public static boolean writeDocumentToFile(Document doc, String localFile) {
try {
TransformerFactory transfact = TransformerFactory.newInstance();
Transformer trans = transfact.newTransformer();
trans.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, YES);
trans.... |
java | public void printPattern(int[] row, int[] column, int offset) {
int size = row.length;
if (size != column.length)
throw new IllegalArgumentException(
"All arrays must be of the same size");
for (int i = 0; i < size; ++i)
format(Locale.ENGLISH, "%10d %1... |
python | def from_name(cls, name):
"""Retrieve webacc id associated to a webacc name."""
result = cls.list({'items_per_page': 500})
webaccs = {}
for webacc in result:
webaccs[webacc['name']] = webacc['id']
return webaccs.get(name) |
python | def unscale_samples(params, bounds):
"""Rescale samples from arbitrary bounds back to [0,1] range
Arguments
---------
bounds : list
list of lists of dimensions num_params-by-2
params : numpy.ndarray
numpy array of dimensions num_params-by-N,
where N is the number of samples
... |
java | public static String getOutputPart(ProcessOutput processOutput,String prefix)
{
//get output
String output=processOutput.getOutputText();
if(output!=null)
{
//set flag
boolean validOutput=false;
int index=output.indexOf(prefix);
if(in... |
java | public SqlResultSetMapping<OrmDescriptor> getOrCreateSqlResultSetMapping()
{
List<Node> nodeList = model.get("sql-result-set-mapping");
if (nodeList != null && nodeList.size() > 0)
{
return new SqlResultSetMappingImpl<OrmDescriptor>(this, "sql-result-set-mapping", model, nodeList.get(0));... |
java | public static boolean runWithSleepUninterrupted(long milliseconds, Runnable runnable) {
Assert.isTrue(milliseconds > 0, "Milliseconds [%d] must be greater than 0", milliseconds);
runnable.run();
return safeSleep(milliseconds);
} |
python | def _netname(name: str) -> dict:
'''resolute network name,
required because some providers use shortnames and other use longnames.'''
try:
long = net_query(name).name
short = net_query(name).shortname
except AttributeError:
raise UnsupportedNetwork(''... |
python | def discoverable(self, boolean):
"""Pass through helper function for flag function."""
if(boolean):
r = self.flag({
"flag": "make_discoverable"
})
else:
r = self.flag({
"flag": "make_not_discoverable"
})
... |
python | def get_function_argspec(func, is_class_method=None):
'''
A small wrapper around getargspec that also supports callable classes
:param is_class_method: Pass True if you are sure that the function being passed
is a class method. The reason for this is that on Python 3
... |
java | @Override
public ConfirmPublicVirtualInterfaceResult confirmPublicVirtualInterface(ConfirmPublicVirtualInterfaceRequest request) {
request = beforeClientExecution(request);
return executeConfirmPublicVirtualInterface(request);
} |
python | def _load_w2v(model_file=_f_model, binary=True):
'''
load word2vec model
'''
if not os.path.exists(model_file):
print("os.path : ", os.path)
raise Exception("Model file [%s] does not exist." % model_file)
return KeyedVectors.load_word2vec_format(
model_file, binary=binary, un... |
python | def get_ftr(self):
"""
Process footer and return the processed string
"""
if not self.ftr:
return self.ftr
width = self.size()[0]
return re.sub(
"%time", "%s\n" % time.strftime("%H:%M:%S"), self.ftr).rjust(width) |
python | def db_insert_record(self, table_name, columns):
"""Insert records into DB.
Args:
table_name (str): The name of the table.
columns (list): List of columns for insert statement.
"""
bindings = ('?,' * len(columns)).strip(',')
values = [None] * len(columns)... |
java | @Override
public synchronized CommsServerByteBuffer allocate() {
if (tc.isEntryEnabled())
SibTr.entry(this, tc, "allocate");
CommsServerByteBuffer buff = (CommsServerByteBuffer) super.allocate();
if (tc.isEntryEnabled())
SibTr.exit(this, tc, "allocate", buff);
... |
python | def query(self, q, data=None, union=True, limit=None):
"""
Query your database with a raw string.
Parameters
----------
q: str
Query string to execute
data: list, dict
Optional argument for handlebars-queries. Data will be passed to the
... |
java | public Observable<ServiceResponse<Page<VirtualNetworkGatewayConnectionListEntityInner>>> listConnectionsSinglePageAsync(final String resourceGroupName, final String virtualNetworkGatewayName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is requir... |
python | def scp_push(self, src, dest, progress=False, preserve_times=True):
""" Purpose: Makes an SCP push request for the specified file(s)/dir.
@param src: string containing the source file or directory
@type src: str
@param dest: destination string of where to put the file(s)/dir
@ty... |
java | public String findCmisName( String jcrName ) {
for (Relation aList : list) {
if (aList.jcrName.equals(jcrName)) {
return aList.cmisName;
}
}
return jcrName;
} |
java | public void setMessage(String message) {
requireArgument(message != null && !message.isEmpty(), "Message cannot be null or empty.");
this.message = message;
} |
python | def ApprovalFind(object_id, token=None):
"""Find approvals issued for a specific client."""
user = getpass.getuser()
object_id = rdfvalue.RDFURN(object_id)
try:
approved_token = security.Approval.GetApprovalForObject(
object_id, token=token, username=user)
print("Found token %s" % str(approved_t... |
python | def apply_backspaces_and_linefeeds(text):
"""
Interpret backspaces and linefeeds in text like a terminal would.
Interpret text like a terminal by removing backspace and linefeed
characters and applying them line by line.
If final line ends with a carriage it keeps it to be concatenable with next
... |
python | def _compute_H(self, t, index, t2, index2, update_derivatives=False, stationary=False):
"""Helper function for computing part of the ode1 covariance function.
:param t: first time input.
:type t: array
:param index: Indices of first output.
:type index: array of int
:par... |
python | def config(self):
''' Read config automatically if required '''
if self.__config is None:
config_path = self.locate_config()
if config_path:
self.__config = self.read_file(config_path)
self.__config_path = config_path
return self.__config |
java | public StrBuilder deleteAll(final String str) {
final int len = (str == null ? 0 : str.length());
if (len > 0) {
int index = indexOf(str, 0);
while (index >= 0) {
deleteImpl(index, index + len, len);
index = indexOf(str, index);
}
... |
python | def auth_app_id(self, app_id, user_id, mount_point='app-id', use_token=True):
"""POST /auth/<mount point>/login
:param app_id:
:type app_id:
:param user_id:
:type user_id:
:param mount_point:
:type mount_point:
:param use_token:
:type use_token:
... |
java | public Locale getLocaleOrDefault(RouteContext routeContext) {
String language = getLanguageOrDefault(routeContext);
return Locale.forLanguageTag(language);
} |
java | static Writer getWriter(OutputStream output, String encoding)
throws UnsupportedEncodingException
{
for (int i = 0; i < _encodings.length; ++i)
{
if (_encodings[i].name.equalsIgnoreCase(encoding))
{
try
{
String jav... |
python | def _resolve_dut_count(self):
"""
Calculates total amount of resources required and their types.
:return: Nothing, modifies _dut_count, _hardware_count and
_process_count
:raises: ValueError if total count does not match counts of types separately.
"""
self._dut_... |
java | @Override
public void sawOpcode(int seen) {
if (seen == Const.INVOKEINTERFACE) {
String clsName = getClassConstantOperand();
String methodName = getNameConstantOperand();
if (queryClasses.contains(clsName) && queryMethods.contains(methodName)) {
queryLoca... |
python | def nsarg_completions(
completion_text: str,
entity_types: list,
bel_spec: BELSpec,
namespace: str,
species_id: str,
bel_fmt: str,
size: int,
):
"""Namespace completions
Args:
completion_text
entity_types: used to filter namespace search results
bel_spec: use... |
python | def surface_2D(num_lat=90, num_lon=180, water_depth=10., lon=None,
lat=None, **kwargs):
"""Creates a 2D slab ocean Domain in latitude and longitude with uniform water depth.
Domain has a single heat capacity according to the specified water depth.
**Function-call argument** \n
:param i... |
java | public final Queue pauseQueue(QueueName name) {
PauseQueueRequest request =
PauseQueueRequest.newBuilder().setName(name == null ? null : name.toString()).build();
return pauseQueue(request);
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.