language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | public PatternTokenizer setSyntaxCharacters(UnicodeSet syntaxCharacters) {
this.syntaxCharacters = (UnicodeSet) syntaxCharacters.clone();
needingQuoteCharacters = null;
return this;
} |
python | def data(self):
"""return dictionary with data.
If data entries are None or incomplete, consider calling
``.load().data()`` to (re-)load the data from files first.
"""
d = {}
for name in self.key_names:
d[name] = self.__dict__.get(name, None)
return ... |
java | public Color getExpectedColorParam(int index) {
Expression expr = getExpectedParam(index);
if (!(expr instanceof Color)) {
throw new IllegalArgumentException("Parameter " + index + " isn't a color. Function call: " + this);
}
return (Color) expr;
} |
java | public static void setZero(LinearSparseVector sv, int[] idx) {
for(int i = 0; i < idx.length; i++) {
if (sv.containsKey(idx[i])) {
sv.remove(idx[i]);
}
}
} |
java | public void setCommerceNotificationTemplateLocalService(
com.liferay.commerce.notification.service.CommerceNotificationTemplateLocalService commerceNotificationTemplateLocalService) {
this.commerceNotificationTemplateLocalService = commerceNotificationTemplateLocalService;
} |
java | @SuppressWarnings("unchecked")
public ModelAndView postNewRule(HttpServletRequest request)
throws IOException {
Object data = view.deserializeRequest(request);
Collection<Rule> rules;
if (data instanceof Collection) {
rules = (Collection<Rule>) data;
... |
java | public RecordReader<DocumentID, LineDocTextAndOp> getRecordReader(
InputSplit split, JobConf job, Reporter reporter) throws IOException {
reporter.setStatus(split.toString());
return new LineDocRecordReader(job, (FileSplit) split);
} |
python | def members(self):
"""
Return a list of all users in this organization. Users are identified
by their login name. Note that this is computed from the teams in the
organization, because GitHub does not currently offer a WebHook for
organization membership, so converting org member... |
python | def parse(self, xmltext):
"""
Parse a string containing LEMS XML text.
@param xmltext: String containing LEMS XML formatted text.
@type xmltext: str
"""
xml = LEMSXMLNode(xe.XML(xmltext))
if xml.ltag != 'lems' and xml.ltag != 'neuroml':
rais... |
java | private boolean satisfied(final CLClause c) {
if (c.satisfied()) { return true; }
for (int i = 0; i < c.lits().size(); i++) {
if (val(c.lits().get(i)) == VALUE_TRUE) {
if (this.level == 0) { c.setSatisfied(true); }
return true;
}
}
... |
python | def _gather_pillar(self):
'''
Whenever a state run starts, gather the pillar data fresh
'''
if self._pillar_override:
if self._pillar_enc:
try:
self._pillar_override = salt.utils.crypt.decrypt(
self._pillar_override,... |
python | def isstring(args, quoted=False):
"""Checks if value is a (quoted) string."""
isquoted = lambda c: c[0]==c[-1] and c[0] in ['"', "'"]
if quoted:
check = lambda c: isinstance(c, str) and isquoted(c)
else:
check = lambda c: isinstance(c, str)
if isinstance(args, list):
return... |
python | def generate(env):
"""Add Builders and construction variables for tar to an Environment."""
try:
bld = env['BUILDERS']['Tar']
except KeyError:
bld = TarBuilder
env['BUILDERS']['Tar'] = bld
env['TAR'] = env.Detect(tars) or 'gtar'
env['TARFLAGS'] = SCons.Util.CLVar('-... |
python | def addEntity(self, model, number, customFieldFormatters=None):
"""
Add an order for the generation of $number records for $entity.
:param model: mixed A Django Model classname, or a faker.orm.django.EntityPopulator instance
:type model: Model
:param number: int The number of en... |
java | @XmlElementDecl(namespace = "http://www.ibm.com/websphere/wim", name = "city")
public JAXBElement<String> createCity(String value) {
return new JAXBElement<String>(_City_QNAME, String.class, null, value);
} |
java | public Integer getHeight() {
final Object result = getStateHelper().eval(PropertyKeys.height);
if (result == null) {
return null;
}
// this will handle any type so long as its convertable to integer
return Integer.valueOf(result.toString());
} |
java | public static void dump(ArrayList<SurvivalInfo> DataT, PrintStream ps, String delimiter) {
ArrayList<String> variables = DataT.get(0).getDataVariables();
ps.print("Seq" + delimiter);
for (String variable : variables) {
ps.print(variable + delimiter);
}
ps.print("TIME" + delimiter + "STATUS" + delimiter + "... |
python | def check_assert(self, cmd, retries=1, pollrate=60, on_retry=None):
"""
Run a command, logging (using gather) and raise an exception if the
return code of the command indicates failure.
Try the command multiple times if requested.
:param cmd <string|list>: A shell command
... |
java | @Override
public void removeByG_U(long groupId, long userId) {
for (CommerceSubscriptionEntry commerceSubscriptionEntry : findByG_U(
groupId, userId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(commerceSubscriptionEntry);
}
} |
java | public HierarchicalProperty getProperty(QName name) throws PathNotFoundException, AccessDeniedException,
RepositoryException
{
if (name.equals(DISPLAYNAME))
{
return new HierarchicalProperty(name, node.getName() + (node.getIndex() > 1 ? "[" + node.getIndex() + "]" : ""));
}
... |
python | def resume(self):
"""
Resumes this VirtualBox VM.
"""
yield from self._control_vm("resume")
self.status = "started"
log.info("VirtualBox VM '{name}' [{id}] resumed".format(name=self.name, id=self.id)) |
java | protected DFSClient getDFSClient(HttpServletRequest request)
throws IOException, InterruptedException {
Configuration conf = new Configuration(masterConf);
UnixUserGroupInformation.saveToConf(conf,
UnixUserGroupInformation.UGI_PROPERTY_NAME, getUGI(request));
return JspHelper.getDFSClient(requ... |
python | def pickle_save(thing,fname=None):
"""save something to a pickle file"""
if fname is None:
fname=os.path.expanduser("~")+"/%d.pkl"%time.time()
assert type(fname) is str and os.path.isdir(os.path.dirname(fname))
pickle.dump(thing, open(fname,"wb"),pickle.HIGHEST_PROTOCOL)
print("saved",fname) |
python | def _validate_paths(self, settings, name, value):
"""
Apply ``SettingsPostProcessor._validate_path`` to each element in
list.
Args:
settings (dict): Current settings.
name (str): Setting name.
value (list): List of paths to patch.
Raises:
... |
python | def is_ome(self):
"""Page contains OME-XML in ImageDescription tag."""
if self.index > 1 or not self.description:
return False
d = self.description
return d[:14] == '<?xml version=' and d[-6:] == '</OME>' |
java | public static boolean representsBold(CSSProperty.FontWeight weight)
{
if (weight == CSSProperty.FontWeight.BOLD ||
weight == CSSProperty.FontWeight.BOLDER ||
weight == CSSProperty.FontWeight.numeric_600 ||
weight == CSSProperty.FontWeight.numeric_700 ||
... |
python | def __git_tag(git_tag):
"""
Create new tag.
The function call will return 0 if the command success.
"""
command = ['git', 'tag', '-a', git_tag, '-m', '\'' + git_tag + '\'']
Shell.msg('Create tag from version ' + git_tag)
if APISettings.DEBUG:
Git.__de... |
java | @VisibleForTesting
public static <T> Iterable<T> getCandidatesViaServiceLoader(Class<T> klass, ClassLoader cl) {
return ServiceProviders.getCandidatesViaServiceLoader(klass, cl);
} |
python | def get_subdomain_DID_record(self, did):
"""
Given a DID for subdomain, get the subdomain record
Return {'record': ...} on success
Return {'error': ...} on error
"""
try:
did_info = parse_DID(did)
assert did_info['name_type'] == 'subdomain'
... |
python | def p_instance_ports_arg(self, p):
'instance_ports_arg : instance_ports_arg COMMA instance_port_arg'
p[0] = p[1] + (p[3],)
p.set_lineno(0, p.lineno(1)) |
python | def check_initial_subdomain(cls, subdomain_rec):
"""
Verify that a first-ever subdomain record is well-formed.
* n must be 0
* the subdomain must not be independent of its domain
"""
if subdomain_rec.n != 0:
return False
if subdomain_rec.indepe... |
java | public void put(Id id, Object value, Mode mode) {
if (Mode.WRITE.equals(mode)) {
writeCache.put(id, value);
}
readCache.put(new CacheKey(id), value);
} |
python | def avhrr_gac(scan_times, scan_points,
scan_angle=55.37, frequency=0.5):
"""Definition of the avhrr instrument, gac version
Source: NOAA KLM User's Guide, Appendix J
http://www.ncdc.noaa.gov/oa/pod-guide/ncdc/docs/klm/html/j/app-j.htm
"""
try:
offset = np.array([(t - scan_time... |
java | public void log(final String message) {
if (!SwingUtilities.isEventDispatchThread()) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
log(message);
}
});
} else {
log.append(message);
}
} |
java | @CheckReturnValue
public static Builder fromPool(Pool pool) {
return new BuilderImpl(pool.poolShutdown, () -> {
try {
return pool.dataSource.getConnection();
} catch (Exception e) {
throw new DatabaseException("Unable to obtain a connection from the DataSource", e);
}
}, new ... |
python | def _replace_batch(self):
"""Incorporates all pending values into the estimator."""
if not self._head:
self._head, self._buffer = self._record(self._buffer[0], 1, 0, None), self._buffer[1:]
rank = 0.0
current = self._head
for b in self._buffer:
if b < self... |
java | public static int byteSizeOf(Bitmap bitmap) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
return bitmap.getAllocationByteCount();
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1) {
return bitmap.getByteCount();
} else {
ret... |
java | @Override
public List<Item> getItemsSince(long date) {
Selector query = new Selector();
query.selectGreaterThan("publicationTime", date);
long l = System.currentTimeMillis();
List<String> jsonItems = mongoHandler.findMany(query, 0);
l = System.currentTimeMillis() - l;
... |
java | private void findAfterLocal(Result<Cursor> result,
RowCursor cursor,
Object []args,
Cursor cursorLocal)
{
long version = 0;
if (cursorLocal != null) {
version = cursorLocal.getVersion();
long time = curs... |
java | public void setUpdate(Document doc, Term term) {
this.op = Op.UPDATE;
this.doc = doc;
this.term = term;
} |
java | @RestrictTo(RestrictTo.Scope.LIBRARY)
public boolean fullyResolvesTo(String key, int depth) {
if (depth >= keys.size()) {
return false;
}
boolean isLastDepth = depth == keys.size() - 1;
String keyAtDepth = keys.get(depth);
boolean isGlobstar = keyAtDepth.equals("**");
if (!isGlobstar) {... |
java | public String name() {
return Charset.isSupported(encoding) ? Charset.forName(encoding).name() : encoding;
} |
python | def parse_doc(obj: dict) -> BioCDocument:
"""Deserialize a dict obj to a BioCDocument object"""
doc = BioCDocument()
doc.id = obj['id']
doc.infons = obj['infons']
for passage in obj['passages']:
doc.add_passage(parse_passage(passage))
for annotation in obj['annotations']:
... |
java | public boolean begin(Class<?> docletClass,
Iterable<String> options,
Iterable<? extends JavaFileObject> fileObjects) {
this.docletClass = docletClass;
List<String> opts = new ArrayList<>();
for (String opt: options)
opts.add(opt);
return begin(opts, f... |
python | def _exclude_ss_bonded_cysteines(self):
"""
Pre-compute ss bonds to discard cystines for H-adding.
"""
ss_bonds = self.nh_structure.search_ss_bonds()
for cys_pair in ss_bonds:
cys1, cys2 = cys_pair
cys1.resname = 'CYX'
c... |
python | def _load_cytoBand(filename):
""" Load UCSC cytoBand table.
Parameters
----------
filename : str
path to cytoBand file
Returns
-------
df : pandas.DataFrame
cytoBand table if loading was successful, else None
References
-... |
java | private static void outputHelp() {
System.out.println("Usage: TzdbZoneRulesCompiler <options> <tzdb source filenames>");
System.out.println("where options include:");
System.out.println(" -srcdir <directory> Where to find source directories (required)");
System.out.println(" -dstdi... |
java | public static void recursivelyDeleteDirectory(File directory) throws IOException {
if (!directory.exists()) {
return;
}
checkArgument(directory.isDirectory(), "Cannot recursively delete a non-directory");
walkFileTree(directory.toPath(), new DeletionFileVisitor());
} |
java | private void drawNoxItem(Canvas canvas, int position, float left, float top) {
if (noxItemCatalog.isBitmapReady(position)) {
Bitmap bitmap = noxItemCatalog.getBitmap(position);
canvas.drawBitmap(bitmap, left, top, paint);
} else if (noxItemCatalog.isDrawableReady(position)) {
Drawable drawable... |
java | public PutIntegrationResult withRequestTemplates(java.util.Map<String, String> requestTemplates) {
setRequestTemplates(requestTemplates);
return this;
} |
python | def bed(args):
'''
%prog bed gff_file [--options]
Parses the start, stop locations of the selected features out of GFF and
generate a bed file
'''
from jcvi.utils.cbook import gene_name
p = OptionParser(bed.__doc__)
p.add_option("--type", dest="type", default="gene",
help="... |
java | public static DataSet last(DataSet data, int n) {
return subset(data, data.size() - n, n);
} |
python | def get_value(self, var, cast=None, default=environ.Env.NOTSET, # noqa: C901
parse_default=False, raw=False):
"""Return value for given environment variable.
:param var: Name of variable.
:param cast: Type to cast return value as.
:param defaul... |
java | public String toRFC1779String(Map<String, String> oidMap) {
if (assertion.length == 1) {
return assertion[0].toRFC1779String(oidMap);
}
StringBuilder sb = new StringBuilder();
for (int i = 0; i < assertion.length; i++) {
if (i != 0) {
sb.append(" ... |
java | private void computeFrameRate(Timing updateFpsTimer, long lastTime, long currentTime)
{
if (updateFpsTimer.elapsed(Constant.ONE_SECOND_IN_MILLI))
{
currentFrameRate = (int) Math.round(Constant.ONE_SECOND_IN_NANO / (double) (currentTime - lastTime));
updateFpsTimer.restart();
... |
python | def start_http_server(self, port, host='0.0.0.0', endpoint=None):
"""
Start an HTTP server for exposing the metrics, if the
`should_start_http_server` function says we should, otherwise just return.
Uses the implementation from `prometheus_client` rather than a Flask app.
:param... |
python | def main(out_path, ud_dir, check_parse=False, langs=ALL_LANGUAGES, exclude_trained_models=False, exclude_multi=False,
hide_freq=False, corpus='train', best_per_language=False):
""""
Assemble all treebanks and models to run evaluations with.
When setting check_parse to True, the default models will ... |
java | @Deprecated
public void setFilterChainMap(Map<RequestMatcher, List<PortletFilter>> filterChainMap) {
filterChains = new ArrayList<PortletSecurityFilterChain>(filterChainMap.size());
for (Map.Entry<RequestMatcher,List<PortletFilter>> entry : filterChainMap.entrySet()) {
filterChains.add(... |
java | public boolean isBefore(OffsetDateTime other) {
long thisEpochSec = toEpochSecond();
long otherEpochSec = other.toEpochSecond();
return thisEpochSec < otherEpochSec ||
(thisEpochSec == otherEpochSec && toLocalTime().getNano() < other.toLocalTime().getNano());
} |
python | def tag(self, *tags):
"""
Tags the job with one or more unique indentifiers.
Tags must be hashable. Duplicate tags are discarded.
:param tags: A unique list of ``Hashable`` tags.
:return: The invoked job instance
"""
if any([not isinstance(tag, collections.Hasha... |
python | def get_script_property(value, is_bytes=False):
"""Get `SC` property."""
obj = unidata.ascii_scripts if is_bytes else unidata.unicode_scripts
if value.startswith('^'):
negated = value[1:]
value = '^' + unidata.unicode_alias['script'].get(negated, negated)
else:
value = unidata.... |
python | def _ParseValueData(self, parser_mediator, registry_key, registry_value):
"""Extracts event objects from a Explorer ProgramsCache value data.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
registry_key (dfwinr... |
python | def show_result(resource, verbose=False):
"""
TODO
"""
if resource.uri == surf.ns.EFRBROO['F10_Person']:
print("\n{} ({})\n".format(unicode(resource), resource.get_urn()))
works = resource.get_works()
print("Works by {} ({}):\n".format(resource, len(works)))
[show_result(... |
java | public BaseTable doMakeTable(Record record)
{
BaseTable table = null;
boolean bIsQueryRecord = record.isQueryRecord();
boolean bIsQuerySupported = !DBConstants.FALSE.equalsIgnoreCase(this.getProperty(SQLParams.SQL_JOINS_SUPPORTED));
if ((bIsQueryRecord) && (bIsQuerySupported))
... |
python | def to_dict(self):
"""
Convert the tree node to its dictionary representation.
:return: an expansion dictionary that represents the type and expansions of this tree node.
:rtype dict[list[union[str, unicode]]]
"""
expansion_strings = []
for expansion in self.exp... |
java | public String getRandomWord(final int minLength, final int maxLength) {
validateMinMaxParams(minLength, maxLength);
// special case if we need a single char
if (maxLength == 1) {
if (chance(50)) {
return "a";
}
return "I";
}
// start from random pos and find ... |
python | def recentEvents(self):
'''
Get the set of recent and upcoming events to which this list applies.
'''
return Event.objects.filter(
Q(pk__in=self.individualEvents.values_list('pk',flat=True)) |
Q(session__in=self.eventSessions.all()) |
Q(publicevent__ca... |
java | protected boolean validateCondition(String key,String value)
{
boolean valid=false;
FaxClientSpiConfigurationConstants condition=FaxClientSpiConfigurationConstants.getEnum(key);
String propertyValue=null;
switch(condition)
{
case PROPERTY_CONDITION:
... |
python | def _normal_map_callback(self, msg):
"""Callback for handling normal maps.
"""
try:
self._cur_normal_map = self._bridge.imgmsg_to_cv2(msg)
except:
self._cur_normal_map = None |
java | public void setIconLight(boolean _iconLight) {
if (_iconLight) {
AddResourcesListener.setFontAwesomeVersion(5, this);
}
getStateHelper().put(PropertyKeys.iconLight, _iconLight);
} |
python | def initUI(self):
#self.setMinimumSize(WIDTH,HEIGTH)
#self.setMaximumSize(WIDTH,HEIGTH)
'''Radio buttons for Original/RGB/HSV/YUV images'''
self.origButton = QRadioButton("Original")
self.rgbButton = QRadioButton("RGB")
self.hsvButton = QRadioButton("HSV")
self.... |
java | private static TrustManagerFactory getTrustManagerFactory(InputStream trustStoreStream, StoreProperties storeProperties)
throws IOException, GeneralSecurityException {
// use provider if given, otherwise use the first matching security provider
final KeyStore ks;
if (StringUtils.isNotBlank(storePrope... |
java | public static void assertBodyPresent(String msg, SipMessage sipMessage) {
assertNotNull("Null assert object passed in", sipMessage);
assertTrue(msg, sipMessage.getContentLength() > 0);
} |
java | public void setBillableRevenueOverride(com.google.api.ads.admanager.axis.v201808.Money billableRevenueOverride) {
this.billableRevenueOverride = billableRevenueOverride;
} |
python | def load_hdf_metadata(filename, groupname="data"):
""""Load attrs of the desired group into a dictionary."""
with _h5py.File(filename, "r") as f:
data = dict(f[groupname].attrs)
return data |
java | private static boolean peek(ListIterator<Segment> segments, SegmentKind... kinds) {
int start = segments.nextIndex();
boolean success = false;
for (SegmentKind kind : kinds) {
if (!segments.hasNext() || segments.next().kind() != kind) {
success = false;
break;
}
}
if (suc... |
python | def setsockopt(self, option, value):
"""Set the value of the given socket option and return the
current value which may have been corrected if it was out of
bounds."""
return self.llc.setsockopt(self._tco, option, value) |
java | public boolean onScheduleAsLibrary(
Config config,
Config runtime,
IScheduler scheduler,
PackingPlan packing) {
boolean ret = false;
try {
scheduler.initialize(config, runtime);
ret = scheduler.onSchedule(packing);
if (ret) {
// Set the SchedulerLocation at la... |
java | public String convertGBOXRESToString(EDataType eDataType, Object instanceValue) {
return instanceValue == null ? null : instanceValue.toString();
} |
python | def _make_bz_instance(opt):
"""
Build the Bugzilla instance we will use
"""
if opt.bztype != 'auto':
log.info("Explicit --bztype is no longer supported, ignoring")
cookiefile = None
tokenfile = None
use_creds = False
if opt.cache_credentials:
cookiefile = opt.cookiefile ... |
java | public LocalDateTime getStartAsLocalDateTime() {
PlainTimestamp tsp = this.getStartAsTimestamp();
return ((tsp == null) ? null : tsp.toTemporalAccessor());
} |
java | public void refreshCachedValues() {
if (noteColumn) {
note = getHistoryReference().hasNote();
}
if (tagsColumn) {
tags = listToCsv(getHistoryReference().getTags());
}
if (highestAlertColumn) {
alertRiskCellItem = AlertRiskTableCellItem.getItemF... |
java | public MachineTime<U> multipliedBy(long factor) {
if (factor == 1) {
return this;
} else if (factor == 0) {
if (this.scale == POSIX) {
return cast(POSIX_ZERO);
} else {
return cast(UTC_ZERO);
}
}
BigDecimal... |
java | public int quoRemIteration(FDBigInteger S) throws IllegalArgumentException {
assert !this.isImmutable : "cannot modify immutable value";
// ensure that this and S have the same number of
// digits. If S is properly normalized and q < 10 then
// this must be so.
int thSize = this.... |
python | def _maybe_connect(self, to_pid, callback=None):
"""Asynchronously establish a connection to the remote pid."""
callback = stack_context.wrap(callback or (lambda stream: None))
def streaming_callback(data):
# we are not guaranteed to get an acknowledgment, but log and discard bytes if we do.
l... |
java | private boolean addConstraintPredicates(KuduTable table, KuduScanToken.KuduScanTokenBuilder builder,
TupleDomain<ColumnHandle> constraintSummary)
{
if (constraintSummary.isNone()) {
return false;
}
else if (!constraintSummary.isAll()) {
Schema schema = tab... |
python | def get_config(self):
"""
serialize to a dict all attributes except model weights
Returns
-------
dict
"""
self.update_network_description()
result = dict(self.__dict__)
result['_network'] = None
result['network_weights'] = None
... |
java | void calculateValueAt(double x) {
int len = points.size();
for (int i = 1; i < len; i++) {
Point p1 = points.get(i - 1);
Point p2 = points.get(i);
if (x >= p1.getX().doubleValue() && x <= p2.getX().doubleValue()) {
// calculate the slope intercept form
double m = (p2.getY().doubleValue() - p1.getY... |
python | def decode(self):
"""Decode self.buffer into instance variables. It returns self for
easy method chaining."""
# We know the first 2 bytes are the opcode. The second two are the
# block number.
(self.blocknumber,) = struct.unpack(str("!H"), self.buffer[2:4])
log.debug("dec... |
python | def fit_transform(self, X, y=None):
"""Fit model to X and perform dimensionality reduction on X.
Parameters
----------
X : array-like, shape (n_samples, n_features)
Training data.
y : Ignored
Returns
-------
X_new : array, shape (n_samples, ... |
python | def build(level, code, validity=None):
'''Serialize a GeoID from its parts'''
spatial = ':'.join((level, code))
if not validity:
return spatial
elif isinstance(validity, basestring):
return '@'.join((spatial, validity))
elif isinstance(validity, datetime):
return '@'.join((sp... |
python | def get_sector_info(self, addr):
"""!
@brief Get info about the sector that contains this address.
"""
assert self.region is not None
if not self.region.contains_address(addr):
return None
info = SectorInfo()
info.erase_weight = self.region.erase_sect... |
java | public static void generate(ConfigurationImpl configuration,
ClassUseMapper mapper, PackageElement pkgElement)
throws DocFileIOException {
DocPath filename = DocPaths.PACKAGE_USE;
PackageUseWriter pkgusegen = new PackageUseWriter(configuration, mapper, filenam... |
java | static CompactCharSequence[][] getAllValuesCompactCharSequence(InputStream is, char delimiter) throws Exception {
// FileReader reader = new FileReader(fileName);
BufferedReader br = new BufferedReader(new InputStreamReader(is));
ArrayList<CompactCharSequence[]> rows = new ArrayList<CompactCharSequence[]>();
... |
java | public JsonReader beginDocument() throws IOException {
if (currentValue.getKey() != BEGIN_OBJECT && currentValue.getKey() != BEGIN_ARRAY) {
throw new IOException("Expecting BEGIN_OBJECT or BEGIN_ARRAY, but found " + jsonTokenToStructuredElement(
null));
}
documentType = currentVal... |
java | public void shutdownFetcher() {
running = false;
if (mainThread != null) {
mainThread.interrupt(); // the main thread may be sleeping for the discovery interval
}
if (LOG.isInfoEnabled()) {
LOG.info("Shutting down the shard consumer threads of subtask {} ...", indexOfThisConsumerSubtask);
}
shardCon... |
python | def bootstrap_styled(cls=None, add_meta=True, form_group=True,
input_class='form-control'):
"""
Wrap a widget to conform with Bootstrap's html control design.
Args:
input_class: Class to give to the rendered <input> control.
add_meta: bool:
"""
def real_decorator(cls... |
java | @XmlAttribute(name="name", required=true)
public void setClassName(String className) {
ArgUtils.notEmpty(className, "className");
this.className = className;
} |
java | public static TestSpecification generateSpecification(@Nonnull final TestDefinition testDefinition) {
final TestSpecification testSpecification = new TestSpecification();
// Sort buckets by value ascending
final Map<String,Integer> buckets = Maps.newLinkedHashMap();
final List<TestBucket... |
java | public final void deleteDevice(String name) {
DeleteDeviceRequest request = DeleteDeviceRequest.newBuilder().setName(name).build();
deleteDevice(request);
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.