language
stringclasses
2 values
func_code_string
stringlengths
63
466k
java
public ProxyPolicyHandler removeProxyPolicyHandler(String id) { return (id != null && this.proxyPolicyHandlers != null) ? (ProxyPolicyHandler)this.proxyPolicyHandlers.remove(id) : null; }
java
private Map<Integer, List<Row>> createExceptionAssignmentMap(List<Row> rows) { Map<Integer, List<Row>> map = new HashMap<Integer, List<Row>>(); for (Row row : rows) { Integer calendarID = row.getInteger("ID"); String exceptions = row.getString("EXCEPTIONS"); map.put(calen...
java
public boolean shouldTraceBeDisabled(WSRdbManagedConnectionImpl mc) { if (!databaseTc.isDebugEnabled() && mc.mcf.loggingEnabled) return true; return false; }
java
public static void generateSource(Reader reader, File sourceOutputPath) throws IOException { ProtoFile protoFile = ProtoSchemaParser.parse(DEFAULT_FILE_NAME, reader); List<CodeDependent> cds = new ArrayList<CodeDependent>(); doCreate(protoFile, true, false, null, true, sourceOutputPath, cds, new...
python
def info(gandi, email): """Display information about a mailbox.""" login, domain = email output_keys = ['login', 'aliases', 'fallback', 'quota', 'responder'] mailbox = gandi.mail.info(domain, login) output_mailbox(gandi, mailbox, output_keys) return mailbox
java
@Override public CommerceAvailabilityEstimate findByGroupId_Last(long groupId, OrderByComparator<CommerceAvailabilityEstimate> orderByComparator) throws NoSuchAvailabilityEstimateException { CommerceAvailabilityEstimate commerceAvailabilityEstimate = fetchByGroupId_Last(groupId, orderByComparator); if (co...
python
def CompareStores(self): """Compares the contents of two stores. Returns: bool: True if the content of the stores is identical. """ storage_reader = storage_factory.StorageFactory.CreateStorageReaderForFile( self._storage_file_path) if not storage_reader: logger.error( ...
java
@SuppressFBWarnings(justification = "Accepting that this is a bad practice - but made more sense in this use case", value = {"NP_BOOLEAN_RETURN_NULL"}) public Boolean isAutoUpdate() { return (line != null && line.hasOption(ARGUMENT.DISABLE_AUTO_UPDATE)) ? false : null; }
java
public java.awt.Graphics2D createPrinterGraphicsShapes(float width, float height, PrinterJob printerJob) { return new PdfPrinterGraphics2D(this, width, height, null, true, false, 0, printerJob); }
java
private void repaintDueToPlaybackStateChange(long oldMaxPosition, long newMaxPosition, PlaybackState oldState, PlaybackState newState) { if (duration.get() > 0) { // We are only drawing markers if we know the track duration final int width = waveform...
python
def as_tree(context): """Return info about an object's members as JSON""" tree = _build_tree(context, 2, 1) if type(tree) == dict: tree = [tree] return Response(content_type='application/json', body=json.dumps(tree))
java
public static Map<String, Field> createSuperColumnsFieldMap(final EntityMetadata m, final KunderaMetadata kunderaMetadata) { Map<String, Field> superColumnNameToFieldMap = new HashMap<String, Field>(); getEmbeddableType(m, null, superColumnNameToFieldMap, kunderaMetadata); r...
python
def _connect(self, server, port, tls=True, tls_verify=True, proxy=False, proxy_type='SOCKS5', proxy_server=None, proxy_port=None, proxy_username=None, proxy_password=None): """ Connects the socket to an IRC server. Required arguments: * server - Server t...
java
public void deletePersonalFavorite(Target target) throws WorkspaceApiException { try { ApiSuccessResponse resp = targetsApi.deletePersonalFavorite(String.valueOf(target.getId()), target.getType().getValue()); Util.throwIfNotOk(resp); } catch(ApiException ex) { ...
python
def init(vcs): """Initialize the locking module for a repository """ path = os.path.join(vcs.private_dir(), 'locks') if not os.path.exists(path): os.mkdir(path)
python
def backend_status(self, backend='ibmqx4', access_token=None, user_id=None): """ Get the status of a chip """ if access_token: self.req.credential.set_token(access_token) if user_id: self.req.credential.set_user_id(user_id) backend_type = self._che...
python
def activate(self, *, filter_func=None): ''' Activate the type safety checker. After the call all functions that need to be checked will be. ''' if self.active: raise RuntimeError("Type safety check already active") self.__module_finder = ModuleFinder(Valida...
python
def vcenter_blit(target, source, dest = (0, 0), area=None, special_flags=0): ''' The same as center_blit(), but only centers vertically. ''' loc = lambda d, s: (_vec(0, d.get_height() / 2) - _vec(0, s.get_height() / 2)) _blitter(loc, target, source, dest, area, special_flags)
java
@Override public DescribeCacheSubnetGroupsResult describeCacheSubnetGroups(DescribeCacheSubnetGroupsRequest request) { request = beforeClientExecution(request); return executeDescribeCacheSubnetGroups(request); }
java
public ServiceFuture<TaskInner> updateAsync(String resourceGroupName, String registryName, String taskName, TaskUpdateParameters taskUpdateParameters, final ServiceCallback<TaskInner> serviceCallback) { return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, registryName, taskName, t...
java
public EntityResult deleteEntities(final String ... guids) throws AtlasServiceException { LOG.debug("Deleting entities: {}", guids); JSONObject jsonResponse = callAPIWithRetries(API.DELETE_ENTITIES, null, new ResourceCreator() { @Override public WebResource createResource() { ...
python
def _merge_fastqc(samples): """ merge all fastqc samples into one by module """ fastqc_list = collections.defaultdict(list) seen = set() for data in samples: name = dd.get_sample_name(data) if name in seen: continue seen.add(name) fns = glob.glob(os.pa...
python
def supports(cls, template_file=None): """ :return: Whether the engine can process given template file or not. """ if anytemplate.compat.IS_PYTHON_3: cls._priority = 99 return False # Always as it's not ported to python 3. return super(Engine, cls).suppo...
python
def MetaField(self, name, t=None): """ Creates an instance of a metadata field of the dataset. It can be used in building expressions or conditions for projection or selection. Notice that this function is equivalent to call:: dataset["name"] If the Meta...
python
def fft_convolve(data, h, res_g = None, plan = None, inplace = False, kernel_is_fft = False, kernel_is_fftshifted = False): """ convolves data with kernel h via FFTs data should be either a numpy array or a OCLArray (see doc for fft) both data an...
java
public WxCpMessageRouterRule handler(WxCpMessageHandler handler, WxCpMessageHandler... otherHandlers) { this.handlers.add(handler); if (otherHandlers != null && otherHandlers.length > 0) { for (WxCpMessageHandler i : otherHandlers) { this.handlers.add(i); } } return this; }
python
def ramping_values(period=360): """ Provides an infinite source of values representing a triangle wave (from 0 to 1 and back again) which repeats every *period* values. For example, to pulse an LED once a second:: from gpiozero import PWMLED from gpiozero.tools import ramping_values ...
java
public static int getHour(Date date) { Calendar c = Calendar.getInstance(); c.setTime(date); return c.get(Calendar.HOUR_OF_DAY); }
java
public synchronized void dequeue() throws IOException { final int length = byteDiskQueue.dequeueInt(); buffer.size(length); byteDiskQueue.dequeue(buffer.elements(), 0, length); size--; }
java
public static int getSingleCodePoint(CharSequence s) { if (s == null || s.length() == 0) { return -1; } else if (s.length() == 1) { return s.charAt(0); } else if (s.length() > 2) { return -1; } // at this point, len = 2 int cp = Charac...
python
def expand_requirement(request, paths=None): """Expands a requirement string like 'python-2.*', 'foo-2.*+<*', etc. Wildcards are expanded to the latest version that matches. There is also a special wildcard '**' that will expand to the full version, but it cannot be used in combination with '*'. W...
python
def send_notification(*, subsystem, recipients, subject, body_html, body_text): """Method to send a notification. A plugin may use only part of the information, but all fields are required. Args: subsystem (`str`): Name of the subsystem originating the notification recipients (`list` of :obj:`N...
java
@Nullable public UserDataObject confirmUploadedFile (@Nullable final String sFieldName) { return m_aRWLock.writeLocked ( () -> { if (StringHelper.hasText (sFieldName)) { // Remove an eventually existing old UDO final TemporaryUserDataObject aUDO = m_aMap.remove (sFieldName); ...
python
def create(self, path: str, k: int = 20): """ Create from a scored lexicon file (fast_align format) using vocab from a trained Sockeye model. :param path: Path to lexicon file. :param k: Number of target entries per source to keep. """ self.lex = np.zeros((len(self.vocab...
java
public static void checkForEqualDimensions(ArrayND a0, ArrayND a1) { if (a0.getSize().getSize() != a1.getSize().getSize()) { throw new IllegalArgumentException( "Arrays have different dimensions: "+a0.getSize().getSize()+ " and "+a1.getSize().getSize...
python
def filter_arrange_nodes(nodes: List[ast.stmt], max_line_number: int) -> List[ast.stmt]: """ Finds all nodes that are before the ``max_line_number`` and are not docstrings or ``pass``. """ return [ node for node in nodes if node.lineno < max_line_number and not isinstance(node, ast.Pass) ...
java
public StartPoint value(Object value) { StartExpression sx = (StartExpression)this.astNode; sx.getPropertyOrQuery().setPropertyValue(value); StartPoint ret = new StartPoint(sx); return ret; }
java
public ServiceFuture<AssetInner> createOrUpdateAsync(String resourceGroupName, String accountName, String assetName, AssetInner parameters, final ServiceCallback<AssetInner> serviceCallback) { return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, assetName, par...
python
def create_release_vcs(path, vcs_name=None): """Return a new release VCS that can release from this source path.""" from rez.plugin_managers import plugin_manager vcs_types = get_release_vcs_types() if vcs_name: if vcs_name not in vcs_types: raise ReleaseVCSError("Unknown version con...
python
def ILIKE(pattern): """Unix shell-style wildcards. Case-insensitive""" return P(lambda x: fnmatch.fnmatch(x.lower(), pattern.lower()))
python
def ckw01(handle, begtim, endtim, inst, ref, avflag, segid, nrec, sclkdp, quats, avvs): """ Add a type 1 segment to a C-kernel. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ckw01_c.html :param handle: Handle of an open CK file. :type handle: int :param begtim: The beginnin...
python
def convert_pnm(self, infile, outfile): """ Convert a PNM file containing raw pixel data into a PNG file with the parameters set in the writer object. Works for (binary) PGM, PPM, and PAM formats. """ if self.interlace: pixels = array('B') pixels...
python
def get(key, default=-1): """Backport support for original codes.""" if isinstance(key, int): return LinkType(key) if key not in LinkType._member_map_: extend_enum(LinkType, key, default) return LinkType[key]
python
def _register_attribute(self, did, checksum, value, account, providers): """Register an DID attribute as an event on the block chain. :param did: 32 byte string/hex of the DID :param checksum: checksum of the ddo, hex str :param value: url for resolve the did, str :param account...
java
private void writePackageInfos( File rootDir, File outputDir ) throws MojoExecutionException { getLog().debug( "in writePackageInfos(" + rootDir + ", " + outputDir + ")" ); try { if ( shouldWritePackageInfo( rootDir ) ) { if( !outputDir.exists...
python
def get_package_formats(): """Get the list of available package formats and parameters.""" # pylint: disable=fixme # HACK: This obviously isn't great, and it is subject to change as # the API changes, but it'll do for now as a interim method of # introspection to get the parameters we need. def ...
java
public static CPDefinitionVirtualSetting removeByUUID_G(String uuid, long groupId) throws com.liferay.commerce.product.type.virtual.exception.NoSuchCPDefinitionVirtualSettingException { return getPersistence().removeByUUID_G(uuid, groupId); }
java
@Deprecated public static String getTypeName(Class<? extends Tag<?>> clazz) { return TagType.getByTagClass(clazz).getTypeName(); }
python
def find_c_file(obj_file, vpath): """ Search vpaths for the c file that matches the provided object_file. :param str obj_file: object file to find the matching c file for :param List[str] vpath: List of base paths, similar to gcc vpath :return: str path to c file or None """ c_file = None r...
python
def unprefix(self, path): """Remove the self.prefix_ (if present) from a path or list of paths""" path = self.strip(path) if isinstance(path, six.string_types): path = path[len(self.prefix_):] if path.startswith(self.prefix_) else path path = path[1:] if path.startswith(s...
java
public V get (long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { return _sync.innerGet(unit.toNanos(timeout)); }
python
def register_blueprint(self, blueprint): ''' Register given blueprint on curren app. This method is provided for using inside plugin's module-level :func:`register_plugin` functions. :param blueprint: blueprint object with plugin endpoints :type blueprint: flask.Bluepri...
python
def get_original_vs_converted_diff( original ,converted ): ''' Compares the *original* text to *converted* text, and detects changes/differences in morphological annotations. The method constructs line-by-line comparison string, where lines are separated by newline, and '***' at the beg...
python
def increment_cell_value(self, column_family_id, column, int_value): """Increments a value in an existing cell. Assumes the value in the cell is stored as a 64 bit integer serialized to bytes. .. note:: This method adds a read-modify rule protobuf to the accumulated ...
java
public Function<Service<HttpRequest, HttpResponse>, HttpAuthService> newDecorator() { final Authorizer<HttpRequest> authorizer = authorizer(); final AuthSuccessHandler<HttpRequest, HttpResponse> successHandler = this.successHandler; final AuthFailureHandler<HttpRequest, HttpResponse> failureHand...
java
@POST @RolesAllowed("administrators") @Path("/remove-workspace/{repositoryName}/{workspaceName}/{forseSessionClose}/") public Response removeWorkspace(@Context UriInfo uriInfo, @PathParam("repositoryName") String repositoryName, @PathParam("workspaceName") String workspaceName, @PathParam("forseSessionCl...
java
@Override public void unregister(Monitor<?> monitor) { Preconditions.checkNotNull(monitor, "monitor"); try { monitors.remove(monitor); } catch (Exception e) { throw new IllegalArgumentException("invalid object", e); } }
python
def addSlider2D(sliderfunc, xmin, xmax, value=None, pos=4, s=.04, title='', c=None, showValue=True): """Add a slider widget which can call an external custom function. :param sliderfunc: external function to be called by the widget :param float xmin: lower value :param float xmax: upp...
java
public static int getPartitionForParameter(VoltType partitionType, Object invocationParameter) { return instance.get().getSecond().getHashedPartitionForParameter(partitionType, invocationParameter); }
python
def confidence_interval_min_width(mu, post, alpha=0.9): ''' Returns the minimal-width confidence interval [mu_low, mu_high] of confidence level alpha for a posterior distribution post on the parameter mu. ''' if not 0 < alpha < 1: raise ValueError("Confidence level must be in (0,1).") #...
python
def get_context(self): """ Context sent to templates for rendering include the form's cleaned data and also the current Request object. """ if not self.is_valid(): raise ValueError("Cannot generate Context when form is invalid.") return dict(request=self.reque...
python
def add_item(self, text, font=("default", 12, "bold"), backgroundcolor="yellow", textcolor="black", highlightcolor="blue"): """ Add a new item on the Canvas. :param text: text to display :type text: str :param font: font of the text :type font: t...
python
def add_exec_to_user( self, name, env, command, args, **attrs ): """Add an exec option to your user.""" # Add exec option. exec_options = { 'command': command, 'env': env, 'args': args, } ...
java
protected AstEval eval(boolean required, boolean deferred) throws ScanException, ParseException { AstEval v = null; Symbol start_eval = deferred ? START_EVAL_DEFERRED : START_EVAL_DYNAMIC; if (token.getSymbol() == start_eval) { consumeToken(); v = new AstEval(expr(true), deferred); consumeToken(END_EVAL)...
java
private static List<BuiltInQProfile> reduceBuiltInQualityProfiles(Context context) throws SQLException { ListMultimap<String, BuiltInQProfile> builtInQPByLanguages = ArrayListMultimap.create(); List<BuiltInQProfile> builtInQProfiles = context.prepareSelect("SELECT kee, language, name FROM rules_profiles WHERE ...
python
def from_dict(self, data, recursive=1): """Populate the resource from a python dict :param recursive: level of recursion for fetching resources :type recursive: int """ # Find other linked resources data = self._encode_resource(data, recursive=recursive) self.dat...
python
def update_user(self, username, profile, owner_privkey): """ Update profile_hash on blockchain """ url = self.base_url + "/users/" + username + "/update" owner_pubkey = get_pubkey_from_privkey(owner_privkey) payload = { 'profile': profile, '...
java
public IpcLogEntry withServerZone(String zone) { this.serverZone = zone; if (serverRegion == null) { serverRegion = extractRegionFromZone(zone); } return this; }
python
def insert_load_command_into_header(header, load_command): """ Inserts the given load command into the header and adjust its size. """ lc, cmd, path = load_command header.commands.append((lc, cmd, path)) header.header.ncmds += 1 header.changedHeaderSizeBy(lc.cmdsize)
java
public Serializable copy(Serializable obj) { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isDebugEnabled()) Tr.debug(tc, "copy : " + Util.identity(obj)); // ----------------------------------------------------------------------- // ...
java
public static sslpolicylabel[] get_filtered(nitro_service service, String filter) throws Exception{ sslpolicylabel obj = new sslpolicylabel(); options option = new options(); option.set_filter(filter); sslpolicylabel[] response = (sslpolicylabel[]) obj.getfiltered(service, option); return response; }
python
def parse_environs(name, parse_class=ParseResult, **defaults): """ same as parse_environ() but will also check name_1, name_2, ..., name_N and return all the found dsn strings from the environment this will look for name, and name_N (where N is 1 through infinity) in the environment, if it finds th...
python
def compute_work_statistics(self): """Computes statistics from all work pieces stored in this class.""" result = {} for v in itervalues(self.work): submission_id = v['submission_id'] if submission_id not in result: result[submission_id] = { 'completed': 0, 'num_er...
java
public static Builder addValuesToAnnotationArgument( AnnotationTree annotation, String parameterName, Collection<String> newValues, VisitorState state) { if (annotation.getArguments().isEmpty()) { String parameterPrefix = parameterName.equals("value") ? "" : (parameterName + " = "); ...
java
public ResourceFormatGenerator getGeneratorForFileExtension(final String extension) throws UnsupportedFormatException { for (final ResourceFormatGenerator generator : listGenerators()) { if (generator.getFileExtensions().contains(extension)) { return generator; } ...
python
def _is_valid_ins(self, ins_ir): """Check for instruction validity as a gadgets. """ invalid_instrs = [ ReilMnemonic.JCC, ReilMnemonic.UNDEF, ReilMnemonic.UNKN, ] return not any([i.mnemonic in invalid_instrs for i in ins_ir])
java
@Nonnull public FineUploader5Validation setAllowedExtensions (@Nullable final Collection <String> aAllowedExtensions) { m_aValidationAllowedExtensions.setAll (aAllowedExtensions); return this; }
java
void closeAllScopeModules() { synchronized (puScopes) { for (String module : puScopes.keySet()) { close(module, false); //PK59717 } puScopes.clear(); } }
java
protected synchronized void connect_event_channel(ConnectionStructure cs) throws DevFailed { // Get a reference to an EventChannel for // this device server from the tango database DeviceProxy adminDevice = DeviceProxyFactory.get( cs.channelName, cs.database.getUrl().getTangoHos...
python
def validate(self, method, *args, **kwargs): """Validate authentication and values passed to the specified method. Raises a PyCronofyValidationError on error. :param string method: Method name to check. :param *args: Arguments for "Method". :param **kwargs: Keyword arguments for...
java
private void parseStartTag(boolean xmldecl, boolean throwOnResolveFailure) throws IOException, KriptonRuntimeException { if (!xmldecl) { read('<'); } name = readName(); attributeCount = 0; while (true) { skip(); if (position >= limit && !fillBuffer(1)) { checkRelaxed(UNEXPECTED_EOF); return...
python
def restrict_to_parent(self, target, parent): """Restrict target to parent structure boundaries.""" if not (parent['start'] < target < parent['end']): target = parent['end'] return target
python
def items(self) -> Tuple[Tuple[str, "Package"], ...]: # type: ignore """ Return an iterable containing package name and corresponding `Package` instance that are available. """ item_dict = { name: self.build_dependencies.get(name) for name in self.build_dependencies ...
python
def absent(name, **kwargs): ''' This function deletes the specified repo on the system, if it exists. It is essentially a wrapper around pkg.del_repo. name The name of the package repo, as it would be referred to when running the regular package manager commands. **UBUNTU-SPECIFIC ...
java
public static void logExceptionRetrieveArchive(final Logger logger, final ArchiveDescription archive, final Exception e) { logger.logException(Level.ERROR, "Exception while accessing archive " + archive.toString(), e); }
python
def is_cursor_on_first_line(self): """Return True if cursor is on the first line""" cursor = self.textCursor() cursor.movePosition(QTextCursor.StartOfBlock) return cursor.atStart()
java
private static void replaceThis(Node expectedGetprop, Node replacement) { Node leftChild = expectedGetprop.getFirstChild(); if (leftChild.isThis()) { expectedGetprop.replaceChild(leftChild, replacement); } else { replaceThis(leftChild, replacement); } }
java
public void copyFromLocalFile(boolean delSrc, boolean overwrite, boolean validate, Path src, Path dst) throws IOException { Configuration conf = getConf(); FileUtil.copy(getLocal(conf), src, this, dst, delSrc, overwrite, validate, conf); }
java
public static <T> void mergeFrom(InputStream in, T message, Schema<T> schema, XMLInputFactory inFactory) throws IOException { XMLStreamReader parser = null; try { parser = inFactory.createXMLStreamReader(in, XML_ENCODING); mergeFrom(parser, message,...
java
public void reset() { mGestureInProgress = false; mPointerCount = 0; for (int i = 0; i < MAX_POINTERS; i++) { mId[i] = MotionEvent.INVALID_POINTER_ID; } }
java
@Override public void eSet(int featureID, Object newValue) { switch (featureID) { case AfplibPackage.FINISHING_FIDELITY__STP_FIN_EX: setStpFinEx((Integer)newValue); return; case AfplibPackage.FINISHING_FIDELITY__REP_FIN_EX: setRepFinEx((Integer)newValue); return; } super.eSet(featureID, new...
java
public synchronized void lostNodeFound(Address address) { Preconditions.checkNotNull(address, "address should not be null"); mLostNodes.remove(address); for (Runnable function : mChangeListeners) { function.run(); } }
python
def _get_minmax_edges(self, edge): ''' Updates the upper and lower depths based on the input edges ''' if isinstance(edge, Line): # For instance of line class need to loop over values depth_vals = np.array([node.depth for node in edge.points]) else: ...
python
def normalize_likes(sql): """ Normalize and wrap LIKE statements :type sql str :rtype: str """ sql = sql.replace('%', '') # LIKE '%bot' sql = re.sub(r"LIKE '[^\']+'", 'LIKE X', sql) # or all_groups LIKE X or all_groups LIKE X matches = re.finditer(r'(or|and) [^\s]+ LIKE X', sq...
java
public void recolorQuery() throws Exception { PrefixManager man = apic.getMutablePrefixManager(); String input = doc.getText(0, doc.getLength()); ImmutableList<TargetAtom> current_query = parse(input, man); if (current_query == null) { JOptionPane.showMessageDialog(null, "An error occured while pa...
java
public Extractor getExtractor() { try { this.rawSourceExtractor = getSource().getExtractor(this.taskState); boolean throttlingEnabled = this.taskState.getPropAsBoolean(ConfigurationKeys.EXTRACT_LIMIT_ENABLED_KEY, ConfigurationKeys.DEFAULT_EXTRACT_LIMIT_ENABLED); if (throttlingEnabled) { ...
python
def GroupEncoder(field_number, is_repeated, is_packed): """Returns an encoder for a group field.""" start_tag = TagBytes(field_number, wire_format.WIRETYPE_START_GROUP) end_tag = TagBytes(field_number, wire_format.WIRETYPE_END_GROUP) assert not is_packed if is_repeated: def EncodeRepeatedField(write, val...
python
def get_single_allele_from_reads(allele_reads): """ Given a sequence of AlleleRead objects, which are expected to all have the same allele, return that allele. """ allele_reads = list(allele_reads) if len(allele_reads) == 0: raise ValueError("Expected non-empty list of AlleleRead object...
java
public Integer convertStringToInteger(String value) { Integer result; try { result = Integer.valueOf(value); } catch (NumberFormatException e) { result = DEFAULT_INT_VALUE; } return result; }
python
def searchExpressionLevelsInDb( self, rnaQuantId, names=[], threshold=0.0, startIndex=0, maxResults=0): """ :param rnaQuantId: string restrict search by quantification id :param threshold: float minimum expression values to return :return an array of dictionaries,...