language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | @Override
public void receiveResponse(Tree message) {
// Verify protocol version
if (checkVersion) {
String ver = message.get("ver", "unknown");
if (!PROTOCOL_VERSION.equals(ver)) {
logger.warn("Invalid protocol version (" + ver + ")!");
return;
}
}
// Get response's unique ID
String id = ... |
java | protected static Function<Triple, Triple> convertMementoReferences(
final IdentifierConverter<Resource, FedoraResource> translator,
final IdentifierConverter<Resource, FedoraResource> internalTranslator) {
return t -> {
final String subjectURI = t.getSubject().getURI();
... |
java | public static String flagsToString(short flags) {
StringBuilder sb=new StringBuilder();
boolean first=true;
Flag[] all_flags=Flag.values();
for(Flag flag: all_flags) {
if(isFlagSet(flags, flag)) {
if(first)
first=false;
els... |
java | protected final void hideInternalView(final Wave wave) {
// Call user code
hideView();
// Sometimes view can be null
if (view() != null) {
view().hide();
}
// Propagate the show view to all Inner Model
if (getInnerComponentMap().isPresent()) {
... |
python | def update(self, default_activity_sid=values.unset,
event_callback_url=values.unset, events_filter=values.unset,
friendly_name=values.unset, multi_task_enabled=values.unset,
timeout_activity_sid=values.unset,
prioritize_queue_order=values.unset):
"""
... |
python | def all(cls, collection, skip=None, limit=None):
"""
Returns all documents of the collection
:param collection Collection instance
:param skip The number of documents to skip in the query
:param limit The maximal amount of documents to return. The skip is applie... |
java | @Override
public String getNext() {
try {
int nextTok = st.nextToken();
switch (nextTok) {
case java.io.StreamTokenizer.TT_EOL:
return eolString;
case java.io.StreamTokenizer.TT_EOF:
return null;
case java.io.StreamTokenizer.TT_WORD:
retu... |
python | def move(source, destination, adapter=None, fatal=True, logger=LOG.debug):
"""
Move source -> destination
:param str|None source: Source file or folder
:param str|None destination: Destination file or folder
:param callable adapter: Optional function to call on 'source' before copy
:param bool|... |
python | def run_cmd(cmd):
"""
Runs a command using subprocess, and returns both the stdout and stderr from that command
If exit code from command is non-zero, raises subproess.CalledProcessError
:param cmd: command to run as a string, as it would be called on the command line
:return: out, err: Strings that... |
python | def get_forwarding_address_details(destination_address, api_key, callback_url=None, coin_symbol='btc'):
"""
Give a destination address and return the details of the input address
that will automatically forward to the destination address
Note: a blockcypher api_key is required for this method
"""
... |
java | protected void validate(String operationType) throws Exception
{
super.validate(operationType);
MPSString timezone_validator = new MPSString();
timezone_validator.validate(operationType, timezone, "\"timezone\"");
} |
java | private List<SnakGroup> copy(List<SnakGroup> snakGroups) {
List<SnakGroup> result = new ArrayList<>(snakGroups.size());
for (SnakGroup snakGroup : snakGroups) {
result.add(copy(snakGroup));
}
return result;
} |
java | public java.util.List<com.google.iam.v1.BindingDelta> getBindingDeltasList() {
return bindingDeltas_;
} |
java | public static int getNumericType(int t1, int t2, boolean canBeNonNumeric) {
int localt1 = t1;
int localt2 = t2;
if (localt1 == localt2)
return localt1;
if (canBeNonNumeric && (localt1 == NONNUMERIC || localt2 == NONNUMERIC || localt1 == CHAR || localt2 == CHAR))
... |
python | def set_direct(self, address_value_dict):
"""Called in the context manager's set method to either overwrite the
value for an address, or create a new future and immediately set a
value in the future.
Args:
address_value_dict (dict of str:bytes): The unique full addresses
... |
java | public void updateSchemaVersion(VersionComparator version) throws SQLException {
PreparedStatement statement = null;
PreparedStatement updateStatement = null;
ResultSet results = null;
try {
statement = connection.prepareStatement("SELECT \"VERSION\" FROM \"SCHEMAVERSION\"");... |
python | def _to_seconds(timestr):
'''
Converts a time value to seconds.
As per RFC1035 (page 45), max time is 1 week, so anything longer (or
unreadable) will be set to one week (604800 seconds).
'''
timestr = timestr.upper()
if 'H' in timestr:
seconds = int(timestr.replace('H', '')) * 3600
... |
python | def _StopAnalysisProcesses(self, abort=False):
"""Stops the analysis processes.
Args:
abort (bool): True to indicated the stop is issued on abort.
"""
logger.debug('Stopping analysis processes.')
self._StopMonitoringProcesses()
# Note that multiprocessing.Queue is very sensitive regardin... |
java | public void tagCssAction(CmsObject cms, HttpServletRequest req) throws CmsException, IOException {
String includeType = TYPE_CSS;
CmsJspStandardContextBean standardContext = getStandardContext(cms, req);
CmsContainerPageBean containerPage = standardContext.getPage();
Set<String> cssIn... |
java | ChronoEntity<?> update(
ChronoEntity<?> entity,
ChronoEntity<?> parsed
) {
if (!parsed.contains(FractionalElement.FRACTION)) {
return entity;
}
BigDecimal fraction = parsed.get(FractionalElement.FRACTION);
int min = entity.getMinimum(this.element).intVal... |
python | def PMIS(S):
"""C/F splitting using the Parallel Modified Independent Set method.
Parameters
----------
S : csr_matrix
Strength of connection matrix indicating the strength between nodes i
and j (S_ij)
Returns
-------
splitting : ndarray
Array of length of S of ones... |
java | @VisibleForTesting
static URI parseProxyAddress(@Nullable String proxyAddress) {
if (Strings.isNullOrEmpty(proxyAddress)) {
return null;
}
String uriString = (proxyAddress.contains("//") ? "" : "//") + proxyAddress;
try {
URI uri = new URI(uriString);
String scheme = uri.getScheme();... |
java | <T> Collection<Method> getPrimaryKeyGetters(Class<T> clazz) {
synchronized (primaryKeyGettersCache) {
if ( !primaryKeyGettersCache.containsKey(clazz) ) {
List<Method> keyGetters = new LinkedList<Method>();
for (Method getter : getRelevantGetters(clazz)) {
... |
python | def stop(self):
"""Stop transmitting message (remove from list)."""
# Remove it completely instead of just stopping it to avoid filling up
# the list with permanently stopped messages
_canlib.canSchedulerRemMessage(self._scheduler, self._index)
self._index = None |
python | def filter_data(self, field, filter_value, filter_operator, field_converter=None):
"""Filter the data given the provided.
Args:
field (string): The field to filter on.
filter_value (string | list): The value to match.
filter_operator (string): The operator for compar... |
python | def _extract_member(self, member, targetpath, pwd):
"""Extract the ZipInfo object 'member' to a physical
file on the path targetpath.
"""
# build the destination pathname, replacing
# forward slashes to platform specific separators.
arcname = member.filename.replace('/... |
java | @CheckReturnValue
public static <ReqT, RespT> Builder<ReqT, RespT> newBuilder(
Marshaller<ReqT> requestMarshaller, Marshaller<RespT> responseMarshaller) {
return new Builder<ReqT, RespT>()
.setRequestMarshaller(requestMarshaller)
.setResponseMarshaller(responseMarshaller);
} |
java | public Observable<PublicIPAddressInner> getByResourceGroupAsync(String resourceGroupName, String publicIpAddressName, String expand) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, publicIpAddressName, expand).map(new Func1<ServiceResponse<PublicIPAddressInner>, PublicIPAddressInner>() {
... |
python | def read_config(self, path):
"""Read configuration file."""
PYVLXLOG.info('Reading config file: %s', path)
try:
with open(path, 'r') as filehandle:
doc = yaml.safe_load(filehandle)
self.test_configuration(doc, path)
self.host = doc['con... |
python | def trajectory(start=None, stop=None, step=None):
'''Useful command to iterate on the trajectory frames by time (in
ns). It is meant to be used in a for loop::
for i in trajectory(0, 10, 0.1):
coords = current_frame()
t = current_time()
# Do something
The previo... |
python | def send(self, email, body):
"""Send email."""
print('Connecting server {0}:{1} with {2}:{3}'.format(
self._host, self._port, self._login, self._password))
print('Sending "{0}" to "{1}"'.format(body, email)) |
java | private ProfilesConfigFile getProfilesConfigFile() {
if (configFile == null) {
synchronized (this) {
if (configFile == null) {
try {
configFile = new ProfilesConfigFile(configFileLocationProvider.getLocation());
} catch ... |
java | public void execute()
throws MojoExecutionException, MojoFailureException
{
if ( isSkipping() )
{
getLog().debug( "Skipping execution, as demanded by user." );
return;
}
final ValidationErrorHandler errorHandler = new ValidationErrorHandler();
... |
python | def set_stats(self, ids):
"""Compute stats for a set of results.
:param id: Result IDs as int list.
:return: :class:`results.SetStats <results.SetStats>` object
:rtype: results.SetStats
"""
schema = SetStatsSchema()
resp = self.service.post(self.base, params={'st... |
python | def readFace(self, line):
""" Each face consists of three or more sets of indices. Each set
consists of 1, 2 or 3 indices to vertices/normals/texcords.
"""
# Get parts (skip first)
indexSets = [num for num in line.split(' ') if num][1:]
final_face = []
for index... |
python | def mass_2d(self, R, Rs, rho0):
"""
mass enclosed a 3d sphere or radius r
:param r:
:param Ra:
:param Rs:
:return:
"""
x = R/Rs
gx = self.g_(x)
m_2d = 4*rho0*Rs*R**2*gx/x**2 * np.pi
return m_2d |
python | def delete_router(self, context, router_id):
"""Delete an existing router from Arista HW as well as from the DB."""
router = self.get_router(context, router_id)
# Delete router on the Arista Hw
try:
self.driver.delete_router(context, router_id, router)
except Except... |
python | def update(environment, zappa_settings):
""" Update an existing deployment."""
print(("Updating " + environment))
# Package dependencies, and the source code into a zip
zappa, settings, lambda_name, zip_path = \
_package(environment, zappa_settings)
s3_bucket_name = settings['s3_bucket']
... |
java | public static double getLimitByUserAndCounter(EntityManager em, PrincipalUser user, PolicyCounter counter) {
PolicyLimit pLimit = findPolicyLimitByUserAndCounter(em, user, counter);
if (pLimit != null) {
return pLimit.getLimit();
}
return counter.getDefaultValue();
} |
python | def message(self,MSG_LEVEL,str):
"""
print function wrapper. Print a message depending on the verbose level
:parameter {in}{required}{type=int} MSG_LEVEL: level of the message to be compared with self.verbose
:example: To write a message
... |
java | private static String mapGermanTagSetToKaf(final String postag) {
if (postag.startsWith("ADV")) {
return "A"; // adverb
} else if (postag.startsWith("KO")) {
return "C"; // conjunction
} else if (postag.equalsIgnoreCase("ART")) {
return "D"; // determiner and predeterminer
} else if (p... |
python | def list_repos(**kwargs):
'''
List all repos known by XBPS
CLI Example:
.. code-block:: bash
salt '*' pkg.list_repos
'''
repos = {}
out = __salt__['cmd.run']('xbps-query -L', output_loglevel='trace')
for line in out.splitlines():
repo = {}
if not line:
... |
java | public static CmsPublishData prefetch(HttpServletRequest request) throws CmsRpcException {
CmsPublishService srv = new CmsPublishService();
srv.setCms(CmsFlexController.getCmsObject(request));
srv.setRequest(request);
CmsPublishData result = null;
HashMap<String, String> params ... |
python | def _join_url_dir(cls, url, *args):
"""
Join a URL with multiple directories
"""
for path in args:
url = url.rstrip('/') + '/'
url = urljoin(url, path.lstrip('/'))
return url |
java | public java.util.List<InventoryDeletionSummaryItem> getSummaryItems() {
if (summaryItems == null) {
summaryItems = new com.amazonaws.internal.SdkInternalList<InventoryDeletionSummaryItem>();
}
return summaryItems;
} |
python | def _parse_action(self, action, current_time):
"""Parse a player action.
TODO: handle cancels
"""
if action.action_type == 'research':
name = mgz.const.TECHNOLOGIES[action.data.technology_type]
self._research[action.data.player_id].append({
'techn... |
java | private void createZkMetadataIfNotExists(StorageInfo si) throws IOException {
try {
if (!hasSomeJournalData()) {
try {
// First create the parent path
zk.create(zkParentPath, new byte[] { '0' },
Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
// Write format/n... |
python | def merge(self, merge_area, tab):
"""Merges top left cell with all cells until bottom_right"""
top, left, bottom, right = merge_area
cursor = self.grid.actions.cursor
top_left_code = self.code_array((top, left, cursor[2]))
selection = Selection([(top, left)], [(bottom, right)]... |
python | def load_configuration(self, **kwargs):
'''load configuration, merge with default settings'''
# update passed arguments with default values
for key in settings.ACTIVE_URL_KWARGS:
kwargs.setdefault(key, settings.ACTIVE_URL_KWARGS[key])
# "active" html tag css class
se... |
python | def _load_init(self, data, ctx):
"""(Re)initializes by loading from data."""
if self.shape:
for self_dim, data_dim in zip(self.shape, data.shape):
assert self_dim in (0, data_dim), \
"Failed loading Parameter '%s' from saved params: " \
... |
java | public static Type build(final Object... instances) {
final Object[] objects = filterNulls(instances);
if (objects.length == 0) {
// null assignable to anything (as Object in assignability logic)
return Object.class;
}
final Type median = getMedianType(objects);... |
python | def build_suite(args):
"""Build a test suite by loading TAP files or a TAP stream."""
loader = Loader()
if len(args.files) == 0 or args.files[0] == "-":
suite = loader.load_suite_from_stdin()
else:
suite = loader.load(args.files)
return suite |
python | def to_Message(self, result=None):
""" Entrypoint -> Message
:param kser.result.Result result: Execution result
:return: Kafka message
:rtype kser.schemas.Message
"""
return Message(
uuid=self.uuid, entrypoint=self.__class__.path, params=self.params,
... |
python | def _Matches(path, pattern_list):
"""Returns true if path matches any patten found in pattern_list.
Args:
path: A dot separated path to a package, class, method or variable
pattern_list: A list of wildcard patterns
Returns:
True if path matches any wildcard found in pattern_list.
"""
# Note: Thi... |
python | def get_product_access_tokens(self, app_ids=[], package_ids=[]):
"""Get access tokens
:param app_ids: list of app ids
:type app_ids: :class:`list`
:param package_ids: list of package ids
:type package_ids: :class:`list`
:return: dict with ``apps`` and ``packages`` contai... |
java | public void actionPerformed(ActionEvent e)
{
if ((m_button != null) && (e.getSource() == m_button))
{
JCalendarPopup popup = JCalendarPopup.createCalendarPopup((Date)this.getControlValue(), m_button);
popup.addPropertyChangeListener(this);
}
else if ((m_button... |
java | public OvhOrder freefax_serviceName_convertToVoicefax_GET(String serviceName, String billingAccount) throws IOException {
String qPath = "/order/freefax/{serviceName}/convertToVoicefax";
StringBuilder sb = path(qPath, serviceName);
query(sb, "billingAccount", billingAccount);
String resp = exec(qPath, "GET", sb... |
java | public String convertIfcRampFlightTypeEnumToString(EDataType eDataType, Object instanceValue) {
return instanceValue == null ? null : instanceValue.toString();
} |
python | def term_color(code):
"""
256 colors supported
"""
def inner(text, rl=False):
"""
Every raw_input with color sequences should be called with
rl=True to avoid readline messed up the length calculation
"""
c = code
if rl:
return "\001\033[38;5;%s... |
java | public void marshall(CreateConstraintRequest createConstraintRequest, ProtocolMarshaller protocolMarshaller) {
if (createConstraintRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(createCons... |
java | public void onBeforeAdd(E value) {
long freeHeapSpace = RUNTIME.freeMemory() + (RUNTIME.maxMemory() - RUNTIME.totalMemory());
// start flow control if we cross the threshold
if (freeHeapSpace < minimumHeapSpaceBeforeFlowControl) {
// x indicates how close we are to overflowing the ... |
java | private void updateListActivity(boolean setSelection) {
activityListModel.clear();
if (getDialogObject() != null) {
List<String> activities = new ArrayList<String>(getDialogObject().getActivities());
Collections.sort(activities);
for (String activity : activities) {
... |
python | def _resolve_qualifiers(self, new_quals, inherited_quals, new_class,
super_class, obj_name, obj_type, qualifier_repo,
propagate=False, verbose=False):
"""
Process the override of qualifiers from the inherited_quals dictionary
to the new_qua... |
python | def numeric(value,
allow_empty = False,
minimum = None,
maximum = None,
**kwargs):
"""Validate that ``value`` is a numeric value.
:param value: The value to validate.
:param allow_empty: If ``True``, returns :obj:`None <python:None>` if ``value``
is :o... |
java | @Override
public List<CommerceDiscountRule> findByCommerceDiscountId(
long commerceDiscountId) {
return findByCommerceDiscountId(commerceDiscountId, QueryUtil.ALL_POS,
QueryUtil.ALL_POS, null);
} |
python | def show_instance(name, call=None):
'''
List the a single node, return dict of grains.
'''
local = salt.client.LocalClient()
ret = local.cmd(name, 'grains.items')
ret.update(_build_required_items(ret))
return ret |
python | def _parse_function_expression(function_specification):
"""
Parse a complex function expression like:
((((powerlaw{1} + (sin{2} * 3)) + (sin{2} * 25)) - (powerlaw{1} * 16)) + (sin{2} ** 3.0))
and return a composite function instance
:param function_specification:
:return: a composite function... |
java | public Set<DbLicense> resolveLicenses(List<String> licStrings) {
Set<DbLicense> result = new HashSet<>();
licStrings
.stream()
.map(this::getMatchingLicenses)
.forEach(result::addAll);
return result;
} |
java | @Override
OperatorStateHandle closeAndGetHandle() throws IOException {
StreamStateHandle streamStateHandle = delegate.closeAndGetHandle();
if (null == streamStateHandle) {
return null;
}
if (partitionOffsets.isEmpty() && delegate.getPos() > initialPosition) {
startNewPartition();
}
Map<String, Ope... |
java | public static Layout forFile(File file) {
if (file == null) {
throw new IllegalArgumentException("File must not be null");
}
String lowerCaseFileName = file.getName().toLowerCase(Locale.ENGLISH);
if (lowerCaseFileName.endsWith(".jar")) {
return new Jar();
}
if (lowerCaseFileName.endsWith(".war")) {
... |
python | def get_type_item(self, value):
"""
Converts the input to a ExecCommand tuple. It can be from a single string, list, or tuple. Single values (also
single-element lists or tuples) are considered a command string, whereas two-element items are read as
``(command string, user name)``.
... |
java | private static void printUsage() {
System.out.println();
System.out.println("USAGE");
System.out.println();
System.out.println("\t[" + ARGUMENT_PREFIX + ARGUMENT_COMPRESS_FORMAT
+ " compress_format] [" + ARGUMENT_PREFIX
+ ARGUMENT_COMPRESS_QUALITY + " compress_quality] ["
+ ARGUMENT_PREFIX + ARGUMEN... |
java | public String shortOrdinal(long n) {
String str = Long.toString(n);
if (n < 0) {
n = -n;
}
n %= 100;
if (n >= 10 && n <= 20) {
str = str.concat("th");
}
else {
if (n > 20) n %= 10;
switch ((int) n) {
... |
python | def _get_entry_link(self, entry):
""" Returns a unique link for an entry
"""
entry_link = None
for link in entry.link:
if '/data/' not in link.href and '/lh/' not in link.href:
entry_link = link.href
break
return entry_link or entry.lin... |
python | def complete_definition(subj: Node,
source_graph: Graph,
target_graph: Optional[Graph]=None) -> PrettyGraph:
"""
Return the transitive closure of subject.
:param subj: URI or BNode for subject
:param source_graph: Graph containing defininition
:param t... |
java | private int countAttachedBonds(List<IBond> connectedBonds, IAtom atom, IBond.Order order, String symbol) {
// count the number of double bonded oxygens
int neighborcount = connectedBonds.size();
int doubleBondedAtoms = 0;
for (int i = neighborcount - 1; i >= 0; i--) {
IBond b... |
java | private void adaptAreaPadding() {
if (areas != null) {
boolean paddingTopApplied = false;
Area previousArea = null;
View previousView = null;
int scrollViewPaddingTop = 0;
int scrollViewMarginBottom = 0;
Iterator<Map.Entry<Area, View>> iter... |
python | def get_tables(self, table_name="", **kwargs):
"""
get all the tables of the currently connected db
table_name -- string -- if you would like to filter the tables list to only include matches with this name
return -- list -- a list of table names
"""
with self.connection... |
java | private static RNASequence getRNASequence(String str) {
try {
RNASequence s = new RNASequence(str);
return s;
} catch (CompoundNotFoundException e) {
logger.error("Unexpected error when creating RNASequence ",e);
}
return null;
} |
python | def NDP_Attack_NS_Spoofing(src_lladdr=None, src=None, target="2001:db8::1",
dst=None, src_mac=None, dst_mac=None, loop=True,
inter=1, iface=None):
"""
The main purpose of this function is to send fake Neighbor Solicitations
messages to a victim, in order... |
java | private IndexMetadata buildLegacyIndex(RawColumn raw, ColumnMetadata column) {
if (raw.indexName == null) {
return null;
}
return new DefaultIndexMetadata(
column.getKeyspace(),
column.getParent(),
CqlIdentifier.fromInternal(raw.indexName),
IndexKind.valueOf(raw.indexTy... |
java | @Override
public void serialize(PrincipalUser value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException {
jgen.writeStartObject();
jgen.writeStringField("id", value.getId().toString());
jgen.writeStringField("createdBy", value.getCreatedBy() == null ... |
java | private boolean processRobot(String useragent, UserAgentInfo retObj) {
try {
lock.lock();
if (robotsMap.containsKey(useragent)) {
retObj.setTyp("Robot");
RobotEntry robotEntry = robotsMap.get(useragent);
robotEntry.copyTo(retObj);
... |
java | @Override
public List<CommerceTierPriceEntry> findByC_LtM(long commercePriceEntryId,
int minQuantity, int start, int end,
OrderByComparator<CommerceTierPriceEntry> orderByComparator) {
return findByC_LtM(commercePriceEntryId, minQuantity, start, end,
orderByComparator, true);
} |
java | public void setNeedleSize(final NeedleSize SIZE) {
if (null == needleSize) {
_needleSize = null == SIZE ? NeedleSize.STANDARD : SIZE;
fireUpdateEvent(RESIZE_EVENT);
} else {
needleSize.set(SIZE);
}
} |
java | Frame updateFrame(Frame target, Frame src) {
if (src != target) ltrash(src);
return src;
} |
java | protected void addAnnotation(EObject element, XAnnotation annotation,
IModificationContext context) throws Exception {
final ICompositeNode node = NodeModelUtils.findActualNodeFor(annotation);
if (node != null) {
final IXtextDocument document = context.getXtextDocument();
final int startOffset = node.getOf... |
python | def load(self, path=None):
""" Loads the XML-file (with sentiment annotations) from the given path.
By default, Sentiment.path is lazily loaded.
"""
# <word form="great" wordnet_id="a-01123879" pos="JJ" polarity="1.0" subjectivity="1.0" intensity="1.0" />
# <word form="damnmi... |
java | public static double distanceInMeters(@Nonnull final Point p1, @Nonnull final Point p2) {
checkNonnull("p1", p1);
checkNonnull("p2", p2);
final Point from;
final Point to;
if (p1.getLonDeg() <= p2.getLonDeg()) {
from = p1;
to = p2;
} else {
... |
java | public <S, T> T convertTo(Class<T> output, Object object, Class<? extends Annotation> qualifier) {
if (object == null) {
return null;
}
@SuppressWarnings("unchecked")
Converter<S, T> conv = (Converter<S, T>) determineConverter(object.getClass(), output, qualifier == null ? DefaultBinding.class : q... |
java | public Document runAtServer(String containerUrl, String testClassName, String testDisplayName) {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder;
try {
String url = containerUrl
+ String.format("?%s=%s&%s=%s", TEST_CLASS_NAME_PARAM, testClassNam... |
java | private Set<DataSegment> refreshSegmentsForDataSource(final String dataSource, final Set<DataSegment> segments)
throws IOException
{
log.debug("Refreshing metadata for dataSource[%s].", dataSource);
final long startTime = System.currentTimeMillis();
// Segment id -> segment object.
final Map<S... |
java | public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, FaceletException,
ELException
{
VariableMapper orig = ctx.getVariableMapper();
AbstractFaceletContext actx = (AbstractFaceletContext) ctx;
actx.pushClient(this);
if (_params != ... |
java | String getName(Node node) {
switch (node.getToken()) {
case CLASS:
case FUNCTION:
return NodeUtil.getName(node);
case GETPROP:
Node lhsOfDot = node.getFirstChild();
Node rhsOfDot = lhsOfDot.getNext();
String lhsOfDotName = getName(lhsOfDot);
String rhsOfDotN... |
python | def complete(self, text):
"""Return the next possible completion for 'text'.
This is called successively with state == 0, 1, 2, ... until it
returns None. The completion should begin with 'text'.
"""
if self.use_main_ns:
# In pydev this option should never be used
... |
java | public void addVirtualHost(String hostname)
{
// Note that null hosts are also added.
if (!_vhosts.contains(hostname))
{
_vhosts.add(hostname);
_contextName=null;
if (_httpServer!=null)
{
if (_vhosts.size()==1)
... |
java | public double[] run(int times) {
if (engine == null) {
throw new RuntimeException("[benchmark error] engine not set for benchmark");
}
double[] runtimes = new double[times];
final int offset = engine.getInputVariables().size();
for (int t = 0; t < times; ++t) {
... |
java | Filter<S> parseRoot() {
Filter<S> filter = parseFilter();
int c = nextCharIgnoreWhitespace();
if (c >= 0) {
mPos--;
throw error("Unexpected trailing characters");
}
return filter;
} |
java | public static Request newStatusUpdateRequest(Session session, String message, Callback callback) {
return newStatusUpdateRequest(session, message, (String)null, null, callback);
} |
java | static float encodeQuality(String value) {
final float qual;
if (StringUtils.isEmpty(value) || value.equals(".")) {
qual = MISSING_QUAL_VALUE;
} else {
qual = Float.parseFloat(value);
}
return qual + 1;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.