language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | @Pure
public BusStop[] busStopsArray() {
return Collections.unmodifiableList(this.busStops).toArray(new BusStop[this.busStops.size()]);
} |
python | def _ParseNoHeaderSingleLine(self, parser_mediator, structure):
"""Parse an isolated header line and store appropriate attributes.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
structure (pyparsing.ParseResul... |
python | def make(self, pnum):
"""
Make a PID file and populate with PID number.
"""
try:
# Create the PID file
self.mkfile(self.pid_file, pnum)
except Exception as e:
self.die('Failed to generate PID file: {}'.format(str(e))) |
java | public static UUID getNext(UUID uuid) {
checkArgument(uuid.version() == 1, "Not a time UUID");
UUID max = maximumUuid();
long lsb = uuid.getLeastSignificantBits();
if (lsb < max.getLeastSignificantBits()) {
return new UUID(uuid.getMostSignificantBits(), lsb + 1);
}
... |
java | public static void postAction (Component source, String command)
{
// slip things onto the event queue for later
ActionEvent event = new ActionEvent(source, 0, command);
EventQueue.invokeLater(new ActionInvoker(event));
} |
java | @Override
public <Y> Expression<Y> coalesce(Expression<? extends Y> arg0, Y arg1)
{
// TODO Auto-generated method stub
return null;
} |
java | @SuppressWarnings("unchecked")
public void clear()
{
for (@DoNotSub int i = 0, size = values.length; i < size; i++)
{
final Object value = values[i];
if (null != value)
{
values[i] = null;
this.size--;
evictionC... |
python | def hide_filter_change_update_delay_holder_filter_change_update_delay_filter_delay_value(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
hide_filter_change_update_delay_holder = ET.SubElement(config, "hide-filter-change-update-delay-holder", xmlns="urn:brocade.c... |
java | private JsonObject toJsonObject() {
JsonObjectBuilder factory = Json.createObjectBuilder();
if (profile != null) {
factory.add("profile", profile);
}
if (!hosts.isEmpty()) {
JsonArrayBuilder ab = Json.createArrayBuilder();
for (String host : hosts) {
... |
java | @Override
public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final RelativeLayout rl = new RelativeLayout(this);
this.mMapView = new MapView(this);
this.mMapView.setTilesScaledToDpi(true);
rl.addView(this.mMapView, new RelativeLayout.LayoutParams(LayoutParams.FILL_P... |
java | private void seekToChunkStart()
{
if (getOnDiskFilePointer() != chunkOffset)
{
try
{
out.seek(chunkOffset);
}
catch (IOException e)
{
throw new FSReadError(e, getPath());
}
}
} |
java | public void doPost (HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String alertId = request.getParameter("alertId");
String tel = request.getParameter("tel");
String alertText = request.getParameter("alertText");
if(alertTex... |
java | public List<java.lang.Object> getStartPageOrEndPageOrMedlinePgn() {
if (startPageOrEndPageOrMedlinePgn == null) {
startPageOrEndPageOrMedlinePgn = new ArrayList<java.lang.Object>();
}
return this.startPageOrEndPageOrMedlinePgn;
} |
java | @Override
public PipelineEventReader<XMLEventReader, XMLEvent> getEventReader(
HttpServletRequest request, HttpServletResponse response) {
// Get the reader from the parent and add the attribute incorporating wrapper
final PipelineEventReader<XMLEventReader, XMLEvent> cachingEventReader ... |
python | def teleport(start_index, end_index, ancilla_index):
"""Teleport a qubit from start to end using an ancilla qubit
"""
program = make_bell_pair(end_index, ancilla_index)
ro = program.declare('ro', memory_size=3)
# do the teleportation
program.inst(CNOT(start_index, ancilla_index))
program.i... |
java | @Override
public List<BundlePath> getItemPathList(Map<String, String> variants) {
return getItemPathList(bundlePathMapping.getItemPathList(), variants);
} |
python | def _add_sj_index_commands(fq1, ref_file, gtf_file):
"""
newer versions of STAR can generate splice junction databases on thephfly
this is preferable since we can tailor it to the read lengths
"""
if _has_sj_index(ref_file):
return ""
else:
rlength = fastq.estimate_maximum_read_l... |
java | static <S extends Sequence<C>, C extends Compound> List<ProfilePair<S, C>>
runProfileAligners(List<ProfileProfileAligner<S, C>> aligners) {
int n = 1, all = aligners.size();
List<Future<ProfilePair<S, C>>> futures = new ArrayList<Future<ProfilePair<S, C>>>();
for (ProfileProfileAligner<S, C> aligner : aligners... |
python | def _substitute_default(s, new_value):
"""Replaces the default value in a parameter docstring by a new value.
The docstring must conform to the numpydoc style and have the form
"something (keyname=<value-to-replace>)"
If no matching pattern is found or ``new_value`` is None, return
the input untou... |
python | def reset(self):
""" Resets the readonly variables.
"""
self.p_lmbda = 0.0
self.q_lmbda = 0.0
self.mu_vmin = 0.0
self.mu_vmax = 0.0 |
python | def cast_datetime(ts, fmt=None):
"""cast timestamp to datetime or date str"""
dt = datetime.datetime.fromtimestamp(ts)
if fmt:
return dt.strftime(fmt)
return dt |
java | public static byte[] encodeMultiple(final byte[] input) {
if (input == null) {
throw new NullPointerException("input");
}
final byte[] output = new byte[input.length << 1]; // * 2
encodeMultiple(input, 0, output, 0, input.length);
return output;
} |
python | def get_related(self, content_id, min_strength=None):
'''Get positive relation labels for ``cid``.
If ``min_strength`` is set, will restrict results to labels
with a ``rel_strength`` greater or equal to the provided
``RelationStrength`` value. Note: ``min_strength`` should be of
... |
java | public static void localRunnerNotification(JobConf conf, JobStatus status) {
JobEndStatusInfo notification = createNotification(conf, status);
if (notification != null) {
while (notification.configureForRetry()) {
try {
int code = httpNotification(notification.getUri());
if (co... |
java | public void addChild(String label, CmsAppHierarchyPanel child) {
Panel panel = new Panel();
panel.setCaption(label);
panel.setContent(child);
addComponent(panel);
} |
java | @SneakyThrows
public CouchDbConsentDecision copyDetailsFrom(final ConsentDecision other) {
setAttributes(other.getAttributes());
setPrincipal(other.getPrincipal());
setCreatedDate(other.getCreatedDate());
setId(other.getId());
setOptions(other.getOptions());
setRemind... |
java | public static void proxyUserKillAllSpawnedHadoopJobs(final String logFilePath, Props jobProps,
File tokenFile, final Logger log) {
Properties properties = new Properties();
properties.putAll(jobProps.getFlattened());
try {
if (HadoopSecureWrapperUtils.shouldProxy(properties)) {
UserGrou... |
python | def _insertFont(self, fontname, bfname, fontfile, fontbuffer, set_simple, idx, wmode, serif, encoding, ordering):
"""_insertFont(self, fontname, bfname, fontfile, fontbuffer, set_simple, idx, wmode, serif, encoding, ordering) -> PyObject *"""
return _fitz.Page__insertFont(self, fontname, bfname, fontfil... |
python | def _ValidateArguments(arg_dict, type_check_dict):
"""Validate dictionary of arguments and return list of errors messages."""
messages = []
for arg_name, arg_value in arg_dict.items():
if arg_name in type_check_dict:
type_check = type_check_dict[arg_name]
res = _ValidateValue(arg_value, type_check... |
java | @Override
public void preProcess(DataSet toPreProcess) {
for (DataSetPreProcessor preProcessor : preProcessors) {
preProcessor.preProcess(toPreProcess);
}
} |
python | def str2dict_values(str_in):
'''
Extracts the values from a string that represents a dict and returns them
sorted by key.
Args:
str_in (string) that contains python dict
Returns:
(list) with values or None if no valid dict was found
Raises:
-
'''
tmp_dict = str2d... |
java | public <R> void visit(String key, Visitor<T, R> visitor) {
if (root != null) {
visit(key, visitor, null, root);
}
} |
java | private void writeMethod(Definition def, Writer out, int indent) throws IOException
{
if (def.getMcfDefs().get(getNumOfMcf()).isDefineMethodInConnection())
{
if (def.getMcfDefs().get(getNumOfMcf()).getMethods().size() > 0)
{
for (MethodForConnection method : def.getMcfDefs()... |
java | private boolean processBlockSignature(ReadBuffer readBuffer) {
if (this.mapFileHeader.getMapFileInfo().debugFile) {
// get and check the block signature
String signatureBlock = readBuffer.readUTF8EncodedString(SIGNATURE_LENGTH_BLOCK);
if (!signatureBlock.startsWith("###TileSt... |
python | def p_parens_expr(p):
"""
expr : LPAREN expr RPAREN
"""
p[0] = node.expr(op="parens", args=node.expr_list([p[2]])) |
python | def _render(roster_file, **kwargs):
"""
Render the roster file
"""
renderers = salt.loader.render(__opts__, {})
domain = __opts__.get('roster_domain', '')
try:
result = salt.template.compile_template(roster_file,
renderers,
... |
python | def edf_totdev(N, m, alpha):
""" Equivalent degrees of freedom for Total Deviation
FIXME: what is the right behavior for alpha outside 0,-1,-2?
NIST SP1065 page 41, Table 7
"""
alpha = int(alpha)
if alpha in [0, -1, -2]:
# alpha 0 WFM
# alpha -1 FFM
# al... |
java | public synchronized void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
final DeploymentUnit parent = deploymentUnit.getParent();
final DeploymentUnit topLevelDeployment = pare... |
python | def filename_from_webname(self, webname):
"""
A 1<->1 map is maintained between a URL pointing to a file and
the name of the file in the file system.
As an example if the base_url is 'https://example.com' and a jwks_uri
is 'https://example.com/jwks_uri.json' then the filename of... |
python | def update_group_properties(self, group_id, group_properties, headers=None, endpoint_url=None):
"""
Update a group's properties with values provided in "group_properties" dictionary
:param str group_id: group ID
:param dict group_properties: group properties to update with a new values
... |
python | def summary(self):
"""Summary statistics describing the fit.
Set alpha property in the object before calling.
Returns
-------
df : DataFrame
Contains columns coef, np.exp(coef), se(coef), z, p, lower, upper"""
ci = 1 - self.alpha
with np.errstate(inva... |
java | static String enclosing(String identifier) {
int hash = identifier.lastIndexOf('#');
if (hash != -1) return identifier.substring(0, hash);
int from = identifier.endsWith(".*") ? identifier.length() - 3 : identifier.length() - 1;
int dot = identifier.lastIndexOf('.', from);
if (dot != -1) return ide... |
java | public Response batchCorrectLocation(Float lat, Float lon, Integer accuracy, String placeId, String woeId) throws JinxException {
JinxUtils.validateParams(lat, lon, accuracy);
if (JinxUtils.isNullOrEmpty(placeId)) {
JinxUtils.validateParams(woeId);
}
Map<String, String> params = new TreeMap<>();
... |
python | def head(self, path, query=None, data=None, redirects=True):
"""
HEAD request wrapper for :func:`request()`
"""
return self.request('HEAD', path, query, None, redirects) |
java | @Override
public GetAliasResult getAlias(GetAliasRequest request) {
request = beforeClientExecution(request);
return executeGetAlias(request);
} |
java | public GlobalCluster withGlobalClusterMembers(GlobalClusterMember... globalClusterMembers) {
if (this.globalClusterMembers == null) {
setGlobalClusterMembers(new com.amazonaws.internal.SdkInternalList<GlobalClusterMember>(globalClusterMembers.length));
}
for (GlobalClusterMember ele ... |
java | public static DeviceType getDeviceType(@NonNull final Context context) {
Condition.INSTANCE.ensureNotNull(context, "The context may not be null");
return DeviceType.fromValue(context.getString(R.string.device_type));
} |
python | def get_published_or_draft(self):
"""
Return the published item, if it exists, otherwise, for privileged
users, return the draft version.
"""
if self.is_published:
return self
elif self.publishing_linked_id:
return self.publishing_linked
if... |
java | @VisibleForTesting
public static <T> Iterable<T> getCandidatesViaServiceLoader(Class<T> klass, ClassLoader cl) {
Iterable<T> i = ServiceLoader.load(klass, cl);
// Attempt to load using the context class loader and ServiceLoader.
// This allows frameworks like http://aries.apache.org/modules/spi-fly.html t... |
java | public ItemData getItemData(final NodeData parentData, final QPathEntry name, ItemType itemType)
throws RepositoryException
{
final WorkspaceStorageConnection con = dataContainer.openConnection();
try
{
return con.getItemData(parentData, name, itemType);
}
finally
{... |
java | @Override
public void removeNotificationListener(ObjectName name, ObjectName listener) throws InstanceNotFoundException, ListenerNotFoundException, IOException {
checkConnection();
getNotificationRegistry().removeNotificationListener(name, listener);
} |
java | public static /*@pure@*/ double mean(double[] vector) {
double sum = 0;
if (vector.length == 0) {
return 0;
}
for (int i = 0; i < vector.length; i++) {
sum += vector[i];
}
return sum / (double) vector.length;
} |
python | def checkversion(version, REFVERSION=FOLIAVERSION):
"""Checks FoLiA version, returns 1 if the document is newer than the library, -1 if it is older, 0 if it is equal"""
try:
for refversion, docversion in zip([int(x) for x in REFVERSION.split('.')], [int(x) for x in version.split('.')]):
if d... |
python | def add_figure(self, key, url, **kwargs):
"""Add a figure.
Args:
key (string): document key
url (string): document url
Keyword Args:
caption (string): simple description
label (string):
material (string):
original_url (stri... |
java | BigInteger setMultiChoiceCount() {
if (fields != null)
for (int i = 0; i < fields.length; i++)
multiChoiceCount = multiChoiceCount.multiply(fields[i].setMultiChoiceCount());
return multiChoiceCount;
} |
python | def set_variables(self, data):
"""
Set variables for the network.
Parameters
----------
data: dict
dict for variable in the form of example as shown.
Examples
--------
>>> from pgmpy.readwrite.XMLBeliefNetwork import XBNWriter
>>> wri... |
java | private void removeDeletable()
{
String fileName = "deletable";
try
{
if (indexDir.fileExists(fileName))
{
indexDir.deleteFile(fileName);
}
}
catch (IOException e)
{
LOG.warn("Unable to remove file 'deletable'.", e);
}
} |
python | def _format_list(result):
"""Format list responses into a table."""
if not result:
return result
if isinstance(result[0], dict):
return _format_list_objects(result)
table = Table(['value'])
for item in result:
table.add_row([iter_to_table(item)])
return table |
python | async def finish_authentication(self, username, password):
"""Finish authentication process.
A username (generated by new_credentials) and the PIN code shown on
screen must be provided.
"""
# Step 1
self.srp.step1(username, password)
data = await self._send_plist... |
java | private float[] generateParticleVelocities()
{
float velocities[] = new float[mEmitRate * 3];
for ( int i = 0; i < mEmitRate * 3; i +=3 )
{
Vector3f nexVel = getNextVelocity();
velocities[i] = nexVel.x;
velocities[i+1] = nexVel.y;
velocities[i+... |
python | def checkVersion(self):
"""Check if the server use the same version of our protocol"""
r = self.doQuery('version')
if r.status_code == 200: # Query ok ?
data = r.json()
if data['result'] == 'Ok' and data['version'] == self.PI_API_VERSION and data['protocol'] == self.P... |
java | @SuppressWarnings("UnstableApiUsage")
private void computeProjectDependencies(IdeaModule module) {
ARTIFACT_DEPS_OF_PRJ.computeIfAbsent(module.getName(), moduleName -> {
Map<String, Set<ArtifactSpec>> dependencies = new HashMap<>();
module.getDependencies().forEach(dep -> {
... |
java | private CmsRectangle getNativeCropRegion() {
CmsCroppingParamBean crop = m_croppingProvider.get();
CmsImageInfoBean info = m_imageInfoProvider.get();
if ((crop == null) || !crop.isCropped()) {
return CmsRectangle.fromLeftTopWidthHeight(0, 0, info.getWidth(), info.getHeight());
... |
python | def versions_from_parentdir(parentdir_prefix, root, verbose):
"""Try to determine the version from the parent directory name.
Source tarballs conventionally unpack into a directory that includes both
the project name and a version string. We will also support searching up
two directory levels for an ap... |
java | public void buildFieldComments(XMLNode node, Content fieldDocTree) {
if (!configuration.nocomment) {
writer.addComments(currentElement, fieldDocTree);
}
} |
java | public void endElement(String uri, String name, String qName)
{
boolean isDebug = logger.isDebugEnabled();
try
{
switch (getLiteralId(qName))
{
case MAPPING_REPOSITORY:
{
currentAttributeContainer = ... |
python | def fs_r(self, percent=0.9, N=None):
"""Get the row factor scores (dimensionality-reduced representation),
choosing how many factors to retain, directly or based on the explained
variance.
'percent': The minimum variance that the retained factors are required
to explain (default: 90% = 0.9)
'N': The ... |
java | @XmlElementDecl(namespace = "http://www.w3.org/1998/Math/MathML", name = "notin")
public JAXBElement<NotinType> createNotin(NotinType value) {
return new JAXBElement<NotinType>(_Notin_QNAME, NotinType.class, null, value);
} |
java | static void requestOverlay(Source source) {
Intent intent = new Intent(source.getContext(), BridgeActivity.class);
intent.putExtra(KEY_TYPE, BridgeRequest.TYPE_OVERLAY);
source.startActivity(intent);
} |
python | def corenlp2naf(xml_bytes, annotators):
"""
Call from on the text and return a Naf object
"""
naf = KafNafParser(type="NAF")
try:
doc = Document(xml_bytes)
except:
log.exception("Error on parsing xml")
raise
terms = {} # (xml_sentid, xml_tokenid) : term
for sent... |
python | def clean(feed: "Feed") -> "Feed":
"""
Apply
#. :func:`drop_zombies`
#. :func:`clean_ids`
#. :func:`clean_times`
#. :func:`clean_route_short_names`
to the given "Feed" in that order.
Return the resulting "Feed".
"""
feed = feed.copy()
ops = [
"clean_ids",
"c... |
java | public List<IoDevice> getAvailableIoDevices() {
List<IoDevice> returnList = new ArrayList<IoDevice>();
for (PriorityIoDeviceTuple compatibleIoDeviceTuple : mCompatibleDevices) {
IoDevice compatibleIoDevice = compatibleIoDeviceTuple.getIoDevice();
if (compatibleIoDevice.equals(mIO... |
python | def update_file(dk_api, kitchen, recipe_name, message, files_to_update_param):
"""
reutrns a string.
:param dk_api: -- api object
:param kitchen: string
:param recipe_name: string -- kitchen name, string
:param message: string message -- commit message, string
:p... |
java | static boolean containsMatch(String actual, String regex) {
return Pattern.compile(regex).matcher(actual).find();
} |
python | def min(self):
"""
The minimum integer value of a value-set. It is only defined when there is exactly one region.
:return: A integer that represents the minimum integer value of this value-set.
:rtype: int
"""
if len(self.regions) != 1:
raise ClaripyVSAOper... |
python | def list(self, request, *args, **kwargs):
"""
To list all services without regard to its type, run **GET** against */api/services/* as an authenticated user.
To list services of specific type issue **GET** to specific endpoint from a list above as a customer owner.
Individual endpoint u... |
java | public TimeZoneRule[] getTimeZoneRules(long start) {
TimeZoneRule[] all = getTimeZoneRules();
TimeZoneTransition tzt = getPreviousTransition(start, true);
if (tzt == null) {
// No need to filter out rules only applicable to time before the start
return all;
}
... |
python | def create(entropy_coefficient, value_coefficient, max_grad_norm, discount_factor, gae_lambda=1.0):
""" Vel factory function """
return A2CPolicyGradient(
entropy_coefficient,
value_coefficient,
max_grad_norm,
discount_factor,
gae_lambda
) |
java | protected Path downloadPlugin(String id, String version) throws PluginException {
try {
PluginRelease release = findReleaseForPlugin(id, version);
Path downloaded = getFileDownloader(id).downloadFile(new URL(release.url));
getFileVerifier(id).verify(new FileVerifier.Context(i... |
java | public void simpleLogout(HttpServletRequest req, HttpServletResponse res) {
createSubjectAndPushItOnThreadAsNeeded(req, res);
AuthenticationResult authResult = new AuthenticationResult(AuthResult.SUCCESS, subjectManager.getCallerSubject());
authResult.setAuditCredType(req.getAuthType());
... |
python | def _continuous_colormap(hue, cmap, vmin, vmax):
"""
Creates a continuous colormap.
Parameters
----------
hue : iterable
The data column whose entries are being discretely colorized. Note that although top-level plotter ``hue``
parameters ingest many argument signatures, not just it... |
python | def absolute(requestContext, seriesList):
"""
Takes one metric or a wildcard seriesList and applies the mathematical abs
function to each datapoint transforming it to its absolute value.
Example::
&target=absolute(Server.instance01.threads.busy)
&target=absolute(Server.instance*.thread... |
python | def fromJSON(cls, jdata):
"""
Generates a new column from the given json data. This should
be already loaded into a Python dictionary, not a JSON string.
:param jdata | <dict>
:return <orb.Column> || None
"""
cls_type = jdata.get('type')
col_cl... |
java | private void addConstructorsForBeanWithPrivateConstructors(ClassFile proxyClassType) {
ClassMethod ctor = proxyClassType.addMethod(AccessFlag.PUBLIC, INIT_METHOD_NAME, BytecodeUtils.VOID_CLASS_DESCRIPTOR, LJAVA_LANG_BYTE);
CodeAttribute b = ctor.getCodeAttribute();
b.aload(0);
b.aconstNu... |
java | private void get(final StringBuilder sql) {
sql.append("SELECT * FROM ").append(getName()).append(" WHERE ").append(JdbcRepositories.getDefaultKeyName()).append(" = ?");
} |
java | public static protocolhttp_stats get(nitro_service service, options option) throws Exception{
protocolhttp_stats obj = new protocolhttp_stats();
protocolhttp_stats[] response = (protocolhttp_stats[])obj.stat_resources(service,option);
return response[0];
} |
java | public static void i(Object source, String format, Object... args) {
log(source, Log.INFO, format, args);
} |
python | def MakeExponentialPmf(lam, high, n=200):
"""Makes a PMF discrete approx to an exponential distribution.
lam: parameter lambda in events per unit time
high: upper bound
n: number of values in the Pmf
returns: normalized Pmf
"""
pmf = Pmf()
for x in numpy.linspace(0, high, n):
p... |
java | public PauseAppStreamResponse pauseAppStream(String app, String stream) {
PauseAppStreamRequest pauseAppStreamRequest = new PauseAppStreamRequest();
pauseAppStreamRequest.setApp(app);
pauseAppStreamRequest.setStream(stream);
return pauseAppStream(pauseAppStreamRequest);
} |
java | @Nonnull
public final LTriBoolFunction<R> build() {
final LTriBoolFunction<R> eventuallyFinal = this.eventually;
LTriBoolFunction<R> retval;
final Case<LLogicalTernaryOperator, LTriBoolFunction<R>>[] casesArray = cases.toArray(new Case[cases.size()]);
retval = LTriBoolFunction.<R> triBoolFunc((a1, a2, a3) -... |
java | public void setIdentifier(String newIdentifier) {
String oldIdentifier = identifier;
identifier = newIdentifier;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DroolsPackage.GLOBAL_TYPE__IDENTIFIER, oldIdentifier, identifier));
} |
java | public NodeIterator selectNodeIterator(
Node contextNode, String str, Node namespaceNode)
throws TransformerException
{
// Execute the XPath, and have it return the result
XObject list = eval(contextNode, str, namespaceNode);
// Have the XObject return its result as a NodeSetDTM. ... |
python | def add(self, operator):
'''Add an operator to the Slicer
Parameters
----------
operator : Scope (TaskTransformer or FeatureExtractor)
The new operator to add
'''
if not isinstance(operator, Scope):
raise ParameterError('Operator {} must be a Task... |
java | public JavaFile createPojo(final String name,
final JCTree.JCLiteral literal,
final List<VariableAndValue> usedVariables) throws PackageNameException {
String eventName;
String packageName;
if (name != null) {
//get event ... |
python | def python_version_matchers():
"""Return set of string representations of current python version"""
version = sys.version_info
patterns = [
"{0}",
"{0}{1}",
"{0}.{1}",
]
matchers = [
pattern.format(*version)
for pattern in patterns
] + [None]
return se... |
java | public void readFields(DataInput in) throws IOException {
name = UTF8.readString(in);
storageID = UTF8.readString(in);
// the infoPort read could be negative, if the port is a large number (more
// than 15 bits in storage size (but less than 16 bits).
// So chop off the first two bytes (and hence th... |
java | public void createLinks(ServiceReference<S> declarationBinderRef) {
for (D declaration : linkerManagement.getMatchedDeclaration()) {
if (linkerManagement.canBeLinked(declaration, declarationBinderRef)) {
linkerManagement.link(declaration, declarationBinderRef);
}
... |
java | private static void omitEdge(int[] edges, int[] idx, int[] sizes, int omit) {
for(int i = 0; i < idx.length; i++) {
idx[i] = i;
}
Arrays.fill(sizes, 1);
for(int i = 0, j = 0, e = edges.length - 1; j < e; i++, j += 2) {
if(i == omit) {
continue;
}
int ea = edges[j + 1], eb... |
java | protected Features getFeaturesFromRequestEncoded(HttpServletRequest request, Features defaultFeatures) throws IOException {
final String methodName = "getFeaturesFromRequestEncoded"; //$NON-NLS-1$
boolean traceLogging = log.isLoggable(Level.FINER);
if (traceLogging) {
log.entering(sourceClass, methodName, ... |
python | def reset_catalog():
'''
.. versionadded:: 2016.3.0
Reset the Software Update Catalog to the default.
:return: True if successful, False if not
:rtype: bool
CLI Example:
.. code-block:: bash
salt '*' softwareupdates.reset_catalog
'''
# This command always returns an erro... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.