language
stringclasses
2 values
func_code_string
stringlengths
63
466k
python
def command_canonize(string, vargs): """ Print the canonical representation of the given string. It will replace non-canonical compound characters with their canonical synonym. :param str string: the string to act upon :param dict vargs: the command line arguments """ try: ipa...
java
protected static void fireArrayEndEvent( JsonConfig jsonConfig ) { if( jsonConfig.isEventTriggeringEnabled() ){ for( Iterator listeners = jsonConfig.getJsonEventListeners() .iterator(); listeners.hasNext(); ){ JsonEventListener listener = (JsonEventListener) listeners.next(); ...
python
def _set_get_vnetwork_dvs(self, v, load=False): """ Setter method for get_vnetwork_dvs, mapped from YANG variable /brocade_vswitch_rpc/get_vnetwork_dvs (rpc) If this variable is read-only (config: false) in the source YANG file, then _set_get_vnetwork_dvs is considered as a private method. Backends ...
java
public static List<int[]> longestCommonSubsequence(String s0, String s1) { int[][] lengths = new int[s0.length() + 1][s1.length() + 1]; for (int i = 0; i < s0.length(); i++) for (int j = 0; j < s1.length(); j++) if (s0.charAt(i) == (s1.charAt(j))) lengths[...
python
def julianDay(year, month, day): "returns julian day=day since Jan 1 of year" hr = 12 #make sure you fall into right day, middle is save t = time.mktime((year, month, day, hr, 0, 0.0, 0, 0, -1)) julDay = time.localtime(t)[7] return julDay
java
public void populateMaps(){ this.elementName2Element = new HashMap<String, Element>(); this.isotopeName2Isotope = new HashMap<String, Isotope>(); if(this.element != null){ for(Element e:this.element){ this.elementName2Element.put(e.getName(), e); if(e.getIsotopes() != null){ for(Isotope i:e.getIso...
java
@Trace(dispatcher = true) public void updateRecord(Long recordId, Long domainId, String name, String content) throws GloboDnsException { NewRelic.setTransactionName(null, "/globodns/updateRecord"); if (recordId == null) { throw new GloboDnsException("Record id cannot be null"); } Record record = new Reco...
java
public double sim(DoubleVector v1, DoubleVector v2) { double dotProduct = VectorMath.dotProduct(v1, v2); return Math.pow(dotProduct + 1, degree); }
java
@Deprecated public boolean skeletonsAreSimilar(String id, String skeleton) { if (id.equals(skeleton)) { return true; // fast path } // must clone array, make sure items are in same order. TreeSet<String> parser1 = getSet(id); TreeSet<String> parser2 = getSet(skele...
python
def delta_unaccelerated(self): """The relative delta of the unaccelerated motion vector of the current event. For gesture events that are not of type :attr:`~libinput.constant.EventType.GESTURE_SWIPE_UPDATE` or :attr:`~libinput.constant.EventType.GESTURE_PINCH_UPDATE`, this property raises :exc:`AttributeE...
java
public Long toLong() { Long value; value = Long.valueOf(this.isNeg ? Long.parseLong(this.param)*-1 : Long.parseLong(this.param)); return value; }
python
def terminal(self, out=None, border=None): """\ Serializes the sequence of QR Codes as ANSI escape code. See :py:meth:`QRCode.terminal()` for details. """ for qrcode in self: qrcode.terminal(out=out, border=border)
python
def rndstr(size=16): """ Returns a string of random ascii characters or digits :param size: The length of the string :return: string """ _basech = string.ascii_letters + string.digits return "".join([rnd.choice(_basech) for _ in range(size)])
python
def isServiceNameAvailable(self, name, serviceType): """ Checks to see if a given service name and type are available for publishing a new service. true indicates that the name and type is not found in the organization's servi...
python
def distinct(self, distinct_fields=None): """ Returns the DISTINCT rows matched by this query. distinct_fields default to the partition key fields if not specified. *Note: distinct_fields must be a partition key or a static column* .. code-block:: python class Aut...
python
def shorten_go_name_ptbl1(self, name): """Shorten GO name for tables in paper.""" if self._keep_this(name): return name name = name.replace("negative", "neg.") name = name.replace("positive", "pos.") name = name.replace("response", "rsp.") name = name.replace(...
python
def _combine_ngrams(ngrams, joiner) -> str: """Construct keys for checking in trie""" if isinstance(ngrams, str): return ngrams else: combined = joiner.join(ngrams) return combined
python
def addGeneTargetingReagent( self, reagent_id, reagent_label, reagent_type, gene_id, description=None): """ Here, a gene-targeting reagent is added. The actual targets of this reagent should be added separately. :param reagent_id: :param reagent_label: ...
python
def _transform(self, Y, scan_onsets, beta, beta0, rho_e, sigma_e, rho_X, sigma2_X, rho_X0, sigma2_X0): """ Given the data Y and the response amplitudes beta and beta0 estimated in the fit step, estimate the corresponding X and X0. It is done by a forward-backward algor...
java
public void setExclusionPreviews(java.util.Collection<ExclusionPreview> exclusionPreviews) { if (exclusionPreviews == null) { this.exclusionPreviews = null; return; } this.exclusionPreviews = new java.util.ArrayList<ExclusionPreview>(exclusionPreviews); }
python
def interjoint_paths(self): """ Returns paths between the adjacent critical points in the skeleton, where a critical point is the set of terminal and branch points. """ paths = [] for tree in self.components(): subpaths = self._single_tree_interjoint_paths(tree) paths.extend(subp...
java
public EnvironmentConfig setTreeDupMaxPageSize(final int pageSize) throws InvalidSettingException { if (pageSize < 8 || pageSize > 128) { throw new InvalidSettingException("Invalid dup tree page size: " + pageSize); } return setSetting(TREE_DUP_MAX_PAGE_SIZE, pageSize); }
java
public void setEntitlements(java.util.Collection<ListedEntitlement> entitlements) { if (entitlements == null) { this.entitlements = null; return; } this.entitlements = new java.util.ArrayList<ListedEntitlement>(entitlements); }
java
public Set<String> getKeyList() throws IOException { if (!closed) { close(); } return new HashSet<>(Arrays.asList(keyList)); }
python
def visit_Compound(self, node): """Visitor for `Compound` AST node.""" self.memory.append_scope() for child in node.children: return_value = self.visit(child) if isinstance(child, ReturnStatement): return return_value if isinstance(child, (If...
java
@Override public boolean logModified(Logger log) { if (_dependencyList.logModified(log)) { return true; } else if (isModified()) { log.info(this + " has modified jar files"); return true; } else { return false; } }
python
def contains_offset(self, offset): """Check whether the section contains the file offset provided.""" if self.PointerToRawData is None: # bss and other sections containing only uninitialized data must have 0 # and do not take space in the file return False ...
python
def _precesion(date): """Precession in degrees """ t = date.change_scale('TT').julian_century zeta = (2306.2181 * t + 0.30188 * t ** 2 + 0.017998 * t ** 3) / 3600. theta = (2004.3109 * t - 0.42665 * t ** 2 - 0.041833 * t ** 3) / 3600. z = (2306.2181 * t + 1.09468 * t ** 2 + 0.018203 * t ** 3) ...
python
def weak_scaling(timing_stats, scaling_var, data_points): """ Generate data for plotting weak scaling. The data points keep a constant amount of work per processor for each data point. Args: timing_stats: the result of the generate_timing_stats function scaling_var: the variable to sel...
java
public void failIfDenied(ModelNode operation) throws OperationFailedException { failIfDenied(operation, PathAddress.pathAddress(operation.get(OP_ADDR))); }
java
static InetSocketAddress getNameNodeAddress(Configuration conf, String cname, String rpcKey, String cname2) { String fs = conf.get(cname); String fs1 = conf.get(rpcKey); String fs2 = conf.get(cname2); Configuration newconf = new Configuration(conf); ...
python
def is_int(value): """Return `True` if ``value`` is an integer.""" if isinstance(value, bool): return False try: int(value) return True except (ValueError, TypeError): return False
python
def _pillar(self, load): ''' Return the pillar data for the minion ''' if any(key not in load for key in ('id', 'grains')): return False # pillar = salt.pillar.Pillar( log.debug('Master _pillar using ext: %s', load.get('ext')) pillar = salt.pillar.get_p...
python
def migrate(self, host, port, key, destination_db, timeout, copy=False, replace=False): """Atomically transfer a key from a source Redis instance to a destination Redis instance. On success th...
java
public static int writeInt(byte[] array, int offset, int v) { array[offset + 0] = (byte) (v >>> 24); array[offset + 1] = (byte) (v >>> 16); array[offset + 2] = (byte) (v >>> 8); array[offset + 3] = (byte) (v >>> 0); return SIZE_INT; }
java
public int[] getUnsignedPixelValues(short[] pixelValues) { int[] unsignedValues = new int[pixelValues.length]; for (int i = 0; i < pixelValues.length; i++) { unsignedValues[i] = getUnsignedPixelValue(pixelValues[i]); } return unsignedValues; }
java
protected NextJourney handleHtmlResponse(HtmlResponse response) { if (response.isForwardTo()) { gatherForwardRenderData(response); // not lazy to be in action transaction } if (response.isReturnAsEmptyBody()) { return createSelfContainedJourney(() -> { // to suppress rend...
python
def fast_sync_fetch(working_dir, import_url): """ Get the data for an import snapshot. Store it to a temporary path Return the path on success Return None on error """ try: fd, tmppath = tempfile.mkstemp(prefix='.blockstack-fast-sync-', dir=working_dir) except Exception, e: ...
java
public final void synpred35_InternalXbaseWithAnnotations_fragment() throws RecognitionException { // InternalXbaseWithAnnotations.g:4368:5: ( ( ( ( ruleJvmTypeReference ) ) ( ( ruleValidID ) ) ) ) // InternalXbaseWithAnnotations.g:4368:6: ( ( ( ruleJvmTypeReference ) ) ( ( ruleValidID ) ) ) {...
java
private boolean fireEventWait(WebElement webElement, Eventable eventable) throws ElementNotVisibleException, InterruptedException { switch (eventable.getEventType()) { case click: try { webElement.click(); } catch (ElementNotVisibleException e) { throw e; } catch (WebDriverException e) { ...
python
def db_get_val(self, table, record, column): """ Gets values of 'column' in 'record' in 'table'. This method is corresponding to the following ovs-vsctl command:: $ ovs-vsctl get TBL REC COL """ command = ovs_vsctl.VSCtlCommand('get', (table, record, column)) ...
java
private void writeObject(ObjectOutputStream stream) throws IOException { // Construct a binary rule byte[] rules = packRules(); int[] times = packTimes(); // Convert to 1.1 FCS rules. This step may cause us to lose information. makeRulesCompatible(); // Wr...
python
def convertToProbabilityMatrix(self, Q): """ Converts the initial matrix to a probability matrix We calculate P = I + Q/l, with l the largest diagonal element. Even if Q is already a probability matrix, this step helps for numerical stability. By adding a small probability on th...
python
def has_hints(self): """ True if self provides hints on the cutoff energy. """ for acc in ["low", "normal", "high"]: try: if self.hint_for_accuracy(acc) is None: return False except KeyError: return False ...
java
public void setChartState(final List<Long> groupTargetCounts, final Long totalTargetsCount) { getState().setGroupTargetCounts(groupTargetCounts); getState().setTotalTargetCount(totalTargetsCount); markAsDirty(); }
java
public boolean get(final T paramOrigin, final T paramDestination) { assert paramOrigin != null; assert paramDestination != null; if (!mMap.containsKey(paramOrigin)) { return false; } final Boolean bool = mMap.get(paramOrigin).get(paramDestination); return boo...
java
@Override public double calculateAnomalyScore(double value) { double zScore = (value - mean) / Math.sqrt(variance); //Taking absolute value for a more human-readable anomaly score return Math.abs(zScore); }
java
private String loadfromFromFile(String queryName) throws IllegalStateException { try (final InputStream is = getClass().getResourceAsStream(scriptsFolder + queryName + ".sql");) { String sql = StringUtils.join(IOUtils.readLines(is, StandardCharsets.UTF_8), IOUtils.LINE_SEPARATOR); // Look for token...
java
@SuppressWarnings("rawtypes") public static void main(String[] args) { StringBuilder sb = new StringBuilder(); for (String arg : args) { sb.append(arg).append(" "); } LOG.info("!!!!!!!!!!!!!!!!!!!!!!!!!!!"); LOG.info("Begin to start worker:" + sb.toString()); ...
python
def _get_iam_rest_api_url_from_creds(rest_client, credentials): """Retrieves the Streams REST API URL from the provided credentials using iam authentication. Args: rest_client (:py:class:`rest_primitives._IAMStreamsRestClient`): A client for making REST calls using IAM authentication credential...
python
def lru_cache(maxsize=128, typed=False): """Decorator to wrap a function with a memoizing callable that saves up to `maxsize` results based on a Least Recently Used (LRU) algorithm. """ if maxsize is None: return _cache(_UnboundCache(), typed) else: return _cache(LRUCache(maxsiz...
java
private static void buildNestedBuckets(HashMap m, String p) { String[] components = p.split(":"); int cl = components.length; if(cl == 1) { if( ! m.containsKey(components[0]) ) m.put(components[0], new HashMap()); } else { HashMap temp = m; ...
java
public java.util.List<ChapInfo> getChapCredentials() { if (chapCredentials == null) { chapCredentials = new com.amazonaws.internal.SdkInternalList<ChapInfo>(); } return chapCredentials; }
python
def import_file(filename): """ Import a file that will trigger the population of Orca. Parameters ---------- filename : str """ pathname, filename = os.path.split(filename) modname = re.match( r'(?P<modname>\w+)\.py', filename).group('modname') file, path, desc = imp.find_m...
java
public static double[] normalizeL1(double[] vector) { // compute vector 1-norm double norm1 = 0; for (int i = 0; i < vector.length; i++) { norm1 += Math.abs(vector[i]); } if (norm1 == 0) { Arrays.fill(vector, 1.0 / vector.length); } else { for (int i = 0; i < vector.length; i++) { v...
python
def uncamel(name): """Transform CamelCase naming convention into C-ish convention.""" s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name) return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower()
java
public Entity getValues(int i) { if (Document_Type.featOkTst && ((Document_Type)jcasType).casFeat_values == null) jcasType.jcas.throwFeatMissing("values", "de.julielab.jules.types.ace.Document"); jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Document_Type)jcasType).casFeatCode_valu...
java
protected void callInvalidateFromInternalInvalidate() { if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) { LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, "callInvalidateFromInternalInvalidate", "calling this.in...
java
protected String getLogFormat() { final String[] formats = getResources().getStringArray(R.array.format_list); if (mFormat >= 0 && mFormat < formats.length) { return formats[mFormat]; } return formats[FORMAT_DEFAULT]; }
java
public synchronized AbstractXMPPConnection connect() throws SmackException, IOException, XMPPException, InterruptedException { // Check if not already connected throwAlreadyConnectedExceptionIfAppropriate(); // Reset the connection state initState(); saslAuthentication.init(); ...
python
def derivesha512address(self): """ Derive address using ``RIPEMD160(SHA512(x))`` """ pkbin = unhexlify(repr(self._pubkey)) addressbin = ripemd160(hexlify(hashlib.sha512(pkbin).digest())) return Base58(hexlify(addressbin).decode('ascii'))
java
public long getLong(String key, long defaultValue) { if (containsKey(key)) { return Long.parseLong(get(key)); } else { return defaultValue; } }
java
static void release(BufferPool.Buffer buff) throws IOException { if (buff.buf.length == staticConf.getSmallBufferSize()) { smallBufferPool.put(buff); } else if (buff.buf.length == staticConf.getMediumBufferSize()) { mediumBufferPool.put(buff); } else if (buff.buf.length == staticConf.getLargeBuf...
java
@Override public void parseHeader(String header, S sequence) { sequence.setOriginalHeader(header); sequence.setAccession(new AccessionID(accession, DataSource.GENBANK, version, identifier)); sequence.setDescription(description); sequence.setComments(comments); sequence.setReferences(references); }
java
@Override public Scan open() { // throws an exception if p is not a tableplan. TableScan ts = (TableScan) tp.open(); Index idx = ii.open(tx); return new IndexSelectScan(idx, new SearchRange(ii.fieldNames(), schema(), searchRanges), ts); }
python
def AddClient(self, client): """Adds a client to the index. Args: client: A VFSGRRClient record to add or update. """ client_id, keywords = self.AnalyzeClient(client) self.AddKeywordsForName(client_id, keywords)
python
def _validate_compute_chunk_params( self, dates, symbols, initial_workspace): """ Verify that the values passed to compute_chunk are well-formed. """ root = self._root_mask_term clsname = type(self).__name__ # Writing this out explicitly so this errors in tes...
python
def distance(latitude_1, longitude_1, latitude_2, longitude_2): """ Distance between two points. """ coef = mod_math.cos(latitude_1 / 180. * mod_math.pi) x = latitude_1 - latitude_2 y = (longitude_1 - longitude_2) * coef return mod_math.sqrt(x * x + y * y) * ONE_DEGREE
python
def traverse(self, fn=None, specs=None, full_breadth=True): """ Traverses any nested DimensionedPlot returning a list of all plots that match the specs. The specs should be supplied as a list of either Plot types or callables, which should return a boolean given the plot class. ...
java
public static SparseDoubleVector multiplyUnmodified(SparseDoubleVector a, SparseDoubleVector b) { SparseDoubleVector result = new CompactSparseVector(); int[] nonZerosA = a.getNonZeroIndices(); int[] nonZerosB = b.getNonZeroIndices(); ...
java
protected boolean setupPruneList(GrowQueue_I32 regionMemberCount) { segmentPruneFlag.resize(regionMemberCount.size); pruneGraph.reset(); segmentToPruneID.resize(regionMemberCount.size); for( int i = 0; i < regionMemberCount.size; i++ ) { if( regionMemberCount.get(i) < minimumSize ) { segmentToPruneID.set...
java
private ClassWriter generateInnerSequenceClass(String typeName, String className, String apiName) { ClassWriter classWriter = generateClass(typeName, JAVA_OBJECT, new String[] {CUSTOM_ATTRIBUTE_GROUP}, getClassSignature(new String[]{CUSTOM_ATTRIBUTE_GROUP}, typeName, apiName), ACC_PUBLIC + ACC_SUPER, apiName); ...
python
def merge_table(self,name): """Merge an existing table in the database with the __self__ table. Executes as ``'INSERT INTO __self__ SELECT * FROM <name>'``. However, this method is probably used less often than the simpler :meth:`merge`. :Arguments: name name of the ...
python
def send_faucet_coins(address_to_fund, satoshis, api_key, coin_symbol='bcy'): ''' Send yourself test coins on the bitcoin or blockcypher testnet You can see your balance info at: - https://live.blockcypher.com/bcy/ for BCY - https://live.blockcypher.com/btc-testnet/ for BTC Testnet ''' asse...
python
def export_to_bw2(self): """ Export the lcopt model in the native brightway 2 format returns name, database to use it to export, then import to brightway:: name, db = model.export_to_bw2() import brightway2 as bw bw.projects.set_current('MyProject')...
java
public void marshall(JobFlowDetail jobFlowDetail, ProtocolMarshaller protocolMarshaller) { if (jobFlowDetail == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(jobFlowDetail.getJobFlowId(), JOBFLOWID_...
java
public static Method getMethod(Class clazz, String methodName, Class<?>... parameterTypes) { if (clazz == null) { return null; } try { return clazz.getDeclaredMethod(methodName, parameterTypes); } catch (SecurityException e) { e.printStackTrace(); ...
python
def get_name_history(name, hostport=None, proxy=None, history_page=None): """ Get the full history of a name Returns {'status': True, 'history': ...} on success, where history is grouped by block Returns {'error': ...} on error """ assert hostport or proxy, 'Need hostport or proxy' if proxy ...
java
public PathMappingResultBuilder rawParam(String name, String value) { params.put(requireNonNull(name, "name"), ArmeriaHttpUtil.decodePath(requireNonNull(value, "value"))); return this; }
java
public SDVariable dot(SDVariable x, SDVariable y, int... dimensions) { return dot(null, x, y, dimensions); }
java
public void info(String format, Object... args) { if (isLoggable(INFO)) { logIt(INFO, String.format(format, args)); } }
python
def and_next(e): """ Create a PEG function for positive lookahead. """ def match_and_next(s, grm=None, pos=0): try: e(s, grm, pos) except PegreError as ex: raise PegreError('Positive lookahead failed', pos) else: return PegreResult(s, Ignore, (...
java
public void add(char ch) { if (b.length <= i) { b = ArrayUtil.grow(b, i + 1); } b[i++] = ch; }
python
def update_from_element(self, elem): """Reset this `Resource` instance to represent the values in the given XML element.""" self._elem = elem for attrname in self.attributes: try: delattr(self, attrname) except AttributeError: pass...
java
public BoundImportSection loadBoundImportSection() throws IOException { Optional<BoundImportSection> bat = maybeLoadBoundImportSection(); return (BoundImportSection) getOrThrow(bat, "unable to load bound import section"); }
java
public PyCodeBuilder append(String... codeFragments) { for (String codeFragment : codeFragments) { code.append(codeFragment); } return this; }
java
boolean getBooleanProperty(String name, boolean defaultValue) { String val = getProperty(name); if (val == null) { return defaultValue; } val = val.toLowerCase(); if (val.equals("true") || val.equals("1")) { return true; } else if (val.equals("fals...
java
public Class<?> compile(String className, String code, ClassLoader classLoader, OutputStream os, long lastModify) { code = code.trim(); try { return Class.forName(className, true, classLoader); } catch (ClassNotFoundException e) { if (!code.endsWith("}")) { ...
python
def write_data(self, variable_id, value): """ write values to the device """ i = 0 j = 0 while i < 10: try: self.inst.query('*IDN?') # logger.info("Visa-AFG1022-Write-variable_id : %s et value : %s" %(variable_id, value)) ...
python
def hasBackground(fitParams): ''' compare the height of putative bg and signal peak if ratio if too height assume there is no background ''' signal = getSignalPeak(fitParams) bg = getBackgroundPeak(fitParams) if signal == bg: return False r = signal[0] / bg[0] if r ...
java
private String calculateSearchLaunchUrl(RenderRequest request, RenderResponse response) { final HttpServletRequest httpRequest = this.portalRequestUtils.getPortletHttpRequest(request); final IPortalUrlBuilder portalUrlBuilder = this.portalUrlProvider.getPortalUrlBuilderBy...
python
def log(prefix = ''): '''Add start and stop logging messages to the function. Parameters ---------- :``prefix``: a prefix for the function name (optional) ''' function = None if inspect.isfunction(prefix): prefix, function = '', prefix def _(function): @functools.wr...
java
public Result<FindPolysAroundResult> findPolysAroundCircle(long startRef, float[] centerPos, float radius, QueryFilter filter) { // Validate input if (!m_nav.isValidPolyRef(startRef) || Objects.isNull(centerPos) || !vIsFinite(centerPos) || radius < 0 || !Float.isFinite(radi...
java
private SITransaction getContainerTransaction() throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.entry(this, TRACE, "getContainerTransaction"); } final SITransaction containerTransaction; try { // Ensure ...
java
public Delete delete(String path) { Delete command = new Delete(); command.path(path); command.version(DEFAULT_VERSION); action.setCommand(command); return command; }
java
public void setBufferSize(final int size) { // // log4j 1.2 would throw exception if size was negative // and deadlock if size was zero. // if (size < 0) { throw new java.lang.NegativeArraySizeException("size"); } synchronized (buffer) { // // don't let size be ze...
java
public GitlabNote addDiscussionNote(GitlabMergeRequest mergeRequest, int discussionId, String body) throws IOException { String tailUrl = GitlabProject.URL + "/" + mergeRequest.getProjectId() + GitlabMergeRequest.URL + "/" + mergeRequest.getIid() + GitlabDiscussion.UR...
python
def version(self): """RPM vesion string.""" stdout = Cmd.sh_e_out('{0} --version'.format(self.rpm_path)) rpm_version = stdout.split()[2] return rpm_version
java
@Override public Map<String, Object> generate(String encoding, String locale, String productExt) { Map<String, Object> returnMap; try { //keeps list of commands final ArrayList<String> commandList = new ArrayList<String>(); //Get java home final Stri...
python
def restart_required(self): """Indicates whether splunkd is in a state that requires a restart. :return: A ``boolean`` that indicates whether a restart is required. """ response = self.get("messages").body.read() messages = data.load(response)['feed'] if 'entry' not in ...