language
stringclasses
2 values
func_code_string
stringlengths
63
466k
python
def layer_from_combo(combo): """Get the QgsMapLayer currently selected in a combo. Obtain QgsMapLayer id from the userrole of the QtCombo and return it as a QgsMapLayer. :returns: The currently selected map layer a combo. :rtype: QgsMapLayer """ index = combo.currentIndex() if index < ...
java
public void addListeners() { super.addListeners(); Record record = this.getMainRecord(); Record recClassInfo = this.getRecord(ClassInfo.CLASS_INFO_FILE); if (recClassInfo != null) { record.setKeyArea(KeyInfo.KEY_FILENAME_KEY); SubFileFilter listener = ...
python
def get_friend_suggestions(self, scope='graph/read'): """ Retrieve the Mxit user's full profile User authentication required with the following scope: 'graph/read' """ suggestions = _get( token=self.oauth.get_user_token(scope), uri='/user/socialgraph/sugge...
java
@Override public void setRoles(List<RoleEntity> inRoles) { if (inRoles == null) { this.roles = new ArrayList<>(); } else { this.roles = new ArrayList<>(inRoles); } this.roles = inRoles; }
python
def filter_tagged_lines(tagged_lines, include_tags=None, exclude_tags=None): r""" Return iterable of tagged lines where the tags all start with one of the include_tags prefixes >>> filter_tagged_lines([('natural', "Hello."), ('code', '[source,python]'), ('code', '>>> hello()')]) <generator object filter_ta...
python
def make_template(name, func, *args, **kwargs): """Given an arbitrary function, wrap it so that it does parameter sharing.""" if args or kwargs: func = functools.partial(func, *args, **kwargs) return Template(name, func)
java
public String replace(Matcher matcher) { StringBuilder replacementBuffer = new StringBuilder(); String replacementText; for (int group = 1; group <= matcher.groupCount(); group++) { replacementText = getReplacement(group); if (replacementText != null) { /...
java
@Override public boolean clearRegistry() throws SalException { boolean result = this.serviceManager.clearServices(); // Only try if we could delete the services if (result) result = result & this.docManager.clearDocuments(); // Only try if we could delete the services an...
python
def send_to_contact(self, obj_id, contact_id): """ Send email to a specific contact :param obj_id: int :param contact_id: int :return: dict|str """ response = self._client.session.post( '{url}/{id}/send/contact/{contact_id}'.format( ur...
python
def getImageForBulkExpressions(self, retina_name, body, get_fingerprint=None, image_scalar=2, plot_shape="circle", sparsity=1.0): """Bulk get images for expressions Args: retina_name, str: The retina name (required) body, ExpressionOperation: The JSON encoded expression to be eva...
python
def mkdir_temp(mode=0o755): """ Context manager that makes a temporary directory and yields it name. Directory is deleted after the context exits Parameters ---------- mode : octal Permissions to apply to the directory. Defaults to '755' because don't want directories world writable ...
python
def launch_subshell(self, shell_cls, cmd, args, *, prompt = None, context = {}): """Launch a subshell. The doc string of the cmdloop() method explains how shell histories and history files are saved and restored. The design of the _ShellBase class encourage launching of sub...
java
public String extractData( final ClientHttpResponse response ) throws IOException { StringWriter output = new StringWriter(); IoUtil.copy( new InputStreamReader( response.getBody() ), output ); return output.toString(); }
java
protected String getName(final String key) { return MetricRegistry.name(DropwizardClusterStatsCollector.class, "cluster", clusterId.applicationName, clusterId.clusterName, key); }
java
public static XAException createXAException(String key, Object args, int xaErrorCode) { XAException xaX = new XAException( args == null ? getNLSMessage(key) : getNLSMessage(key, args)); xaX.errorCode...
python
def draw(self, viewer): """General draw method for RGB image types. Note that actual insertion of the image into the output is handled in `draw_image()` """ cache = self.get_cache(viewer) if not cache.drawn: cache.drawn = True viewer.redraw(whence...
java
public void free() { int iOldEditMode = 0; if (m_record != null) // First, release the record for this table { iOldEditMode = this.getRecord().getEditMode(); this.getRecord().setEditMode(iOldEditMode | DBConstants.EDIT_CLOSE_IN_FREE); // This is a cludge... signals...
java
public CmsI18nInfo getI18nInfo(HttpServletRequest req, CmsUser user, CmsProject project, String resource) { CmsI18nInfo i18nInfo = null; // check if this is a request against a Workplace folder if (OpenCms.getSiteManager().isWorkplaceRequest(req)) { // The list of configured locali...
python
def text(min_size, max_size): """ Generates a random text, consisting of first names, last names, colors, stuffs, adjectives, verbs, and punctuation marks. :param min_size: minimum amount of words to generate. Text will contain 'minSize' words if 'maxSize' is omitted. :param ma...
java
public static AsyncHandler<Response<ByteString>> httpPayloadSemantics( AsyncHandler<Response<ByteString>> inner) { return inner.flatMapSync(resp -> ctx -> applyHttpPayloadSemantics(ctx.request(), resp)); }
java
@Override public DoubleMatrix1D getMatrixScalingFactorsSymm(DoubleMatrix2D A) { int n = A.rows(); final double log10_b = Math.log10(base); final int[] x = new int[n]; final double[] cHolder = new double[1]; final double[] tHolder = new double[1]; final int[] currentColumnIndexHolder = new int[] ...
java
public void becomeCloneOf(ManagedObject other) { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, "becomeCloneOf", "other=" + other + "(ManagedObject)"); // LinkedLists use an optimistic update methodo...
java
public void addFile(File file, String name) { files.put(name, file); // remove duplicate key if (fileStreams.containsKey(name)) { fileStreams.remove(name); } }
python
def get_user_roles(self, user): """Retrieve a list of user role names. .. note:: Database management methods. """ # For SQL: user.roles is list of pointers to Role objects if isinstance(self.db_adapter, SQLDbAdapter): # user.roles is a list of Role IDs ...
python
def ListDirectory(self, pathspec, depth=0): """A recursive generator of files.""" # Limit recursion depth if depth >= self.request.max_depth: return try: fd = vfs.VFSOpen(pathspec, progress_callback=self.Progress) files = fd.ListFiles(ext_attrs=self.request.collect_ext_attrs) exce...
python
def get_coordinates(node_class): """Generate coordinates for a node in a given class.""" quadrant_size = (2 * math.pi / 8.0) quadrant = get_quadrant_from_class(node_class) begin_angle = quadrant_size * quadrant r = 200 + 800*random.random() alpha = begin_angle + random.random() * quadrant_size ...
java
public Object getHandle(int iHandleType) throws DBException { switch (iHandleType) { case DBConstants.OBJECT_SOURCE_HANDLE: // Usually override to handle this type case DBConstants.FULL_OBJECT_HANDLE: String strSource = this.getSourceType() + HANDLE_SEPARATOR + this.g...
python
def Get_Page(self): ''' Fetches raw HTML data from the site for a given tracking_no ''' # Simply encode the correct url as a string url = 'https://www.aramex.com/express/track-results-multiple.aspx?ShipmentNumber=' url += self.tracking_no driver = webdriver.PhantomJS() # create a selenium webdriver ...
java
@Override public void write(ZooPC obj) { if (obj.getClass() == GenericObject.class) { writeGeneric((GenericObject) obj); return; } preWrite(); //write object ds.writeObject(obj, cls); //updated index //This is buffered to reduce look-ups to...
java
public MethodHandleConstant addMethodHandle(MethodHandleType mhType, ConstantPoolEntry cpEntry) { MethodHandleConstant entry = getMethodHandle(mhType, cpEntry); if (entry != null) { return entry; } entry = new MethodHandleConstant(this, _entries.si...
java
public void addConnection(WebSocketConnection conn) { WebSocketScope scope = getScope(conn); scope.addConnection(conn); }
python
def _ParseLogonApplications(self, parser_mediator, registry_key): """Parses the registered logon applications. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and dfvfs. registry_key (dfwinreg.WinRegistryKey): Windows Reg...
java
public BigInteger getPrivKey() { if (privKey == null) { throw new MissingPrivateKeyException(); } else if (privKey instanceof BCECPrivateKey) { return ((BCECPrivateKey) privKey).getD(); } else { throw new MissingPrivateKeyException(); } }
python
def sapm(self, effective_irradiance, temp_cell, **kwargs): """ Use the :py:func:`sapm` function, the input parameters, and ``self.module_parameters`` to calculate Voc, Isc, Ix, Ixx, Vmp/Imp. Parameters ---------- poa_direct : Series The direct irradia...
python
def warp(self, order): """对order/market的封装 [description] Arguments: order {[type]} -- [description] Returns: [type] -- [description] """ # 因为成交模式对时间的封装 if order.order_model == ORDER_MODEL.MARKET: if order.frequence is FREQ...
python
def update_payload(self, fields=None): """Wrap submitted data within an extra dict.""" payload = super(JobTemplate, self).update_payload(fields) effective_user = payload.pop(u'effective_user', None) if effective_user: payload[u'ssh'] = {u'effective_user': effective_user} ...
python
def list_records_for_project(id=None, name=None, page_size=200, page_index=0, sort="", q=""): """ List all BuildRecords for a given Project """ data = list_records_for_project_raw(id, name, page_size, page_index, sort, q) if data: return utils.format_json_list(data)
python
def importGurobiSolution(self, grbmodel): """ Import the solution from a gurobipy.Model object. Args: grbmodel: A :class:`gurobipy.Model` object with the model solved. """ self.eval(''.join( 'let {} := {};'.format(var.VarName, var.X) for var i...
java
private PageModel<T> createPageModel(final int pagePosition) { final T indicator = getIndicatorFromPagePosition(pagePosition); final ViewGroup view = instantiateItem(indicator); return new PageModel<T>(view, indicator); }
java
public static boolean isWlpRepoEnabled(Properties repoProperties) { if (!repoPropertiesFileExists() || repoProperties == null) return true; String wlpEnabled = repoProperties.getProperty(USE_WLP_REPO); if (wlpEnabled == null) return true; return !wlpEnabled.trim()...
python
def get_ls_l_desc(desc, include_folder=False, include_project=False): """ desc must have at least all the fields given by get_ls_l_desc_fields. """ # If you make this method consume an additional field, you must add it to # get_ls_l_desc_fields above. if 'state' in desc: state_len = len(...
python
def summary(args): """ %prog summary coordsfile provide summary on id% and cov%, for both query and reference """ from jcvi.formats.blast import AlignStats p = OptionParser(summary.__doc__) p.add_option("-s", dest="single", default=False, action="store_true", help="provide stat...
java
public static String combineLines( String[] lines, char separator ) { if (lines == null || lines.length == 0) return ""; StringBuilder sb = new StringBuilder(); for (int i = 0; i != lines.length; ++i) { String line = lines[i]; if (i ...
python
def download_member_shared(cls, member_data, target_member_dir, source=None, max_size=MAX_SIZE_DEFAULT, id_filename=False): """ Download files to sync a local dir to match OH member shared data. Files are downloaded to match their "basename" on Open Humans. ...
java
@SuppressWarnings("unused") public void clearCompletionText() { //Respect currentCompletionText in case hint is visible or if other checks are added. if (currentCompletionText().length() == 0){ return; } Range currentRange = getCurrentCandidateTokenRange(); inter...
java
@Override public InputStream getInputStream() throws IOException { if (_retrieved) throw new IOException("Already retrieved"); _retrieved = true; InputStream answer = _is; _is = null; return answer; }
python
def to_jd(year, month, day): '''Determine Julian day from Bahai date''' gy = year - 1 + EPOCH_GREGORIAN_YEAR if month != 20: m = 0 else: if isleap(gy + 1): m = -14 else: m = -15 return gregorian.to_jd(gy, 3, 20) + (19 * (month - 1)) + m + day
python
def get_language_from_extension(file_name): """Returns a matching language for the given file extension. When guessed_language is 'C', does not restrict to known file extensions. """ filepart, extension = os.path.splitext(file_name) pathpart, filename = os.path.split(file_name) if filename ==...
python
def delay(self): """Compute the next delay Returns the next delay to wait according to the exponential backoff algorithm. This is a value between 0 and base * 2^exp where exponent starts off at 1 and is incremented at every invocation of this method up to a maximum of 10. ...
java
public <R> StreamEx<R> mapFirstOrElse(Function<? super T, ? extends R> firstMapper, Function<? super T, ? extends R> notFirstMapper) { return new StreamEx<>(new PairSpliterator.PSOfRef<>(firstMapper, notFirstMapper, spliterator(), true), context); }
java
@Override public <NV extends NumberVector> NV projectRelativeScaledToDataSpace(double[] v, NumberVector.Factory<NV> prototype) { final int dim = v.length; double[] vec = new double[dim]; for(int d = 0; d < dim; d++) { vec[d] = scales[d].getRelativeUnscaled(v[d]); } return prototype.newNumber...
python
def sort(self, key_column_names, ascending=True): """ Sort current SFrame by the given columns, using the given sort order. Only columns that are type of str, int and float can be sorted. Parameters ---------- key_column_names : str | list of str | list of (str, bool) pa...
java
public void setSharedVars(Map<String, Object> vars) { if(this.sharedVars!=null) { this.sharedVars.putAll(vars); }else { this.sharedVars = vars; } }
python
def set_watched(db, aid, ep_type, number): """Set episode as watched.""" db.cursor().execute( """UPDATE episode SET user_watched=:watched WHERE aid=:aid AND type=:type AND number=:number""", { 'aid': aid, 'type': ep_type, 'number': number, ...
java
@SuppressWarnings({ "unchecked", "rawtypes" }) public void setupLookAndFeel(PropertyOwner propertyOwner) { Map<String,Object> properties = null; if (propertyOwner == null) propertyOwner = this.retrieveUserProperties(Params.SCREEN); if (propertyOwner == null) { // Th...
java
public org.apache.hadoop.conf.Configuration getOrLoadHadoopConfig() { org.apache.hadoop.conf.Configuration hadoopConfig = this.hadoopConfig; if (hadoopConfig == null) { if (flinkConfig != null) { hadoopConfig = mirrorCertainHadoopConfig(loadHadoopConfigFromFlink()); } else { LOG.warn("Flink configu...
java
private long allocate_from_tail(int block_size) throws IOException { long block_to_alloc; block_to_alloc = tail_ptr; tail_ptr = tail_ptr + block_size; allocated_blocks++; allocated_words += block_size; seek_and_count(block_to_alloc); writeInt(- block_si...
java
public PublicIPPrefixInner beginCreateOrUpdate(String resourceGroupName, String publicIpPrefixName, PublicIPPrefixInner parameters) { return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, parameters).toBlocking().single().body(); }
python
def specificity(Ntn, Nfp, eps=numpy.spacing(1)): """Specificity Wikipedia entry https://en.wikipedia.org/wiki/Sensitivity_and_specificity Parameters ---------- Ntn : int >= 0 Number of true negatives. Nfp : int >= 0 Number of false positives. eps : float eps. ...
java
public void setClusterNames(java.util.Collection<String> clusterNames) { if (clusterNames == null) { this.clusterNames = null; return; } this.clusterNames = new java.util.ArrayList<String>(clusterNames); }
python
def runExperimentSP(dirName): """ This runs a pool of experiments where the network is trained on stream containing a mixture of temporal and sensorimotor sequences. """ # Results are put into a pkl file which can be used to generate the plots. # dirName is the absolute path where the pkl file will be place...
python
def show_planes(im): r""" Create a quick montage showing a 3D image in all three directions Parameters ---------- im : ND-array A 3D image of the porous material Returns ------- image : ND-array A 2D array containing the views. This single image can be viewed using ...
java
@CheckReturnValue public PermissionOverrideAction setDeny(long denyBits) { Checks.notNegative(denyBits, "Denied permissions value"); Checks.check(denyBits <= Permission.ALL_PERMISSIONS, "Specified allow value may not be greater than a full permission set"); this.deny = denyBits; ...
java
public Map<String, String> getDetails() { if (details == null) { return null; } return Collections.unmodifiableMap(details); }
python
def get_current_value(self): """Return current annealing value # Returns Value to use in annealing """ if self.agent.training: # Linear annealed: f(x) = ax + b. a = -float(self.value_max - self.value_min) / float(self.nb_steps) b = float(s...
java
public SebContextWait sleep() { try { sleeper.sleep(timeout); return this; } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new WebDriverException(e); } }
python
def prepare_callable(self, fn, partial=False): """Prepare arguments required to apply function.""" notes, keyword_notes = self.get_annotations(fn) return self.prepare_notes(*notes, __partial=partial, **keyword_notes)
java
@Override public java.util.List<com.liferay.commerce.notification.model.CommerceNotificationTemplateUserSegmentRel> getCommerceNotificationTemplateUserSegmentRels( int start, int end) { return _commerceNotificationTemplateUserSegmentRelLocalService.getCommerceNotificationTemplateUserSegmentRels(start, end); }
java
private void postDelete(User user) throws Exception { for (UserEventListener listener : listeners) { listener.postDelete(user); } }
java
public Governator addModules(Module ... modules) { if (modules != null) { this.modules.addAll(Arrays.asList(modules)); } return this; }
python
def Kurt(poly, dist=None, fisher=True, **kws): """ Kurtosis operator. Element by element 4rd order statistics of a distribution or polynomial. Args: poly (Poly, Dist): Input to take kurtosis on. dist (Dist): Defines the space the skewness is taken on. It is igno...
python
def get_config(ini_path=None, rootdir=None): """ Load configuration from INI. :return Namespace: """ config = Namespace() config.default_section = 'pylama' if not ini_path: path = get_default_config_file(rootdir) if path: config.read(path) else: config....
python
def from_text(cls, fname, vocabUnicodeSize=78, desired_vocab=None, encoding="utf-8"): """ Create a WordVectors class based on a word2vec text file Parameters ---------- fname : path to file vocabUnicodeSize: the maximum string length (78, by default) desired_voca...
python
def __msg_curse_header(self, ret, process_sort_key, args=None): """Build the header and add it to the ret dict.""" sort_style = 'SORT' if args.disable_irix and 0 < self.nb_log_core < 10: msg = self.layout_header['cpu'].format('CPU%/' + str(self.nb_log_core)) elif args.disabl...
java
public TraceSummary withFaultRootCauses(FaultRootCause... faultRootCauses) { if (this.faultRootCauses == null) { setFaultRootCauses(new java.util.ArrayList<FaultRootCause>(faultRootCauses.length)); } for (FaultRootCause ele : faultRootCauses) { this.faultRootCauses.add(el...
python
def extract_from_dict(data, path): """ Navigate `data`, a multidimensional array (list or dictionary), and returns the object at `path`. """ value = data try: for key in path: value = value[key] return value except (KeyError, IndexError, TypeError): return...
java
public B css(String className, boolean force) { get().classList.toggle(className, force); return that(); }
python
def rmon_event_entry_log(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") rmon = ET.SubElement(config, "rmon", xmlns="urn:brocade.com:mgmt:brocade-rmon") event_entry = ET.SubElement(rmon, "event-entry") event_index_key = ET.SubElement(event_entry,...
python
def current(cls, with_exception=True): """ Returns the current database context. """ if with_exception and len(cls.stack) == 0: raise NoContext() return cls.stack.top()
java
public static void generate(ConfigurationImpl configuration, PackageDoc packageDoc) { PackageFrameWriter packgen; try { packgen = new PackageFrameWriter(configuration, packageDoc); String pkgName = Util.getPackageName(packageDoc); Content body = packgen.ge...
java
private int compareToRule(int month, int monthLen, int prevMonthLen, int dayOfMonth, int dayOfWeek, int millis, int millisDelta, int ruleMode, int ruleMonth, int ruleDayOfWeek, int rul...
java
@SuppressWarnings("unchecked") protected <T extends Source>T createSAXSource( Class<T> sourceClass) throws SQLException { SAXSource source = null; try { source = (sourceClass == null) ? new SAXSource() : (SAXSource) sourceClass.newInstance(); } c...
java
public SubProcessBuilder subProcessDone() { BpmnModelElementInstance lastSubProcess = element.getScope(); if (lastSubProcess != null && lastSubProcess instanceof SubProcess) { return ((SubProcess) lastSubProcess).builder(); } else { throw new BpmnModelException("Unable to find a parent subPr...
python
def _init_check_upodates(): """Sub function for init """ message, count, packages = check_updates() if count > 0: print(message) for pkg in packages: print("{0}".format(pkg)) else: print(message)
python
def calc_qigz2_v1(self): """Aggregate the amount of the second interflow component released by all HRUs. Required control parameters: |NHRU| |FHRU| Required flux sequence: |QIB2| Calculated state sequence: |QIGZ2| Basic equation: :math:`QIGZ2 = \\Sigma(FHRU \\c...
java
private void updateDates(Task parentTask) { if (parentTask.hasChildTasks()) { int finished = 0; Date plannedStartDate = parentTask.getStart(); Date plannedFinishDate = parentTask.getFinish(); Date actualStartDate = parentTask.getActualStart(); Date actualFinis...
python
def goto(self, position, duration, wait=False, accurate=False): """ Goes to a given cartesian position. :param list position: [x, y, z] representing the target position (in meters) :param float duration: move duration :param bool wait: whether to wait for the end of the move...
java
public void resetStats(){ this.cacheHits.set(0); this.cacheMiss.set(0); this.statementsCached.set(0); this.connectionsRequested.set(0); this.cumulativeConnectionWaitTime.set(0); this.cumulativeStatementExecuteTime.set(0); this.cumulativeStatementPrepareTime.set(0); this.statementsExecuted.set(0); this...
python
def add_indicators(self, indicators=list(), private=False, tags=list()): """Add indicators to the remote instance.""" if len(indicators) == 0: raise Exception("No indicators were identified.") self.logger.debug("Checking {} indicators".format(len(indicators))) cleaned = clean...
java
protected HttpResponse doDelete(ServiceRequestContext ctx, HttpRequest req) throws Exception { final HttpResponseWriter res = HttpResponse.streaming(); doDelete(ctx, req, res); return res; }
java
private void generatePdf() { File pdfFile = new File(directory, filename + ".pdf"); try (OutputStream os = new FileOutputStream(pdfFile)) { PdfRendererBuilder builder = new PdfRendererBuilder(); builder.withHtmlContent(getHtmlForPDFConversion(), "file://" + pdfFile.getAbsolutePat...
python
def sessionize(user_events, cutoff=defaults.CUTOFF): """ Clusters user sessions from a sequence of user events. Note that, `event` data will simply be returned in the case of a revert. This function serves as a convenience wrapper around calls to :class:`~mw.lib.sessions.Cache`'s :meth:`~mw.lib.se...
java
public void onMessagesRead(Peer peer, long fromDate) { // Filtering obsolete read events if (fromDate < getLastReadDate(peer)) { return; } // Removing read messages from pending storage getNotifications().clear(); pendingStorage.setMessagesCount(0); ...
java
public void addGeoPackage(T geoPackage) { PropertiesCoreExtension<T, ?, ?, ?> propertiesExtension = getPropertiesExtension(geoPackage); propertiesMap.put(geoPackage.getName(), propertiesExtension); }
java
public void addTo(Date date) { // check data parameter if (date == null) { throw new NullPointerException("date == null"); } Calendar cal = new GregorianCalendar(); cal.setTime(date); this.addTo(cal); date.setTime(getCalendarTimeInMillis(cal)); }
python
def _extract_fields(self, line): """Extract the key/value fields from a line of performance data """ acc = {} field_tokens = line.split("\t") for field_token in field_tokens: kv_tokens = field_token.split('::') if len(kv_tokens) == 2: (key,...
python
def _remote_chmod(self, paths, mode, sudoable=False): """ Issue an asynchronous set_file_mode() call for every path in `paths`, then format the resulting return value list with fake_shell(). """ LOG.debug('_remote_chmod(%r, mode=%r, sudoable=%r)', paths, mode, s...
java
public Query getMails(String[] messageNumbers, String[] uids, boolean all) throws MessagingException, IOException { Query qry = new QueryImpl(all ? _fldnew : _flddo, 0, "query"); Folder folder = _store.getFolder("INBOX"); folder.open(Folder.READ_ONLY); try { getMessages(qry, folder, uids, messageNumbers, start...
java
public static List<JCAnnotation> findCopyableAnnotations(JavacNode node) { JCAnnotation anno = null; String annoName = null; for (JavacNode child : node.down()) { if (child.getKind() == Kind.ANNOTATION) { if (anno != null) { annoName = ""; break; } JCAnnotation annotation = (JCAnnotation)...
java
static final JSType createAsyncReturnableType(JSTypeRegistry registry, JSType maybeThenable) { JSType unknownType = registry.getNativeType(JSTypeNative.UNKNOWN_TYPE); ObjectType iThenableType = registry.getNativeObjectType(JSTypeNative.I_THENABLE_TYPE); JSType iThenableOfUnknownType = registry.createTempla...