language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | public static boolean installRserve(String Rcmd, String http_proxy, String repository) {
if (repository == null || repository.length() == 0) {
repository = Rsession.DEFAULT_REPOS;
}
if (http_proxy == null) {
http_proxy = "";
}
Log.Out.println("Install Rser... |
java | @Override
public String sessionId() {
String sessionId = cookie(SESSION_COOKIE, null);
if (U.isEmpty(sessionId)) {
sessionId = UUID.randomUUID().toString();
synchronized (cookies) {
if (cookie(SESSION_COOKIE, null) == null) {
cookies.put(SESSION_COOKIE, sessionId);
response().cookie(SESSION_CO... |
python | def GetFrequencyStartTimes(self):
"""Return a list of start time for each headway-based run.
Returns:
a sorted list of seconds since midnight, the start time of each run. If
this trip doesn't have headways returns an empty list."""
start_times = []
# for each headway period of the trip
... |
python | def _parse_version(self, value):
"""Parses `version` option value.
:param value:
:rtype: str
"""
version = self._parse_file(value)
if version != value:
version = version.strip()
# Be strict about versions loaded from file because it's easy to
... |
java | public static String getHbInfo(Map<String, String> params, String certPath, String certPassword) {
return HttpUtils.postSSL(getHbInfo, PaymentKit.toXml(params), certPath, certPassword);
} |
java | public static String detokenize(List<String> tokens) {
return TwitterKoreanProcessor.detokenize(JavaConversions.iterableAsScalaIterable(tokens));
} |
python | def overplot_boundaries_from_params(ax, params, parmodel,
list_islitlet,
list_csu_bar_slit_center,
micolors=('m', 'c'), linetype='--',
labels=True, alpha_fill=None,
... |
java | public static void setPropertiesDir(String propertiesDir) {
if (propertiesDir == null)
propertiesDir = "";
propertiesDir = propertiesDir.trim();
if (!propertiesDir.endsWith("/"))
propertiesDir += "/";
ConfigFactory.propertiesDir = propertiesDir;
init();
} |
java | public ServiceFuture<List<ApplicationGatewaySslPredefinedPolicyInner>> listAvailableSslPredefinedPoliciesAsync(final ListOperationCallback<ApplicationGatewaySslPredefinedPolicyInner> serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listAvailableSslPredefinedPoliciesSinglePageAsync(),
... |
java | private void upgradeIfNeeded(File oldPidGenDir) throws IOException {
if (oldPidGenDir != null && oldPidGenDir.isDirectory()) {
String[] names = oldPidGenDir.list();
Arrays.sort(names);
if (names.length > 0) {
BufferedReader in =
new Buf... |
python | def default_set(self, obj):
'Set passed sink or source to be used as default one by pulseaudio server.'
assert_pulse_object(obj)
method = {
PulseSinkInfo: self.sink_default_set,
PulseSourceInfo: self.source_default_set }.get(type(obj))
if not method: raise NotImplementedError(type(obj))
method(obj) |
java | public SmartBinder castReturn(Class<?> type) {
return new SmartBinder(this, signature().changeReturn(type), binder.cast(type, binder.type().parameterArray()));
} |
java | private Path getOrGenerateSchemaFile(Schema schema) throws IOException {
Preconditions.checkNotNull(schema, "Avro Schema should not be null");
String hashedSchema = Hashing.sha256().hashString(schema.toString(), StandardCharsets.UTF_8).toString();
if (!this.schemaPaths.containsKey(hashedSchema)) {
... |
python | def list_files(self, remote_path, by="name", order="desc",
limit=None, extra_params=None, is_share=False, **kwargs):
"""获取目录下的文件列表.
:param remote_path: 网盘中目录的路径,必须以 / 开头。
.. warning::
* 路径长度限制为1000;
... |
java | @SuppressWarnings("resource")
private boolean doPack(final File targetArchiveFile, List<FileData> fileDatas,
final ArchiveRetriverCallback<FileData> callback) {
// 首先判断下对应的目标文件是否存在,如存在则执行删除
if (true == targetArchiveFile.exists() && false == NioUtils.delete(targetArchiveFil... |
python | def auth(config):
"""
Perform authentication with Twitter and return a client instance to communicate with Twitter
:param config: ResponseBot config
:type config: :class:`~responsebot.utils.config_utils.ResponseBotConfig`
:return: client instance to execute twitter action
:rtype: :class:`~respo... |
java | public ByteBuffer getPosKeyBuffer() {
ByteBuffer buf = m_posKeys.duplicate();
buf.order(ByteOrder.nativeOrder());
return buf;
} |
python | def evaluator(evaluate):
"""Return an inspyred evaluator function based on the given function.
This function generator takes a function that evaluates only one
candidate. The generator handles the iteration over each candidate
to be evaluated.
The given function ``evaluate`` must have the fol... |
java | private String findRememberMeCookieValue(HttpServletRequest request, HttpServletResponse response) {
Cookie[] cookies = request.getCookies();
if ((cookies == null) || (cookies.length == 0)) {
return null;
}
for (Cookie cookie : cookies) {
if (ACEGI_SECURITY_HASH... |
java | public static void zip(File[] sources, File target, String compressFileName) throws IOException {
$.notEmpty(sources);
$.notNull(target);
if (!target.isDirectory()) {
throw new IllegalArgumentException("The target can be a directory");
}
// 压缩后文件的名称
compressFileName = $.notEmpty(compressFileName) ... |
python | def plotConvergenceByObject(results, objectRange, featureRange, numTrials,
linestyle='-'):
"""
Plots the convergence graph: iterations vs number of objects.
Each curve shows the convergence for a given number of unique features.
"""
#################################################... |
java | public void setMolecule(IAtomContainer mol, boolean clone, Set<IAtom> afix, Set<IBond> bfix) {
if (clone) {
if (!afix.isEmpty() || !bfix.isEmpty())
throw new IllegalArgumentException("Laying out a cloned molecule, can't fix atom or bonds.");
try {
this.mol... |
python | def cancel_ride(self, ride_id, cancel_confirmation_token=None):
"""Cancel an ongoing ride on behalf of a user.
Params
ride_id (str)
The unique ID of the Ride Request.
cancel_confirmation_token (str)
Optional string containing the cancellation confi... |
python | def filter_batched_data(data, mapping):
"""
Iterates over the data and mapping for a ColumnDataSource and
replaces columns with repeating values with a scalar. This is
purely and optimization for scalar types.
"""
for k, v in list(mapping.items()):
if isinstance(v, dict) and 'field' in v... |
python | def update_gl_state(self, *args, **kwargs):
"""Modify the set of GL state parameters to use when drawing
Parameters
----------
*args : tuple
Arguments.
**kwargs : dict
Keyword argments.
"""
if len(args) == 1:
self._vshare.gl_st... |
python | def _setup_eventloop(self):
"""
Sets up a new eventloop as the current one according to the OS.
"""
if os.name == 'nt':
self.eventloop = asyncio.ProactorEventLoop()
else:
self.eventloop = asyncio.new_event_loop()
asyncio.set_event_loop(self.eventlo... |
java | public synchronized ServletHolder addServlet(String name,
String pathSpec,
String className)
throws ClassNotFoundException,
InstantiationException,
IllegalAccessException
{
... |
python | def get(self, url):
"""
Make a HTTP GET request to the Reader API.
:param url: url to which to make a GET request.
"""
logger.debug('Making GET request to %s', url)
return self.oauth_session.get(url) |
python | def send(self, obj):
"""Send a push notification"""
if not isinstance(obj, NotificationMessage):
raise ValueError, u"You can only send NotificationMessage objects."
self._send_queue.put(obj) |
python | def get_go2obj(self, goids):
"""Return GO Terms for each user-specified GO ID. Note missing GO IDs."""
goids = goids.intersection(self.go2obj.keys())
if len(goids) != len(goids):
goids_missing = goids.difference(goids)
print(" {N} MISSING GO IDs: {GOs}".format(N=len(goid... |
python | def config(name, reset=False, **kwargs):
'''
Modify configuration options for a given port. Multiple options can be
specified. To see the available options for a port, use
:mod:`ports.showconfig <salt.modules.freebsdports.showconfig>`.
name
The port name, in ``category/name`` format
re... |
python | def get_name():
'''Get desktop environment or OS.
Get the OS name or desktop environment.
**List of Possible Values**
+-------------------------+---------------+
| Windows | windows |
+-------------------------+---------------+
| Mac OS X | mac |
+-------------------------+---------------+
| G... |
java | public boolean remove(Object e) {
if (e == null)
return false;
Class<?> eClass = e.getClass();
if (eClass != elementType && eClass.getSuperclass() != elementType)
return false;
int eOrdinal = ((Enum<?>)e).ordinal();
int eWordNum = eOrdinal >>> 6;
... |
python | def body(self, value):
"""Sets the request body; handles logging and length measurement."""
self.__body = value
if value is not None:
# Avoid calling len() which cannot exceed 4GiB in 32-bit python.
body_length = getattr(
self.__body, 'length', None) or le... |
java | public void checkParentLinks() {
this.visit(new NodeVisitor() {
@Override
public boolean visit(AstNode node) {
int type = node.getType();
if (type == Token.SCRIPT)
return true;
if (node.getParent() == null)
... |
python | def simxLoadUI(clientID, uiPathAndName, options, operationMode):
'''
Please have a look at the function description/documentation in the V-REP user manual
'''
count = ct.c_int()
uiHandles = ct.POINTER(ct.c_int)()
if (sys.version_info[0] == 3) and (type(uiPathAndName) is str):
uiPathAndN... |
java | private static void bisectTokeRange(
DeepTokenRange range, final IPartitioner partitioner, final int bisectFactor,
final List<DeepTokenRange> accumulator) {
final AbstractType tkValidator = partitioner.getTokenValidator();
Token leftToken = partitioner.getTokenFactory().fromByt... |
java | static void publishBundle(XMPPConnection connection, OmemoDevice userDevice, OmemoBundleElement bundle)
throws XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException,
SmackException.NoResponseException {
PubSubManager pm = PubSubManager.getInstanceFo... |
python | def data(args):
"""
%prog data data.bin samples.ids STR.ids meta.tsv
Make data.tsv based on meta.tsv.
"""
p = OptionParser(data.__doc__)
p.add_option("--notsv", default=False, action="store_true",
help="Do not write data.tsv")
opts, args = p.parse_args(args)
if len(arg... |
python | def close(self):
"""Close open resources."""
super(RarExtFile, self).close()
if self._fd:
self._fd.close()
self._fd = None |
java | public static List<ResourceBuilder> builders(ClassLoader classLoader, ResourcesModel resourcesModel) {
List<ResourceBuilder> builders = new ArrayList<ResourceBuilder>();
if (resourcesModel != null) {
for (ResourceModel resourceModel : resourcesModel.getResources()) {
builders... |
python | def register(self, fd, events):
"""
Register an USB-unrelated fd to poller.
Convenience method.
"""
if fd in self.__fd_set:
raise ValueError(
'This fd is a special USB event fd, it cannot be polled.'
)
self.__poller.register(fd, eve... |
java | public static OptionalEntity<RequestHeader> getEntity(final CreateForm form, final String username, final long currentTime) {
switch (form.crudMode) {
case CrudMode.CREATE:
return OptionalEntity.of(new RequestHeader()).map(entity -> {
entity.setCreatedBy(username);
... |
java | public ContainerDefinition withResourceRequirements(ResourceRequirement... resourceRequirements) {
if (this.resourceRequirements == null) {
setResourceRequirements(new com.amazonaws.internal.SdkInternalList<ResourceRequirement>(resourceRequirements.length));
}
for (ResourceRequiremen... |
python | def validate_token(self, token):
'''retrieve a subject based on a token. Valid means we return a participant
invalid means we return None
'''
# A token that is finished or revoked is not valid
subid = None
if not token.endswith(('finished','revoked')):
subid = self.generate_subid(toke... |
python | def energy(self, hamiltonian=None):
r"""
The total energy *per unit mass*:
Returns
-------
E : :class:`~astropy.units.Quantity`
The total energy.
"""
if self.hamiltonian is None and hamiltonian is None:
raise ValueError("To compute the to... |
java | public static <O> Function<Object, O> getParseFunction(Class<O> type) {
return new StructBehavior<Function<Object, O>>(type) {
@SuppressWarnings("unchecked")
@Override protected Function<Object, O> booleanIf() {
return (Function<Object, O>) TO_BOOLEAN;
}
... |
java | public boolean checkAliasAccess(Subject authenticatedSubject,
String destination, String aliasDestination, int destinationType, String operationType) throws MessagingAuthorizationException {
SibTr.entry(tc, CLASS_NAME + "checkAliasAccess", new Object[] { authenticatedSubject,... |
java | public CompletableFuture<TopicDescription> getTopicAsync(String path) {
EntityNameHelper.checkValidTopicName(path);
CompletableFuture<String> contentFuture = getEntityAsync(path, null, false);
CompletableFuture<TopicDescription> tdFuture = new CompletableFuture<>();
contentFuture.handle... |
java | @Override
public boolean satisfies(Match match, int... ind)
{
Collection<BioPAXElement> set = con.generate(match, ind);
switch (type)
{
case EQUAL: return set.size() == size;
case GREATER: return set.size() > size;
case GREATER_OR_EQUAL: return set.size() >= size;
case LESS: return set.size() < s... |
java | public CoronaTaskTrackerProtocol getClient(
String host, int port) throws IOException {
String key = makeKey(host, port);
Node ttNode = topologyCache.getNode(host);
CoronaTaskTrackerProtocol client = null;
synchronized (ttNode) {
client = trackerClients.get(key);
if (client == null) {
... |
python | def recognize(mol):
""" Detect cycle basis, biconnected and isolated components (DFS).
This will add following attribute to the molecule instance object.
mol.ring: Cycle basis
mol.scaffold: biconnected components
mol.isolated: isolated components other than the largest one
To find minimum set ... |
java | private void adjustTarget(
DeleteNode point)
{
int s = point.targetType();
GBSNode t = point.targetNode();
GBSNode d = point.deleteNode();
int tx;
switch (s)
{
case DeleteNode.NONE:
/* Nothing to do. Delete poin... |
java | public void filter(ClientRequestContext request) throws IOException
{
if(!request.getHeaders().containsKey("X-License-Key"))
request.getHeaders().add("X-License-Key", this.licensekey);
} |
python | def which(name):
""" Returns the full path to executable in path matching provided name.
`name`
String value.
Returns string or ``None``.
"""
# we were given a filename, return it if it's executable
if os.path.dirname(name) != '':
if not os.path.isdir(name) and... |
java | private static <V> boolean colorOf(TreeEntry<V> p) {
return p == null ? BLACK : p.color;
} |
java | private static float angleDeg(final float ax, final float ay,
final float bx, final float by) {
final double angleRad = Math.atan2(ay - by, ax - bx);
double angle = Math.toDegrees(angleRad);
if (angleRad < 0) {
angle += 360;
}
return ... |
python | def s3_read(source, profile_name=None):
"""
Read a file from an S3 source.
Parameters
----------
source : str
Path starting with s3://, e.g. 's3://bucket-name/key/foo.bar'
profile_name : str, optional
AWS profile
Returns
-------
content : bytes
Raises
-----... |
java | public static String executeRemoveText(String text, String parseExpression) {
LOGGER.debug("removeText抽取函数之前:" + text);
String parameter = parseExpression.replace("removeText(", "");
parameter = parameter.substring(0, parameter.length() - 1);
text = text.replace(parameter, "");
L... |
java | protected AJP13Connection createConnection(Socket socket) throws IOException
{
return new AJP13Connection(this,socket.getInputStream(),socket.getOutputStream(),socket,getBufferSize());
} |
java | public static MutableIntTuple multiply(
IntTuple t0, int factor, MutableIntTuple result)
{
return IntTupleFunctions.apply(
t0, (a)->(a*factor), result);
} |
java | private static <T> int indexOfNullElement(T[] array) {
for (int i = 0; i < array.length; i++) {
if (array[i] == null) {
return i;
}
}
return -1;
} |
python | def from_indexed_arrays(cls, name, verts, normals):
"""Takes MxNx3 verts, Mx3 normals to build obj file"""
# Put header in string
wavefront_str = "o {name}\n".format(name=name)
new_verts, face_indices = face_index(verts)
assert new_verts.shape[1] == 3, "verts should be Nx3 arr... |
java | private void popLastItem() {
KeyValue<K,V> lastKV = items.last();
items.remove(lastKV);
index.remove(lastKV.key);
} |
java | private void repairBrokenLatticeAfter(ViterbiLattice lattice, int nodeEndIndex) {
ViterbiNode[][] nodeEndIndices = lattice.getEndIndexArr();
for (int endIndex = nodeEndIndex + 1; endIndex < nodeEndIndices.length; endIndex++) {
if (nodeEndIndices[endIndex] != null) {
ViterbiN... |
python | def _create_controls(self, can_kill):
"""
Creates the button controls, and links them to event handlers
"""
DEBUG_MSG("_create_controls()", 1, self)
# Need the following line as Windows toolbars default to 15x16
self.SetToolBitmapSize(wx.Size(16,16))
self.AddSimp... |
java | public static short byteArrayToShort(byte[] ba) throws WsocBufferException {
short num = 0;
if ((ba == null) || (ba.length == 0)) {
IllegalArgumentException x = new IllegalArgumentException("Array of no size passed in");
throw new WsocBufferException(x);
}
if (ba... |
java | private void storeUpperBound(Token tok, Token simTok, List usefulTokens, Map upperBoundOnWeight, double sim)
{
double upperBound = tfidfDistance.getWeight(tok)*maxTFIDFScore[simTok.getIndex()]*sim;
if (DEBUG) System.out.println("upper-bounding tok "+simTok+" sim="+sim+" to "+tok+" upperBound "+up... |
java | protected static String[] getMultipartDataBoundary(String contentType) {
// Check if Post using "multipart/form-data; boundary=--89421926422648 [; charset=xxx]"
String[] headerContentType = splitHeaderContentType(contentType);
final String multiPartHeader = HttpHeaderValues.MULTIPART_FORM_DATA.t... |
java | public void connectBeginToBegin(SGraphSegment segment) {
if (segment.getGraph() != getGraph()) {
throw new IllegalArgumentException();
}
final SGraphPoint point = new SGraphPoint(getGraph());
setBegin(point);
segment.setBegin(point);
final SGraph g = getGraph();
assert g != null;
g.updatePointCount(... |
java | @SuppressWarnings("NarrowingCompoundAssignment")
private String hexAV() {
if (pos + 4 >= length) {
// encoded byte array must be not less then 4 c
throw new IllegalStateException("Unexpected end of DN: " + dn);
}
beg = pos; // store '#' position
pos++;
while (true) {
// check ... |
java | @Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
ensureList();
} |
java | @Override
public void dropRetentionPolicy(final String rpName, final String database) {
Preconditions.checkNonEmptyString(rpName, "retentionPolicyName");
Preconditions.checkNonEmptyString(database, "database");
StringBuilder queryBuilder = new StringBuilder("DROP RETENTION POLICY \"");
queryBuilder.ap... |
java | public final Operation setMonitoringService(
String projectId, String zone, String clusterId, String monitoringService) {
SetMonitoringServiceRequest request =
SetMonitoringServiceRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)... |
java | public DfuServiceInitiator setCustomUuidsForLegacyDfu(@Nullable final UUID dfuServiceUuid,
@Nullable final UUID dfuControlPointUuid,
@Nullable final UUID dfuPacketUuid,
@Nullable final UUID dfuVersionUuid) {
final ParcelUuid[] uuids = new ParcelUuid[4];
uuids[0] = dfu... |
java | final public void increment(long incVal) {
if (enabled) { // synchronize the update of lastValue
lastSampleTime = updateIntegral();
synchronized (this) {
current += incVal;
}
updateWaterMark();
} else {
current += incVal;
... |
java | public final void conditionalAndExpression() throws RecognitionException {
int conditionalAndExpression_StartIndex = input.index();
try {
if ( state.backtracking>0 && alreadyParsedRule(input, 112) ) { return; }
// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1146:5: ( inclusiveOrExpre... |
java | @Override
public String getDatabaseUrlForDatabase(DatabaseType databaseType, String hostname,
int port, String databaseName) {
String scheme = this.getSchemeNames().get(databaseType);
String authenticationInfo = this.getAuthenticationInfo().get(databaseType);
Assert.notNull(databaseType, String
.format("N... |
python | def print_torrent(self):
"""
Print the details of a torrent
"""
print('Title: %s' % self.title)
print('URL: %s' % self.url)
print('Category: %s' % self.category)
print('Sub-Category: %s' % self.sub_category)
print('Magnet Link: %s' % self.magnet_link)
... |
java | @Override
public <T> void insert(Collection<? extends T> batchToSave, Class<T> entityClass) {
insert(batchToSave, Util.determineCollectionName(entityClass));
} |
java | private void buildPropertiesFile(String path) throws IOException {
Properties properties = new Properties();
properties.put(MetaInf.PACKAGE_FORMAT_VERSION, Integer.toString(MetaInf.FORMAT_VERSION_2));
properties.put(PackageProperties.NAME_REQUIRES_ROOT, Boolean.toString(false));
for (Map.Entry<String, ... |
java | public static String dateIncreaseByYearforString(String date, int mnt) {
Date date1 = stringToDate(date);
Calendar cal = GregorianCalendar.getInstance();
cal.setTime(date1);
cal.add(Calendar.YEAR, mnt);
String ss = dateToString(cal.getTime(), ISO_DATE_FORMAT);
return date... |
java | public static GeoLocationRequest getHttpServletRequestGeoLocation(final HttpServletRequest request) {
val loc = new GeoLocationRequest();
if (request != null) {
val geoLocationParam = request.getParameter("geolocation");
if (StringUtils.isNotBlank(geoLocationParam)) {
... |
java | @Conditioned
@Et("Je m'attends à avoir '(.*)-(.*)' avec le texte '(.*)'[\\.|\\?]")
@And("I expect to have '(.*)-(.*)' with the text '(.*)'[\\.|\\?]")
public void expectText(String page, String elementName, String textOrKey, List<GherkinStepCondition> conditions) throws FailureException, TechnicalException {... |
python | def thousands(x):
"""
>>> thousands(12345)
'12,345'
"""
import locale
try:
locale.setlocale(locale.LC_ALL, "en_US.utf8")
except Exception:
locale.setlocale(locale.LC_ALL, "en_US.UTF-8")
finally:
s = '%d' % x
groups = []
while s and s[-1].isdigit():... |
python | def _initialize_model_diagnostics(self):
"""Extra diagnostics for two-layer model"""
self.add_diagnostic('entspec',
description='barotropic enstrophy spectrum',
function= (lambda self:
np.abs(self.del1*self.qh[0] + self.del2*self.qh[1])**2.)
)
... |
java | @Override
public SerIterator createChild(final Object value, final SerIterator parent) {
Class<?> declaredType = parent.valueType();
List<Class<?>> childGenericTypes = parent.valueTypeTypes();
if (value instanceof BiMap) {
if (childGenericTypes.size() == 2) {
retu... |
python | def stop(self):
"""Tell the sender thread to finish and wait for it to stop sending
(should be at most "timeout" seconds).
"""
if self.interval is not None:
self._queue.put_nowait(None)
self._thread.join()
self.interval = None |
java | public void search() {
if (layer != null) {
// First we try to get the list of criteria:
List<SearchCriterion> criteria = getSearchCriteria();
if (criteria != null && !criteria.isEmpty()) {
SearchFeatureRequest request = new SearchFeatureRequest();
String value = (String) logicalOperatorRadio.getValu... |
java | public static <T> ConflictHandler<T> localWins() {
return new ConflictHandler<T>() {
@Override
public T resolveConflict(
final BsonValue documentId,
final ChangeEvent<T> localEvent,
final ChangeEvent<T> remoteEvent
) {
return localEvent.getFullDocument();
... |
python | def render_block_to_string(template_name, block_name, context=None):
"""
Loads the given template_name and renders the given block with the given
dictionary as context. Returns a string.
template_name
The name of the template to load and render. If it's a list of
template na... |
python | def addSplits(self, login, tableName, splits):
"""
Parameters:
- login
- tableName
- splits
"""
self.send_addSplits(login, tableName, splits)
self.recv_addSplits() |
python | def parse(self, fp, headersonly=True):
"""Create a message structure from the data in a file."""
feedparser = FeedParser(self._class)
feedparser._set_headersonly()
try:
mp = mmap.mmap(fp.fileno(), 0, access=mmap.ACCESS_READ)
except:
mp = fp
data ... |
java | @Override
public <U extends ApiBaseUser> ResponseToRoom exclude(Collection<U> users) {
for(U user : users)
this.excludedUsers.add(user.getName());
return this;
} |
java | public Observable<Page<PolicyAssignmentInner>> listByResourceGroupNextAsync(final String nextPageLink) {
return listByResourceGroupNextWithServiceResponseAsync(nextPageLink)
.map(new Func1<ServiceResponse<Page<PolicyAssignmentInner>>, Page<PolicyAssignmentInner>>() {
@Override
... |
java | @Override
public void println(String s) throws IOException {
print(s);
this.output.write(CRLF, 0, 2);
} |
java | static UserLimits getLimitsFromUserAccount(HTTPServerConfig config, String username, String password) {
Objects.requireNonNull(username);
Objects.requireNonNull(password);
String token = cache.getUnchecked(new Account(username, password));
return getLimitsFromToken(config, token);
} |
python | def rmlinenumber(linenumber, infile, dryrun=False):
"""
Sed-like line deletion function based on given line number..
Usage: pysed.rmlinenumber(<Unwanted Line Number>, <Text File>)
Example: pysed.rmlinenumber(10, '/path/to/file.txt')
Example 'DRYRUN': pysed.rmlinenumber(10, '/path/to/file.txt', dryru... |
python | def _set_ma_type(self, v, load=False):
"""
Setter method for ma_type, mapped from YANG variable /cfm_state/cfm_detail/domain/ma/ma_type (ma-types)
If this variable is read-only (config: false) in the
source YANG file, then _set_ma_type is considered as a private
method. Backends looking to populate ... |
python | def potential_cloud_layer(self, pcp, water, tlow, land_cloud_prob, land_threshold,
water_cloud_prob, water_threshold=0.5):
"""Final step of determining potential cloud layer
Equation 18 (Zhu and Woodcock, 2012)
Saturation (green or red) test is not in the algorithm
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.