language
stringclasses
2 values
func_code_string
stringlengths
63
466k
python
def create_pipeline(self, onetime=None): """Create the spinnaker pipeline(s).""" utils.banner("Creating Pipeline") kwargs = { 'app': self.app, 'trigger_job': self.trigger_job, 'prop_path': self.json_path, 'base': None, 'runway_dir': se...
java
@ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalEmptyArgumentException.class }) public static <T extends Iterable<?>> T notEmpty(@Nonnull final T iterable, @Nullable final String name) { notNull(iterable, name); notEmpty(iterable, !iterable.iterator().hasNext(), name); return iterable; }
python
def image_list(self, name=None): ''' List server images ''' nt_ks = self.compute_conn ret = {} for image in nt_ks.images.list(): links = {} for link in image.links: links[link['rel']] = link['href'] ret[image.name] = { ...
java
public StrBuilder insert(int index, Object obj) { if (obj instanceof CharSequence) { return insert(index, (CharSequence) obj); } return insert(index, Convert.toStr(obj)); }
java
@Override public void aggregate(final ByteBuffer buf, final int position) { final Object value = selector.getObject(); if (value == null) { return; } final Lock lock = stripedLock.getAt(lockIndex(position)).writeLock(); lock.lock(); try { final HllSketch sketch = sketchCache.get(...
python
def _args_checks_gen(self, decorated_function, function_spec, arg_specs): """ Generate checks for positional argument testing :param decorated_function: function decorator :param function_spec: function inspect information :param arg_specs: argument specification (same as arg_specs in :meth:`.Verifier.decorate...
java
@Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case AfplibPackage.EFM__FM_NAME: return getFMName(); } return super.eGet(featureID, resolve, coreType); }
python
def get_distribution(self, name): """ Looks for a named distribution on the path. This function only returns the first result found, as no more than one value is expected. If nothing is found, ``None`` is returned. :rtype: :class:`InstalledDistribution`, :class:`EggInfoDistribu...
java
protected void launch(String[] args) { try { JarFile.registerUrlProtocolHandler(); ClassLoader classLoader = createClassLoader(getClassPathArchives()); launch(args, getMainClass(), classLoader); } catch (Exception ex) { ex.printStackTrace(); Sy...
java
public Iterator<ElementType> iterator() { return new Iterator<ElementType>() { int idx = getIdx; int N = size; public boolean hasNext() { return N > 0; } public ElementType next() { ElementType x = (ElementType) elemen...
java
public void dumpDTM(OutputStream os) { try { if(os==null) { File f = new File("DTMDump"+((Object)this).hashCode()+".txt"); System.err.println("Dumping... "+f.getAbsolutePath()); os=new FileOutputStream(f); } PrintStream ps = new PrintStream(os); while (nex...
python
def make_trace_api(client): """ Create an instance of the gapic Trace API. Args: client (~google.cloud.trace.client.Client): The client that holds configuration details. Returns: A :class:`~google.cloud.trace._gapic._TraceAPI` instance with the proper configurations...
java
public HandlerChainsInfo buildHandlerChainsInfoFromAnnotation(String serviceClazzName, HandlerChainAnnotationSer hcSer, QName portQName, QName serviceQName, String bindingID) { HandlerChainsInfo chainsInfo = new HandlerChainsInfo(); vali...
python
def create_cached_item(self, path, content): """ Create cached resource item :param path: str :param content: PIL.Image :return: str """ if isinstance(content, Image.Image): f = tempfile.NamedTemporaryFile() content.save(f.name, format=cont...
python
def requires(self, requirements, **overrides): """Adds additional requirements to the specified route""" return self.where(requires=tuple(self.route.get('requires', ())) + tuple(requirements), **overrides)
python
def capsnet(batch_size, n_class, num_routing, recon_loss_weight): """Create CapsNet""" # data.shape = [batch_size, 1, 28, 28] data = mx.sym.Variable('data') input_shape = (1, 28, 28) # Conv2D layer # net.shape = [batch_size, 256, 20, 20] conv1 = mx.sym.Convolution(data=data, ...
java
public final void ruleOpUnary() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalXbase.g:546:2: ( ( ( rule__OpUnary__Alternatives ) ) ) // InternalXbase.g:547:2: ( ( rule__OpUnary__Alternatives ) ) { // InternalX...
java
public static Map<String, AttributeValue> toAttributeValues(Item item) { if (item == null) return null; // row with multiple attributes Map<String, AttributeValue> result = new LinkedHashMap<String, AttributeValue>(); for (Map.Entry<String, Object> entry : item.attributes()) ...
java
public DirectedGraph<DirectedEdge> readDirected(File f) throws IOException { return readDirected(f, new HashIndexer<String>()); }
java
public boolean remove(Object obj) { Entry tab[] = mTable; if (obj == null) { obj = NULL; } int hash = obj.hashCode(); int index = (hash & 0x7FFFFFFF) % tab.length; for (Entry e = tab[index], prev = null; e != null; e = e.mNext) { Object entryVal...
java
public void addTrace(LogTrace<E> trace) throws ParameterException { Validate.notNull(trace); trace.setCaseNumber(traces.size() + 1); traces.add(trace); summary.addTrace(trace); if (!distinctTraces.add(trace)) { for (...
java
public void setEnabled(boolean enabled) { super.setEnabled(enabled); comboBox.setEnabled(enabled); if (spinner != null) { spinner.setEnabled(enabled); } }
java
@Override public void step(SimState simulation) { this.simulation = (ShanksSimulation) simulation; this.checkMail(); this.executeReasoningCycle((ShanksSimulation) simulation); }
java
public void connectIfNotConnectedInDirection(N srcValue, E edgeValue, N destValue) { LinkedDirectedGraphNode<N, E> src = createDirectedGraphNode(srcValue); LinkedDirectedGraphNode<N, E> dest = createDirectedGraphNode(destValue); if (!this.isConnectedInDirection(src, Predicates.equalTo(edgeValue), dest)) { ...
python
def angmom(x): """ returns angular momentum vector of phase-space point x""" return np.array([x[1]*x[5]-x[2]*x[4],x[2]*x[3]-x[0]*x[5],x[0]*x[4]-x[1]*x[3]])
python
def pave_profile(self): """ Usage: containment pave_profile """ settings.personal_config.path.mkdir() json.dump( settings.personal_config.package_list, settings.personal_config.os_packages.open(mode="w"), ) json.dump({}, settings....
python
def lengthen(self): ''' Returns a new Vowel with its Length lengthened, and ":" appended to its IPA symbol. ''' vowel = deepcopy(self) if vowel[Length] == Length.short: vowel[Length] = Length.long elif vowel[Length] == Length.long: vowel[Length] = Length.overlong vowel.ipa += ':' ...
java
private static String encodeUrl(String url) { try { URL u = new URL(url); return encodeUrl(u).toExternalForm(); } catch (Exception e) { return url; } }
java
public Panel addComponent(Component component, LayoutData layoutData) { if(component != null) { component.setLayoutData(layoutData); addComponent(component); } return this; }
python
def _trigger_event(self, event, *args, **kwargs): """Invoke an event handler.""" run_async = kwargs.pop('run_async', False) if event in self.handlers: if run_async: return self.start_background_task(self.handlers[event], *args) else: try: ...
java
public int read() throws IOException { // If we got something in the char buffer, let's use it. if (0 != fCharCount) { fCharCount--; return ((int) fCharBuf[fCharCount]) & 0xFFFF; } int b0 = fInputStream.read() & 0xff; // 1st byte if (b0 == 0xff) { ...
java
private static InternationalFixedDate resolvePreviousValid(int prolepticYear, int month, int day) { int monthR = Math.min(month, MONTHS_IN_YEAR); int dayR = Math.min(day, (monthR == 13 || (monthR == 6 && INSTANCE.isLeapYear(prolepticYear)) ? DAYS_IN_LONG_MONTH : DAYS_IN_MONTH)); ret...
python
def info(rq, ctx, path, interval, raw, only_queues, only_workers, by_queue, queues): "RQ command-line monitor." return ctx.invoke( rq_cli.info, path=path, interval=interval, raw=raw, only_queues=only_queues, only_workers=only_workers, by_queue=by_...
python
def is_encrypted_account(self, id): """Are all fields for the account id encrypted?""" for key in self.secured_field_names: if not self.parser.is_secure_option(id, key): return False return True
java
@Nullable static String getBestBrowserPackage(@NonNull Context context) { PackageManager pm = context.getPackageManager(); Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.example.com")); ResolveInfo webHandler = pm.resolveActivity(browserIntent, Bu...
java
protected DSetEditor<E> createEditor ( DObject setter, String setName, Class<?> entryClass, String[] editableFields, ObjectEditorTable.FieldInterpreter interp, EntryGrouper<E> grouper, String group) { return new DSetEditor<E>(setter, setName, entryClass, editableFields, inter...
python
def _handle_blacklist(blacklist, dirnames, filenames): """remove files/directories in the black list dirnames/filenames are usually from os.walk """ for norecurs in blacklist: if norecurs in dirnames: dirnames.remove(norecurs) elif norecurs in filenames: filename...
python
def remove_filter(func, language=None): """ :param func: :param language: :return: """ if not (language in _filters and func in _filters[language]): return False _filters[language].remove(func) return True
java
@Override public <I> void hear(TypeLiteral<I> type, TypeEncounter<I> encounter) { for (Field field : type.getRawType().getDeclaredFields()) { if (field.getType().equals(Logger.class) && field.isAnnotationPresent(InjectLogger.class)) { encounter.register(new SLF4JMembersInjector<I...
python
def start_supporting_containers(sitedir, srcdir, passwords, get_container_name, extra_containers, log_syslog=False): """ Start all supporting containers (containers required for CKAN to operate) if they aren't already running, along with some extra containers specified by the user """ if...
python
def configuration_remove(self, environment_id, configuration_id): """ Remove Prefix Configuration :return: None :raise InvalidValueError: Invalid Id for Environment or IpConfig. :raise IPConfigNotFoundError: Ipconfig not resgistred. :raise AmbienteNotFoundError: Environ...
java
@Override AutoBuffer call( AutoBuffer ab ) { long[] a = snapshot(); if( ab._h2o == H2O.SELF ) { synchronized(TimeLine.class) { for( int i=0; i<CLOUD._memary.length; i++ ) if( CLOUD._memary[i]==H2O.SELF ) SNAPSHOT[i] = a; TimeLine.class.notify(); } } else // ...
python
def get_xrefs_list_from_element(cls, element): """Helper for get_xrefs_list element is a ClassDefItem or MethodDefItem At the end of the function, we lost if we worked on a class or method but we do not care for now. """ xref_items = element.XREFfrom.items ...
java
public void setMetaClassCreationHandle(MetaClassCreationHandle handle) { if(handle == null) throw new IllegalArgumentException("Cannot set MetaClassCreationHandle to null value!"); ClassInfo.clearModifiedExpandos(); handle.setDisableCustomMetaClassLookup(metaClassCreationHandle.isDisableCustomMe...
python
def isclose(a, b, rtol=4*np.finfo(float).eps, atol=0.0, equal_nan=False): """ Returns a boolean array where two arrays are element-wise equal within a tolerance. This function is essentially a copy of the `numpy.isclose` function, with different default tolerances and one minor changes necessary to...
java
public static BufferedReader getReader(File file, String charsetName) throws IORuntimeException { return IoUtil.getReader(getInputStream(file), charsetName); }
java
protected void fireTCAbortV1(Dialog tcapDialog, boolean returnMessageOnError) throws MAPException { if (this.getTCAPProvider().getPreviewMode()) { return; } TCUserAbortRequest tcUserAbort = this.getTCAPProvider().getDialogPrimitiveFactory().createUAbort(tcapDialog); if (ret...
java
@Override public HttpResponse execute(final InvocationContext context, final HttpRequestBase request) { ASYNC_EXECUTOR_SERVICE.execute(new Runnable() { @Override public void run() { AsyncRequestExecutor.super.execute(context, request); } }); return null; }
java
public static java.security.cert.X509Certificate convert(javax.security.cert.X509Certificate cert) { try { byte[] encoded = cert.getEncoded(); ByteArrayInputStream bis = new ByteArrayInputStream(encoded); java.security.cert.CertificateFactory cf = java.securit...
python
def _expand_datasets(test_functions): """ Generator producing test_methods, with an optional dataset. :param test_functions: Iterator over tuples of test name and test unbound function. :type test_functions: `iterator` of `tuple` of (`unicode`, `function`) :return: Generator...
java
private JScrollPane getJScrollPane() { if (jScrollPane == null) { jScrollPane = new JScrollPane(); jScrollPane.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); jScrollPane.setVerticalScrollBarPolicy(javax.swing.JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); jScrollPane.se...
java
protected final int key (int x, int y) { int sx = MathUtil.floorDiv(x, swidth); int sy = MathUtil.floorDiv(y, sheight); return (sx << 16) | (sy & 0xFFFF); }
python
def get_key_from_envs(envs, key): """Return the value of a key from the given dict respecting namespaces. Data can also be a list of data dicts. """ # if it barks like a dict, make it a list have to use `get` since dicts and # lists both have __getitem__ if hasattr(envs, 'get'): envs =...
python
def dump_config(self): # pragma: no cover """dumps configfile to stdout so users can edit/implement their own""" with open(self.config_path, 'r') as cfg_fh: base_config = cfg_fh.read() print(base_config) exit(2)
python
def pysal_Geary(self, **kwargs): """ Compute Geary’s C for GeoRaster Usage: geo.pysal_C(permutations = 1000, rook=True) arguments passed to raster_weights() and pysal.Geary See help(gr.raster_weights), help(pysal.Geary) for options """ if self.weights is...
java
public static void setTypeInfo(Configuration conf, StructTypeInfo typeInfo) { conf.set(INPUT_TYPE_INFO, typeInfo.getTypeName()); LOG.debug("Set input typeInfo on conf: {}", typeInfo); }
python
def send(email, subject=None, from_email=None, to_email=None, cc=None, bcc=None, reply_to=None, smtp=None): """Send markdown email Args: email (str/obj): A markdown string or EmailContent object subject (str): subject line from_email (str): sender email addre...
java
private void parseSegmentStartHeader(WsByteBuffer contextBuffer) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "parseSegmentStartHeader", contextBuffer); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) JFapUtils.debugTraceWsByteBufferInfo(this, ...
python
def _check_SS_matrix(p_M, state_dim, measurement_dim, which='A'): """ Veryfy that on exit the matrix has appropriate shape for the KF algorithm. Input: p_M: matrix As it is given for the user state_dim: int State dimensioanlity ...
java
public static void splitURI(String uriStr, StringBuilder uriPath, StringBuilder uriQuery, StringBuilder uriFragment) { assert uriStr != null; assert uriPath != null; assert uriQuery != null; assert uriFragment != null; // Find location of q...
java
public double getLength() { double len = 0; if (!isEmpty()) { for (int i = 0; i < coordinates.length - 1; i++) { double deltaX = coordinates[i + 1].getX() - coordinates[i].getX(); double deltaY = coordinates[i + 1].getY() - coordinates[i].getY(); len += Math.sqrt(deltaX * deltaX + deltaY * deltaY); ...
java
public Formula equivalence(final Formula left, final Formula right) { if (left.type() == TRUE) return right; if (right.type() == TRUE) return left; if (left.type() == FALSE) return this.not(right); if (right.type() == FALSE) return this.not(left); if (left.equals(right)) ...
java
@Override public void initialize(InputSplit split) throws IOException, InterruptedException { if (split instanceof ListStringSplit) { ListStringSplit listStringSplit = (ListStringSplit) split; delimitedData = listStringSplit.getData(); dataIter = delimitedData.iterator();...
python
def list_tag(self, limit=500, offset=0): """List `all` the tags for this Thing Returns lists of tags, as below #!python [ "mytag1", "mytag2" "ein_name", "nochein_name" ] - OR... Raises...
python
def exp(self): """ Returns the exponent of the quaternion. (not tested) """ # Init vecNorm = self.x**2 + self.y**2 + self.z**2 wPart = np.exp(self.w) q = Quaternion() # Calculate q.w = wPart * np.cos(vecNorm) q.x ...
java
private String buildTemplates() { String[] templateString = new String[model.getTemplates().size()]; for (int i = 0; i < (model.getTemplates().size()); i++) { String templateLoaded = loadTemplateFile( model.getTemplates().get(i)); if (templateLoaded != null) { templateString[i] = templateLoaded; }...
java
public void getPersistentData(ObjectOutputStream dout) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "getPersistentData", dout); try { dout.writeUTF(_streamKey); dout.writeUTF(_streamId.toString()); } catch (IOException e) { // No F...
java
private static Class<?> resolveType(ELContext context, PropertyDescriptor pd) { if (pd != null) { Object type = pd.getValue("type"); if (type != null) { type = ((ValueExpression)type).getValue(context); if (type instanceof String) ...
python
def url_for_token(self, token): """Find the full URL for a help token.""" book_url = self.get_config_value("pages", token) book, _, url_tail = book_url.partition(':') book_base = settings.HELP_TOKENS_BOOKS[book] url = book_base lang = getattr(settings, "HELP_TOKENS_LANG...
python
def replace_grist (features, new_grist): """ Replaces the grist of a string by a new one. Returns the string with the new grist. """ assert is_iterable_typed(features, basestring) or isinstance(features, basestring) assert isinstance(new_grist, basestring) # this function is used a lot in th...
java
@Deprecated public void log(Level level, Object message, Object[] params, Throwable t) { doLog(level, FQCN, message, params, t); }
python
def initialize_db_args(self, settings, db_key): """ Initialize connection arguments for postgres commands. """ self.print_message("Initializing database settings for %s" % db_key, verbosity_needed=2) db_member = self.databases[db_key] db_name = settings.get('NAME') if db_name a...
java
private void processRow(Example valuesRow, Example headers, Fixture rowFixtureAdapter) throws Exception { Statistics rowStats = new Statistics(); for (int i = 0; i != valuesRow.remainings(); ++i) { Example cell = valuesRow.at( i ); if (i < headers.remainings()) ...
java
public static MsgPhrase get(final UUID _uuid) throws EFapsException { final Cache<UUID, MsgPhrase> cache = InfinispanCache.get().<UUID, MsgPhrase>getCache(MsgPhrase.UUIDCACHE); if (!cache.containsKey(_uuid)) { MsgPhrase.loadMsgPhrase(_uuid); } return cache.get(_uu...
java
public void setPublicIpv4Pools(java.util.Collection<PublicIpv4Pool> publicIpv4Pools) { if (publicIpv4Pools == null) { this.publicIpv4Pools = null; return; } this.publicIpv4Pools = new com.amazonaws.internal.SdkInternalList<PublicIpv4Pool>(publicIpv4Pools); }
java
public PresenceSubscriber addBuddy(String uri, int duration, long timeout) { return addBuddy(uri, duration, null, timeout); }
python
def PrependENVPath(self, name, newpath, envname = 'ENV', sep = os.pathsep, delete_existing=1): """Prepend path elements to the path 'name' in the 'ENV' dictionary for this environment. Will only add any particular path once, and will normpath and normcase all paths to hel...
java
public static String trimLeadingCharacter(final String str, final char leadingCharacter) { if (!StringUtils.hasLength(str)) { return str; } final StringBuilder sb = new StringBuilder(str); while (sb.length() > 0 && sb.charAt(0) == leadingCharacter) { sb.deleteCharAt(0); } return sb....
python
def gameValue(self): """identify the correpsonding internal SC2 game value for self.type's value""" allowed = type(self).ALLOWED_TYPES try: if isinstance(allowed, dict): # if ALLOWED_TYPES is not a dict, there is no-internal game value mapping defined return allowed.g...
java
@Override public List<String> getReconfigurableProperties() { List<String> changeable = Arrays.asList("dfs.data.dir"); return changeable; }
python
def confirm(text, default=False, abort=False, prompt_suffix=': ', show_default=True, err=False): """Prompts for confirmation (yes/no question). If the user aborts the input by sending a interrupt signal this function will catch it and raise a :exc:`Abort` exception. .. versionadded:: 4.0 ...
java
public EClass getIfcPersonAndOrganization() { if (ifcPersonAndOrganizationEClass == null) { ifcPersonAndOrganizationEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(350); } return ifcPersonAndOrganizationEClass; }
java
public static RequestToken fetchAll(BaasHandler<List<BaasUser>> handler) { return fetchAll(null, RequestOptions.DEFAULT, handler); }
java
@Override protected void defineWidgets() { // initialize the user object to use for the dialog initFileInfo(); setKeyPrefix(KEY_PREFIX); addWidget(new CmsWidgetDialogParameter(this, "path", PAGES[0], new CmsDisplayWidget())); addWidget(new CmsWidgetDialogParameter(this, "t...
java
public static int getInt(JsonObject object, String field, int defaultValue) { final JsonValue value = object.get(field); if (value == null || value.isNull()) { return defaultValue; } else { return value.asInt(); } }
python
def tags(self): """Creates a list of all the tags of the contained items # Returns `list [str]` > A list of all the tags """ tags = set() for i in self: tags |= set(i.keys()) return tags
python
def unionfs(rw='rw', ro=None, union='union'): """ Decorator for the UnionFS feature. This configures a unionfs for projects. The given base_dir and/or image_dir are layered as follows: image_dir=RW:base_dir=RO All writes go to the image_dir, while base_dir delivers the (read-only) versions...
python
def _psdn(timeseries, method_func, *args, **kwargs): """Generate a PSD using a method function with FFT arguments in samples All arguments are presumed to be in sample counts, not physical units Parameters ---------- timeseries : `~gwpy.timeseries.TimeSeries`, `tuple` the data to process, ...
python
def normal_prior(value, mean, sigma): """Normal prior distribution. """ return -0.5 * (2 * np.pi * sigma) - (value - mean) ** 2 / (2.0 * sigma)
java
private void updateCurrentFunction(AbstractFunctionExpression parentExpr) { GroovyExpression expr = parentExpr.getCaller(); if (expr instanceof AbstractFunctionExpression) { AbstractFunctionExpression exprAsFunction = (AbstractFunctionExpression) expr; GroovyExpression exprCaller...
java
@NonNull public static CreateIndexStart createIndex(@Nullable String indexName) { return createIndex(indexName == null ? null : CqlIdentifier.fromCql(indexName)); }
python
def get_sum(qs, field): """ get sum for queryset. ``qs``: queryset ``field``: The field name to sum. """ sum_field = '%s__sum' % field qty = qs.aggregate(Sum(field))[sum_field] return qty if qty else 0
python
def emulate_abs(self, x_val, y_val, timeval): """Emulate the absolute co-ordinates of the mouse cursor.""" x_event = self.create_event_object( "Absolute", 0x00, x_val, timeval) y_event = self.create_event_object( "Absolute", ...
java
private void reset(Connection connection, JFapByteBuffer buffer, int priority, boolean isPooled, boolean isExchange, int segmentType, int conversationId, int requestN...
python
def stream_to_workbench(self, raw_bytes, filename, type_tag, tags): """Split up a large file into chunks and send to Workbench""" md5_list = [] sent_bytes = 0 total_bytes = len(raw_bytes) for chunk in self._file_chunks(raw_bytes, self.chunk_size): md5_list.append(self...
python
def abspath(self, path): ''' Transform the path to an absolute path Args: path (string): The path to transform to an absolute path Returns: string: The absolute path to the file ''' if not path.startswith(os.path.sep) or path.startswith('~'): ...
python
def set_sentry_context(self, tag, value): """Set a context tag in Sentry for the given key and value. :param tag: The context tag name :type tag: :class:`str` :param value: The context value :type value: :class:`str` """ if self.sentry_client: self.l...
java
private void injectCache(LongConsumer cacheAware) { if (cacheAware instanceof CacheAware) { ((CacheAware) cacheAware).injectCache(registry.getComponent(Cache.class)); } }
python
def _should_add_constraints(cls, state): """ Check to see if the current address concretization variable is any of the registered constrained_addrs we want to allow concretization for """ expr = state.inspect.address_concretization_expr hit_indices = cls._to_indices(state...
java
private String stripPrefix(String text, String prefix, ParsePosition pp) { // if the prefix text is empty, dump out without doing anything if (prefix.length() == 0) { return text; } else { // otherwise, use prefixLength() to match the beginning of // "text" ag...