language
stringclasses
2 values
func_code_string
stringlengths
63
466k
python
def load_xml(self, filepath): """Loads the values of the configuration variables from an XML path.""" from os import path import xml.etree.ElementTree as ET #Make sure the file exists and then import it as XML and read the values out. uxpath = path.expanduser(filepath) if...
java
private void openCli(SessionContext context, Executor executor) { CliClient cli = null; try { cli = new CliClient(context, executor); // interactive CLI mode if (options.getUpdateStatement() == null) { cli.open(); } // execute single update statement else { final boolean success = cli.subm...
java
private void finalizeSourceMap() throws IOException { StringWriter writer = new StringWriter(); smGen.appendTo(writer, "" /* file name */); //$NON-NLS-1$ sourceMap = writer.toString(); // now add the sourcesContent field try { JSONObject obj = new JSONObject(sourceMap); JSONArray sources = (JSONA...
java
private long readLines(final RandomAccessFile reader) throws IOException { final ByteArrayOutputStream lineBuf = new ByteArrayOutputStream(64); long pos = reader.getFilePointer(); long rePos = pos; // position to re-read int num; boolean seenCR = false; // FIXME replace -...
java
public void removeComponent(Object screenField) { if (this.getNextConverter() != null) { FieldInfo field = this.getField(); this.getNextConverter().removeComponent(screenField); // **START SPECIAL CODE** This code is for a specific special case. // Thi...
python
def date_decoder(dic): """Add python types decoding. See JsonEncoder""" if '__date__' in dic: try: d = datetime.date(**{c: v for c, v in dic.items() if not c == "__date__"}) except (TypeError, ValueError): raise json.JSONDecodeError("Corrupted date format !", str(dic), 1)...
python
def metrics_asserted_pct(self): """ Return the metrics assertion coverage """ num_metrics = len(self._metrics) num_asserted = len(self._asserted) if num_metrics == 0: if num_asserted == 0: return 100 else: return 0 ...
java
@Override public CreateQualificationTypeResult createQualificationType(CreateQualificationTypeRequest request) { request = beforeClientExecution(request); return executeCreateQualificationType(request); }
python
def run_shell(cmd: str, out: Optional[Union[TeeCapture, IO[str]]] = sys.stdout, err: Optional[Union[TeeCapture, IO[str]]] = sys.stderr, raise_on_fail: bool = True, log_run_to_stderr: bool = True, **kwargs ) -> CommandOutput: """Invo...
java
public void init(EntityConfig config) { this.source = (Phrase) config.getValue(SOURCE); this.header_name = (Phrase) config.getValue(HEADER_NAME); }
java
static private Object effectiveParamValue( Map<String, Object> parameters, String paramName) { String upper = paramName.toUpperCase(); Object value = parameters.get(upper); if (value != null) { return value; } value = defaultParameters.get(upper); if (value != null) ...
java
public int compareTo(Day object) { if (object == null) throw new IllegalArgumentException("day cannot be null"); Day day = (Day)object; return localDate.compareTo(day.localDate); }
java
public static boolean branchExists(String branch, String baseUrl) { CommandLine cmdLine = new CommandLine(SVN_CMD); cmdLine.addArgument(CMD_LOG); cmdLine.addArgument(OPT_XML); addDefaultArguments(cmdLine, null, null); cmdLine.addArgument("-r"); cmdLine.addArgument("HEAD:H...
python
def as_unicode(obj, encoding=convert.LOCALE, pretty=False): """ Representing any object to <unicode> string (python2.7) or <str> string (python3.0). :param obj: any object :type encoding: str :param encoding: codec for encoding unicode strings (locale.getpreferredencoding() by ...
python
def deploy_project(): """ Deploy to the project directory in the virtualenv """ project_root = '/'.join([deployment_root(),'env',env.project_fullname,'project']) local_dir = os.getcwd() if env.verbosity: print env.host,"DEPLOYING project", env.project_fullname #Exclude a fe...
java
private <T> T mergeObjectEncodedAsGroup(T value, final Schema<T> schema) throws IOException { // if (recursionDepth >= recursionLimit) { // throw ProtobufException.recursionLimitExceeded(); // } // ++recursionDepth; if (value == null) { value = schema.new...
python
def download(link, out): """ Downloading data from websites, such as previously acquired physiological signals, is an extremely relevant task, taking into consideration that, without data, processing cannot take place. With the current function a file can be easily downloaded through the "link" input. ...
java
synchronized void closeSocket() { @Nullable SocketChannel clientChannel = this.clientChannel; if (clientChannel != null) { try { clientChannel.socket().shutdownInput(); } catch (ClosedChannelException ignored) { } catch (IOException e) { ...
java
public static <T extends MethodDescription> ElementMatcher.Junction<T> takesGenericArguments(Type... type) { return takesGenericArguments(new TypeList.Generic.ForLoadedTypes(type)); }
python
def attachIterator(self, login, tableName, setting, scopes): """ Parameters: - login - tableName - setting - scopes """ self.send_attachIterator(login, tableName, setting, scopes) self.recv_attachIterator()
java
public static <T extends Object> T[] insert (T[] values, T value, int index) { @SuppressWarnings("unchecked") T[] nvalues = (T[])Array.newInstance(values.getClass().getComponentType(), values.length+1); if (index > 0) { System.arraycopy(values, 0, nvalues, 0, index); } ...
java
public List<NamedAttributeNode<NamedEntityGraph<T>>> getAllNamedAttributeNode() { List<NamedAttributeNode<NamedEntityGraph<T>>> list = new ArrayList<NamedAttributeNode<NamedEntityGraph<T>>>(); List<Node> nodeList = childNode.get("named-attribute-node"); for(Node node: nodeList) { Nam...
python
def load_import_keychain( cls, working_dir, namespace_id ): """ Get an import keychain from disk. Return None if it doesn't exist. """ # do we have a cached one on disk? cached_keychain = os.path.join(working_dir, "%s.keychain" % namespace_id) if os.path.ex...
python
def build_pwm(): """ Builds source with Python 2.7 and 3.2, and tests import """ with cd("/tmp/source/c_pwm"): test = "import _PWM; print(_PWM.VERSION)" run("make py2.7") run('sudo python2.7 -c "%s"' % test) run("cp _PWM.so ../RPIO/PWM/") run("mv _PWM.so ../RPIO/PWM/_PWM2...
python
def HandleExceptionsAndRebuildHttpConnections(retry_args): """Exception handler for http failures. This catches known failures and rebuilds the underlying HTTP connections. Args: retry_args: An ExceptionRetryArgs tuple. """ # If the server indicates how long to wait, use that value. Otherwi...
java
@Override public Tensor forward() { Tensor x = modInX.getOutput(); y = new Tensor(x); // copy y.exp(); return y; }
java
@SubscribeEvent public void onGetCollisionBoxes(GetCollisionBoxesEvent event) // public void getCollisionBoxes(World world, AxisAlignedBB mask, List<AxisAlignedBB> list, Entity entity) { //no mask, no need to check for collision if (event.getAabb() == null) return; for (Chunk chunk : ChunkBlockHandler.getA...
java
@Override public void internalWrite(Server server, Query query, ImmutableList<Result> results) throws Exception { String gatewayMessage = getGatewayMessage(results); // message won't be returned if there are no numeric values in the query results if (gatewayMessage != null) { logger.info(gatewayMessage); ...
java
static long limitExpiryToMaxLinger(long now, long _maxLinger, long _requestedExpiryTime, boolean _sharpExpiryEnabled) { if (_sharpExpiryEnabled && _requestedExpiryTime > ExpiryPolicy.REFRESH && _requestedExpiryTime < ExpiryPolicy.ETERNAL) { _requestedExpiryTime = -_requestedExpiryTime; } return Expiry...
python
def delete(self, cartname): """ `cartname` - name of the cart to delete Delete a cart both from your local filesystem and the mongo database """ cart = juicer.common.Cart.Cart(cart_name=cartname) cart.implode(self._defaults['start_in'])
java
public void setColor(final Color COLOR) { if (null == color) { _color = COLOR; fireSectionEvent(UPDATE_EVENT); } else { color.set(COLOR); } }
java
public FilterSpec addExpression(FilterSpec expr) { if (expressions == null) { expressions = new ArrayList<>(); } expressions.add((FilterSpec) expr); return this; }
java
@Override public void topPosition(BaseCell cell) { if (cell != null) { int pos = mGroupBasicAdapter.getComponents().indexOf(cell); if (pos > 0) { VirtualLayoutManager lm = getLayoutManager(); View view = lm.findViewByPosition(pos); if (...
python
def rollback(): """ Rolls back to previous release """ init_tasks() run_hook("before_rollback") # Remove current version current_release = paths.get_current_release_path() if current_release: env.run("rm -rf %s" % current_release) # Restore previous version old_releas...
python
def match(self, item): """ Return True if filter matches item. """ val = getattr(item, self._name) or False return bool(val) is self._value
python
def __looks_like_html(response): """Guesses entity type when Content-Type header is missing. Since Content-Type is not strictly required, some servers leave it out. """ text = response.text.lstrip().lower() return text.startswith('<html') or text.startswith('<!doctype')
python
def _get_weight_size(self, data, n_local_subj): """Calculate the size of weight for this process Parameters ---------- data : a list of 2D array, each in shape [n_voxel, n_tr] The fMRI data from multi-subject. n_local_subj : int Number of subjects alloc...
java
private static <T extends MPBase> JsonObject generatePayload(HttpMethod httpMethod, T resource) { JsonObject payload = null; if (httpMethod.equals(HttpMethod.POST) || (httpMethod.equals(HttpMethod.PUT) && resource._lastKnownJson == null)) { payload = MPCoreUtils.getJsonFromRe...
python
def as_dict(self): """ Json-serializable dict representation of COHP. """ d = {"@module": self.__class__.__module__, "@class": self.__class__.__name__, "are_coops": self.are_coops, "efermi": self.efermi, "energies": self.energies.tolist...
java
private void readObject(java.io.ObjectInputStream s) throws IOException, ClassNotFoundException { // Read in the length, threshold, and loadfactor s.defaultReadObject(); // Read the original length of the array and number of elements int origlength = s.readInt(); int elements = s.readInt(...
python
def set_inode(self, ino): # type: (inode.Inode) -> None ''' A method to set the Inode associated with this El Torito Entry. Parameters: ino - The Inode object corresponding to this entry. Returns: Nothing. ''' if not self._initialized: ...
java
private static StateUpdater createCheck(Cursor cursor, SelectorModel model, AtomicReference<StateUpdater> start) { return (extrp, current) -> { if (model.isEnabled() && cursor.getClick() == 0) { return start.get(); } return current; ...
python
def get_offset(self, x, y): """ Computes how far away and at what angle a coordinate is located. Distance is returned in feet, angle is returned in degrees :returns: distance,angle offset of the given x,y coordinate ....
python
def read_tcp(self, length): """Read Transmission Control Protocol (TCP). Structure of TCP header [RFC 793]: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...
java
public void generateArchetypesFromGitRepoList(File file, File outputDir, List<String> dirs) throws IOException { File cloneParentDir = new File(outputDir, "../git-clones"); if (cloneParentDir.exists()) { Files.recursiveDelete(cloneParentDir); } Properties properties = new Pr...
python
def com_google_fonts_check_name_license_url(ttFont, familyname): """"License URL matches License text on name table?""" from fontbakery.constants import PLACEHOLDER_LICENSING_TEXT LEGACY_UFL_FAMILIES = ["Ubuntu", "UbuntuCondensed", "UbuntuMono"] LICENSE_URL = { 'OFL.txt': 'http://scripts.sil.org/OFL', '...
python
def T(self): """ Looks for the temperature in the catalogue, if absent it calculates it using calcTemperature() :return: planet temperature """ paramTemp = self.getParam('temperature') if not paramTemp is np.nan: return paramTemp elif ed_params.estimateMissi...
java
private void writeText(String value) { if(this.rtfParser.isNewGroup()) { this.rtfDoc.add(new RtfDirectContent("{")); this.rtfParser.setNewGroup(false); } if(value.length() > 0) { this.rtfDoc.add(new RtfDirectContent(value)); } }
python
def _getbugs(self, idlist, permissive, include_fields=None, exclude_fields=None, extra_fields=None): """ Return a list of dicts of full bug info for each given bug id. bug ids that couldn't be found will return None instead of a dict. """ oldidlist = idlist id...
python
def _fake_setqualifier(self, namespace, **params): """ Implements a server responder for :meth:`pywbem.WBEMConnection.SetQualifier`. Create or modify a qualifier declaration in the local repository of this class. This method will create a new namespace for the qualifier ...
python
def is_feasible_i(self, x, i): """return True if value ``x`` is in the invertible domain of variable ``i`` """ lb = self._lb[self._index(i)] ub = self._ub[self._index(i)] al = self._al[self._index(i)] au = self._au[self._index(i)] return lb - al < x < ub ...
java
public void removeConverter(final TypeConverter tc) { if (tc.getSupportedTypes() == null) { untypedTypeEncoders.remove(tc); registeredConverterClasses.remove(tc.getClass()); } else { for (final Entry<Class, List<TypeConverter>> entry : tcMap.entrySet()) { ...
python
def __user_location(__pkg: str, type_) -> str: """Utility function to look up XDG basedir locations Args: __pkg: Package name __type: Location type """ if ALLOW_DARWIN and sys.platform == 'darwin': user_dir = '~/Library/{}'.format(__LOCATIONS[type_][0]) else: user_di...
java
public static BookmarkablePageLink<String> newBookmarkablePageLink(final String linkId, final Class<? extends Page> pageClass, final String labelId, final String resourceModelKey, final Object[] parameters, final String defaultValue, final Component component) { return newBookmarkablePageLink(linkId, pageCla...
python
def _process_input_seed(seed_photon_fields): """ take input list of seed_photon_fields and fix them into usable format """ Tcmb = 2.72548 * u.K # 0.00057 K Tfir = 30 * u.K ufir = 0.5 * u.eV / u.cm ** 3 Tnir = 3000 * u.K unir = 1.0 * u.eV / u.cm ** 3 ...
java
public Elements not(String query) { Elements out = Selector.select(query, this); return Selector.filterOut(this, out); }
python
def get_cpu_cores_per_run(coreLimit, num_of_threads, my_cgroups, coreSet=None): """ Calculate an assignment of the available CPU cores to a number of parallel benchmark executions such that each run gets its own cores without overlapping of cores between runs. In case the machine has hyper-threading...
java
public <OUT> DataStreamSource<OUT> readFile(FileInputFormat<OUT> inputFormat, String filePath) { return readFile(inputFormat, filePath, FileProcessingMode.PROCESS_ONCE, -1); }
java
public void execute() throws MojoExecutionException, MojoFailureException { if (skip) { getLog().info("Skipping format check"); return; } if ("pom".equals(packaging)) { getLog().info("Skipping format check: project uses 'pom' packaging"); return; } if (skipSortingImports) { ...
java
public Observable<CertificateBundle> mergeCertificateAsync(String vaultBaseUrl, String certificateName, List<byte[]> x509Certificates) { return mergeCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, x509Certificates).map(new Func1<ServiceResponse<CertificateBundle>, CertificateBundle>() { ...
java
private long numDepthWiseParams(SeparableConvolution2D layerConf) { int[] kernel = layerConf.getKernelSize(); val nIn = layerConf.getNIn(); val depthMultiplier = layerConf.getDepthMultiplier(); return nIn * depthMultiplier * kernel[0] * kernel[1]; }
java
private StringBuffer generateReport() throws Exception { Graph[] gs = browser.getGraphs(); StringBuffer result = new StringBuffer(); Hashtable stats=new Hashtable(); for (int k = 0; k < gs.length; k++) { Graph g = gs[k]; this.generateADiagramReport(stats,g); } Object[] keys=new Vector(stats.keySet())....
java
public Collection<BeanRule> getBeanRules() { Collection<BeanRule> idBasedBeanRules = beanRuleRegistry.getIdBasedBeanRules(); Collection<Set<BeanRule>> typeBasedBeanRules = beanRuleRegistry.getTypeBasedBeanRules(); Collection<BeanRule> configurableBeanRules = beanRuleRegistry.getConfigurableBeanR...
java
public static byte[] toByteArray(String string, ProcessEngine processEngine) { ProcessEngineConfigurationImpl processEngineConfiguration = ((ProcessEngineImpl) processEngine).getProcessEngineConfiguration(); Charset charset = processEngineConfiguration.getDefaultCharset(); return string.getBytes(charset); ...
java
public void setEnabled(boolean isEnabled) { mCardNumberEditText.setEnabled(isEnabled); mExpiryDateEditText.setEnabled(isEnabled); mCvcNumberEditText.setEnabled(isEnabled); }
java
@SuppressWarnings("unchecked") public <V3, M4, C, N, Q> C getDiffuseColor( AiWrapperProvider<V3, M4, C, N, Q> wrapperProvider) { Property p = getProperty(PropertyKey.COLOR_DIFFUSE.m_key); if (null == p || null == p.getData()) { Object def = m_defaults.get(Pr...
python
def get_exception(): """Return full formatted traceback as a string.""" trace = "" exception = "" exc_list = traceback.format_exception_only( sys.exc_info()[0], sys.exc_info()[1] ) for entry in exc_list: exception += entry tb_list = traceback.format_tb(sys.exc_info()[2]) ...
java
public static JsonNode toJson(Object obj, ClassLoader classLoader) { return SerializationUtils.toJson(obj, classLoader); }
java
public boolean stream(int bufferId) { int frames = sectionSize; boolean reset = false; boolean more = true; if (frames > songDuration) { frames = songDuration; reset = true; } ibxm.get_audio(data, frames); bufferData.clear(); bufferData.put(data); bufferData.limit(frames * 4); if (res...
java
public QualifiedName enclosingType() { checkState(!isTopLevel(), "Cannot return enclosing type of top-level type"); return new QualifiedName(packageName, simpleNames.subList(0, simpleNames.size() - 1)); }
python
def serial_number(self): """Return the serial number of the printer.""" try: return self.data.get('identity').get('serial_num') except (KeyError, AttributeError): return self.device_status_simple('')
java
public void close() throws IOException { if (kids != null) { for (RecordReader<K,? extends Writable> rr : kids) { rr.close(); } } if (jc != null) { jc.close(); } }
java
public Path getAuditFilePath() { StringBuilder auditFileNameBuilder = new StringBuilder(); auditFileNameBuilder.append("P=").append(auditMetadata.getPhase()).append(FILE_NAME_DELIMITTER).append("C=") .append(auditMetadata.getCluster()).append(FILE_NAME_DELIMITTER).append("E=") .append(auditMetad...
python
def _call(self, x, out=None): """Implement ``self(x[, out])``.""" if out is None: return self.operator(self.scalar * x) else: if self.__tmp is not None: tmp = self.__tmp else: tmp = self.domain.element() tmp.lincomb(...
python
def eval_adiabatic_limit(YABFGN, Ytilde, P0): """Compute the limiting SLH model for the adiabatic approximation Args: YABFGN: The tuple (Y, A, B, F, G, N) as returned by prepare_adiabatic_limit. Ytilde: The pseudo-inverse of Y, satisfying Y * Ytilde = P0. P0: The projector o...
python
def report_again(self, current_status): """Computes a sleep interval, sleeps for the specified amount of time then kicks off another status report. """ # calculate sleep interval based on current status and configured interval _m = {'playing': 1, 'paused': 2, 'stopped': 5}[curren...
python
def humanize_size(size): """Create a nice human readable representation of the given number (understood as bytes) using the "KiB" and "MiB" suffixes to indicate kibibytes and mebibytes. A kibibyte is defined as 1024 bytes (as opposed to a kilobyte which is 1000 bytes) and a mibibyte is 1024**2 bytes (as...
java
protected void rehash(KType[] fromKeys, VType[] fromValues) { assert fromKeys.length == fromValues.length && HashContainers.checkPowerOfTwo(fromKeys.length - 1); // Rehash all stored key/value pairs into the new buffers. final KType[] keys = Intrinsics.<KType[]> cast(this.keys); final VT...
python
def is_pickle_file(abspath): """Parse file extension. - *.pickle: uncompressed, utf-8 encode pickle file - *.gz: compressed, utf-8 encode pickle file """ abspath = abspath.lower() fname, ext = os.path.splitext(abspath) if ext in [".pickle", ".pk", ".p"]: is_pickle = True eli...
python
def p_lexical_var_list(p): '''lexical_var_list : lexical_var_list COMMA AND VARIABLE | lexical_var_list COMMA VARIABLE | AND VARIABLE | VARIABLE''' if len(p) == 5: p[0] = p[1] + [ast.LexicalVariable(p[4], True, lineno=p.lineno(2))] ...
java
public void free() { if (handle != 0L) { Log.d(LogDomain.REPLICATOR, "handle: " + handle); Log.d( LogDomain.REPLICATOR, "replicatorContext: " + replicatorContext + " $" + replicatorContext.getClass()); Log.d( LogDomain.REPLICATO...
java
@Override public T validate(T wert) { if (!isValid(wert)) { throw new InvalidLengthException(Objects.toString(wert), min, max); } return wert; }
java
private boolean hasOverriddenNativeProperty(String propertyName) { if (isNativeObjectType()) { return false; } JSType propertyType = getPropertyType(propertyName); ObjectType nativeType = isFunctionType() ? registry.getNativeObjectType(JSTypeNative.FUNCTION_PROTOTYPE) ...
java
public OvhTask organizationName_service_exchangeService_mailingList_POST(String organizationName, String exchangeService, OvhMailingListDepartRestrictionEnum departRestriction, String displayName, Boolean hiddenFromGAL, OvhMailingListJoinRestrictionEnum joinRestriction, String mailingListAddress, Long maxReceiveSize, L...
java
@Override public Exception isCorrect (final ProtocolDataUnit protocolDataUnit) { final AbstractMessageParser parser = protocolDataUnit.getBasicHeaderSegment().getParser(); if (parser instanceof DataInParser) { final DataInParser dataParser = (DataInParser) parser; try { ...
java
public Genomics fromApiKey(String apiKey) { Preconditions.checkNotNull(apiKey); return fromApiKey(getGenomicsBuilder(), apiKey).build(); }
python
def delete(self): """Delete this cluster. For example: .. literalinclude:: snippets.py :start-after: [START bigtable_delete_cluster] :end-before: [END bigtable_delete_cluster] Marks a cluster and all of its tables for permanent deletion in 7 days. Imme...
java
private void completeEnclosing(ClassSymbol c) { if (c.owner.kind == PCK) { Symbol owner = c.owner; for (Name name : Convert.enclosingCandidates(Convert.shortName(c.name))) { Symbol encl = owner.members().lookup(name).sym; if (encl == null) ...
python
def stop_broadcast(self, broadcast_id): """ Use this method to stop a live broadcast of an OpenTok session :param String broadcast_id: The ID of the broadcast you want to stop :rtype A Broadcast object, which contains information of the broadcast: id, sessionId projectId, creat...
python
def click_event(self, event): """ Execute the 'on_click' method of this module with the given event. """ # we can prevent request that a refresh after the event has happened # by setting this to True. Modules should do this via # py3.prevent_refresh() self.preven...
java
@Override public CommerceDiscount findByLtD_S_Last(Date displayDate, int status, OrderByComparator<CommerceDiscount> orderByComparator) throws NoSuchDiscountException { CommerceDiscount commerceDiscount = fetchByLtD_S_Last(displayDate, status, orderByComparator); if (commerceDiscount != null) { return ...
python
def p_arglist(self, tree): ''' V ::= arglist ( V , V )''' if type(tree[0].value) == type([]): tree.value = tree[0].value + [tree[2].value] else: tree.value = [tree[0].value, tree[2].value] try: tree.svalue = "%s,%s"%(tree[0].svalue,tree[2].svalu...
python
def main(): """ NAME download_magic.py DESCRIPTION unpacks a magic formatted smartbook .txt file from the MagIC database into the tab delimited MagIC format txt files for use with the MagIC-Py programs. SYNTAX download_magic.py command line options] INPUT ta...
java
public final IonTextWriterBuilder withLstMinimizing(LstMinimizing minimizing) { IonTextWriterBuilder b = mutable(); b.setLstMinimizing(minimizing); return b; }
java
public HierarchicalProperty getProperty(String name) throws RepositoryException { for (HierarchicalProperty p : properties) { if (p.getStringName().equals(name)) return p; } return null; // if ("jcr:primaryType".equals(name) || "jcr:mixinTypes".equals(name) || ...
python
def handle_or_else(self, orelse, test): """Handle the orelse part of an if or try node. Args: orelse(list[Node]) test(Node) Returns: The last nodes of the orelse branch. """ if isinstance(orelse[0], ast.If): control_flow_node = se...
java
void rotate(Collection<AtomPair> pairs) { // bond has already been tried in this phase so // don't need to test again Set<IBond> tried = new HashSet<>(); Pair: for (AtomPair pair : pairs) { for (IBond bond : pair.bndAt) { // only try each bond once ...
java
private String getRequestBody(ServletRequest request) throws IOException { final StringBuilder sb = new StringBuilder(); String line = request.getReader().readLine(); while (null != line) { sb.append(line); line = request.getReader().readLine(); } retur...
java
public String getProperty(String key, String defaultValue) { String property = configProperties.getProperty(key, defaultValue); if (property != null) { property = property.trim(); } return property; }
python
def _get_param_values(self, name): """ Return the parameter by name as stored on the protocol agent payload. This loads the data from the local cache versus having to query the SMC for each parameter. :param str name: name of param :rtype: dict """ ...