language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def lengths_offsets(value):
"""Split the given comma separated value to multiple integer values. """
values = []
for item in value.split(','):
item = int(item)
values.append(item)
return values |
python | def _read_para_echo_request_signed(self, code, cbit, clen, *, desc, length, version):
"""Read HIP ECHO_REQUEST_SIGNED parameter.
Structure of HIP ECHO_REQUEST_SIGNED parameter [RFC 7401]:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3... |
python | def consume(self, callback, queue):
"""
Register a new consumer.
This consumer will be configured for every protocol this factory
produces so it will be reconfigured on network failures. If a connection
is already active, the consumer will be added to it.
Args:
... |
python | def hmac_md5(s, salt):
"""
获取一个字符串的 使用 salt 加密的 hmac MD5 值
:param:
* s: (string) 需要进行 hash 的字符串
* salt: (string) 随机字符串
:return:
* result: (string) 32位小写 MD5 值
"""
hmac_md5 = hmac.new(salt.encode('utf-8'), s.encode('utf-8'),
... |
python | def parent_element(self):
"""
Get the parent of the element
@rtype: WebElementWrapper
@return: Parent of webelementwrapper on which this was invoked
"""
def parent_element():
"""
Wrapper to get parent element
"""
par... |
java | public void processUserDefinedFields(List<Row> fields, List<Row> values)
{
// Process fields
Map<Integer, String> tableNameMap = new HashMap<Integer, String>();
for (Row row : fields)
{
Integer fieldId = row.getInteger("udf_type_id");
String tableName = row.getString("table_... |
python | def r(self, **kwargs):
"""
Resolve the object.
This returns default (if present) or fails on an Empty.
"""
# by using kwargs we ensure that usage of positional arguments, as if
# this object were another kind of function, will fail-fast and raise
# a TypeError
... |
java | private String buildConnectionDescription() {
List<String> descList = Lists.newArrayListWithExpectedSize(4);
for(ConnectionPoolSegment segment : segments) {
String desc = segment.dbConnection.getConnectionDescription();
if(!descList.contains(desc)) {
descList.add(desc);
... |
java | public static aaagroup_authorizationpolicy_binding[] get(nitro_service service, String groupname) throws Exception{
aaagroup_authorizationpolicy_binding obj = new aaagroup_authorizationpolicy_binding();
obj.set_groupname(groupname);
aaagroup_authorizationpolicy_binding response[] = (aaagroup_authorizationpolicy_b... |
python | def _fill_lookup_prop(self, testsuites_properties):
"""Fills the polarion-lookup-method property."""
if not self._lookup_prop:
raise Dump2PolarionException("Failed to set the 'polarion-lookup-method' property")
etree.SubElement(
testsuites_properties,
"proper... |
python | def get_aggregator_quotas(self, quota):
""" Fetch ancestors quotas that have the same name and are registered as aggregator quotas. """
ancestors = quota.scope.get_quota_ancestors()
aggregator_quotas = []
for ancestor in ancestors:
for ancestor_quota_field in ancestor.get_quo... |
python | def max_texture_limit(self):
"""The maximum number of textures available for this graphic card's fragment shader."""
max_unit_array = (gl.GLint * 1)()
gl.glGetIntegerv(gl.GL_MAX_TEXTURE_IMAGE_UNITS, max_unit_array)
return max_unit_array[0] |
java | public static List<Partition> getPartitions(IMetaStoreClient client, Table table, Optional<String> filter)
throws IOException {
return getPartitions(client, table, filter, Optional.<HivePartitionExtendedFilter>absent());
} |
java | public static RowMajorSparseMatrix random(int rows, int columns, double density, Random random) {
return CRSMatrix.random(rows, columns, density, random);
} |
python | def strings_equal(s1, s2):
"""
Timing-attack resistant string comparison.
Normal comparison using == will short-circuit on the first mismatching
character. This avoids that by scanning the whole string, though we
still reveal to a timing attack whether the strings are the same
length.
"""
... |
python | def rubberstamp(rest):
"Approve something"
parts = ["Bad credit? No credit? Slow credit?"]
rest = rest.strip()
if rest:
parts.append("%s is" % rest)
karma.Karma.store.change(rest, 1)
parts.append("APPROVED!")
return " ".join(parts) |
python | def dump(data_structure):
"""Dump will create a human readable version of your data-structure.
It will try to dump almost anything, it has recursion detection and
will try to display the recursion in a meaningful way.
:param data_structure: The structure to convert.
When you freeze only content ... |
java | public void inc(String name, int con) throws IOException
{
if (hasLocalVariable(name))
{
tinc(name, con);
}
else
{
VariableElement field = El.getField(subClass, name);
if (field == null)
{
throw new Il... |
java | static Generator serialMinuteGenerator(final int interval, final DateValue dtStart) {
final TimeValue dtStartTime = TimeUtils.timeOf(dtStart);
return new Generator() {
int minute = dtStartTime.minute() - interval;
int hour = dtStartTime.hour();
int day = dtStart.day();
int month = dtStart.month();
in... |
java | public static double atof(String s) {
int i = 0;
int sign = 1;
double r = 0; // integer part
double p = 1; // exponent of fractional part
int state = 0; // 0 = int part, 1 = frac part
while (i < s.length() && Character.isWhitespace(s.charAt(i)))
i++;
... |
java | public ServiceBuilder withStorageFactory(Function<ComponentSetup, StorageFactory> storageFactoryCreator) {
Preconditions.checkNotNull(storageFactoryCreator, "storageFactoryCreator");
this.storageFactoryCreator = storageFactoryCreator;
return this;
} |
java | public void marshall(StackError stackError, ProtocolMarshaller protocolMarshaller) {
if (stackError == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(stackError.getErrorCode(), ERRORCODE_BINDING);
... |
python | def values_list(
self, *fields_: str, flat: bool = False
) -> "ValuesListQuery": # pylint: disable=W0621
"""
Make QuerySet returns list of tuples for given args instead of objects.
If ```flat=True`` and only one arg is passed can return flat list.
"""
return ValuesLi... |
python | def _gsa_force(grav, mass_i, mass_j, position_i, position_j):
"""Gives the force of solution j on solution i.
Variable name in GSA paper given in ()
args:
grav: The gravitational constant. (G)
mass_i: The mass of solution i (derived from fitness). (M_i)
mass_j: The mass of solution... |
java | private static void usage() {
display("Usage: CSVLoader <params>");
display("where <params> are:");
display(" -app <name> Doradus application name. Default is: {}", CSVConfig.DEFAULT_APPNAME);
display(" -batchsize <#> Batch size. Default is: {}", CSVConfig.DEFAULT_BA... |
python | def configure_sources(update=False,
sources_var='install_sources',
keys_var='install_keys'):
"""Configure multiple sources from charm configuration.
The lists are encoded as yaml fragments in the configuration.
The fragment needs to be included as a string. Sourc... |
java | public DescribeAggregationAuthorizationsResult withAggregationAuthorizations(AggregationAuthorization... aggregationAuthorizations) {
if (this.aggregationAuthorizations == null) {
setAggregationAuthorizations(new com.amazonaws.internal.SdkInternalList<AggregationAuthorization>(aggregationAuthorizati... |
python | def parse_officials(self):
"""
Parse the officials
:returns: ``self`` on success, ``None`` otherwise
"""
# begin proper body of method
lx_doc = self.html_doc()
off_parser = opm(self.game_key.season)
self.officials = off_parser(lx_doc)
return self... |
java | public static <K, V> Map<K, V> drop(Map<K, V> self, int num) {
if (self.size() <= num) {
return createSimilarMap(self);
}
if (num == 0) {
return cloneSimilarMap(self);
}
Map<K, V> ret = createSimilarMap(self);
for (Map.Entry<K, V> entry : self.entr... |
java | public static AclEntry fromCliString(String stringEntry) {
if (stringEntry == null) {
throw new IllegalArgumentException("Input acl string is null");
}
List<String> components = Arrays.stream(stringEntry.split(":")).map(String::trim).collect(
Collectors.toList());
if (!((components.size() ... |
python | def _setfile(self, filename, length, offset):
"""Use file as source of bits."""
source = open(filename, 'rb')
if offset is None:
offset = 0
if length is None:
length = os.path.getsize(source.name) * 8 - offset
byteoffset, offset = divmod(offset, 8)
... |
python | def bbox_transform(ex_rois, gt_rois, box_stds):
"""
compute bounding box regression targets from ex_rois to gt_rois
:param ex_rois: [N, 4]
:param gt_rois: [N, 4]
:return: [N, 4]
"""
assert ex_rois.shape[0] == gt_rois.shape[0], 'inconsistent rois number'
ex_widths = ex_rois[:, 2] - ex_ro... |
python | def get_sequences(self, pdb_id = None):
'''Create Sequence objects for each FASTA sequence.'''
sequences = {}
if pdb_id:
for chain_id, sequence in self.get(pdb_id, {}).iteritems():
sequences[chain_id] = Sequence.from_sequence(chain_id, sequence)
else:
... |
java | public Element addClass(String className) {
Validate.notNull(className);
Set<String> classes = classNames();
classes.add(className);
classNames(classes);
return this;
} |
java | @RequestMapping(value = "/cloud/volume/refresh", method = POST, consumes = APPLICATION_JSON_VALUE,
produces = APPLICATION_JSON_VALUE)
public ResponseEntity<Collection<String>> refreshVolumes(
@Valid @RequestBody CloudVolumeListRefreshRequest request) {
return ResponseEntity.ok().bod... |
java | public static Response.ResponseBuilder makeCORS(Response.ResponseBuilder responseBuilder,
String returnMethod) {
// TODO(william): Make origin, methods, and headers configurable.
Response.ResponseBuilder rb = responseBuilder.header("Access-Control-Allow-Origin", "*")
.header("Access-Control-Allow-... |
java | public void marshall(UpdateVirtualServiceRequest updateVirtualServiceRequest, ProtocolMarshaller protocolMarshaller) {
if (updateVirtualServiceRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshal... |
python | def find_version_by_regex(file_source): # type: (str)->Optional[str]
"""
Regex for dunder version
"""
if not file_source:
return None
version_match = re.search(r"^version=['\"]([^'\"]*)['\"]", file_source, re.M)
if version_match:
return version_match.group(1)
return None |
python | async def expn(
self, address: str, timeout: DefaultNumType = _default
) -> SMTPResponse:
"""
Send an SMTP EXPN command, which expands a mailing list.
Not many servers support this command.
:raises SMTPResponseException: on unexpected server response code
"""
... |
java | public void setValidationParameter(byte[] validationParameter) throws InvalidArgumentException {
if (null == validationParameter) {
throw new InvalidArgumentException("The valdiationParameter parameter can not be null.");
}
this.validationParameter = ByteString.copyFrom(validationPar... |
python | def get_manual_homology_models(self, input_dict, outdir=None, clean=True, force_rerun=False):
"""Copy homology models to the GEM-PRO project.
Requires an input of a dictionary formatted like so::
{
model_gene: {
homology_model_id1: {
... |
python | def GetRosettaResidueMap(self, ConvertMSEToAtom = False, RemoveIncompleteFinalResidues = False, RemoveIncompleteResidues = False):
'''Note: This function ignores any DNA.'''
raise Exception('This code looks to be deprecated. Use construct_pdb_to_rosetta_residue_map instead.')
chain = None
... |
python | def sec(self, s):
"""
Parse a public pair as a text SEC.
Return a :class:`Key <pycoin.key.Key>` or None.
"""
pair = parse_colon_prefix(s)
if pair is not None and pair[0] == self._wif_prefix:
s = pair[1]
try:
sec = h2b(s)
return ... |
java | public static boolean allEquals(final String value, final String... strings) {
if (strings != null) {
for (final String s : strings) {
if (s == null && value != null || s != null && !s.equals(value)) {
return false;
}
}
}... |
java | public OneLoginResponse<User> getUsersBatch(int batchSize) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
return getUsersBatch(batchSize, null);
} |
python | def get_block_height(self, is_full: bool = False) -> int or dict:
"""
This interface is used to get the decimal block height in current network.
Return:
the decimal total height of blocks in current network.
"""
response = self.get_block_count(is_full=True)
r... |
java | public void marshall(Entitlement entitlement, ProtocolMarshaller protocolMarshaller) {
if (entitlement == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(entitlement.getDescription(), DESCRIPTION_BIND... |
java | @Override
public Float set(int index, Float element) {
return set(index, element.floatValue());
} |
java | private static void appendPathElt(final Object pathElt, final StringBuilder buf) {
if (buf.length() > 0) {
buf.append(File.pathSeparatorChar);
}
// Escape any rogue path separators, as long as file separator is not '\\' (on Windows, if there are any
// extra ';' characters in... |
java | final int awaitJoin(WorkQueue w, ForkJoinTask<?> task, long deadline) {
int s = 0;
if (w != null) {
ForkJoinTask<?> prevJoin = w.currentJoin;
if (task != null && (s = task.status) >= 0) {
w.currentJoin = task;
CountedCompleter<?> cc = (task instanc... |
python | def coarsen_data(x, y, ey=None, ex=None, level=2, exponential=False):
"""
Coarsens the supplied data set. Returns coarsened arrays of x, y, along with
quadrature-coarsened arrays of ey and ex if specified.
Parameters
----------
x, y
Data arrays. Can be lists (will convert to numpy a... |
python | def do_check_artifact_cache(self, vts, post_process_cached_vts=None):
"""Checks the artifact cache for the specified list of VersionedTargetSets.
Returns a tuple (cached, uncached, uncached_causes) of VersionedTargets that were
satisfied/unsatisfied from the cache.
"""
if not vts:
return [], ... |
python | def from_btl(fname):
"""
DataFrame constructor to open Seabird CTD BTL-ASCII format.
Examples
--------
>>> from pathlib import Path
>>> import ctd
>>> data_path = Path(__file__).parents[1].joinpath("tests", "data")
>>> bottles = ctd.from_btl(data_path.joinpath('btl', 'bottletest.btl'))
... |
python | def hcons(xmrs):
"""Return the list of all HandleConstraints in *xmrs*."""
return [
HandleConstraint(hi, reln, lo)
for hi, reln, lo in sorted(xmrs.hcons(), key=lambda hc: var_id(hc[0]))
] |
python | def blend(self, other):
"""Alpha blend *other* on top of the current image."""
raise NotImplementedError("This method has not be implemented for "
"xarray support.")
if self.mode != "RGBA" or other.mode != "RGBA":
raise ValueError("Images must be in... |
python | def populate(self):
"""Populates a new cache.
"""
if self.exists:
raise CacheAlreadyExistsException('location: %s' % self.cache_uri)
self._populate_setup()
with closing(self.graph):
with self._download_metadata_archive() as metadata_archive:
... |
python | def user_hostname(self, vm_name=None):
'''
Return a string combining user and hostname, e.g. 'vagrant@127.0.0.1'.
This string is suitable for use in an ssh commmand. If user is None
or empty, it will be left out of the string, e.g. 'localhost'. If
hostname is None, have bigger ... |
python | def bag(directory, mets_basename, dest, identifier, in_place, manifestation_depth, mets, base_version_checksum, tag_file, skip_zip, processes):
"""
Bag workspace as OCRD-ZIP at DEST
"""
resolver = Resolver()
workspace = Workspace(resolver, directory=directory, mets_basename=mets_basename)
worksp... |
java | public static final int getShort(byte[] data, int offset)
{
int result = 0;
int i = offset;
for (int shiftBy = 0; shiftBy < 16; shiftBy += 8)
{
result |= ((data[i] & 0xff)) << shiftBy;
++i;
}
return result;
} |
python | def parse_title(self, docname):
"""Parse a document title as the first line starting in [A-Za-z0-9<]
or fall back to the document basename if no such line exists.
The cmake --help-*-list commands also depend on this convention.
Return the title or False if the document file does... |
java | public static byte[] encryptBytes (PublicKey key, byte[] secret, byte[] salt)
{
byte[] encrypt = new byte[secret.length + salt.length];
for (int ii = 0; ii < secret.length; ii++) {
encrypt[ii] = secret[ii];
}
for (int ii = 0; ii < salt.length; ii++) {
encrypt[... |
java | public static Object autoMap(Object o, Class<?> cls) {
if (o == null)
return o;
else if (cls.isAssignableFrom(o.getClass())) {
return o;
} else {
if (o instanceof java.sql.Date) {
java.sql.Date d = (java.sql.Date) o;
if (cls.isA... |
java | protected static ActivityManager.MemoryInfo getMemInfo(Context ctx) {
try {
ActivityManager actManager = (ActivityManager) ctx.getSystemService(ACTIVITY_SERVICE);
ActivityManager.MemoryInfo memInfo = new ActivityManager.MemoryInfo();
actManager.getMemoryInfo(memInfo);
... |
python | def _make_actor_method_executor(self, method_name, method, actor_imported):
"""Make an executor that wraps a user-defined actor method.
The wrapped method updates the worker's internal state and performs any
necessary checkpointing operations.
Args:
method_name (str): The n... |
python | def get_url(access_token, endpoint=ams_rest_endpoint, flag=True):
'''Get Media Services Final Endpoint URL.
Args:
access_token (str): A valid Azure authentication token.
endpoint (str): Azure Media Services Initial Endpoint.
flag (bol): flag.
Returns:
HTTP response. JSON bod... |
python | def call(self, method, args={}, retry=False, retry_policy=None,
ticket=None, **props):
"""Send message to the same actor and return :class:`AsyncResult`."""
ticket = ticket or uuid()
reply_q = self.get_reply_queue(ticket)
self.cast(method, args, declare=[reply_q], reply_to=t... |
java | protected Member findMostSpecificMemberIn (List<Member> memberList)
throws NoSuchMethodException
{
List<Member> mostSpecificMembers = new ArrayList<Member>();
for (Member member : memberList) {
if (mostSpecificMembers.isEmpty()) {
// First guy in is the most spec... |
java | public AnimatedImageResultBuilder setDecodedFrames(
List<CloseableReference<Bitmap>> decodedFrames) {
mDecodedFrames = CloseableReference.cloneOrNull(decodedFrames);
return this;
} |
python | def get(self, sid):
"""
Constructs a ParticipantContext
:param sid: A 34 character string that uniquely identifies this resource.
:returns: twilio.rest.messaging.v1.session.participant.ParticipantContext
:rtype: twilio.rest.messaging.v1.session.participant.ParticipantContext
... |
python | def _clear(self):
'''Clear state.
'''
self._depth = 0 # recursion depth
self._duplicate = 0
self._incl = '' # or ' (incl. code)'
self._missed = 0 # due to errors
self._profile = False
self._profs = {}
self._seen = {}
... |
java | public static String getRequestParameters(HttpServletRequest aRequest) {
// set the ALGORIGTHM as defined for the application
// ALGORITHM = (String) aRequest.getAttribute(Constants.ENC_ALGORITHM);
Map m = aRequest.getParameterMap();
return createQueryStringFromMap(m, "&").toString();
} |
java | public static <T> void sort(List<T> list, Comparator<? super T> comparator) {
if (list instanceof RandomAccess) {
quicksort(list, comparator);
} else {
List<T> copy = new ArrayList<>(list);
quicksort(copy, comparator);
list.clear();
list.addAll(copy);
}
} |
python | def live(self):
"""Get a live stream of timeseries readings.
This returns an Iterable over a live stream of readings. Note
that the result will need to be closed since the system can
not tell when you'll be done with it.
You can either call ``close`` on the endpoint when you're... |
java | public static Cookie getSSOCookieFromSSOToken() throws Exception {
Subject subject = null;
Cookie ltpaCookie = null;
if (webAppSecConfig == null) {
// if we don't have the config, we can't construct the cookie
return null;
}
try {
subject = WSS... |
java | protected Optional<Dataset> createJobProps(Dataset dataset) throws IOException {
if (this.recompactFromOutputPaths && (!latePathsFound(dataset))) {
LOG.info(String.format("Skipping recompaction for %s since there is no late data in %s",
new Object[] { dataset.inputPaths(), dataset.inputLatePaths() }... |
python | def get_subgraphs_as_molecules(self, use_weights=False):
"""
Retrieve subgraphs as molecules, useful for extracting
molecules from periodic crystals.
Will only return unique molecules, not any duplicates
present in the crystal (a duplicate defined as an
isomorphic subgra... |
java | private void notifyBroadcastClose() {
final IStreamAwareScopeHandler handler = getStreamAwareHandler();
if (handler != null) {
try {
handler.streamBroadcastClose(this);
} catch (Throwable t) {
log.error("Error in notifyBroadcastClose", t);
... |
java | public static String findNearest( String key, String[] group ) {
return findNearest(key,Arrays.asList(group));
} |
java | public void setFastCatchupTimeSecs(long secondsSinceEpoch) {
lock.lock();
try {
checkState(chain == null || !chain.shouldVerifyTransactions(), "Fast catchup is incompatible with fully verifying");
fastCatchupTimeSecs = secondsSinceEpoch;
if (downloadPeer != null) {
... |
python | def delete_api_key(apiKey, region=None, key=None, keyid=None, profile=None):
'''
Deletes a given apiKey
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_api_key apikeystring
'''
try:
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
... |
python | def field(self, name):
'''
Get the gdb.Value for the given field within the PyObject, coping with
some python 2 versus python 3 differences.
Various libpython types are defined using the "PyObject_HEAD" and
"PyObject_VAR_HEAD" macros.
In Python 2, this these are defined... |
java | public static String replaceAll(
String pattern, CharSequence input, String replacement) {
input = new InterruptibleCharSequence(input);
Matcher m = getMatcher(pattern, input);
String res = m.replaceAll(replacement);
recycleMatcher(m);
return res;
} |
python | def user_agent(self):
"""Return the formatted user agent string."""
components = ["/".join(x) for x in self.user_agent_components.items()]
return " ".join(components) |
python | def remove_redundant_items(items):
# type: (List[AbstractType]) -> List[AbstractType]
"""Filter out redundant union items."""
result = []
for item in items:
for other in items:
if item is not other and is_redundant_union_item(item, other):
break
else:
... |
java | public Datapoint addDoubleValue(long time, double value) {
initialValues();
checkType(TsdbConstants.TYPE_DOUBLE);
values.add(Lists.<JsonNode> newArrayList(new LongNode(time), new DoubleNode(value)));
return this;
} |
python | def add_to_island_expectations_dict(average_window_readcount,
current_max_scaled_score,
island_eligibility_threshold,
island_expectations, gap_contribution):
# type: ( float, int, float, Dict[int, float], flo... |
java | public static void clearRecentHistory(Context context) {
SearchHistoryDatabase database = SearchHistoryDatabase.getInstance(context);
SearchHistoryDatabase.deleteAllData(database);
} |
java | private static URI asRefBase( JsonString uri)
{
try
{
return
uri == null
? null
: new URI( uri.getChars().toString());
}
catch( Exception e)
{
throw new ProjectException( String.format( "Error defining reference base=%s", uri), e);
}
} |
java | public void purge()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "purge");
synchronized(queueMonitor)
{
state = CLOSED;
for (int i=0; i < JFapChannelConstants.MAX_PRIORITY_LEVELS-1; ++i)
{
queueArray[i].monitor.setActive(false);
}
... |
python | def conjugate(self):
""":obj:`DualQuaternion`: The conjugate of this quaternion.
"""
qr_c_xyzw = quaternion_conjugate(self._qr)
qd_c_xyzw = quaternion_conjugate(self._qd)
qr_c_wxyz = np.roll(qr_c_xyzw, 1)
qd_c_wxyz = np.roll(qd_c_xyzw, 1)
return DualQuaternion(qr... |
python | def disk(x, y, height, gaussian_width):
"""
Circular disk with Gaussian fall-off after the solid central region.
"""
disk_radius = height/2.0
distance_from_origin = np.sqrt(x**2+y**2)
distance_outside_disk = distance_from_origin - disk_radius
sigmasq = gaussian_width*gaussian_width
if ... |
python | def zSetDefaultMeritFunctionSEQ(self, ofType=0, ofData=0, ofRef=0, pupilInteg=0, rings=0,
arms=0, obscuration=0, grid=0, delVignetted=False, useGlass=False,
glassMin=0, glassMax=1000, glassEdge=0, useAir=False, airMin=0,
... |
java | @Override
public DataPoint[] getLastN(int n, DataPoint.Type type) {
return getLastN(n, 1, type);
} |
java | protected Map<String, Role> parseDefinedRoles(Config config) {
// Parse the defined Roles
Map<String, Role> roleMap = new HashMap<>();
if (!config.hasPath("roles")) {
log.trace("'{}' has no roles", config);
} else if (config.hasPath("roles")) {
log.trace("Parsing ... |
java | @Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {
clearSession(request);
JSONObject json = ServletHelpers.readObject(request.getReader());
String username = (String) json.get("username");
String password = (String) json.ge... |
python | def while_loop(cond_fn, body_fn, inputs, num_loop_vars=None,
has_accumulators=False, **kwargs):
"""While Loop.
See comments above for WhileLoopOperation
num_loop_vars is a hack for the multi-gpu setup. In this case, loops
are generally slow, as all loop variables are placed on device. By sett... |
python | def select_as_multiple(self, keys, where=None, selector=None, columns=None,
start=None, stop=None, iterator=False,
chunksize=None, auto_close=False, **kwargs):
""" Retrieve pandas objects from multiple tables
Parameters
----------
ke... |
java | public String getNaturalAnalog() {
MonomerFactory factory = null;
try {
factory = MonomerFactory.getInstance();
} catch (Exception ex) {
Logger.getLogger(Nucleotide.class.getName()).log(Level.SEVERE, "Unable to initialize monomer factory", ex);
}
return getNaturalAnalog(factory.getMonome... |
python | def add_dr( self, dr ):
"""
Add an observed interatomic distance to the g(r) data at dr.
Args:
dr (Float): the interatomic distance, dr.
Returns:
None
"""
this_bin = int( dr / self.dr )
if this_bin > self.number_of_bins:
rai... |
java | Observable<ComapiResult<List<Conversation>>> doGetConversations(@NonNull final String token, @NonNull final String profileId, @NonNull final Scope scope) {
return wrapObservable(service.getConversations(AuthManager.addAuthPrefix(token), apiSpaceId, scope.getValue(), profileId).map(mapToComapiResult()), log, "Ge... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.