language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def _filter(self, text):
"""Filter markdown."""
self.markdown.reset()
return self.markdown.convert(text) |
python | def sunionstore(self, dest, keys, *args):
"""
Store the union of sets specified by ``keys`` into a new
set named ``dest``. Returns the number of members in the new set.
"""
keys = [self.redis_key(k) for k in self._parse_values(keys, args)]
with self.pipe as pipe:
... |
java | public final String csv() {
StringBuilder sb = new StringBuilder();
String header =
"#RunID, ClientID, MsgCount, MsgBytes, MsgsPerSec, BytesPerSec, DurationSecs";
sb.append(String.format("%s stats: %s\n", name, this));
sb.append(header); sb.append("\n");
sb.appen... |
python | def get_earth_radii(self):
"""Get earth radii from prologue
Returns:
Equatorial radius, polar radius [m]
"""
earth_model = self.prologue['GeometricProcessing']['EarthModel']
a = earth_model['EquatorialRadius'] * 1000
b = (earth_model['NorthPolarRadius'] +
... |
java | public PerfCounter get(String counter)
{
// Admited: could get a little race condition at the very beginning, but all that'll happen is that we'll lose a handful of tracking event, a loss far outweighed by overall reduced contention.
if (!this.Counters.containsKey(counter))
this.Counters... |
java | public static Matcher<Result> contains(final String string) {
return new Matcher<Result>() {
@Override
public Result matches(String input, boolean isEof) {
int pos = input.indexOf(string);
return pos != -1
? success(input, input.sub... |
java | public void cdataProperty(final QName tag, final String val) throws IOException {
blanks();
openTagSameLine(tag);
cdataValue(val);
closeTagSameLine(tag);
newline();
} |
java | public int put(Object value) {
value = makePoolValue(value);
Assert.check(!(value instanceof Type.TypeVar));
Assert.check(!(value instanceof Types.UniqueType &&
((UniqueType) value).type instanceof Type.TypeVar));
Integer index = indices.get(value);
if (ind... |
java | private void computeStackTraceInformation(
StackTraceFilter stackTraceFilter, Throwable stackTraceHolder, boolean isInline) {
StackTraceElement filtered = stackTraceFilter.filterFirst(stackTraceHolder, isInline);
// there are corner cases where exception can have a null or empty stack trace
... |
java | public void submitAnswer(JSONObject answer, String realm) {
if (answers == null) {
answers = new JSONObject();
}
try {
answers.put(realm, answer);
if (isAnswersFilled()) {
resendRequest();
}
} catch (Throwable t) {
... |
python | def hkeys(self, name, key_start, key_end, limit=10):
"""
Return a list of the top ``limit`` keys between ``key_start`` and
``key_end`` in hash ``name``
Similiar with **Redis.HKEYS**
.. note:: The range is (``key_start``, ``key_end``]. The ``key_start``
isn't ... |
python | def add_user_actions(self, actions=(), version='v1.0'):
"""
回传数据
https://wximg.qq.com/wxp/pdftool/get.html?id=rkalQXDBM&pa=39
:param actions: 用户行为源类型
:param version: 版本号 v1.0
"""
return self._post(
'user_actions/add',
params={'version': v... |
java | public void handleHttpSession(Response serverResponse, String headerKey) {
/** ---------------
* Session handled
* ----------------
*/
if ("Set-Cookie".equals(headerKey)) {
COOKIE_JSESSIONID_VALUE = serverResponse.getMetadata().get(headerKey);
}
} |
python | def gaus_pdf(x, mean, std):
'''Gaussian distribution's probability density function.
See, e.g. `Wikipedia <https://en.wikipedia.org/wiki/Normal_distribution>`_.
:param x: point in x-axis
:type x: float or numpy.ndarray
:param float mean: mean or expectation
:param float str: standard deviation... |
python | def prior_names(self):
""" get the prior information names
Returns
-------
prior_names : list
a list of prior information names
"""
return list(self.prior_information.groupby(
self.prior_information.index).groups.keys()) |
java | public void setPATT(Integer newPATT) {
Integer oldPATT = patt;
patt = newPATT;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.GSPT__PATT, oldPATT, patt));
} |
java | @Nullable
public SchemaAndTable getOverride(SchemaAndTable key) {
SchemaAndTable result = nameMapping.getOverride(key).or(key);
if (schemaMapping.containsKey(key.getSchema())) {
result = new SchemaAndTable(schemaMapping.get(key.getSchema()), result.getTable());
}
return r... |
java | public static KubernetesMessage response(String command, KubernetesResource<?> result) {
KubernetesResponse response = new KubernetesResponse();
response.setCommand(command);
response.setResult(result);
return new KubernetesMessage(response);
} |
java | public PNCounterConfig getPNCounterConfig(String name) {
return ConfigUtils.getConfig(configPatternMatcher, pnCounterConfigs, name, PNCounterConfig.class);
} |
python | def uniq(items):
"""Remove duplicates in given list with its order kept.
>>> uniq([])
[]
>>> uniq([1, 4, 5, 1, 2, 3, 5, 10])
[1, 4, 5, 2, 3, 10]
"""
acc = items[:1]
for item in items[1:]:
if item not in acc:
acc += [item]
return acc |
python | def encoder(self, inputs, n_layers=3):
"""Convnet that encodes inputs into mean and std of a gaussian.
Args:
inputs: 5-D Tensor, shape (batch_size, num_frames, width, height, channels)
n_layers: Number of layers.
Returns:
z_mu: Mean of the latent gaussians.
z_log_var: log(var) of the l... |
java | public WordForm getDep() {
if (Dependency_Type.featOkTst && ((Dependency_Type)jcasType).casFeat_dep == null)
jcasType.jcas.throwFeatMissing("dep", "com.digitalpebble.rasp.Dependency");
return (WordForm)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Dependency_Type)jcasType).casFeat... |
java | private static void unloadChains(Iterator<String> chains) {
final boolean bTrace = TraceComponent.isAnyTracingEnabled();
final ChannelFramework cf = ChannelFrameworkFactory.getChannelFramework();
List<String> runningChains = new LinkedList<String>();
while (chains.hasNext()) {
... |
python | def update(self, text, revision=None):
"""
Modifies the internal state based a change to the content and returns
the sets of words added and removed.
:Parameters:
text : str
The text content of a revision
revision : `mixed`
Revisio... |
java | <T extends EventListener> ArrayList<EventListener> getListeners(Class<T> type) {
ArrayList<EventListener> listeners = new ArrayList<EventListener>();
for (TangoListener tangoListener : tangoListeners) {
if (tangoListener.type==type) {
listeners.add(tangoListener.listener);... |
python | def __dbfHeaderLength(self):
"""Retrieves the header length of a dbf file header."""
if not self.__dbfHdrLength:
if not self.dbf:
raise ShapefileException("Shapefile Reader requires a shapefile or file-like object. (no dbf file found)")
dbf = self.dbf
... |
python | def sum(self):
"""
Evaluate the integral over the given interval using
Clenshaw-Curtis quadrature.
"""
ak = self.coefficients()
ak2 = ak[::2]
n = len(ak2)
Tints = 2/(1-(2*np.arange(n))**2)
val = np.sum((Tints*ak2.T).T, axis=0)
a_, b_ = self... |
python | def tag_users(self, tag_id, open_id_list):
"""
批量为用户打标签
:param tag_id: 标签 ID
:param open_id_list: 包含一个或多个用户的 OPENID 的列表
:return: 返回的 JSON 数据包
"""
return self.post(
url="https://api.weixin.qq.com/cgi-bin/tags/members/batchtagging",
data={
... |
java | public void afterPropertiesSet() throws Exception {
scheduler = new ScheduledThreadPoolExecutor(DEFAULT_POOL, new NamedThreadFactory("Otter-Statistics-Client"),
new ThreadPoolExecutor.CallerRunsPolicy());
scheduler.submit(new Runnable() {
... |
java | public void restart_server() throws DevFailed {
Util.out4.println("In DServer.restart_server() method");
//
// Reset initial state and status
//
set_state(DevState.ON);
set_status("The device is ON");
//
// Destroy and recreate the muli attribute object... |
java | protected void validate(final boolean isDomain) throws MojoDeploymentException {
final boolean hasServerGroups = hasServerGroups();
if (isDomain) {
if (!hasServerGroups) {
throw new MojoDeploymentException(
"Server is running in domain mode, but no ser... |
python | def roster(team_id):
"""Returns a dictionary of roster information for team id"""
data = mlbgame.data.get_roster(team_id)
parsed = json.loads(data.read().decode('utf-8'))
players = parsed['roster_40']['queryResults']['row']
return {'players': players, 'team_id': team_id} |
java | public static AggregatePlanNode convertToPartialAggregatePlanNode(HashAggregatePlanNode hashAggregateNode,
List<Integer> aggrColumnIdxs) {
final AggregatePlanNode partialAggr = setAggregatePlanNode(hashAggregateNode, new PartialAggregatePlanNode());
partialAggr.m_partialGroupByColumns = aggr... |
python | def _compare_list(new_list, old_list, change_list=None, root=None):
'''
a method for recursively listing changes made to a list
:param new_list: list with new value
:param old_list: list with old values
:param change_list: list of differences between old and new
:param root: string with re... |
java | public void getEntriesAndAddListener(RosterListener rosterListener, RosterEntries rosterEntries) {
Objects.requireNonNull(rosterListener, "listener must not be null");
Objects.requireNonNull(rosterEntries, "rosterEntries must not be null");
synchronized (rosterListenersAndEntriesLock) {
... |
python | def fetch_list_members(list_url):
""" Get all members of the list specified by the given url. E.g., https://twitter.com/lore77/lists/libri-cultura-education """
match = re.match(r'.+twitter\.com\/(.+)\/lists\/(.+)', list_url)
if not match:
print('cannot parse list url %s' % list_url)
return ... |
python | def remove_sequences(self, tree, sequence_names):
'''Remove sequences with in the given sequence_names array from the tree in
place. Assumes the sequences are found in the tree, and that they are
all unique.
Parameters
----------
tree: dendropy.Tree
tree to r... |
java | public void addShutdownListener(final ShutdownListener shutdownListener) {
synchronized (lock) {
if (!shutdown) {
throw UndertowMessages.MESSAGES.handlerNotShutdown();
}
long count = activeRequestsUpdater.get(this);
if (count == 0) {
... |
java | private static int getNumberOfInserts(String messageKey) {
String unInsertedMessage = nls.getString(messageKey);
int numInserts = 0;
// Not much point in going any further than 20 inserts!
for (int i = 0; i < 20; i++) {
if (unInsertedMessage.indexOf("{" + i + "}") != -1) {
... |
java | @Override
protected boolean removeFromQueueStorage(Connection conn, IQueueMessage<Long, byte[]> _msg) {
if (!(_msg instanceof UniversalIdIntQueueMessage)) {
throw new IllegalArgumentException("This method requires an argument of type ["
+ UniversalIdIntQueueMessage.class.getN... |
java | public static GeneralParameterValue[] createGridGeometryGeneralParameter( RegionMap regionMap,
CoordinateReferenceSystem crs ) {
GeneralParameterValue[] readParams = new GeneralParameterValue[1];
Parameter<GridGeometry2D> readGG = new Parameter<GridGeometry2D>(AbstractGridFormat.READ_GRIDGEO... |
java | public void marshall(CreateTypeRequest createTypeRequest, ProtocolMarshaller protocolMarshaller) {
if (createTypeRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(createTypeRequest.getApiId()... |
java | @Nonnull
public <V1 extends T1, V2 extends T2> LToFltBiFunctionBuilder<T1, T2> aCase(Class<V1> argC1, Class<V2> argC2, LToFltBiFunction<V1, V2> function) {
PartialCaseWithFltProduct.The pc = partialCaseFactoryMethod((a1, a2) -> (argC1 == null || argC1.isInstance(a1)) && (argC2 == null || argC2.isInstance(a2)));
p... |
python | def reset(self):
"""Reset the dataset to zero elements."""
self.data = []
self.size = 0
self.kdtree = None # KDTree
self.nn_ready = False |
java | public static double[] solveLinearEquationLeastSquare(double[][] matrix, double[] vector) {
// We use the linear algebra package apache commons math
DecompositionSolver solver = new SingularValueDecomposition(new Array2DRowRealMatrix(matrix, false)).getSolver();
return solver.solve(new ArrayRealVector(vector)).to... |
python | def add_root_family(self, family_id):
"""Adds a root family.
arg: family_id (osid.id.Id): the ``Id`` of a family
raise: AlreadyExists - ``family_id`` is already in hierarchy
raise: NotFound - ``family_id`` not found
raise: NullArgument - ``family_id`` is ``null``
r... |
java | public static Optional<Method> extractSetter(final Class<?> targetClass, final String propertyName, final Class<?> propertyType) {
final String methodName = "set" + Utils.capitalize(propertyName);
Method method;
try {
method = targetClass.getMethod(methodName,... |
java | public void rename(String newName) {
URL url = FILE_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID());
BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "PUT");
JsonObject updateInfo = new JsonObject();
updateInfo.add("name", newName);
request.setBody(u... |
python | def segment_lengths(neurites, neurite_type=NeuriteType.all):
'''Lengths of the segments in a collection of neurites'''
def _seg_len(sec):
'''list of segment lengths of a section'''
return np.linalg.norm(np.diff(sec.points[:, COLS.XYZ], axis=0), axis=1)
return map_segments(_seg_len, neurites... |
python | def get_reference_data(data_dir=None):
'''Obtain information for all stored references
This is a nested dictionary with all the data for all the references
The reference data is read from the REFERENCES.json file in the given
`data_dir` directory.
'''
data_dir = fix_data_dir(data_dir)
ref... |
python | def objects_to_record(self):
"""Write from object metadata to the record. Note that we don't write everything"""
o = self.get_object()
o.about = self._bundle.metadata.about
o.identity = self._dataset.identity.ident_dict
o.names = self._dataset.identity.names_dict
o.cont... |
python | def _initialize_session(self):
"""
:rtype: None
"""
session_server = core.SessionServer.create(self).value
token = session_server.token.token
expiry_time = self._get_expiry_timestamp(session_server)
user_id = session_server.get_referenced_user().id_
self... |
java | public static InjectorImpl create(ClassLoader loader)
{
synchronized (loader) {
if (loader instanceof DynamicClassLoader) {
InjectorImpl inject = _localManager.getLevel(loader);
if (inject == null) {
inject = (InjectorImpl) InjectorAmp.manager(loader).get();
_localManage... |
java | @Override
public void generateSerializeOnXml(BindTypeContext context, MethodSpec.Builder methodBuilder, String serializerName,
TypeName beanClass, String beanName, BindProperty property) {
TypeName elementTypeName = extractTypeParameterName(property);
// @formatter:off
methodBuilder.beginControlFlow("if ($L!=... |
python | def has_minimum_version(raises=True):
"""
Return if tmux meets version requirement. Version >1.8 or above.
Parameters
----------
raises : bool
raise exception if below minimum version requirement
Returns
-------
bool
True if tmux meets minimum required version.
Rai... |
java | private int incrementReferenceCounter(final JobID jobID) {
while (true) {
AtomicInteger ai = this.libraryReferenceCounter.get(jobID);
if (ai == null) {
ai = new AtomicInteger(1);
if (this.libraryReferenceCounter.putIfAbsent(jobID, ai) == null) {
return 1;
}
// We had a race, try again
... |
python | def raw(self, query):
"""
make a raw query
Args:
query (str): solr query
\*\*params: solr parameters
"""
clone = copy.deepcopy(self)
clone.adapter._pre_compiled_query = query
clone.adapter.compiled_query = query
return clone |
python | def handleError(self, record):
'''
Override the default error handling mechanism
Deal with log file rotation errors due to log file in use
more softly.
'''
handled = False
# Can't use "salt.utils.platform.is_windows()" in this file
if (sys.platform.start... |
java | private String[] getSparkLibConf() {
String sparkHome = null;
String sparkConf = null;
// If user has specified version in job property. e.g. spark-version=1.6.0
final String jobSparkVer = getJobProps().get(SparkJobArg.SPARK_VERSION.azPropName);
if (jobSparkVer != null) {
info("This job sets s... |
python | def convert_activation(builder, layer, input_names, output_names, keras_layer):
"""Convert an activation layer from keras to coreml.
Parameters
----------
keras_layer: layer
A keras layer object.
builder: NeuralNetworkBuilder
A neural network builder object.
"""
# Get input... |
java | private static double branchWeight(Node node, Arborescence<Node> arborescence,
Map<Node, Set<Node>> edgesParentToChild,
Map<Node, Map<Node, Fragment>> edgeFragmentChildToParent) {
Double nodeWeight = node.getNodeWeight();
if... |
python | def finish(request, socket, context):
"""
Event handler for a socket session ending in a room. Broadcast
the user leaving and delete them from the DB.
"""
try:
user = context["user"]
except KeyError:
return
left = {"action": "leave", "name": user.name, "id": user.id}
sock... |
java | public static <L, R> TypeInformation<Either<L, R>> EITHER(TypeInformation<L> leftType, TypeInformation<R> rightType) {
return new EitherTypeInfo<>(leftType, rightType);
} |
python | def add_group_mindist(self, group_definitions, group_pairs='all', threshold=None, periodic=True):
r"""
Adds the minimum distance between groups of atoms to the feature list. If the groups of
atoms are identical to residues, use :py:obj:`add_residue_mindist <pyemma.coordinates.data.featurizer.MDF... |
java | private String getTextLine(String[] textLines, int line)
{
return (isIgnoreTrailingWhiteSpaces()) ? textLines[line].trim() : textLines[line];
} |
java | public ActionFuture<IndexResponse> sendDataAsync(
String jsonSource, String index, String type, String id) {
return indexQueryAsync(buildIndexRequest(jsonSource, index, type, id));
} |
java | public void setInstanceProfiles(java.util.Collection<InstanceProfile> instanceProfiles) {
if (instanceProfiles == null) {
this.instanceProfiles = null;
return;
}
this.instanceProfiles = new com.amazonaws.internal.SdkInternalList<InstanceProfile>(instanceProfiles);
} |
python | def get(self, section, option, type_=six.string_types, default=None):
"""Retrieves option from the specified section (or 'DEFAULT') and attempts to parse it as type.
If the specified section does not exist or is missing a definition for the option, the value is
looked up in the DEFAULT section. If there i... |
java | private static String readObjectProperty(String ref, TypeDef source, Property property) {
return ref + "." + getterOf(source, property).getName() + "()";
} |
python | def _get_default_iface_linux():
# type: () -> Optional[str]
"""Get the default interface by reading /proc/net/route.
This is the same source as the `route` command, however it's much
faster to read this file than to call `route`. If it fails for whatever
reason, we can fall back on the system comma... |
python | def authentications_spec(self):
"""Spec for a group of authentication options"""
return container_spec(authentication_objs.Authentication
, dictof(string_spec(), set_options(
reading = optional_spec(authentication_spec())
, writing = optional_spec(authenti... |
java | private double mdist(double[] a, double[] b) {
return Math.abs(a[0] - b[0]) + Math.abs(a[1] - b[1]);
} |
java | @Override
public CreateCodeRepositoryResult createCodeRepository(CreateCodeRepositoryRequest request) {
request = beforeClientExecution(request);
return executeCreateCodeRepository(request);
} |
java | public static @SlashedClassName String trimSignature(String signature) {
if ((signature != null) && signature.startsWith(Values.SIG_QUALIFIED_CLASS_PREFIX) && signature.endsWith(Values.SIG_QUALIFIED_CLASS_SUFFIX)) {
return signature.substring(1, signature.length() - 1);
}
return sig... |
java | public EClass getIfcWorkControl() {
if (ifcWorkControlEClass == null) {
ifcWorkControlEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(649);
}
return ifcWorkControlEClass;
} |
python | def request(self, method, data=None, nid=None, nid_key='nid',
api_type="logic", return_response=False):
"""Get data from arbitrary Piazza API endpoint `method` in network `nid`
:type method: str
:param method: An internal Piazza API method name like `content.get`
or... |
python | def importable(obj):
"""Check if an object can be serialised as a qualified name. This is done
by checking that a ``look_up(object_name(obj))`` gives back the same
object.
.. |importable| replace:: :py:func:`importable`"""
try:
return look_up(object_name(obj)) is obj
except (AttributeEr... |
python | def edit_distance(wordA,wordB):
"""" Implements Daegmar-Levenshtein edit distance algorithm:
Ref: https://en.wikipedia.org/wiki/Edit_distance
Ref: https://en.wikipedia.org/wiki/Levenshtein_distance"""
if not type(wordA) is list:
lettersA = tamil.utf8.get_letters(wordA)
else:
... |
java | public void prepare(Collection<String> urls, String userAgent) {
List<String> safeUrls = new ArrayList<String>(urls);
FetchThread threads[] = new FetchThread[PREPARE_THREAD_COUNT ];
for (int i = 0; i < PREPARE_THREAD_COUNT ; i++) {
threads[i] = new FetchThread(safeUrls, userAgent);
... |
java | public boolean isParserDirective()
{
if (getValue() == null || isCommand() || getValue().length() == 0)
return false;
if (getValue().charAt(0) == '_')
return true;
if (getValue().length() == 1 && getValue().charAt(0) == '=')
return true;
return fal... |
python | def _get_image_entropy(self, image):
"""calculate the entropy of an image"""
hist = image.histogram()
hist_size = sum(hist)
hist = [float(h) / hist_size for h in hist]
return -sum([p * math.log(p, 2) for p in hist if p != 0]) |
python | def watch(
self,
username,
watch={
"friend":True,
"deviations":True,
"journals":True,
"forum_threads":True,
"critiques":True,
"scraps":True,
"activity":True,
"collections":True
}
):
... |
java | @Override
public void exec(Result<Object> result, Object[] args)
{
TableKelp tableKelp = _table.getTableKelp();
RowCursor minCursor = tableKelp.cursor();
RowCursor maxCursor = tableKelp.cursor();
minCursor.clear();
maxCursor.setKeyMax();
_whereKraken.fillMinCursor(minCursor, a... |
python | def authenticate(self, key_id=None, secret=None, allow_agent=False):
"""
:param key_id: SmartDC identifier for the ssh key
:type key_id: :py:class:`basestring`
:param secret: path to private rsa key
:type secret: :py:class:`basestring`
:param allow_agent... |
java | public void initialize(FaxClientSpi faxClientSpi)
{
if(this.initialized)
{
throw new FaxException("Fax Modem Adapter already initialized.");
}
//set flag
this.initialized=true;
//get logger
Logger logger=faxClientSpi.getLogger();
... |
java | public static void printJob(Optional<JobExecutionInfo> jobExecutionInfoOptional) {
if (!jobExecutionInfoOptional.isPresent()) {
System.err.println("Job id not found.");
return;
}
JobExecutionInfo jobExecutionInfo = jobExecutionInfoOptional.get();
List<List<String... |
java | @Override
public Dag<JobExecutionPlan> compileFlow(Spec spec) {
Preconditions.checkNotNull(spec);
Preconditions.checkArgument(spec instanceof FlowSpec, "MultiHopFlowCompiler only accepts FlowSpecs");
long startTime = System.nanoTime();
FlowSpec flowSpec = (FlowSpec) spec;
String source = ConfigU... |
java | public void marshall(StopJobRequest stopJobRequest, ProtocolMarshaller protocolMarshaller) {
if (stopJobRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(stopJobRequest.getArn(), ARN_BINDING)... |
python | def _ingest_list(self, input_list, schema_list, path_to_root):
'''
a helper method for ingesting items in a list
:return: valid_list
'''
valid_list = []
# construct max list size
max_size = None
rules_path_to_root = re.sub('\[\d+\]', '[0]', path_to_roo... |
java | public void writeByte(byte value) throws UnsupportedEncodingException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "writeByte", Byte.valueOf(value));
getBodyList().add(Byte.valueOf(value));
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exi... |
java | @Inline(value="$3.removeAll($1, $2)", imported=Iterables.class)
public static <E> boolean operator_remove(Collection<E> collection, Collection<? extends E> newElements) {
return removeAll(collection, newElements);
} |
java | static Matrix[] jamaSVD(double[][] inputMatrix, int dimensions) {
// Use reflection to load the JAMA classes and perform all the
// operation in order to avoid any compile-time dependencies on the
// package.
try {
SVD_LOGGER.fine("attempting JAMA");
isJAMAavailab... |
java | @SuppressWarnings("unchecked")
public static PendingMessages parse(List<?> xpendingOutput) {
LettuceAssert.notNull(xpendingOutput, "XPENDING output must not be null");
LettuceAssert.isTrue(xpendingOutput.size() == 4, "XPENDING output must have exactly four output elements");
Long count = (... |
python | def check_filters(filters):
"""
Execute range_check for every element of an iterable.
Parameters
----------
filters : iterable
The collection of filters to check. Each element
must be a two-element tuple of floats or ints.
Returns
-------
The input as-is, or None if it ... |
python | def _ParseRecords(self, parser_mediator, evt_file):
"""Parses Windows EventLog (EVT) records.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
evt_file (pyevt.file): Windows EventLog (EVT) file.
"""
# To... |
python | def widgets(self):
"""Gets all (first) child wigets"""
w = []
for i in range(self.count()):
w.append(self.widget(i))
return w |
java | @Override
public MutationResult execute() {
if (pendingMutations == null || pendingMutations.isEmpty()) {
return new MutationResultImpl(true, 0, null);
}
final BatchMutation<K> mutations = pendingMutations.makeCopy();
pendingMutations = null;
return new MutationResultImpl(keyspace.doExecuteO... |
python | def update_requests_request_id(self, update_request, request_id):
"""UpdateRequestsRequestId.
[Preview API] Update a symbol request by request identifier.
:param :class:`<Request> <azure.devops.v5_0.symbol.models.Request>` update_request: The symbol request.
:param str request_id: The sy... |
java | public <T extends AmazonWebServiceRequest> T withSdkClientExecutionTimeout(int sdkClientExecutionTimeout) {
setSdkClientExecutionTimeout(sdkClientExecutionTimeout);
@SuppressWarnings("unchecked")
T t = (T) this;
return t;
} |
java | @Override
public void clearCache() {
entityCache.clearCache(CommerceSubscriptionEntryImpl.class);
finderCache.clearCache(FINDER_CLASS_NAME_ENTITY);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.