language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def createMedian(imgObjList, configObj, procSteps=None):
""" Top-level interface to createMedian step called from top-level
AstroDrizzle.
This function parses the input parameters then calls the `_median()`
function to median-combine the input images into a single image.
"""
if imgObjList is N... |
java | private static boolean isDefaultHttpOrHttpsPort(String scheme, int port) {
if (port == DEFAULT_HTTP_PORT && isHttp(scheme)) {
return true;
}
if (port == DEFAULT_HTTPS_PORT && isHttps(scheme)) {
return true;
}
return false;
} |
python | def append(self, x, y, scatter_kwargs, hist_kwargs=None, xhist_kwargs=None,
yhist_kwargs=None, num_ticks=3, labels=None, hist_share=False,
marginal_histograms=True):
"""
Adds a new scatter to self.scatter_ax as well as marginal histograms
for the same data, borrowin... |
python | def user_data(user):
"""
Compute indicators and statistics used by the visualization
and returns a dictionnary.
"""
# For the dasboard, indicators are computed on a daily basis
# and by taking into account empty time windows
_range = _group_range(user.records, 'day')
export = OrderedDict... |
python | def plot_brillouin(self):
"""
plot the Brillouin zone
"""
# get labels and lines
labels = {}
for k in self._bs.kpoints:
if k.label:
labels[k.label] = k.frac_coords
lines = []
for b in self._bs.branches:
lines.appen... |
python | async def delete(self):
"""Delete this Fabric."""
if self.id == self._origin.Fabric._default_fabric_id:
raise CannotDelete("Default fabric cannot be deleted.")
await self._handler.delete(id=self.id) |
java | private static String joinStringsSpaceSeparated(List<? extends IPrimitiveType<String>> theStrings) {
StringBuilder b = new StringBuilder();
for (IPrimitiveType<String> next : theStrings) {
if (next.isEmpty()) {
continue;
}
if (b.length() > 0) {
b.append(' ');
}
b.append(next.getValue... |
java | private void pushOutputValues(ValueNumber[] outputValueList) {
ValueNumberFrame frame = getFrame();
for (ValueNumber aOutputValueList : outputValueList) {
frame.pushValue(aOutputValueList);
}
} |
java | public ContainerDetail withVolumes(Volume... volumes) {
if (this.volumes == null) {
setVolumes(new java.util.ArrayList<Volume>(volumes.length));
}
for (Volume ele : volumes) {
this.volumes.add(ele);
}
return this;
} |
python | def routers_updated(self, context, routers, operation=None, data=None,
shuffle_agents=False):
"""Notify cfg agents about configuration changes to routers.
This includes operations performed on the router like when a
router interface is added or removed.
"""
... |
python | def _associate_eip_with_interface(eni_id, eip_id, private_ip=None, vm_=None):
'''
Accept the id of a network interface, and the id of an elastic ip
address, and associate the two of them, such that traffic sent to the
elastic ip address will be forwarded (NATted) to this network interface.
Optional... |
python | def visitEbnfSuffix(self, ctx: jsgParser.EbnfSuffixContext):
""" ebnfSuffix: QMARK | STAR | PLUS | OBRACE INT (COMMA (INT|STAR)?)? CBRACE """
self._ebnftext = ctx.getText()
if ctx.INT():
self.min = int(ctx.INT(0).getText())
if ctx.COMMA():
if len(ctx.INT()... |
java | public void validateFile(MultipartFile file, long maxLength, String[] allowExtName) {
if (file.isEmpty()) {
throw new FieldException("file", "您没有上传文件", null);
}
// 文件大小
if (file.getSize() < 0 || file.getSize() > maxLength) {
throw new FieldException("file", "文件... |
java | public static @CheckForNull Executor currentExecutor() {
Thread t = Thread.currentThread();
if (t instanceof Executor) return (Executor) t;
return IMPERSONATION.get();
} |
java | private File getTmpDir(ProbeTestRun testRun) {
File tmpDir = new File(configuration.getWorkspace() + "/tmp/" + testRun.getVersion());
if (!tmpDir.exists()) {
tmpDir.mkdirs();
}
return tmpDir;
} |
python | def f(self, x):
"""Calculate the value of the functional for the specified arguments
(taking any specified mask into account).
:param x: the value(s) to evaluate at
"""
x = self._flatten(x)
if self._dtype == 0:
return numpy.array(_functional._f(self, x))
... |
python | def command_max_run_time(self, event=None):
""" CPU burst max running time - self.runtime_cfg.max_run_time """
try:
max_run_time = self.max_run_time_var.get()
except ValueError:
max_run_time = self.runtime_cfg.max_run_time
self.runtime_cfg.max_run_time = max_run_... |
java | private void updateTextSize(@NonNull Rect viewBounds) {
float textSize = (float) viewBounds.height() * (mRespectFontBounds ? 1 : 2);
mIconBrush.getPaint().setTextSize(textSize);
String textValue = mIcon != null ? String.valueOf(mIcon.getCharacter()) : String.valueOf(mPlainIcon);
mIconBr... |
python | def from_dict(data, ctx):
"""
Instantiate a new OrderClientExtensionsModifyRejectTransaction from a
dict (generally from loading a JSON response). The data used to
instantiate the OrderClientExtensionsModifyRejectTransaction is a
shallow copy of the dict passed in, with any compl... |
java | public void addComparator(Comparator<T> comparator) {
if (comparator instanceof InvertibleComparator) {
this.comparators.add((InvertibleComparator<T>) comparator);
}
else {
this.comparators.add(new InvertibleComparator<T>(comparator));
}
} |
python | def srandmember(self, name, number=None):
"""
Return a random member of the set.
:param name: str the name of the redis key
:return: Future()
"""
with self.pipe as pipe:
f = Future()
res = pipe.srandmember(self.redis_key(name), number=number)
... |
python | def predict_without_uncertainties(self, mjd, complain=True):
"""Predict the object position at a given MJD.
The return value is a tuple ``(ra, dec)``, in radians, giving the
predicted position of the object at *mjd*. Unlike :meth:`predict`, the
astrometric uncertainties are ignored. Thi... |
java | public static String getSystemProperty(String name) {
return StringUtils.isBlank(name) ? "" : System.getProperty(name);
} |
java | public EClass getIfcCompoundPlaneAngleMeasure() {
if (ifcCompoundPlaneAngleMeasureEClass == null) {
ifcCompoundPlaneAngleMeasureEClass = (EClass) EPackage.Registry.INSTANCE
.getEPackage(Ifc2x3tc1Package.eNS_URI).getEClassifiers().get(765);
}
return ifcCompoundPlaneAngleMeasureEClass;
} |
python | def get_relative_path(self, domain, locale):
"""
Gets the relative file path using the template.
@type domain: str
@param domain: The domain
@type locale: str
@param locale: The locale
@rtype: string
@return: The relative file path
"""
r... |
java | @Override
public boolean nextStep() {
initStepPosition();
final boolean res = this.stepPosition.get() < getStepList().size() - 1;
if (res && view().isReadyForSlidesStepUpdate(false)) {
setCurrentFlow(SlideFlow.forward);
// Launch the next step
showSlideS... |
python | def measure_board_rms(control_board, n_samples=10, sampling_ms=10,
delay_between_samples_ms=0):
'''
Read RMS voltage samples from control board high-voltage feedback circuit.
'''
try:
results = control_board.measure_impedance(n_samples, sampling_ms,
... |
java | public static ITextProcessor unwrap(final ITextProcessor processor) {
if (processor == null) {
return null;
}
if (processor instanceof AbstractProcessorWrapper) {
return (ITextProcessor)((AbstractProcessorWrapper) processor).unwrap();
}
return processor;
... |
java | @Override public void addNumCol(int colIdx, double value) {
if (Double.isNaN(value) || Double.isInfinite(value)) {
addInvalidCol(colIdx);
} else {
if( colIdx < _nCols ) {
_nvs[_col = colIdx].addNumDecompose(value);
if(_ctypes != null && _ctypes[colIdx] == Vec.T_BAD ) _ctypes[colIdx] ... |
java | public void show(android.support.v4.app.FragmentManager manager, String tag){
mActiveSupportMail = generateSupportDialogFragment();
mActiveSupportMail.show(manager, tag);
} |
java | protected JCCompilationUnit parse(JavaFileObject filename, CharSequence content) {
long msec = now();
JCCompilationUnit tree = make.TopLevel(List.nil());
if (content != null) {
if (verbose) {
log.printVerbose("parsing.started", filename);
}
if ... |
java | public String getKey(int key) {
if (key == 0)
return Long.toString(this.getEvaluationIndex());
else return Long.toString(10000
* this.getEvaluationIndex()
+ this.getClassifierIndex());
} |
java | public BoxRequestsFolder.CreateFolder getCreateRequest(String parentId, String name) {
BoxRequestsFolder.CreateFolder request = new BoxRequestsFolder.CreateFolder(parentId, name, getFoldersUrl(), mSession);
return request;
} |
java | public static Throwable generateIncidentV2WithException(SFSession session,
Throwable exc,
String jobId,
String requestId)
{
new Incident(ses... |
java | public void onComplete(
final Consumer<StreamElementQueueEntry<T>> completeFunction,
Executor executor) {
final StreamElementQueueEntry<T> thisReference = this;
getFuture().whenCompleteAsync(
// call the complete function for normal completion as well as exceptional completion
// see FLINK-6435
(val... |
java | private int getHalogenCount(IAtomContainer ac, IAtom atom) {
List<IAtom> neighbours = ac.getConnectedAtomsList(atom);
int acounter = 0;
for (IAtom neighbour : neighbours) {
if (neighbour.getSymbol().equals("F") || neighbour.getSymbol().equals("I")
|| neighbour.get... |
java | @Deprecated
public void sendEvent(String eventId, String ymlPrivileges) {
SystemEvent event = buildSystemEvent(eventId, ymlPrivileges);
serializeEvent(event).ifPresent(this::send);
} |
python | def add_editor(name, userid):
"""
:param name: a string representing the user's name
:param userid: a string representing the user's UW NetID
:return: True if request is successful, False otherwise.
raise DataFailureException or a corresponding TrumbaException
if the request failed or an error c... |
python | def publish(spec, nb_name, template='full', save_first=True):
"""
Converts nb_name to an HTML file. Preserves widget functionality.
Outputs a link to download HTML file after conversion if called in a
notebook environment.
Equivalent to running `nbinteract ${spec} ${nb_name}` on the command line.
... |
python | def sample(self):
""" Sample from M-H algorithm
Returns
----------
chain : np.array
Chains for each parameter
mean_est : np.array
Mean values for each parameter
median_est : np.array
Median values for each parameter
upper_95... |
python | def _index(self, item):
'''Return index of *item* in member list or -1 if not present.'''
index = bisect.bisect_left(self._members, item)
if index != len(self) and self._members[index] == item:
return index
return -1 |
java | private static String computeFileHash(File file, MessageDigest md) throws IOException {
md.reset();
return BaseEncoding.base16().encode(md.digest(Files.toByteArray(file)));
} |
java | private Method getPrivateMethod(VelMethod velMethod) throws Exception
{
Field methodField = velMethod.getClass().getDeclaredField("method");
boolean isAccessible = methodField.isAccessible();
try {
methodField.setAccessible(true);
return (Method) methodField.get(velMe... |
java | public static String format(String format, Object... args)
{
if(format == null) {
return null;
}
if(format.isEmpty()) {
return "";
}
if(args.length == 0) {
return format;
}
for(int i = 0; i < args.length; i++) {
if(args[i] instanceof Class) {
... |
java | public void moveScriptElementsToBody ()
{
// Move all JS from head to body
final ICommonsList <IHCNode> aJSNodes = new CommonsArrayList <> ();
m_aHead.getAllAndRemoveAllJSNodes (aJSNodes);
// Find index of first script in body
int nFirstScriptIndex = 0;
if (m_aBody.hasChildren ())
for (... |
python | def load_plugins(self, plugin_dirs=None, quiet=True):
"""
Load plugins in `sys.path` and :attr:`plugin_dirs`
Parameters
----------
plugin_dirs : list or tuple of string, optional
A list or tuple of plugin directory path
quiet : bool, optional
If T... |
java | public double calculateDistance(double srcLat, double srcLong, double destLat, double destLong) {
float[] results = new float[1];
Location.distanceBetween(srcLat, srcLong, destLat, destLong, results);
return results[0] / 1000;
} |
java | public static final PlanVersionNotFoundException planVersionNotFoundException(String planId, String version) {
return new PlanVersionNotFoundException(Messages.i18n.format("PlanVersionDoesNotExist", planId, version)); //$NON-NLS-1$
} |
python | def partition_range(stop, annotations=None):
"""
Partition the range from 0 to `stop` based on annotations.
>>> partition_range(50, annotations=[[(0, 21), (30, 35)],
... [(15, 32), (40, 46)]])
[(0, 15, {0}),
(15, 21, {0, 1}),
(21, 30, {... |
java | protected void readDirTabs(FontFileReader in) throws IOException {
in.skip(4); // TTF_FIXED_SIZE
int ntabs = in.readTTFUShort();
in.skip(6); // 3xTTF_USHORT_SIZE
dirTabs = new java.util.HashMap();
TTFDirTabEntry[] pd = new TTFDirTabEntry[ntabs];
log.debug("Reading ... |
java | public static TypeConverter converterForType(Class type)
{
for (TypeConverter converter : converters)
{
if (converter.canConvertTo( type )) return converter;
}
return null;
} |
java | @Override
public HiveMetastoreClient createMetastoreClient()
throws TException
{
List<HostAndPort> metastores = new ArrayList<>(addresses);
Collections.shuffle(metastores.subList(1, metastores.size()));
TException lastException = null;
for (HostAndPort metastore : me... |
python | def plot_lyap(maptype="logistic"):
"""
Plots a bifurcation plot of the given map and superimposes the true
lyapunov exponent as well as the estimates of the largest lyapunov exponent
obtained by ``lyap_r`` and ``lyap_e``. The idea for this plot is taken from [ll]_.
This function requires the package ``matplo... |
java | public static <A> double[] alphaBetaPWM(A data, NumberArrayAdapter<?, A> adapter, final int nmom) {
final int n = adapter.size(data);
final double[] xmom = new double[nmom << 1];
double aweight = 1. / n, bweight = aweight;
for(int i = 0; i < n; i++) {
final double val = adapter.getDouble(data, i);... |
python | def period(argument):
""" Detect desired time period for the argument """
since, until, period = None, None, None
if "today" in argument:
since = Date("today")
until = Date("today")
until.date += delta(days=1)
period = "today"
elif "yesterd... |
java | public static synchronized void addCachedDatabaseConfigs(Collection<DatabaseTableConfig<?>> configs) {
Map<Class<?>, DatabaseTableConfig<?>> newMap;
if (configMap == null) {
newMap = new HashMap<Class<?>, DatabaseTableConfig<?>>();
} else {
newMap = new HashMap<Class<?>, DatabaseTableConfig<?>>(configMap);
... |
python | def _GetTimelineStatEntriesLegacy(client_id, file_path, with_history=True):
"""Gets timeline entries from AFF4."""
folder_urn = aff4.ROOT_URN.Add(str(client_id)).Add(file_path)
child_urns = []
for _, children in aff4.FACTORY.RecursiveMultiListChildren([folder_urn]):
child_urns.extend(children)
if with_... |
python | def generate_graphs(data, name, results_dir):
"""Generate all reports from original dataframe
:param dic data: dict containing raw and compiled results dataframes
:param str name: name for prefixing graphs output
:param str results_dir: results output directory
"""
graphs.resp_graph_raw(data['r... |
java | @Override
public StartTriggerResult startTrigger(StartTriggerRequest request) {
request = beforeClientExecution(request);
return executeStartTrigger(request);
} |
python | def serialize(self, value):
"""See base class."""
if isinstance(value, list):
return self.list_sep.join(_helpers.str_or_unicode(x.name) for x in value)
else:
return _helpers.str_or_unicode(value.name) |
python | def add(self, name, value, bitmask=DEFMASK):
"""Add an enum member
Args:
name: Name of the member
value: value of the member
bitmask: bitmask. Only use if enum is a bitfield.
"""
_add_enum_member(self._eid, name, value, bitmask) |
java | private static TrainingParameters loadTrainingParameters(
final String paramFile, final boolean supportSequenceTraining) {
TrainingParameters params = null;
if (paramFile != null) {
checkInputFile("Training Parameter", new File(paramFile));
InputStream paramsIn = null;
try {
... |
java | private void celerioWelcomeBanner() {
// http://ascii.mastervb.net/
// font : varsity.ftl
int currentYear = Calendar.getInstance().get(Calendar.YEAR);
getLog().info("");
getLog().info(" ______ __ _ ");
getLog().info(" .' ___ ... |
python | def show_rsa(minion_id, dns_name):
'''
Show a private RSA key
CLI Example:
.. code-block:: bash
salt-run digicert.show_rsa myminion domain.example.com
'''
cache = salt.cache.Cache(__opts__, syspaths.CACHE_DIR)
bank = 'digicert/domains'
data = cache.fetch(
bank, dns_nam... |
java | protected double[] aggregateInternal(ArrayList<double[]> descriptors) {
double[] vlad = new double[numCentroids * descriptorLength];
if (descriptors.size() == 0) { // when there are 0 local descriptors extracted
return vlad;
}
for (double[] descriptor : descriptors) {
int nnIndex = computeNearestCen... |
python | def flush_content(self):
"""
Flushes the cache content.
Usage::
>>> cache = Cache()
>>> cache.add_content(John="Doe", Luke="Skywalker")
True
>>> cache.flush_content()
True
>>> cache
{}
:return: Method ... |
python | def deleted(message):
"""Create a Deleted response builder with specified message."""
def deleted(value, _context, **_params):
return Deleted(value, message)
return deleted |
python | def _setter(self, attr, value, bottom, top, to_step):
""" Set a value.
:param attr: Attribute to set.
:param value: Value to use.
:param bottom: Get to bottom value.
:param top: Get to top value.
:param to_step: Get to intermediary value.
"""
if value < 0... |
java | @Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case TypesPackage.JVM_FEATURE__LOCAL_CLASSES:
return getLocalClasses();
}
return super.eGet(featureID, resolve, coreType);
} |
java | public I_CmsEditor getEditorForType(I_CmsResourceType type, boolean plainText) {
List<I_CmsEditor> editors = new ArrayList<I_CmsEditor>();
for (int i = 0; i < EDITORS.length; i++) {
if (EDITORS[i].matchesType(type, plainText)) {
editors.add(EDITORS[i]);
}
... |
python | def copyright_holder_json(soup):
"for json output add a full stop if ends in et al"
holder = None
permissions_tag = raw_parser.article_permissions(soup)
if permissions_tag:
holder = node_text(raw_parser.copyright_holder(permissions_tag))
if holder is not None and holder.endswith('et al'):
... |
python | def update_nseg(self):
"""Update the number of segments, displayed in the dialog."""
self.nseg = 0
if self.one_grp:
segments = self.get_segments()
if segments is not None:
self.nseg = len(segments)
self.show_nseg.setText('Number of segment... |
java | protected void recommend(Class<?> superModule, GuiceModuleAccess currentModuleAccess) {
LOG.info(MessageFormat.format("Building injection configuration from {0}", //$NON-NLS-1$
superModule.getName()));
final Set<BindingElement> superBindings = new LinkedHashSet<>();
fillFrom(superBindings, superModule.getSupe... |
java | public static synchronized void beforeAll(String url, Consumer<Exchange> consumer) {
checkStarted();
instance().rootInterceptors.add(new Interceptor(Interceptor.Type.BEFORE, HandlerUtil.parseUrl(url), consumer));
} |
java | public void leave() throws NotConnectedException, InterruptedException, NoResponseException, XMPPErrorException {
HashMap<Jid, MUCLightAffiliation> affiliations = new HashMap<>();
affiliations.put(connection.getUser(), MUCLightAffiliation.none);
MUCLightChangeAffiliationsIQ changeAffiliationsIQ... |
java | private void writeTask(Task task)
{
if (!task.getNull())
{
if (extractAndConvertTaskType(task) == null || task.getSummary())
{
writeWBS(task);
}
else
{
writeActivity(task);
}
}
} |
java | public void setActiveListName(String listName) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
// The request of the list is an privacy message with an empty list
Privacy request = new Privacy();
request.setActiveName(listName);
// Send the ... |
python | def update_custom_params(api_key, api_secret, video_key, params):
"""
Function which allows you to update a video's custom params. Custom params are indicated by key-values of
"custom.<key>" = "<value>" so they must be provided as a dictionary and passed to the platform API call.
:param api_key: <strin... |
python | def modify_kpi(self, kpi_id, product_id, measures=[], append=False, **kwargs):
'''
modify_kpi(self, kpi_id, product_id, measures=[], append=False, **kwargs)
Creates a new kpi or modifies existing one.
:Parameters:
* *kpi_id* (`string`) -- The KPI identifier (unique per product)
... |
java | public void setBlob(final int parameterIndex, final InputStream inputStream, final long length) throws SQLException {
if(inputStream == null) {
setNull(parameterIndex, Types.BLOB);
return;
}
try {
setParameter(parameterIndex, new StreamParameter(inputStream, ... |
java | public static xen_upgrade[] get(nitro_service client) throws Exception
{
xen_upgrade resource = new xen_upgrade();
resource.validate("get");
return (xen_upgrade[]) resource.get_resources(client);
} |
java | public static LocalTime ofNanoOfDay(long nanoOfDay) {
NANO_OF_DAY.checkValidValue(nanoOfDay);
int hours = (int) (nanoOfDay / NANOS_PER_HOUR);
nanoOfDay -= hours * NANOS_PER_HOUR;
int minutes = (int) (nanoOfDay / NANOS_PER_MINUTE);
nanoOfDay -= minutes * NANOS_PER_MINUTE;
... |
java | @Override
public AlertPolicyChannel deserialize(JsonElement element, Type type, JsonDeserializationContext context)
throws JsonParseException
{
JsonObject obj = element.getAsJsonObject();
JsonElement policy = obj.get("policy");
if(policy != null && policy.isJsonObject())
... |
python | def linkify_hostgroups_realms_hosts(self, realms, hosts, forced_realms_hostgroups=True):
# pylint: disable=too-many-locals, too-many-nested-blocks, too-many-branches
"""Link between an hostgroup and a realm is already done in the configuration parsing
function that defines and checks the default... |
python | def training_loop(env=None,
env_name="CartPole-v0",
epochs=EPOCHS,
policy_net_fun=None,
value_net_fun=None,
policy_and_value_net_fun=None,
policy_optimizer_fun=None,
value_optimizer_fun=None,
... |
java | public static MultiPolygon removeDuplicateCoordinates(MultiPolygon multiPolygon, double tolerance) throws SQLException {
ArrayList<Polygon> polys = new ArrayList<Polygon>();
for (int i = 0; i < multiPolygon.getNumGeometries(); i++) {
Polygon poly = (Polygon) multiPolygon.getGeometryN(i);
... |
java | public static synchronized void registerCCMConnection(String poolName, Object mcp, Object cl,
Object connection, String key)
{
log.tracef("%s", new TraceEvent(poolName,
Integer.toHexString(System.identityHashCode(mcp... |
python | def oauth_connect(self, provider, action):
"""
This endpoint doesn't check if user is logged in, because it has two functions
1. If the user is not logged in, it will try to signup the user
- if the social info exist, it will login
- not, it will create a new account and... |
java | public String getHtmlControl()
{
StringWriter sw = new StringWriter();
PrintWriter rw = new PrintWriter(sw);
this.getScreenField().printData(rw, HtmlConstants.HTML_DISPLAY); // DO print screen
String string = sw.toString();
return string;
} |
python | def Environ(variable, default):
"""A wrapper for `os.environ.get` that works the same way in both Pythons.
Args:
variable: A name of the variable to get the value of.
default: A default value to return in case no value for the given variable
is set.
Returns:
An environment value of the given v... |
java | public List<T> next(T node) {
List<T> sons = new ArrayList<T>();
if(left(node) != null) sons.add(left(node));
if(right(node) != null) sons.add(right(node));
return sons;
} |
python | def fetch(self, recursive=1, fields=None, detail=None,
filters=None, parent_uuid=None, back_refs_uuid=None):
"""
Fetch collection from API server
:param recursive: level of recursion
:type recursive: int
:param fields: fetch only listed fields.
... |
java | @Override
public CreateRequestValidatorResult createRequestValidator(CreateRequestValidatorRequest request) {
request = beforeClientExecution(request);
return executeCreateRequestValidator(request);
} |
java | public String getURL(String url, Object optParam) throws IOException {
return getURL(url, optParam, true);
} |
java | public void clearPersistedFiles(List<Long> persistedFiles) {
synchronized (mLock) {
for (long persistedId : persistedFiles) {
mPersistedUfsFingerprints.remove(persistedId);
}
}
} |
python | def _parse_date_onblog(dateString):
'''Parse a string according to the OnBlog 8-bit date format'''
m = _korean_onblog_date_re.match(dateString)
if not m:
return
w3dtfdate = '%(year)s-%(month)s-%(day)sT%(hour)s:%(minute)s:%(second)s%(zonediff)s' % \
{'year': m.group(1), 'month': m... |
java | public Packer setAnchorSouth(final boolean how) {
if (how == true) {
gc.anchor = GridBagConstraints.SOUTH;
} else {
gc.anchor &= ~GridBagConstraints.SOUTH;
}
setConstraints(comp, gc);
return this;
} |
python | def service(self):
'''
Instantiate service class with django http_request
'''
service_class = getattr(self, 'service_class')
service = service_class(self.http_request)
return service |
python | def rsdl_sn(self, U):
"""Compute dual residual normalisation term.
Overriding this method is required if methods :meth:`cnst_A`,
:meth:`cnst_AT`, :meth:`cnst_B`, and :meth:`cnst_c` are not
overridden.
"""
return self.rho * np.linalg.norm(self.cnst_AT(U)) |
python | def odoo_tuple_in(iterable):
"""Return `True` if `iterable` contains an expected tuple like
``(6, 0, IDS)`` (and so on).
>>> odoo_tuple_in([0, 1, 2]) # Simple list
False
>>> odoo_tuple_in([(6, 0, [42])]) # List of tuples
True
>>> odoo_tuple_in([[1, 42]]) ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.