language
stringclasses
2 values
func_code_string
stringlengths
63
466k
java
protected int _firstch(int identity) { // Boiler-plate code for each of the _xxx functions, except for the array. int info = (identity >= m_size) ? NOTPROCESSED : m_firstch.elementAt(identity); // Check to see if the information requested has been processed, and, // if not, advance the iterator unti...
java
public <T> T pick (Iterable<? extends T> iterable, T ifEmpty) { return pickPluck(iterable, ifEmpty, false); }
python
def gnomonicSphereToImage(lon, lat): """ Gnomonic projection (deg). """ # Convert angle to [-180, 180] interval lon = lon - 360.*(lon>180) lon = np.radians(lon) lat = np.radians(lat) r_theta = (180. / np.pi) / np.tan(lat) x = r_theta * np.cos(lon) y = r_theta * np.sin(lon) re...
java
public String toHeaderRow(Class<?> objectClass) { if(ClassPath.isPrimitive(objectClass) || Scheduler.isDateOrTime(objectClass)) return new StringBuilder(objectClass.getSimpleName()).append("\n").toString(); Method[] methodArray = objectClass.getMethods(); Method m; String methodName = null; meth...
python
def duration(self): """The duration of this stimulus :returns: float -- duration in seconds """ durs = [] for track in self._segments: durs.append(sum([comp.duration() for comp in track])) return max(durs)
java
public DescribeStacksResult withStacks(Stack... stacks) { if (this.stacks == null) { setStacks(new com.amazonaws.internal.SdkInternalList<Stack>(stacks.length)); } for (Stack ele : stacks) { this.stacks.add(ele); } return this; }
java
public static FileStatus replaceScheme(FileStatus st, String replace, String replacement) { if (replace != null && replace.equals(replacement)) { return st; } try { return new FileStatus(st.getLen(), st.isDir(), st.getReplication(), st.getBlockSize(), st.getModificationTime(), st.getAc...
python
def on_dict(self, node): # ('keys', 'values') """Dictionary.""" return dict([(self.run(k), self.run(v)) for k, v in zip(node.keys, node.values)])
java
public static long readLongBigEndian(InputStream io) throws IOException { long value = io.read(); if (value < 0) throw new EOFException(); value <<= 56; int i = io.read(); if (i < 0) throw new EOFException(); value |= ((long)i) << 48; i = io.read(); if (i < 0) throw new EOFException(); value ...
python
def sun_rise_set_transit_spa(times, latitude, longitude, how='numpy', delta_t=67.0, numthreads=4): """ Calculate the sunrise, sunset, and sun transit times using the NREL SPA algorithm described in [1]. If numba is installed, the functions can be compiled to machine cod...
java
public void setSupportedTimezones(java.util.Collection<Timezone> supportedTimezones) { if (supportedTimezones == null) { this.supportedTimezones = null; return; } this.supportedTimezones = new java.util.ArrayList<Timezone>(supportedTimezones); }
java
@Override public void writeShort(short v) throws IOException { outputStream.write(0xFF & v); outputStream.write(0xFF & (v >> 8)); bytesWritten += 2; }
java
public ServiceFuture<RecommendationRuleInner> getRuleDetailsByWebAppAsync(String resourceGroupName, String siteName, String name, Boolean updateSeen, String recommendationId, final ServiceCallback<RecommendationRuleInner> serviceCallback) { return ServiceFuture.fromResponse(getRuleDetailsByWebAppWithServiceResp...
python
def get_collection_datasets(collection_id,**kwargs): """ Get all the datasets from the collection with the specified name """ collection_datasets = db.DBSession.query(Dataset).filter(Dataset.id==DatasetCollectionItem.dataset_id, DatasetCollectionItem.collectio...
java
public static IterableResult<Extension> search(ExtensionRepository repository, ExtensionQuery query, IterableResult<Extension> previousSearchResult) throws SearchException { IterableResult<Extension> result; if (repository instanceof Searchable) { if (repository instanceof Advan...
java
public void setDistanceFunction(DistanceFunction df) throws Exception { if (!(df instanceof EuclideanDistance)) throw new Exception("KDTree currently only works with " + "EuclideanDistanceFunction."); m_DistanceFunction = m_EuclideanDistance = (EuclideanDistance) df; }
java
public void autoReportZero(final Set<MetricIdentity> autoMetrics) { Preconditions.checkNotNull(autoMetrics); for (MetricIdentity identity : autoMetrics) { if (!aggregateExistsForCurrentMinute(identity)) { MetricAggregate aggregate = getAggregate(identity); aggregate.setCount(1); aggregate.set...
java
public DateRangeQuery end(Date end, boolean inclusive) { this.end = SearchUtils.toFtsUtcString(end); this.inclusiveEnd = inclusive; return this; }
python
def remove_resource(zone, resource_type, resource_key, resource_value): ''' Remove a resource zone : string name of zone resource_type : string type of resource resource_key : string key for resource selection resource_value : string value for resource selection ...
java
public static FLValue fromData(AllocSlice slice) { final long value = fromData(slice.handle); return value != 0 ? new FLValue(value) : null; }
java
@Deprecated public ComponentMetadata findComponentMetadata(Class<?> componentType) { ComponentMetadata md = null; while (md == null) { String componentName = componentType.getName(); md = findComponentMetadata(componentName); if (md == null) { // Test superclasses/s...
python
def publisher(self): """Name of the publisher of the abstract. Note: Information provided in the FULL view of the article might be more complete. """ # Return information from FULL view, fall back to other views full = chained_get(self._head, ['source', 'publisher', 'publ...
python
def get_image(self, id): """Return a Image object representing the image with the given id.""" url = self._base_url + "/3/image/{0}".format(id) resp = self._send_request(url) return Image(resp, self)
python
def check_storage_controllers(): """ Check the status of the storage controllers Skip this check, if --noController is set """ if ctrl_flag: ctrl = walk_data(sess, oid_ctrl, helper)[0] for x, data in enumerate(ctrl, 1): ctrl_summary_output, ctrl_long_output = state_summar...
java
public void marshall(UpdatePullRequestTitleRequest updatePullRequestTitleRequest, ProtocolMarshaller protocolMarshaller) { if (updatePullRequestTitleRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.m...
java
public String get(final String path) throws IOException { final HttpRequest request = getRequest(path); final HttpResponse response = request.execute(); return response.parseAsString(); }
python
def allowed(self, url, agent): '''Return true if the provided URL is allowed to agent.''' return self.get(url).allowed(url, agent)
python
def _make_middleware_stack(middleware, base): """ Given a list of in-order middleware callables `middleware` and a base function `base`, chains them together so each middleware is fed the function below, and returns the top level ready to call. """ for ware in reversed(mi...
java
public static Object deserialize(byte[] bytes, boolean gzipOnSerialize) { try { InputStream is = new ByteArrayInputStream(bytes); if (gzipOnSerialize) { is = new GZIPInputStream(is); } ObjectInputStream in = new ObjectInputStream(is); O...
python
def _iter_matches(self, input_match, subject_graph, one_match, level=0): """Given an onset for a match, iterate over all completions of that match This iterator works recursively. At each level the match is extended with a new set of relations based on vertices in the pattern graph ...
python
def subSampleWholeColumn(spikeTrains, colIndices, cellsPerColumn, currentTS, timeWindow): """ Obtains subsample from matrix of spike trains by considering the cells in columns specified by colIndices. Thus, it returns a matrix of spike trains of cells within the same column. @param spikeTrains (array) arra...
python
def _proxy(self): """ Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context :returns: SyncListItemContext for this SyncListItemInstance :rtype: twilio.rest.preview.sync.service.sync_l...
java
public boolean isBeforeRange(final Range<T> otherRange) { if (otherRange == null) { return false; } return isBefore(otherRange.minimum); }
python
def get_percentage_bond_dist_changes(self, max_radius=3.0): """ Returns the percentage bond distance changes for each site up to a maximum radius for nearest neighbors. Args: max_radius (float): Maximum radius to search for nearest neighbors. This radius is ap...
python
def get_hgp(p, k, N, K, n): """Calculate the hypergeometric p-value when p = f(k; N,K,n) is already known. """ pval = p while k < min(K, n): p *= (float((n-k)*(K-k) / float((k+1)*(N-K-n+k+1)))) pval += p k += 1 return pval
java
public IStringBuffer append( char c ) { if ( count == buff.length ) { resizeTo( buff.length * 2 + 1 ); } buff[count++] = c; return this; }
java
public void marshall(UpdateCertificateOptionsRequest updateCertificateOptionsRequest, ProtocolMarshaller protocolMarshaller) { if (updateCertificateOptionsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarsha...
java
public ConstructorDeclaration getConstructor(String signature) { for (EntityDeclaration node : type.getMembers()) { if (node.getEntityType() == EntityType.CONSTRUCTOR) { ConstructorDeclaration cons = (ConstructorDeclaration) node; if (signature.equals(signature(cons))) { return cons;...
python
def notify_mail(title, message, recipient=None, sender=None, smtp_host=None, smtp_port=None, **kwargs): """ Mail notification method taking a *title* and a string *message*. *recipient*, *sender*, *smtp_host* and *smtp_port* default to the configuration values in the [notifications] section. """...
python
def authorize_security_group( self, group_name=None, group_id=None, source_group_name="", source_group_owner_id="", ip_protocol="", from_port="", to_port="", cidr_ip=""): """ There are two ways to use C{authorize_security_group}: 1) associate an existing group (source group) ...
python
def active(): ''' List existing device-mapper device details. ''' ret = {} # TODO: This command should be extended to collect more information, such as UUID. devices = __salt__['cmd.run_stdout']('dmsetup ls --target crypt') out_regex = re.compile(r'(?P<devname>\w+)\W+\((?P<major>\d+), (?P<mi...
python
def block_specification_to_number(block: BlockSpecification, web3: Web3) -> BlockNumber: """ Converts a block specification to an actual block number """ if isinstance(block, str): msg = f"string block specification can't contain {block}" assert block in ('latest', 'pending'), msg number...
java
@Override public DescribeNotebookInstanceLifecycleConfigResult describeNotebookInstanceLifecycleConfig(DescribeNotebookInstanceLifecycleConfigRequest request) { request = beforeClientExecution(request); return executeDescribeNotebookInstanceLifecycleConfig(request); }
java
protected <T> T handleGet(URL resourceUrl, Class<T> type) throws ExecutionException, InterruptedException, KubernetesClientException, IOException { return handleGet(resourceUrl, type, Collections.<String, String>emptyMap()); }
python
def connection_made(self, transport): """ Called by the underlying transport when a connection is made. :param transport: The transport representing the connection. """ # Save the underlying transport self._transport = transport # Call connection_made() on the ...
java
public <T> T getService(String serviceName) { T service = findService(serviceName, true); if (service == null) { throw new IllegalArgumentException(format("No service found named \"%s\"", serviceName)); } return service; }
java
@Override public void execute(TridentTuple tuple, TridentCollector collector) { String receivedStr = tuple.getString(0); String[] splitedStr = StringUtils.split(receivedStr, this.delimeter); int dataNum = splitedStr.length; double[] points = new double[splitedStr.length]; ...
java
public static void multAddOuter( double alpha , DMatrix6x6 A , double beta , DMatrix6 u , DMatrix6 v , DMatrix6x6 C ) { C.a11 = alpha*A.a11 + beta*u.a1*v.a1; C.a12 = alpha*A.a12 + beta*u.a1*v.a2; C.a13 = alpha*A.a13 + beta*u.a1*v.a3; C.a14 = alpha*A.a14 + beta*u.a1*v.a4; C.a15 = ...
java
@Override public <E extends Exception> void add(Iteration<? extends Statement, E> statements, Resource... contexts) throws RepositoryException, E { while(statements.hasNext()){ Statement st = statements.next(); add(st.getSubject(), st.getPredicate(), st.getObject(), mergeResource(st....
python
def PatchAt(cls, n, module, method_wrapper=None, module_alias=None, method_name_modifier=utils.identity, blacklist_predicate=_False, whitelist_predicate=_True, return_type_predicate=_None, getmembers_predicate=inspect.isfunction, admit_private=False, explanation=""): """ This classmethod lets you easily patch a...
python
def cross(self): """Return cross join""" self.query.do_join(Join(self.item, JoinType.cross)) return self.query
java
public static CPInstance fetchByCompanyId_First(long companyId, OrderByComparator<CPInstance> orderByComparator) { return getPersistence() .fetchByCompanyId_First(companyId, orderByComparator); }
java
@Override public void recordVariableUpdate(VariableInstanceEntity variable) { if (isHistoryLevelAtLeast(HistoryLevel.ACTIVITY)) { HistoricVariableInstanceEntity historicProcessVariable = getEntityCache().findInCache(HistoricVariableInstanceEntity.class, variable.getId()); if (historicProcessVariable =...
java
protected List<String> getTokensFromHeader(Request request, String headerName) { List<String> result = new ArrayList<>(); Enumeration<String> headers = request.getHeaders(headerName); while (headers.hasMoreElements()) { String header = headers.nextElement(); String[] tok...
python
def get_meta_graph_def(saved_model_dir, tag_set): """Utility function to read a meta_graph_def from disk. From `saved_model_cli.py <https://github.com/tensorflow/tensorflow/blob/8e0e8d41a3a8f2d4a6100c2ea1dc9d6c6c4ad382/tensorflow/python/tools/saved_model_cli.py#L186>`_ Args: :saved_model_dir: path to saved_...
java
public Where<T, ID> or(int numClauses) { if (numClauses == 0) { throw new IllegalArgumentException("Must have at least one clause in or(numClauses)"); } Clause[] clauses = new Clause[numClauses]; for (int i = numClauses - 1; i >= 0; i--) { clauses[i] = pop("OR"); } addClause(new ManyClause(clauses, Ma...
python
def get_password(args): """Get password Argument: args: arguments object Return: password string """ password = '' if args.__dict__.get('password'): # Specify password as argument (for -p option) password = args.password elif args.__dict__.get('P'): # Ent...
java
public Observable<Void> ignoreInput() { return getInput().map(new Func1<R, Void>() { @Override public Void call(R r) { ReferenceCountUtil.release(r); return null; } }).ignoreElements(); }
java
public void onCacheHit(String template, int locality) { final String methodName = "onCacheHit()"; CacheStatsModule csm = null; if ((csm = getCSM(template)) == null) { return; } if (tc.isDebugEnabled()) Tr.debug(tc, methodName + " cacheName=" + _sCacheName...
java
private void replaceModuleName() throws CmsException, UnsupportedEncodingException { CmsResourceFilter filter = CmsResourceFilter.ALL.addRequireFile().addExcludeState( CmsResource.STATE_DELETED).addRequireTimerange().addRequireVisible(); List<CmsResource> resources = getCms().readResources(...
java
public static Functor instanciateFunctorAsAnInstanceMethodWrapper(final Object instance, String methodName) throws Exception { if (null == instance) { throw new NullPointerException("Instance is null"); } Method _method = instance.getClass().getMethod(methodName, (Class<?>[]) null); return instanci...
python
def sparkify(series): u"""Converts <series> to a sparkline string. Example: >>> sparkify([ 0.5, 1.2, 3.5, 7.3, 8.0, 12.5, 13.2, 15.0, 14.2, 11.8, 6.1, ... 1.9 ]) u'β–β–β–‚β–„β–…β–‡β–‡β–ˆβ–ˆβ–†β–„β–‚' >>> sparkify([1, 1, -2, 3, -5, 8, -13]) u'β–†β–†β–…β–†β–„β–ˆβ–' Raises ValueError if input data cannot be converted ...
java
public ParallelTaskBuilder setTargetHostsFromJsonPath(String jsonPath, String sourcePath, HostsSourceType sourceType) throws TargetHostsLoadException { this.targetHosts = targetHostBuilder.setTargetHostsFromJsonPath(jsonPath, sourcePath, sourceType); return this;...
java
public static String getDefaultProjectId() { String projectId = System.getProperty(PROJECT_ENV_NAME, System.getenv(PROJECT_ENV_NAME)); if (projectId == null) { projectId = System.getProperty(LEGACY_PROJECT_ENV_NAME, System.getenv(LEGACY_PROJECT_ENV_NAME)); } if (projectId == null) { ...
python
def run(self): """ Runs the simulation. """ self.init_run() if self.debug: self.dump("AfterInit: ") #print("++++++++++++++++ Time: %f"%self.current_time) while self.step(): #self.dump("Time: %f"%self.current_time) #print("++++++++++++++++ ...
python
def console_new(w: int, h: int) -> tcod.console.Console: """Return an offscreen console of size: w,h. .. deprecated:: 8.5 Create new consoles using :any:`tcod.console.Console` instead of this function. """ return tcod.console.Console(w, h)
java
public CheckRequest asCheckRequest(Clock clock) { Preconditions.checkState(!Strings.isNullOrEmpty(getServiceName()), "a service name must be set"); Preconditions.checkState(!Strings.isNullOrEmpty(getOperationId()), "an operation ID must be set"); Preconditions.checkState(!Strings.isNullOrEmp...
python
def similar_title(post, parameter=None): '''Skip posts with fuzzy-matched (threshold = levenshtein distance / length) title. Parameters (comma-delimited): minimal threshold, at which values are considired similar (float, 0 < x < 1, default: {0}); comparison timespan, seconds (int, 0 = inf, default: {1}).''' f...
java
public GroupOptions setOffset(@Nullable Integer offset) { this.offset = offset == null ? null : Math.max(0, offset); return this; }
java
private int completeRead(int b) throws IOException, StreamIntegrityException { if (b == END_OF_STREAM) { handleEndOfStream(); } else { // Have we reached the end of the stream? int c = pushbackInputStream.read(); if (c == END_OF_STREAM) { handleEndOfStream(); } else { ...
python
def node_vectors(node_id): """Get the vectors of a node. You must specify the node id in the url. You can pass direction (incoming/outgoing/all) and failed (True/False/all). """ exp = Experiment(session) # get the parameters direction = request_parameter(parameter="direction", default="...
python
def remote_space_available(self, search_pattern=r"(\d+) bytes free"): """Return space available on remote device.""" remote_cmd = 'system "df {}"'.format(self.folder_name) remote_output = self.ssh_ctl_chan.send_command_expect(remote_cmd) for line in remote_output.splitlines(): ...
python
def upsert(self, space, t, operations, **kwargs) -> _MethodRet: """ Update request coroutine. Performs either insert or update (depending of either tuple exists or not) Examples: .. code-block:: pycon # upsert does not return anything ...
java
protected long readFromFile(OutputStream stream, File file, long length, long position) throws IOException { FileInputStream in = null; try { if (channel == null || !channel.isOpen()) { in = PrivilegedFileHelper.fileInputStream(file); channel = in.getChann...
java
@Override protected ParameterBinder createBinder(Object[] values) { return new SpelExpressionStringQueryParameterBinder((DefaultParameters) getQueryMethod().getParameters(), values, query, evaluationContextProvider, parser); }
python
def concat(self, target, sources, **kwargs): """Concat existing files together. For preconditions, see https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/filesystem/filesystem.html#void_concatPath_p_Path_sources :param target: the path to the target destination. ...
python
def parse(content, *args, **kwargs): ''' Use mecab-python3 by default to parse JP text. Fall back to mecab binary app if needed ''' global MECAB_PYTHON3 if 'mecab_loc' not in kwargs and MECAB_PYTHON3 and 'MeCab' in globals(): return MeCab.Tagger(*args).parse(content) else: return r...
java
@Override public void describeTo(Description description) { describeKeyTo(description); if (isRun) { if (hasResult()) { description.appendText(" = ") .appendValue(getResult()); } else { description.appendText(...
python
def backwards(self, backwards): """Decorator to specify the ``backwards`` action.""" if self._backwards is not None: raise ValueError('Backwards action already specified.') self._backwards = backwards return backwards
java
public void setupFields() { FieldInfo field = null; field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null); field.setDataClass(Integer.class); field.setHidden(true); field = new FieldInfo(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null); ...
java
private void obtainPreviewSize(@NonNull final TypedArray typedArray) { int defaultValue = getContext().getResources() .getDimensionPixelSize(R.dimen.color_picker_preference_default_preview_size); setPreviewSize(typedArray .getDimensionPixelSize(R.styleable.AbstractColorPi...
python
def sflow_polling_interval(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") sflow = ET.SubElement(config, "sflow", xmlns="urn:brocade.com:mgmt:brocade-sflow") polling_interval = ET.SubElement(sflow, "polling-interval") polling_interval.text = kwar...
python
def write_sig(self): '''Write signature to sig store''' if not self._md5: self._md5 = fileMD5(self) with open(self.sig_file(), 'w') as sig: sig.write( f'{os.path.getmtime(self)}\t{os.path.getsize(self)}\t{self._md5}' )
java
public Optional<URL> getRoute() { Optional<Route> optionalRoute = getClient().routes().inNamespace(namespace) .list().getItems() .stream() .findFirst(); return optionalRoute .map(OpenShiftRouteLocator::createUrlFromRoute); }
python
def consume(self, tokens): """Consume tokens. Args: tokens (float): number of transport tokens to consume Returns: wait_time (float): waiting time for the consumer """ wait_time = 0. self.tokens -= tokens if self.tokens < 0: sel...
python
def checkResponse(request): ''' Returns if a request has an okay error code, otherwise raises InvalidRequest. ''' # Check the status code of the returned request if str(request.status_code)[0] not in ['2', '3']: w = str(request.text).split('\\r')[0][2:] r...
python
def _init_metadata(self): """stub""" super(LabelOrthoFacesAnswerFormRecord, self)._init_metadata() self._face_values_metadata = { 'element_id': Id(self.my_osid_object_form._authority, self.my_osid_object_form._namespace, 'face...
python
def greater_than(self, greater_than): """Adds new `>` condition :param greater_than: str or datetime compatible object (naive UTC datetime or tz-aware datetime) :raise: - QueryTypeError: if `greater_than` is of an unexpected type """ if hasattr(greater_than, 'strfti...
java
public void data_smd_smdId_DELETE(Long smdId) throws IOException { String qPath = "/domain/data/smd/{smdId}"; StringBuilder sb = path(qPath, smdId); exec(qPath, "DELETE", sb.toString(), null); }
java
public static StoredFile createLocalStoredFile(String sourceUrl, String localFilePath, String mimeType) { InputStream is = null; try { Context context = ApptentiveInternal.getInstance().getApplicationContext(); if (URLUtil.isContentUrl(sourceUrl) && context != null) { Uri uri = Uri.parse(sourceUrl); i...
python
def parse_responses(self): """ Parses the json response sent back by the server and tries to get out the important return variables Returns: dict: multicast_ids (list), success (int), failure (int), canonical_ids (int), results (list) and optional topic_message_id (s...
python
def get_milestone(self, title): """ given the title as str, looks for an existing milestone or create a new one, and return the object """ if not title: return GithubObject.NotSet if not hasattr(self, '_milestones'): self._milestones = {m.title: m ...
python
def login_handler(self, config=None, prefix=None, **args): """OAuth starts here, redirect user to Google.""" params = { 'response_type': 'code', 'client_id': self.google_api_client_id, 'redirect_uri': self.scheme_host_port_prefix( 'http', config.host, ...
java
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { try { if (com.google.api.ads.adwords.axis.v201809.cm.BatchJobServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) { com.google.api.ads.adwords.axis.v201809.cm.BatchJob...
java
public boolean needsRefreshing() { // is there a new version available? long lastmodified = new File(pathResourceDirectory, Parameters.lexiconName).lastModified(); boolean needsRefreshing = false; if (lastmodifiedLexicon != lastmodified) { needsRefreshing = true; } return needsRefreshing; }
java
public static String getDependencyIssue(AddOn.BaseRunRequirements requirements) { if (!requirements.hasDependencyIssue()) { return null; } List<Object> issueDetails = requirements.getDependencyIssueDetails(); switch (requirements.getDependencyIssue()) { case CYCLIC: ...
java
public void setSpecified (int index, boolean value) { if (index < 0 || index >= getLength ()) throw new ArrayIndexOutOfBoundsException ( "No attribute at index: " + index); specified [index] = value; }
java
public void offer(PrioritizedSplitRunner split) { checkArgument(split != null, "split is null"); split.setReady(); int level = split.getPriority().getLevel(); lock.lock(); try { if (levelWaitingSplits.get(level).isEmpty()) { // Accesses to levelSc...
java
public static Document asDocument(String html) throws IOException { DOMParser domParser = new DOMParser(); try { domParser .setProperty( "http://cyberneko.org/html/properties/names/elems", "match"); domPa...
python
def get_method_contents(self, method): """ Returns the swagger contents of the given method. This checks to see if a conditional block has been used inside of the method, and, if so, returns the method contents that are inside of the conditional. :param dict method: method dicti...