language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | public static Date getDateFromLong(long date)
{
TimeZone tz = TimeZone.getDefault();
return (new Date(date - tz.getRawOffset()));
} |
python | def search(self, pattern, minAddr = None, maxAddr = None):
"""
Search for the given pattern within the process memory.
@type pattern: str, compat.unicode or L{Pattern}
@param pattern: Pattern to search for.
It may be a byte string, a Unicode string, or an instance of
... |
java | public void marshall(AuthorizationConfig authorizationConfig, ProtocolMarshaller protocolMarshaller) {
if (authorizationConfig == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(authorizationConfig.ge... |
java | public void start() {
this.factoryTracker.open();
Dictionary<String, String> props = new Hashtable<String, String>();
props.put(Constants.APPLICATION_NAME, applicationName);
serviceRegistration = paxWicketBundleContext.registerService(PaxWicketInjector.class, this, props);
} |
java | public boolean setBranchKey(String key) {
Branch_Key = key;
String currentBranchKey = getString(KEY_BRANCH_KEY);
if (key == null || currentBranchKey == null || !currentBranchKey.equals(key)) {
clearPrefOnBranchKeyChange();
setString(KEY_BRANCH_KEY, key);
retur... |
java | @Override
public void setValue(final List<T> value) {
if (list == null && value == null) {
// fast exit
return;
}
if (list != null && list.isSameValue(value)) {
// setting the same value as the one being edited
list.refresh();
return;
}
if (list != null) {
// H... |
python | def find_resource_class(resource_path):
"""
dynamically load a class from a string
"""
class_path = ResourceTypes[resource_path]
# First prepend our __name__ to the resource string passed in.
full_path = '.'.join([__name__, class_path])
class_data = full_path.split(".")
module_path = "."... |
python | def aa_counts(aln, weights=None, gap_chars='-.'):
"""Calculate the amino acid frequencies in a set of SeqRecords.
Weights for each sequence in the alignment can be given as a list/tuple,
usually calculated with the sequence_weights function. For convenience, you
can also pass "weights=True" and the wei... |
java | public final void short_key() throws RecognitionException {
Token id=null;
try {
// src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:772:5: ({...}? =>id= ID )
// src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:772:12: {...}? =>id= ID
{
if ( !(((helper.validateIdentifierKey(Dr... |
java | public void performEpilogue(ActionRuntime runtime) { // fixed process
if (runtime.isForwardToHtml()) {
arrangeNoCacheResponseWhenJsp(runtime);
}
handleSqlCount(runtime);
handleMailCount(runtime);
handleRemoteApiCount(runtime);
clearCallbackContext();
c... |
java | public Map<TimestampMode, List<String>> getDefaultTimestampModes() {
Map<TimestampMode, List<String>> result = new HashMap<TimestampMode, List<String>>();
for (String resourcetype : m_defaultTimestampModes.keySet()) {
TimestampMode mode = m_defaultTimestampModes.get(resourcetype);
... |
python | def allele_plot(file, normalize=False, alleles=None, generations=None):
"""Plot the alleles from each generation from the individuals file.
This function creates a plot of the individual allele values as they
change through the generations. It creates three subplots, one for each
of the best, media... |
python | def fast_spearman(x, y=None, destination=None):
"""calculate the spearman correlation matrix for the columns of x (with dimensions MxN), or optionally, the spearman correlaton
matrix between the columns of x and the columns of y (with dimensions OxP). If destination is provided, put the results there.
In t... |
java | public static Concept deserialiseConcept(String s) {
if(unmarshaller == null) init();
try {
Object res = unmarshaller.unmarshal(new ByteArrayInputStream(s.getBytes()));
return (Concept) res;
} catch(JAXBException e) {
log.error("There was a problem deserialisi... |
java | @Override
public ExportBundleResult exportBundle(ExportBundleRequest request) {
request = beforeClientExecution(request);
return executeExportBundle(request);
} |
java | public static Dynamic ofField(FieldDescription.InDefinedShape fieldDescription) {
if (!fieldDescription.isStatic() || !fieldDescription.isFinal()) {
throw new IllegalArgumentException("Field must be static and final: " + fieldDescription);
}
boolean selfDeclared = fie... |
python | def genty_dataprovider(builder_function):
"""Decorator defining that this test gets parameters from the given
build_function.
:param builder_function:
A callable that returns parameters that will be passed to the method
decorated by this decorator.
If the builder_function returns a... |
python | def postprocess_keyevent(self, event):
"""Process keypress event"""
ShellBaseWidget.postprocess_keyevent(self, event)
if QToolTip.isVisible():
_event, _text, key, _ctrl, _shift = restore_keyevent(event)
self.hide_tooltip_if_necessary(key) |
python | def list_quantum_computers(connection: ForestConnection = None,
qpus: bool = True,
qvms: bool = True) -> List[str]:
"""
List the names of available quantum computers
:param connection: An optional :py:class:ForestConnection` object. If not specified,
... |
java | public static <Vertex> BiDiNavigator<SCComponent<Vertex>> getSccBiDiNavigator() {
return
new BiDiNavigator<SCComponent<Vertex>>() {
public List<SCComponent<Vertex>> next(SCComponent<Vertex> scc) {
return scc.next();
}
public List<SCComponent<Vertex>> prev(SCComponent<Vertex> scc) {
... |
java | public static boolean isEmptyAll(String... args) {
for (String arg : args) {
if (!isEmpty(arg)) {
return false;
}
}
return true;
} |
python | def _sanitise_list(arg_list):
"""A generator for iterating through a list of gpg options and sanitising
them.
:param list arg_list: A list of options and flags for GnuPG.
:rtype: generator
:returns: A generator whose next() method returns each of the items in
``arg_list`` after callin... |
python | def _get_tau(self, C, mag):
"""
Returns magnitude dependent inter-event standard deviation (tau)
(equation 14)
"""
if mag < 6.5:
return C["tau1"]
elif mag < 7.:
return C["tau1"] + (C["tau2"] - C["tau1"]) * ((mag - 6.5) / 0.5)
else:
... |
java | private static int extractInt(byte[] arr, int offset) {
return ((arr[offset] & 0xFF) << 24) | ((arr[offset + 1] & 0xFF) << 16) | ((arr[offset + 2] & 0xFF) << 8)
| (arr[offset + 3] & 0xFF);
} |
python | def create_method(self):
"""
Build the estimator method or function.
Returns
-------
:return : string
The built method as string.
"""
n_indents = 0 if self.target_language in ['c', 'go'] else 1
method_type = 'separated.{}.method'.format(self.p... |
python | def mod_aggregate(low, chunks, running):
'''
The mod_aggregate function which looks up all packages in the available
low chunks and merges them into a single pkgs ref in the present low data
'''
pkgs = []
pkg_type = None
agg_enabled = [
'installed',
'removed',
]
if lo... |
java | private void checkIndices(int row, int col, boolean expand) {
if (row < 0 || col < 0) {
throw new ArrayIndexOutOfBoundsException();
}
if (expand) {
int r = row + 1;
int cur = 0;
while (r > (cur = rows.get()) && !rows.compareAndSet(cur, r))
... |
python | def wait_for_tasks(self, raise_if_error=True):
"""
Wait for the running tasks lauched from the sessions.
Note that it also wait for tasks that are started from other tasks
callbacks, like on_finished.
:param raise_if_error: if True, raise all possible encountered
er... |
python | def _check_types(func_name, types, func_args, defaults):
"""Make sure that enough types were given to ensure conversion. Also remove
potential Self/Class arguments.
Args:
func_name: name of the decorated function
types: a list of Python types to which the argument will be converted
... |
java | public synchronized boolean contains(EvidenceType type, Confidence confidence) {
if (null == type) {
return false;
}
final Set<Evidence> col;
switch (type) {
case VENDOR:
col = vendors;
break;
case PRODUCT:
... |
java | @Override
public VALUE get(KEY key) {
return key != null ? getMap().get(key) : null;
} |
java | public Integer extractArchiveDateCount(String datePattern) {
int dateCount = 0;
String[] splits = datePattern.split("d|M|y");
if (splits.length > 0) {
dateCount = dateCount + Integer.valueOf(splits[0]);
}
if (splits.length > 1) {
dateCount = dateCount + (I... |
python | def async_send(self, url, data, headers, success_cb, failure_cb):
"""
Spawn an async request to a remote webserver.
"""
# this can be optimized by making a custom self.send that does not
# read the response since we don't use it.
self._lock.acquire()
return gevent... |
java | public Observable<RouteFilterRuleInner> updateAsync(String resourceGroupName, String routeFilterName, String ruleName, PatchRouteFilterRule routeFilterRuleParameters) {
return updateWithServiceResponseAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters).map(new Func1<ServiceResponse<Ro... |
java | public void setAvailablePolicyTypes(java.util.Collection<PolicyTypeSummary> availablePolicyTypes) {
if (availablePolicyTypes == null) {
this.availablePolicyTypes = null;
return;
}
this.availablePolicyTypes = new java.util.ArrayList<PolicyTypeSummary>(availablePolicyTypes... |
python | def create_version(self, version_label):
'''
method to create a new version of the resource as it currently stands
- Note: this will create a version based on the current live instance of the resource,
not the local version, which might require self.update() to update.
Args:
version_label (str): label... |
java | @Override
public java.util.List<com.liferay.commerce.product.model.CProduct> getCProducts(
int start, int end) {
return _cProductLocalService.getCProducts(start, end);
} |
java | private void addInitialFactPattern( final GroupElement subrule ) {
// creates a pattern for initial fact
final Pattern pattern = new Pattern( 0,
ClassObjectType.InitialFact_ObjectType );
// adds the pattern as the first child of the given AND group ... |
java | protected void runAsyncWithoutFencing(Runnable runnable) {
if (rpcServer instanceof FencedMainThreadExecutable) {
((FencedMainThreadExecutable) rpcServer).runAsyncWithoutFencing(runnable);
} else {
throw new RuntimeException("FencedRpcEndpoint has not been started with a FencedMainThreadExecutable RpcServer."... |
python | def range(self, key, size=None, unique=True):
"""Returns a generator of nodes' configuration available
in the continuum/ring.
:param key: the key to look for.
:param size: limit the list to at most this number of nodes.
:param unique: a node may only appear once in the list (def... |
python | def _create_m_objective(w, X):
"""
Creates an objective function and its derivative for M, given W and X
Args:
w (array): clusters x cells
X (array): genes x cells
"""
clusters, cells = w.shape
genes = X.shape[0]
w_sum = w.sum(1)
def objective(m):
m = m.reshape((... |
java | public ArrayList<OvhRadiusConnectionLog> serviceName_radiusConnectionLogs_GET(String serviceName) throws IOException {
String qPath = "/xdsl/{serviceName}/radiusConnectionLogs";
StringBuilder sb = path(qPath, serviceName);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t17);
} |
python | def parse_coach_go(infile):
"""Parse a GO output file from COACH and return a rank-ordered list of GO term predictions
The columns in all files are: GO terms, Confidence score, Name of GO terms. The files are:
- GO_MF.dat - GO terms in 'molecular function'
- GO_BP.dat - GO terms in 'bi... |
java | public static Class<?> erase(Type type)
{
if (type instanceof Class<?>)
{
return (Class<?>) type;
}
else if (type instanceof ParameterizedType)
{
return (Class<?>) ((ParameterizedType) type).getRawType();
}
else if (type instanceof TypeVariable<?>)
{
TypeVariable<?> tv = (TypeVaria... |
java | public CMASpace fetchOne(String spaceId) {
assertNotNull(spaceId, "spaceId");
return service.fetchOne(spaceId).blockingFirst();
} |
python | def export(self, name, columns, points):
"""Write the points in RabbitMQ."""
data = ('hostname=' + self.hostname + ', name=' + name +
', dateinfo=' + datetime.datetime.utcnow().isoformat())
for i in range(len(columns)):
if not isinstance(points[i], Number):
... |
python | def expand(self, id):
""" Expand a concept or collection to all it's narrower concepts.
If the id passed belongs to a :class:`skosprovider.skos.Concept`,
the id of the concept itself should be include in the return value.
:param str id: A concept or collection id.
:retur... |
python | def Param(name, value=None, unit=None, ucd=None, dataType=None, utype=None,
ac=True):
"""
'Parameter', used as a general purpose key-value entry in the 'What' section.
May be assembled into a :class:`Group`.
NB ``name`` is not mandated by schema, but *is* mandated in full spec.
Args:
... |
java | public void marshall(CreateEndpointConfigRequest createEndpointConfigRequest, ProtocolMarshaller protocolMarshaller) {
if (createEndpointConfigRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshal... |
java | protected Element createGroup(String namespace, Object parent, Object group, String type) {
Element parentElement;
if (parent == null) {
parentElement = getRootElement();
} else {
parentElement = getGroup(parent);
}
if (parentElement == null) {
return null;
} else {
Element element;
String id... |
python | def raw_custom_event(sender, event_name,
payload,
user,
send_hook_meta=True,
instance=None,
**kwargs):
"""
Give a full payload
"""
HookModel = get_hook_model()... |
java | public int install(int appId, int spaceId) {
return getResourceFactory()
.getApiResource("/app/" + appId + "/install")
.entity(new ApplicationInstall(spaceId),
MediaType.APPLICATION_JSON_TYPE)
.post(ApplicationCreateResponse.class).getId();
} |
python | def jac_uniform(X, cells):
"""The approximated Jacobian is
partial_i E = 2/(d+1) (x_i int_{omega_i} rho(x) dx - int_{omega_i} x rho(x) dx)
= 2/(d+1) sum_{tau_j in omega_i} (x_i - b_{j, rho}) int_{tau_j} rho,
see Chen-Holst. This method here assumes uniform density, rho(x) = 1, such tha... |
java | public static HttpUrl presignV4(Request request, String region, String accessKey, String secretKey, int expires)
throws NoSuchAlgorithmException, InvalidKeyException {
String contentSha256 = "UNSIGNED-PAYLOAD";
DateTime date = DateFormat.AMZ_DATE_FORMAT.parseDateTime(request.header("x-amz-date"));
Sign... |
java | public void writeSmallShortArray( short[] values ) {
int byteSize = values.length * 2 + 1;
this.addUnsignedByte( ( short ) values.length );
doWriteShortArray( values, byteSize );
} |
java | public void writeMBeanQuery(OutputStream out, MBeanQuery value) throws IOException {
writeStartObject(out);
writeObjectNameField(out, OM_OBJECTNAME, value.objectName);
// TODO: Produce proper JSON for QueryExp?
writeSerializedField(out, OM_QUERYEXP, value.queryExp);
writeStringFi... |
python | def _update_with_merge_lists(self, other, key, val=None, **options):
"""
Similar to _update_with_merge but merge lists always.
:param self: mapping object to update with 'other'
:param other: mapping object to update 'self'
:param key: key of mapping object to update
:param val: value to update... |
java | @Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case AfplibPackage.CFI__FIXED_LENGTH_RG:
return getFixedLengthRG();
}
return super.eGet(featureID, resolve, coreType);
} |
python | def cli(wio):
'''
Login with your Wio account.
\b
DOES:
Login and save an access token for interacting with your account on the Wio.
\b
USE:
wio login
'''
mserver = wio.config.get("mserver", None)
if mserver:
click.echo(click.style('> ', fg='green') + "Curre... |
java | public Observable<List<ExplicitListItem>> getExplicitListAsync(UUID appId, String versionId, UUID entityId) {
return getExplicitListWithServiceResponseAsync(appId, versionId, entityId).map(new Func1<ServiceResponse<List<ExplicitListItem>>, List<ExplicitListItem>>() {
@Override
public Lis... |
python | def update_warning(self):
"""
Updates the icon and tip based on the validity of the array content.
"""
widget = self._button_warning
if not self.is_valid():
tip = _('Array dimensions not valid')
widget.setIcon(ima.icon('MessageBoxWarning'))
... |
python | def update_dict(self, base: Dict[str, LinkItem], new: Dict[str, LinkItem]):
"""
Use for updating save state dicts and get the new save state dict. Provides a debug option at info level.
Updates the base dict. Basically executes `base.update(new)`.
:param base: base dict **gets overridde... |
java | public AsyncContext startAsync(ServletRequest servletRequest,
ServletResponse servletResponse)
throws IllegalStateException {
return request.startAsync(servletRequest, servletResponse);
} |
java | public Buffer copyTo(Buffer out, long offset, long byteCount) {
if (out == null) throw new IllegalArgumentException("out == null");
checkOffsetAndCount(size, offset, byteCount);
if (byteCount == 0) return this;
out.size += byteCount;
// Skip segments that we aren't copying from.
Segment s = he... |
java | public static int compareTo(
ReadableInstant start, ReadableInstant end, ReadableInstant instant) {
if (instant.isBefore(start)) {
return 1;
}
if (end.isAfter(instant)) {
return 0;
}
return -1;
} |
python | def get_all_events(self):
"""Make a list of all events in the TRIPS EKB.
The events are stored in self.all_events.
"""
self.all_events = {}
events = self.tree.findall('EVENT')
events += self.tree.findall('CC')
for e in events:
event_id = e.attrib['id'... |
java | public static <T extends ImageGray<T>>
DenseOpticalFlow<T> region( @Nullable ConfigOpticalFlowBlockPyramid config , Class<T> imageType )
{
if( config == null )
config = new ConfigOpticalFlowBlockPyramid();
DenseOpticalFlowBlockPyramid<T> alg;
if( imageType == GrayU8.class )
alg = (DenseOpticalFlowBlockPy... |
java | public static void main(String[] args) throws JMetalException {
DoubleProblem problem;
Algorithm<List<DoubleSolution>> algorithm;
MutationOperator<DoubleSolution> mutation;
String problemName;
if (args.length == 1) {
problemName = args[0];
} else {
problemName = "org.uma.jmetal.prob... |
python | def compound_crossspec(a_data, tbin, Df=None, pointProcess=False):
"""
Calculate cross spectra of compound signals.
a_data is a list of datasets (a_data = [data1,data2,...]).
For each dataset in a_data, the compound signal is calculated
and the crossspectra between these compound signals is computed... |
python | def apply_operation(op_stack, out_stack):
"""
Apply operation to the first 2 items of the output queue
op_stack Deque (reference)
out_stack Deque (reference)
"""
out_stack.append(calc(out_stack.pop(), out_stack.pop(), op_stack.pop())) |
java | public long getPositiveMillisOrDefault(HazelcastProperty property, long defaultValue) {
long millis = getMillis(property);
return millis > 0 ? millis : defaultValue;
} |
python | def from_inline(cls: Type[MembershipType], version: int, currency: str, membership_type: str,
inline: str) -> MembershipType:
"""
Return Membership instance from inline format
:param version: Version of the document
:param currency: Name of the currency
:para... |
java | private void parseSubHierarchy(final Node parent, final AvroNode n) {
final Node parsed;
if (n.getPackageNode() != null) {
parsed = new PackageNodeImpl(parent, getString(n.getName()), getString(n.getFullName()));
} else if (n.getNamedParameterNode() != null) {
final AvroNamedParameterNode np = n... |
python | def load_pdb(self, pdb_id, mapped_chains=None, pdb_file=None, file_type=None, is_experimental=True,
set_as_representative=False, representative_chain=None, force_rerun=False):
"""Load a structure ID and optional structure file into the structures attribute.
Args:
pdb_id (st... |
python | def __load_yml(self, stream):
"""Load yml stream into a dict object """
try:
return yaml.load(stream, Loader=yaml.SafeLoader)
except ValueError as e:
cause = "invalid yml format. %s" % str(e)
raise InvalidFormatError(cause=cause) |
python | def create_action(self):
"""Create actions associated with this widget.
Notes
-----
I think that this should be a function or a property.
The good thing about the property is that it is updated every time you
run it (for example, if you change some parameters in the set... |
java | public Object readObject(String correlationId, ConfigParams parameters) throws ApplicationException {
if (_path == null)
throw new ConfigException(correlationId, "NO_PATH", "Missing config file path");
try {
Path path = Paths.get(_path);
String json = new String(Files.readAllBytes(path));
json = param... |
java | private boolean checkSiVatId(final String pvatId) {
boolean checkSumOk;
final int checkSum = pvatId.charAt(9) - '0';
final int sum = (pvatId.charAt(2) - '0') * 8 + (pvatId.charAt(3) - '0') * 7
+ (pvatId.charAt(4) - '0') * 6 + (pvatId.charAt(5) - '0') * 5 + (pvatId.charAt(6) - '0') * 4
+... |
python | def retinotopy_anchors(mesh, mdl,
polar_angle=None, eccentricity=None,
weight=None, weight_min=0.1,
field_sign_weight=0, field_sign=None, invert_field_sign=False,
radius_weight=0, radius_weight_source='Wandell2015', radius=None,... |
java | public static long[] concatArrays(List<long[]> arrays, int start, int size) {
long[] result = new long[size];
// How many values we still need to move over
int howManyLeft = size;
// Where in the resulting array we're currently bulk-writing
int targetPosition = 0;
// Where we're copying *from*, in (one o... |
java | public static Object[] boxAll(Object src, int srcPos, int len) {
switch (tId(src.getClass())) {
case I_BOOLEAN: return box((boolean[]) src, srcPos, len);
case I_BYTE: return box((byte[]) src, srcPos, len);
case I_CHARACTER: return box((char[]) src, srcPos, len);
... |
python | def connect_patch_namespaced_pod_proxy(self, name, namespace, **kwargs):
"""
connect PATCH requests to proxy of Pod
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.connect_patch_namespaced_... |
python | def standard_sc_expr_str(sc):
"""
Standard symbol/choice printing function. Uses plain Kconfig syntax, and
displays choices as <choice> (or <choice NAME>, for named choices).
See expr_str().
"""
if sc.__class__ is Symbol:
return '"{}"'.format(escape(sc.name)) if sc.is_constant else sc.n... |
java | @SuppressWarnings("unchecked")
public T add(Iterable<Link> links) {
Assert.notNull(links, "Given links must not be null!");
links.forEach(this::add);
return (T) this;
} |
java | public static spilloveraction[] get(nitro_service service, options option) throws Exception{
spilloveraction obj = new spilloveraction();
spilloveraction[] response = (spilloveraction[])obj.get_resources(service,option);
return response;
} |
java | private void verifyReplacementRange(SegmentWithRange replacedSegment, StreamSegmentsWithPredecessors replacementSegments) {
log.debug("Verification of replacement segments {} with the current segments {}", replacementSegments, segments);
Map<Long, List<SegmentWithRange>> replacementRanges = replacementS... |
python | def login(self, username, password):
"""Log in to Betfair. Sets `session_token` if successful.
:param str username: Username
:param str password: Password
:raises: BetfairLoginError
"""
response = self.session.post(
os.path.join(self.identity_url, 'certlogin'... |
python | def delete_cluster_role(self, name, **kwargs):
"""
delete a ClusterRole
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_cluster_role(name, async_req=True)
>>> result = thread... |
java | public void selectValues(String[] expectedValues, double seconds) {
double end = System.currentTimeMillis() + (seconds * 1000);
try {
elementPresent(seconds);
if (!element.is().select()) {
throw new TimeoutException(ELEMENT_NOT_SELECT);
}
w... |
java | @XmlElementDecl(namespace = "http://www.drugbank.ca", name = "defining-change", scope = SnpEffectType.class)
public JAXBElement<String> createSnpEffectTypeDefiningChange(String value) {
return new JAXBElement<String>(_SnpEffectTypeDefiningChange_QNAME, String.class, SnpEffectType.class, value);
} |
java | public IpcLogEntry addTag(String k, String v) {
this.additionalTags.put(k, v);
return this;
} |
python | def collect_yarn_application_diagnostics(self, *application_ids):
"""
DEPRECATED: use create_yarn_application_diagnostics_bundle on the Yarn service. Deprecated since v10.
Collects the Diagnostics data for Yarn applications.
@param application_ids: An array of strings containing the ids of the
... |
java | @Override
public Name addNameToPerson(final Person person, final String string) {
if (person == null || string == null) {
return new Name();
}
final Name name = new Name(person, string);
person.insert(name);
return name;
} |
java | public static JavaPairRDD<RowColumn, Bytes> toPairRDD(JavaRDD<RowColumnValue> rcvRDD) {
return rcvRDD.mapToPair(rcv -> new Tuple2<>(rcv.getRowColumn(), rcv.getValue()));
} |
java | public static <D> Predicate notIn(Expression<D> left, SubQueryExpression<? extends D> right) {
return predicate(Ops.NOT_IN, left, right);
} |
java | @Override
public <T> Flowable<T> get(@Nonnull ResultSetMapper<? extends T> mapper) {
Preconditions.checkNotNull(mapper, "mapper cannot be null");
return update.startWithDependency(Update.<T>createReturnGeneratedKeys(update.connections,
update.parameterGroupsToFlowable(), update.sql, ... |
java | static String maybeEscapeElementValue(final String pValue) {
int startEscape = needsEscapeElement(pValue);
if (startEscape < 0) {
// If no escaping is needed, simply return original
return pValue;
}
else {
// Otherwise, start replacing
Str... |
java | private static ResourceCache loadResourceCache() {
try {
return Optional.ofNullable(Bootstrap.getService(ResourceCache.class)).orElseGet(
DefaultResourceCache::new);
} catch (Exception e) {
LOG.log(Level.SEVERE, "Error loading ResourceCache instance.", e);
... |
java | public Effects animate(Object stringOrProperties, int duration, Function... funcs) {
return animate(stringOrProperties, duration, EasingCurve.linear, funcs);
} |
python | def retrieve_old_notifications(self):
"""
Retrieve notifications older than X days, where X is specified in settings
"""
date = ago(days=DELETE_OLD)
return Notification.objects.filter(added__lte=date) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.