language
stringclasses
2 values
func_code_string
stringlengths
63
466k
python
def get_beam(header): """ Create a :class:`AegeanTools.fits_image.Beam` object from a fits header. BPA may be missing but will be assumed to be zero. if BMAJ or BMIN are missing then return None instead of a beam object. Parameters ---------- header : HDUHeader The fits header. ...
python
def _call(self, x, out=None): """Create an interpolator from grid values ``x``. Parameters ---------- x : `Tensor` The array of values to be interpolated out : `FunctionSpaceElement`, optional Element in which to store the interpolator Returns ...
python
def _extract_multiple_hits(self, hits, reads_path, output_path): ''' splits out regions of a read that hit the HMM. For example when two of same gene are identified within the same contig, The regions mapping to the HMM will be split out and written out to a new file as a new record. ...
python
def push_scope(self, frame, extra_vars=()): """This function returns all the shadowed variables in a dict in the form name: alias and will write the required assignments into the current scope. No indentation takes place. This also predefines locally declared variables from the loop ...
java
private static Pair<DimFilter, RangeSet<Long>> extractConvertibleTimeBounds(final DimFilter filter) { if (filter instanceof AndDimFilter) { final List<DimFilter> children = ((AndDimFilter) filter).getFields(); final List<DimFilter> newChildren = new ArrayList<>(); final List<RangeSet<Long>> rang...
java
public Dbi<T> openDbi(final byte[] name, final DbiFlags... flags) { try (Txn<T> txn = readOnly ? txnRead() : txnWrite()) { final Dbi<T> dbi = new Dbi<>(this, txn, name, null, flags); txn.commit(); // even RO Txns require a commit to retain Dbi in Env return dbi; } }
java
public static QueryRunnerService getQueryRunner(Connection conn, Class<? extends TypeHandler> typeHandlerClazz) { return (QueryRunnerService) ProfilerFactory.newInstance(new QueryRunner(conn, typeHandlerClazz)); }
python
def get_input_key(): """Input API key and validate""" click.secho("No API key found!", fg="yellow", bold=True) click.secho("Please visit {} and get an API token.".format(RequestHandler.BASE_URL), fg="yellow", bold=True) while True: confkey = click.prompt(click.sty...
java
@SuppressWarnings("unchecked") public Collection<TopicAnnotation> getCategories() { Collection<? extends Enhancement> result = enhancements.get(TopicAnnotation.class); return (Collection<TopicAnnotation>) result; // Should be safe. Needs to be tested }
python
def send_email(name, ctx_dict, send_to=None, subject=u'Subject', **kwargs): """ Shortcut function for EmailFromTemplate class @return: None """ eft = EmailFromTemplate(name=name) eft.subject = subject eft.context = ctx_dict eft.get_object() eft.render_message() eft.send_email(s...
java
@SafeVarargs public static void assertState(String message, DataSet... dataSets) throws DBAssertionError { multipleStateAssertions(CallInfo.create(message), dataSets); }
java
public HttpMove createMoveMethod(final String sourcePath, final String destinationPath) { return new HttpMove(repositoryURL + sourcePath, repositoryURL + destinationPath); }
java
public final void mNOT_EQUAL() throws RecognitionException { try { int _type = NOT_EQUAL; int _channel = DEFAULT_TOKEN_CHANNEL; // src/riemann/Query.g:10:11: ( '!=' ) // src/riemann/Query.g:10:13: '!=' { match("!="); } ...
java
public SipServletRequest createRequest(SipServletRequest origRequest) { final SipServletRequestImpl newSipServletRequest = (SipServletRequestImpl) sipFactoryImpl.createRequest(origRequest, false); final SipServletRequestImpl origRequestImpl = (SipServletRequestImpl) origRequest; final Mobicents...
java
public ServiceFuture<ConnectionInner> updateAsync(String resourceGroupName, String automationAccountName, String connectionName, ConnectionUpdateParameters parameters, final ServiceCallback<ConnectionInner> serviceCallback) { return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, au...
python
def seek(self, pos): """Seeks the parser to the given position. """ if self.debug: logging.debug('seek: %r' % pos) self.fp.seek(pos) # reset the status for nextline() self.bufpos = pos self.buf = b'' self.charpos = 0 # reset the status ...
python
def _merge_mapping(a, b): """ MERGE TWO MAPPINGS, a TAKES PRECEDENCE """ for name, b_details in b.items(): a_details = a[literal_field(name)] if a_details.properties and not a_details.type: a_details.type = "object" if b_details.properties and not b_details.type: ...
python
def get_message(self, method, args, kwargs, options=None): """ Get the soap message for the specified method, args and soapheaders. This is the entry point for creating the outbound soap message. @param method: The method being invoked. @type method: I{service.Method} @pa...
python
def plot_mean_quantile_returns_spread_time_series(mean_returns_spread, std_err=None, bandwidth=1, ax=None): """ Plots mean period wise returns for factor quantile...
python
def new(self, path, desc=None, bare=True): """ Create a new bare repo.Local instance. :param path: Path to new repo. :param desc: Repo description. :param bare: Create as bare repo. :returns: New repo.Local instance. """ if os.path.exists(path): ...
python
def stop(self): """ Stops this bot. Returns as soon as all running threads have finished processing. """ self.log.debug('Stopping bot {}'.format(self._name)) self._stop = True for t in self._threads: t.join() self.log.debug('Stopping bot {} f...
java
@Override public void eUnset(int featureID) { switch (featureID) { case AfplibPackage.BPS__PSEG_NAME: setPsegName(PSEG_NAME_EDEFAULT); return; case AfplibPackage.BPS__TRIPLETS: getTriplets().clear(); return; } super.eUnset(featureID); }
java
@Override public void clampMax(int max) { if (this.x > max) this.x = max; if (this.y > max) this.y = max; if (this.z > max) this.z = max; }
java
void outputEntityDecl(String name, String value) throws IOException { final java.io.Writer writer = m_writer; writer.write("<!ENTITY "); writer.write(name); writer.write(" \""); writer.write(value); writer.write("\">"); writer.write(m_lineSep, 0, m_lineSepLen)...
python
def get_executable(): ''' Find executable which matches supported python version in the thin ''' pymap = {} with open(os.path.join(OPTIONS.saltdir, 'supported-versions')) as _fp: for line in _fp.readlines(): ns, v_maj, v_min = line.strip().split(':') pymap[ns] = (int(...
java
public void run() { Record recDest = this.getMainRecord(); Iterator<Record> source = this.getSource(); while (source.hasNext()) { Record recSource = source.next(); this.mergeSourceRecord(recSource, recDest); } }
python
def add_analysis(self, analysis): """Adds an analysis to be consumed by the Analyses Chart machinery (js) :param analysis_object: analysis to be rendered in the chart """ analysis_object = api.get_object(analysis) result = analysis_object.getResult() results_range = anal...
python
def get_apphook_configs(obj): """ Get apphook configs for an object obj :param obj: any model instance :return: list of apphook configs for given obj """ keys = get_apphook_field_names(obj) return [getattr(obj, key) for key in keys] if keys else []
java
public static Response delete(String url, Map<String, String> query) throws HttpException { return delete(url, query, null, DEFAULT_CONNECT_TIMEOUT, DEFAULT_READ_TIMEOUT); }
java
public static <T> Collector<T, ?, T> toOneElement() { return java.util.stream.Collectors.collectingAndThen( java.util.stream.Collectors.toList(), list -> { if (list.size() != 1) { throw new IllegalStateException("Stream should have only one element"); } return list.get(...
python
def process_crs(crs): """ Parses cartopy CRS definitions defined in one of a few formats: 1. EPSG codes: Defined as string of the form "EPSG: {code}" or an integer 2. proj.4 string: Defined as string of the form "{proj.4 string}" 3. cartopy.crs.CRS instance 4. None defaults to crs.Pla...
java
public void setCrawlerMetricsList(java.util.Collection<CrawlerMetrics> crawlerMetricsList) { if (crawlerMetricsList == null) { this.crawlerMetricsList = null; return; } this.crawlerMetricsList = new java.util.ArrayList<CrawlerMetrics>(crawlerMetricsList); }
java
public static <T extends Writer> T pump(Reader reader, T writer, boolean closeReader, boolean closeWriter) throws IOException{ char buff[] = new char[1024]; int len; Exception exception = null; try{ while((len=reader.read(buff))!=-1) writer.write(buff, 0, len)...
python
def prt_results(self, goea_results): """Print GOEA results to the screen or to a file.""" # objaart = self.prepgrp.get_objaart(goea_results) if self.prepgrp is not None else None if self.args.outfile is None: self._prt_results(goea_results) else: # Users can print...
java
protected void joinInputs(DiGraphNode<N, Branch> node) { FlowState<L> state = node.getAnnotation(); if (isForward()) { if (cfg.getEntry() == node) { state.setIn(createEntryLattice()); } else { List<DiGraphNode<N, Branch>> inNodes = cfg.getDirectedPredNodes(node); if (inNodes....
python
def filename_to_task_id(fname): """Map filename to the task id that created it assuming 1k tasks.""" # This matches the order and size in WikisumBase.out_filepaths fname = os.path.basename(fname) shard_id_increment = { "train": 0, "dev": 800, "test": 900, } parts = fname.split("-") split...
python
def declare_config_variable(self, name, config_id, type_name, default=None, convert=None): #pylint:disable=too-many-arguments;These are all necessary with sane defaults. """Declare a config variable that this emulated tile accepts. The default value (if passed) may be specified as either a `bytes` ...
python
def shutdown(at_time=None): ''' Shutdown a running system at_time The wait time in minutes before the system will be shutdown. CLI Example: .. code-block:: bash salt '*' system.shutdown 5 ''' cmd = ['shutdown', '-h', ('{0}'.format(at_time) if at_time else 'now')] ret ...
java
protected boolean doShutdown() { if (state == State.NOT_RUNNING) { LOGGER.debug("Engine already shut down."); return true; } LOGGER.debug("Shutting down engine..."); final Lock lock = this.lock.writeLock(); try { lock.lock(); state ...
python
def _update_limits_from_api(self): """ Query EC2's DescribeAccountAttributes API action and update the network interface limit, as needed. Updates ``self.limits``. More info on the network interface limit, from the docs: 'This limit is the greater of either the default limit (35...
java
protected Object serializeArgumentToJson(Object pArg) { if (pArg == null) { return null; } else if (pArg instanceof JSONAware) { return pArg; } else if (pArg.getClass().isArray()) { return serializeArray(pArg); } else if (pArg instanceof Map) { ...
java
@Override public DeleteProtectionResult deleteProtection(DeleteProtectionRequest request) { request = beforeClientExecution(request); return executeDeleteProtection(request); }
python
def offers_to_pwl(self, offers): """ Updates the piece-wise linear total cost function using the given offer blocks. Based on off2case.m from MATPOWER by Ray Zimmerman, developed at PSERC Cornell. See U{http://www.pserc.cornell.edu/matpower/} for more info. """ assert no...
python
def updateAARText(self): 'Updates the displayed airspeed, altitude, climb rate Text' self.airspeedText.set_text('AR: %.1f m/s' % self.airspeed) self.altitudeText.set_text('ALT: %.1f m ' % self.relAlt) self.climbRateText.set_text('CR: %.1f m/s' % self.climbRate)
python
def _authorization_headers_valid(self, token_type, token): """Verify authorization headers for a request. Parameters token_type (str) Type of token to access resources. token (str) Server Token or OAuth 2.0 Access Token. Returns ...
java
protected int fill(RecyclerView.Recycler recycler, LayoutState layoutState, RecyclerView.State state, boolean stopOnFocusable) { // max offset we should set is mFastScroll + available final int start = layoutState.mAvailable; if (layoutState.mScrollingOffset != LayoutState...
java
public ThriftConnectionHandle<T> recreateConnectionHandle() throws ThriftConnectionPoolException { ThriftConnectionHandle<T> handle = new ThriftConnectionHandle<>(this.thriftConnection, this.thriftConnectionPartition, this.thriftConnectionPool, true); handle.thriftConnectionPartition = this.thriftConnectionPart...
python
def bip32_prv(self, s): """ Parse a bip32 private key from a text string ("xprv" type). Return a :class:`BIP32 <pycoin.key.BIP32Node.BIP32Node>` or None. """ data = self.parse_b58_hashed(s) if data is None or not data.startswith(self._bip32_prv_prefix): return...
python
def update_anomalous_score(self): """Update anomalous score. New anomalous score is the summation of weighted differences between current summary and reviews. The weights come from credibilities. Therefore, the new anomalous score is defined as .. math:: {\\rm ano...
python
def _parse_requirements_file(requirements_file): ''' Parse requirements.txt and return list suitable for passing to ``install_requires`` parameter in ``setup()``. ''' parsed_requirements = [] with open(requirements_file) as rfh: for line in rfh.readlines(): line = line.strip(...
java
public static void main(String[] args) throws Exception { int zkPort; boolean secureZK = false; String zkKeyStore; String zkKeyStorePasswd = null; String zkTrustStore = null; try { zkPort = Integer.parseInt(System.getProperty(PROPERTY_ZK_PORT)); se...
python
def __call(self): """ Calls the callback method """ try: if self.__callback is not None: self.__callback(self.__successes, self.__errors) except Exception as ex: self.__logger.exception("Error calling back count down " ...
python
def SampleStop(self): """Stops measuring the CPU time.""" if self._start_cpu_time is not None: self.total_cpu_time += time.clock() - self._start_cpu_time
python
def set_Y(self, Y): """ Set the output data of the model :param Y: output observations :type Y: np.ndarray or ObsArray """ assert isinstance(Y, (np.ndarray, ObsAr)) state = self.update_model() self.update_model(False) if self.normalizer is not Non...
python
def _UploadChunk(self, chunk): """Uploads a single chunk to the transfer store flow. Args: chunk: A chunk to upload. Returns: A `BlobImageChunkDescriptor` object. """ blob = _CompressedDataBlob(chunk) self._action.ChargeBytesToSession(len(chunk.data)) self._action.SendReply(bl...
java
@Override public void eUnset(int featureID) { switch (featureID) { case AfplibPackage.PAGE_POSITION_INFORMATION__PGPRG: setPGPRG(PGPRG_EDEFAULT); return; } super.eUnset(featureID); }
java
private static Set<Annotation> getAnnotations(final Annotation[] annotations, final Class<? extends Annotation> neededAnnotationType) { final Set<Annotation> ret = new HashSet<>(); for (final Annotation annotation : annotations) { annotation.annotationType().getAnnotations(); fi...
java
private double[][] getAugmentedData(double[][] x) { double[][] ret = new double[x.length + p][p]; double padding = c * Math.sqrt(lambda2); for (int i = 0; i < x.length; i++) { for (int j = 0; j < p; j++) { ret[i][j] = c * x[i][j]; } } for (...
java
public final Collection<String> getParameters() { ArrayList<String> params = new ArrayList<String>(); if( parameters == null ) { return params; } // we copy to guarantee that the caller does not screw up our internal storage params.addAll(Arrays.asList(parame...
java
public Object get(final Declaration declaration) { return declaration.getValue( (InternalWorkingMemory) workingMemory, getObject( getFactHandle( declaration ) ) ); }
java
private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException { // Write out any hidden serialization magic s.defaultWriteObject(); // Write out size s.writeInt(size); // Write out all elements in the proper order. for (Node<E> x = first; x !...
java
public void updateStatus() { String hostaddr = null; try { hostaddr = InetAddress.getByName(ip).getHostAddress(); } catch (UnknownHostException e) { online = false; latency = Long.MAX_VALUE; return; } int total = 0; long totalPing = 0; // test ping 4 times int ...
java
public static Map<String, String> toMap(String[]... wordMappings) { Map<String, String> mappings = new HashMap<String, String>(); for (int i = 0; i < wordMappings.length; i++) { String singular = wordMappings[i][0]; String plural = wordMappings[i][1]; mappings.put(singular, plural); } ...
python
def _populate_cparams(self, img_array, mct=None, cratios=None, psnr=None, cinema2k=None, cinema4k=None, irreversible=None, cbsize=None, eph=None, grid_offset=None, modesw=None, numres=None, prog=None, psizes=None, sop=None, ...
java
private String formatRelationList(List<Relation> value) { String result = null; if (value != null && value.size() != 0) { StringBuilder sb = new StringBuilder(); for (Relation relation : value) { if (sb.length() != 0) { sb.append(m_...
python
def init_signal(self): """Init signal 3 signals are added: ``feeder_exited``, ``parser_exited`` and ``reach_max_num``. """ self.signal = Signal() self.signal.set( feeder_exited=False, parser_exited=False, reach_max_num=False)
python
def read_digits(self, start: int, char: str) -> int: """Return the new position in the source after reading digits.""" source = self.source body = source.body position = start while "0" <= char <= "9": position += 1 char = body[position : position + 1] ...
java
@Override protected String processLink(final IExpressionContext context, final String link) { if (!(context instanceof ISpringWebFluxContext)) { return link; } final ServerWebExchange exchange = ((ISpringWebFluxContext)context).getExchange(); return exchange.transformUr...
java
public void sendDtmf(final String dtmf) throws IOException, AppPlatformException { final Map<String, Object> params = new HashMap<String, Object>(); params.put("dtmfOut", dtmf); final String uri = StringUtils.join(new String[]{ getUri(), "dtmf" }, '/'); ...
python
def formatSub(self, string): """Convert sub-type specific formatting to GSP formatting. By default formatSub will replace 1-to-1 all occurences of subtitle specific tags with their GSP equivalents. Due to performance reasons it will not parse given 'string' in any other way. That means t...
python
def send(signal=Any, sender=Anonymous, *arguments, **named): """Send signal from sender to all connected receivers. signal -- (hashable) signal value, see connect for details sender -- the sender of the signal if Any, only receivers registered for Any will receive the message. ...
java
@Override public final String getFor(final Class<?> pClass, final String pThingName) { Field field = this.fieldsRapiHolder.getFor(pClass, pThingName); Class<?> classKey = field.getType(); if (IHasId.class.isAssignableFrom(classKey)) { classKey = IHasId.class; } else if (Enum.class.isAssignableFr...
java
String toJsonString() { try { return from(s3obj.getObjectContent()); } catch (Exception e) { throw new SdkClientException("Error parsing JSON: " + e.getMessage()); } }
java
@Override protected Integer handleRow(ResultSet rs) throws SQLException { if (this.columnName == null) { return rs.getInt(this.columnIndex); } return rs.getInt(this.columnName); }
java
@Nonnull public PasswordHash createUserDefaultPasswordHash (@Nullable final IPasswordSalt aSalt, @Nonnull final String sPlainTextPassword) { ValueEnforcer.notNull (sPlainTextPassword, "PlainTextPassword"); final IPasswordHashCreator aPHC = getDefaultPass...
python
def create_or_update_tags(self, tags): """ Creates new tags or updates existing tags for an Auto Scaling group. :type tags: List of :class:`boto.ec2.autoscale.tag.Tag` :param tags: The new or updated tags. """ params = {} for i, tag in enumerate(tags): ...
java
@Override public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, Object[] args) { if (!f.hasTag(getClassName())) { return super.execIdCall(f, cx, scope, thisObj, args); } int id = f.methodId(); switc...
java
public Set<String> keySet(String group) { group = StrUtil.nullToEmpty(group).trim(); readLock.lock(); try { final LinkedHashMap<String, String> valueMap = this.get(group); if (MapUtil.isNotEmpty(valueMap)) { return valueMap.keySet(); } } finally { readLock.unlock(); } return Colle...
java
public boolean hasContact(ResidueNumber resNumber1, ResidueNumber resNumber2) { return contacts.containsKey(new Pair<ResidueNumber>(resNumber1, resNumber2)); }
java
public static rnat_stats get(nitro_service service) throws Exception{ rnat_stats obj = new rnat_stats(); rnat_stats[] response = (rnat_stats[])obj.stat_resources(service); return response[0]; }
python
def encrypt(text): 'Encrypt a string using an encryption key based on the django SECRET_KEY' crypt = EncryptionAlgorithm.new(_get_encryption_key()) return crypt.encrypt(to_blocksize(text))
java
public static void printClassPathEntries (@Nonnull final PrintStream aPS, @Nonnull final String sItemSeparator) { forAllClassPathEntries (x -> { aPS.print (x); aPS.print (sItemSeparator); }); }
java
public List<End<Flow<T>>> getAllEnd() { List<End<Flow<T>>> list = new ArrayList<End<Flow<T>>>(); List<Node> nodeList = childNode.get("end"); for(Node node: nodeList) { End<Flow<T>> type = new EndImpl<Flow<T>>(this, "end", childNode, node); list.add(type); } retu...
python
def cmd_zf(self, ch=None): """zf ch=chname Zoom the image for the given viewer/channel to fit the window. """ viewer = self.get_viewer(ch) if viewer is None: self.log("No current viewer/channel.") return viewer.zoom_fit() cur_lvl = viewer...
python
def tree_to_gexf(tree:'BubbleTree') -> str: """Compute the gexf representation of given power graph, and push it into given file. See https://gephi.org/gexf/format/index.html for format doc. """ output_nodes, output_edges = '', '' def build_node(node:str) -> str: """Yield strings ...
java
public static List<String> parse(String address, String addresses) { List<String> result; // backwards compatibility - older clients only send a single address in the single address header and don't supply the multi-address header if (addresses == null || addresses.isEmpty()) { addre...
python
def process_action(self): """ Process the action and update the related object, returns a boolean if a change is made. """ if self.publish_version == self.UNPUBLISH_CHOICE: actioned = self._unpublish() else: actioned = self._publish() # Only log i...
java
public Collection<FullColumnDescription> getPartitionKeyColumnDescriptions() { if (partitionKeys == null) { partitionKeys = new LinkedList<>(); for (FullColumnDescription col : fullColumnDescriptions.values()) { if (col.isPartitionKeyMember()) ...
python
def convertLengthList(self, svgAttr): """Convert a list of lengths.""" return [self.convertLength(a) for a in self.split_attr_list(svgAttr)]
python
def try_set_count(self, count): """ Sets the count to the given value if the current count is zero. If count is not zero, this method does nothing and returns ``false``. :param count: (int), the number of times count_down() must be invoked before threads can pass through await(). ...
python
def make_diffuse_comp_info_dict(self, galkey): """ Make a dictionary maping from merged component to information about that component Parameters ---------- galkey : str A short key identifying the galprop parameters """ galprop_rings = self.read_galprop_ring...
python
def issue(self, CorpNum, ItemCode, MgtKey, Memo=None, EmailSubject=None, UserID=None): """ ๋ฐœํ–‰ args CorpNum : ํŒ๋นŒํšŒ์› ์‚ฌ์—…์ž๋ฒˆํ˜ธ ItemCode : ๋ช…์„ธ์„œ ์ข…๋ฅ˜ ์ฝ”๋“œ [121 - ๊ฑฐ๋ž˜๋ช…์„ธ์„œ], [122 - ์ฒญ๊ตฌ์„œ], [123 - ๊ฒฌ์ ์„œ], [124 - ๋ฐœ์ฃผ์„œ], [125 - ์ž…๊ธˆํ‘œ], [126 - ์˜์ˆ˜์ฆ] ...
python
def data_check(self, participant): """Make sure each trial contains exactly one chosen info.""" infos = participant.infos() return len([info for info in infos if info.chosen]) * 2 == len(infos)
java
public ConstraintDefinitionType<ValidationMappingDescriptor> getOrCreateConstraintDefinition() { List<Node> nodeList = model.get("constraint-definition"); if (nodeList != null && nodeList.size() > 0) { return new ConstraintDefinitionTypeImpl<ValidationMappingDescriptor>(this, "constraint-...
python
def _write(self, s, s_length=None, flush=False, ignore_overflow=False, err_msg=None): """Write ``s`` :type s: str|unicode :param s: String to write :param s_length: Custom length of ``s`` :param flush: Set this to flush the terminal stream after writing :...
java
public void marshall(FileGroupSettings fileGroupSettings, ProtocolMarshaller protocolMarshaller) { if (fileGroupSettings == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(fileGroupSettings.getDestina...
python
def GetCodeObjectAtLine(module, line): """Searches for a code object at the specified line in the specified module. Args: module: module to explore. line: 1-based line number of the statement. Returns: (True, Code object) on success or (False, (prev_line, next_line)) on failure, where prev_line ...
java
void writeChildren(TreeMap<Character, Long> counts) { int firstIndex = trie.nodes.length(); counts.forEach((k, v) -> { if (v > 0) trie.nodes.add(new NodeData(k, (short) -1, -1, v, -1)); }); short length = (short) (trie.nodes.length() - firstIndex); trie.ensureParentIndexCapacity(firstIndex, le...
java
@Override public Query rewrite(IndexReader reader) throws IOException { Query cQuery = contextQuery.rewrite(reader); if (cQuery == contextQuery) // NOSONAR { return this; } else { return new DerefQuery(cQuery, refProperty, nameTest, version, nsMappings); ...
python
def parse_template(self, pattern): """Parse template.""" i = _util.StringIter((self._original.decode('latin-1') if self.is_bytes else self._original)) iter(i) self.result = [""] while True: try: t = next(i) if self.use_format and t in...