language
stringclasses
2 values
func_code_string
stringlengths
63
466k
java
protected void createTicketGrantingTicketCheckAction(final Flow flow) { val action = createActionState(flow, CasWebflowConstants.STATE_ID_TICKET_GRANTING_TICKET_CHECK, CasWebflowConstants.ACTION_ID_TICKET_GRANTING_TICKET_CHECK); createTransitionForState(action, CasWebflowConstants.TRANSITION...
java
protected void checkForCyclicDependencies(AccessControlGroup group, List<AccessControlGroup> groupList) { for (AccessControlGroup inheritedGroup : group.getInherits()) { if (groupList.contains(inheritedGroup)) { StringBuilder sb = new StringBuilder("A cyclic dependency of access control groups has be...
java
private void maybeUpdatePicker() { List<RoundRobinEntry> pickList; ConnectivityState state; switch (mode) { case ROUND_ROBIN: pickList = new ArrayList<>(backendList.size()); Status error = null; boolean hasIdle = false; for (BackendEntry entry : backendList) { ...
java
@Override public WSStepThreadExecutionAggregate getStepExecutionAggregateFromJobExecutionNumberAndStepName(long jobInstanceId, short jobExecNum, ...
python
def execute(action, io_loop=None): """Execute the given action and return a Future with the result. The ``forwards`` and/or ``backwards`` methods for the action may be synchronous or asynchronous. If asynchronous, that method must return a Future that will resolve to its result. See :py:func:`reve...
python
def match_pattern(nm, patterns): """ Compares `nm` with the supplied patterns, and returns True if it matches at least one. Patterns are standard file-name wildcard strings, as defined in the `fnmatch` module. For example, the pattern "*.py" will match the names of all Python scripts. """ ...
python
def savetostr(self, sortkey = True): """ Save configurations to a single string """ return ''.join(k + '=' + repr(v) + '\n' for k,v in self.config_items(sortkey))
java
public void startPrefixMapping(String prefix, String uri) throws org.xml.sax.SAXException { // m_nsSupport.pushContext(); // this.getNamespaceSupport().declarePrefix(prefix, uri); //m_prefixMappings.add(prefix); // JDK 1.2+ only -sc //m_prefixMappings.add(uri); // JDK 1.2+ only -sc m_pr...
python
def db(self, connection_string=None): """Gets the SQLALchemy session for this request""" connection_string = connection_string or self.settings["db"] if not hasattr(self, "_db_conns"): self._db_conns = {} if not connection_string in self._db_conns: self._db_conn...
java
@Override public long dynamicQueryCount(DynamicQuery dynamicQuery, Projection projection) { return commerceShippingFixedOptionPersistence.countWithDynamicQuery(dynamicQuery, projection); }
python
def singularity_build(script=None, src=None, dest=None, **kwargs): '''docker build command. By default a script is sent to the docker build command but you can also specify different parameters defined inu//docker-py.readthedocs.org/en/stable/api/#build ''' singularity = SoS_SingularityClient() sing...
python
async def copy_from_query(self, query, *args, output, timeout=None, format=None, oids=None, delimiter=None, null=None, header=None, quote=None, escape=None, force_quote=None, encoding=None): "...
java
@Override public ThriftServer getThriftServer(String serverName, int serverPort, TProcessor processor) { return new ThreadPoolThriftServerImpl(serverName, serverPort, thriftServerConfiguration, processor); }
java
public static List<Monomer> getListOfHandledMonomersOnlyBase(List<MonomerNotation> monomerNotations) throws HELM2HandledException, NotationException, ChemistryException{ LOG.debug("Get all bases of the rna"); List<Monomer> items = new ArrayList<Monomer>(); for (MonomerNotation monomerNotation : ...
java
public void marshall(GetGatewayResponsesRequest getGatewayResponsesRequest, ProtocolMarshaller protocolMarshaller) { if (getGatewayResponsesRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(g...
python
def plot_soma3d(ax, soma, color=None, alpha=_ALPHA): '''Generates a 3d figure of the soma. Args: ax(matplotlib axes): on what to plot soma(neurom.core.Soma): plotted soma color(str or None): Color of plotted values, None corresponds to default choice alpha(float): Transparency o...
python
def set_input(self, input_names, input_dims): """ Set the inputs of the network spec. Parameters ---------- input_names: [str] List of input names of the network. input_dims: [tuple] List of input dimensions of the network. The ordering of input_...
java
public final void store(LoadStoreParameter param) throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException { if (!initialized) { throw new KeyStoreException("Uninitialized keystore"); } keyStoreSpi.engineStore(param); }
java
public static List<MailboxNodeContent> parseMailboxContents(List<String> jsons) throws JSONException { ArrayList<MailboxNodeContent> objects = new ArrayList<MailboxNodeContent>(jsons.size()); for (String json : jsons) { MailboxNodeContent content = null; JSONObject jsObj = new JS...
python
def write_line(self, line=None, *args, **kwargs): """ Formats and writes a line to the output """ if line is None: # Empty line self.write("\n") else: # Format the line, if arguments have been given if args or kwargs: ...
python
def load_with_vocab(fin, vocab, dtype=np.float32): """ Refer to :func:`word_embedding_loader.loader.glove.load_with_vocab` for the API. """ line = next(fin) data = line.strip().split(b' ') assert len(data) == 2 size = int(data[1]) arr = np.empty((len(vocab), size), dtype=dtype) arr.f...
java
MethodDescriptor getMethodDescriptor(TypeCache.CachedType<?> cachedType, String signature) { MethodDescriptor methodDescriptor = cachedType.getMethod(signature); if (methodDescriptor == null) { if (signature.startsWith(CONSTRUCTOR_METHOD)) { methodDescriptor = scannerContext....
java
@Pure public static int compareAttrs(Attribute arg0, Attribute arg1) { if (arg0 == arg1) { return 0; } if (arg0 == null) { return 1; } if (arg1 == null) { return -1; } final String n0 = arg0.getName(); final String n1 = arg1.getName(); final int cmp = compareAttrNames(n0, n1); if (cmp ==...
python
def emit_code_from_single_match_query(match_query): """Return a MATCH query string from a list of IR blocks.""" query_data = deque([u'MATCH ']) if not match_query.match_traversals: raise AssertionError(u'Unexpected falsy value for match_query.match_traversals received: ' ...
python
def _enforce_txt_record_maxlen(key, value): ''' Enforces the TXT record maximum length of 255 characters. TXT record length includes key, value, and '='. :param str key: Key of the TXT record :param str value: Value of the TXT record :rtype: str :return: The value of the TXT record. It may...
python
def change_password(self, password): """ Change a user's password :param user: :param password: :param password_confirm: :return: """ def cb(): if not utils.is_password_valid(password): raise exceptions.AuthError("Invalid Passw...
python
def _head_length(self, port): """Distance from the center of the port to the perpendicular waypoint""" if not port: return 0. parent_state_v = self.get_parent_state_v() if parent_state_v is port.parent: # port of connection's parent state return port.port_size[1]...
java
protected void processAnimations(FragmentAnimation animation, FragmentTransaction ft) { if (animation != null) { if (animation.isCompletedAnimation()) { ft.setCustomAnimations(animation.getEnterAnim(), animation.getExitAnim(), animation.getPushInAnim(), animat...
python
def __get_global_options(cmd_line_options, conf_file_options=None): """ Get all global options :type cmd_line_options: dict :param cmd_line_options: Dictionary with all command line options :type conf_file_options: dict :param conf_file_options: Dictionary with all config file options :returns:...
python
def replicaStatus(self, url): """gets the replica status when exported async set to True""" params = {"f" : "json"} url = url + "/status" return self._get(url=url, param_dict=params, securityHandler=self._securityHandler, ...
python
def add_start_event_to_diagram(self, process_id, start_event_name="", start_event_definition=None, parallel_multiple=False, is_interrupting=True, node_id=None): """ Adds a StartEvent element to BPMN diagram. User-defined attributes: - name - p...
java
public Object marshal(org.openprovenance.prov.model.Attribute attribute) { return DOMProcessing.marshalAttribute(attribute); }
python
def get_conditions(self, service_id): """ Build a Conditions XML block for a SAML 1.1 Assertion. """ conditions = etree.Element('Conditions') conditions.set('NotBefore', self.instant()) conditions.set('NotOnOrAfter', self.instant(offset=30)) restriction = etree.Su...
python
def dump_resource_to_zipfile(resource, zipfile, content_type=None): """ Convenience function. See :meth:`everest.resources.io.ConnectedResourcesSerializer.to_zipfile` for details. The given context type defaults to CSV. """ if content_type is None: content_type = CsvMime srl = C...
java
private void closeChannels() { conn.closeChannel(video.getId()); conn.closeChannel(audio.getId()); conn.closeChannel(data.getId()); }
python
def _create_intermediate_nodes(self, name): """Create intermediate nodes if hierarchy does not exist.""" hierarchy = self._split_node_name(name, self.root_name) node_tree = [ self.root_name + self._node_separator + self._node_separator.join(hierarchy[: num + 1...
python
def satisfy_custom_matcher(self, args, kwargs): """Returns a boolean indicating whether or not the mock will accept the provided arguments. :param tuple args: A tuple of position args :param dict kwargs: A dictionary of keyword args :return: Whether or not the mock accepts the provided ...
java
private void failover(long globalModVersionOfFailover) { if (!executionGraph.getRestartStrategy().canRestart()) { executionGraph.failGlobal(new FlinkException("RestartStrategy validate fail")); } else { JobStatus curStatus = this.state; if (curStatus.equals(JobStatus.RUNNING)) { cancel(globalModVersi...
java
@Deprecated public ValueType getArgument(InvokeInstruction ins, ConstantPoolGen cpg, int i, int numArguments) throws DataflowAnalysisException { SignatureParser sigParser = new SignatureParser(ins.getSignature(cpg)); return getArgument(ins, cpg, i, sigParser); }
python
def write_grib2(self, path): """ Writes data to grib2 file. Currently, grib codes are set by hand to hail. Args: path: Path to directory containing grib2 files. Returns: """ if self.percentile is None: var_type = "mean" else: ...
python
def get_sorted_hdrgo2usrgos(self, hdrgos, flat_list=None, hdrgo_prt=True, hdrgo_sort=True): """Return GO IDs sorting using go2nt's namedtuple.""" # Return user-specfied sort or default sort of header and user GO IDs sorted_hdrgos_usrgos = [] h2u_get = self.grprobj.hdrgo2usrgos.get ...
python
def window(preceding=None, following=None, group_by=None, order_by=None): """Create a window clause for use with window functions. This ROW window clause aggregates adjacent rows based on differences in row number. All window frames / ranges are inclusive. Parameters ---------- preceding ...
python
def purge_object(self, pid, log_message=None): """ Purge an object from Fedora. Calls :meth:`ApiFacade.purgeObject`. :param pid: pid of the object to be purged :param log_message: optional log message :rtype: boolean """ kwargs = {'pid': pid} if log_mess...
java
public T growW() { T a; if( size >= data.length) { a = data[start]; if( a == null ) data[start] = a = createInstance(); start = (start+1)%data.length; } else { a = data[(start+size)%data.length]; if( a == null ) data[(start+size)%data.length] = a = createInstance(); size++; } return ...
java
@Nonnull public static Jenkins get() throws IllegalStateException { Jenkins instance = getInstanceOrNull(); if (instance == null) { throw new IllegalStateException("Jenkins.instance is missing. Read the documentation of Jenkins.getInstanceOrNull to see what you are doing wrong."); ...
python
def listen(self, wait=60, blocking=True): """Listen for events and call any associated callbacks when there is an event. There are three events you can subscribe too; **status_change**, **play_state_change**, **track_change** :param wait: how long to wait for a response before starting a new co...
java
private boolean hasLocaleDependencies() { for (CmsSearchIndexSource source : getIndex().getSources()) { if (source.getIndexer().isLocaleDependenciesEnable()) { return true; } } return false; }
java
private IOException checkForErrors(long numBytes, boolean async) { IOException exception = null; if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "checkForErrors: numBytes=" + numBytes + " buffers=" + SSLUtils.getBufferTraceInfo(getBuff...
python
def delete(self): 'Delete this folder and return a deleted JFSFolder' #url = '%s?dlDir=true' % self.path params = {'dlDir':'true'} r = self.jfs.post(self.path, params) self.sync() return r
python
def normalize_node(node, headers=None): """Normalizes given node as str or dict with headers""" headers = {} if headers is None else headers if isinstance(node, str): url = normalize_url(node) return {'endpoint': url, 'headers': headers} url = normalize_url(node['endpoint']) node_he...
java
public void setPolicyIds(java.util.Collection<String> policyIds) { if (policyIds == null) { this.policyIds = null; return; } this.policyIds = new java.util.ArrayList<String>(policyIds); }
python
def get_async(self, **ctx_options): """Return a Future whose result is the entity for this Key. If no such entity exists, a Future is still returned, and the Future's eventual return result be None. """ from . import model, tasklets ctx = tasklets.get_context() cls = model.Model._kind_map.g...
java
public void grow() { if( tailBlockSize >= blockLength ) { tailBlockSize = 0; blocks.grow(); } BlockIndexLength s = sets.grow(); s.block = blocks.size-1; s.start = tailBlockSize; s.length = 0; tail = s; }
python
def get_output(command): """Returns the output of a command returning a single line of output.""" p = Popen(command, shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE) p.stdin.close() p.stderr.close() line=p.stdout.readline().strip() p.wait() if type(line).__name__ == "bytes": line = ...
python
def diff_basis_dict(left_list, right_list): ''' Compute the difference between two sets of basis set dictionaries The result is a list of dictionaries that correspond to each dictionary in `left_list`. Each resulting dictionary will contain only the elements/shells that exist in that entry and not ...
java
public static <T extends TypeDefinition> ElementMatcher.Junction<T> declaresField(ElementMatcher<? super FieldDescription> matcher) { return new DeclaringFieldMatcher<T>(new CollectionItemMatcher<FieldDescription>(matcher)); }
java
@Override public boolean containsAll(IntSet c) { if (c == null || c.isEmpty() || c == this) { return true; } if (isEmpty()) { return false; } final FastSet other = convert(c); if (other.firstEmptyWord > firstEmptyWord) { return false; } final int[...
python
def fix_file(self, file_name): """Apply autopep8 to the diff lines of a file. - Returns the diff between original and fixed file. - If self.in_place then this writes the the fixed code the file_name. - Prints dots to show progress depending on options. """ # We hope tha...
java
public static Year randomYearBefore(int before) { checkArgument(before > MIN_YEAR, "Before must be after %s", MIN_YEAR); return Year.of(RandomUtils.nextInt(MIN_YEAR, before)); }
java
public static String getStringProperty(String name, Map<String, String> map, String defaultValue) { if (map.containsKey(name) && Strings.isNotNullOrEmpty(map.get(name))) { defaultValue = map.get(name); } return getPropertyOrEnvironmentVariable(name, defaultValue); }
java
public boolean exists(String indexName) { try { final JestResult result = jestClient.execute(new GetSettings.Builder().addIndex(indexName).build()); return result.isSucceeded() && Iterators.contains(result.getJsonObject().fieldNames(), indexName); } catch (IOException e) { ...
python
def save_account(changes: Changeset, table: LdapObjectClass, database: Database) -> Changeset: """ Modify a changes to add an automatically generated uidNumber. """ d = {} settings = database.settings uid_number = changes.get_value_as_single('uidNumber') if uid_number is None: scheme = sett...
python
def is_BF_hypergraph(self): """Indicates whether the hypergraph is a BF-hypergraph. A BF-hypergraph consists of only B-hyperedges and F-hyperedges. See "is_B_hypergraph" or "is_F_hypergraph" for more details. :returns: bool -- True iff the hypergraph is an F-hypergraph. """ ...
java
public String getFileType(Element schema_links) throws Exception { Document d = schema_links.getOwnerDocument(); NodeList nodes = d.getElementsByTagNameNS( "http://www.occamlab.com/te/parsers", "schema"); String localType = null; for (int i = 0; i < nodes.getLength()...
java
private UserMapping getUserMapping() { // Read user mapping from GUACAMOLE_HOME/user-mapping.xml File userMappingFile = new File(environment.getGuacamoleHome(), USER_MAPPING_FILENAME); // Abort if user mapping does not exist if (!userMappingFile.exists()) { logger.debug("Us...
java
public static void expandNcsOps(Structure structure, Map<String,String> chainOrigNames, Map<String,Matrix4d> chainNcsOps) { PDBCrystallographicInfo xtalInfo = structure.getCrystallographicInfo(); if (xtalInfo ==null) return; if (xtalInfo.getNcsOperators()==null || xtalInfo.getNcsOperators().length==0) return;...
java
@SuppressWarnings("rawtypes") public static <T> List<T> topp(final Collection<? extends T> c, final int fromIndex, final int toIndex, final int n, final Comparator<? super T> cmp) { N.checkArgNotNegative(n, "n"); if (n == 0) { return new ArrayList<>(); } else if (n >= toIn...
python
async def main() -> None: """Create the aiohttp session and run the example.""" loglevels = dict((logging.getLevelName(level), level) for level in [10, 20, 30, 40, 50]) logging.basicConfig( level=loglevels[LOGLEVEL], format='%(asctime)s:%(levelname)s:\t%(name)s\t%(mess...
python
def add(self, a, b): """ Parameters: - a - b """ self.send_add(a, b) return self.recv_add()
python
def chunk_from_mem(self, ptr): """ Given a pointer to a user payload, return the chunk associated with that payload. :param ptr: a pointer to the base of a user payload in the heap :returns: the associated heap chunk """ raise NotImplementedError("%s not implemented for ...
python
def get_grade_entries_by_genus_type(self, grade_entry_genus_type): """Gets a ``GradeEntryList`` corresponding to the given grade entry genus ``Type`` which does not include grade entries of genus types derived from the specified ``Type``. arg: grade_entry_genus_type (osid.type.Type): a grade entry ...
python
def _finalize_axis(self, key): """ General method to finalize the axis and plot. """ if 'title' in self.handles: self.handles['title'].set_visible(self.show_title) self.drawn = True if self.subplot: return self.handles['axis'] else: ...
python
def otherwise(self, value): """ Evaluates a list of conditions and returns one of multiple possible result expressions. If :func:`Column.otherwise` is not invoked, None is returned for unmatched conditions. See :func:`pyspark.sql.functions.when` for example usage. :param value:...
python
def N_to_Ntriangles(N): """ @N: WD style gridsize Converts WD style grid size @N to the number of triangles on the surface. Returns: number of triangles. """ theta = np.array([np.pi/2*(k-0.5)/N for k in range(1, N+1)]) phi = np.array([[np.pi*(l-0.5)/Mk for l in range(1, Mk+1)] for Mk ...
python
def print_head(self, parent_plate_value, plate_values, interval, n=10, print_func=logging.info): """ Print the first n values from the streams in the given time interval. The parent plate value is the value of the parent plate, and then the plate values are the values for the plate that ...
java
public static String getSelect(final SQLiteDataset dataset) { final Class<?> klass = dataset.getClass(); try { return getSelect(klass); } catch (final Exception e) { Logger.ex(e); return ""; } }
python
def serve_file(load, fnd): ''' Return a chunk from a file based on the data received ''' ret = {'data': '', 'dest': ''} required_load_keys = ('path', 'loc', 'saltenv') if not all(x in load for x in required_load_keys): log.debug( 'Not all of the required keys prese...
java
private int checkOutput(int readBytes) throws IOException { if (readBytes > -1) { return readBytes; } if (closed) { throw new IOException("The stream has been closed"); } if (readThread.error != null) { throw new IOException(readThread.error.getMessage()); } return readByte...
java
@VisibleForTesting String upload(File report) { LOG.debug("Upload report"); long startTime = System.currentTimeMillis(); PostRequest.Part filePart = new PostRequest.Part(MediaTypes.ZIP, report); PostRequest post = new PostRequest("api/ce/submit") .setMediaType(MediaTypes.PROTOBUF) .setPara...
python
def read_fwf(filepath_or_buffer: FilePathOrBuffer, colspecs='infer', widths=None, infer_nrows=100, **kwds): r""" Read a table of fixed-width formatted lines into DataFrame. Also supports optionally iterating or breaking of the file into chunks. ...
java
public ProgressTopicType createProgressTopicTypeFromString(EDataType eDataType, String initialValue) { ProgressTopicType result = ProgressTopicType.get(initialValue); if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() ...
java
private JPanel getJPanelBottom() { if (jPanelBottom == null) { GridBagConstraints gridBagConstraints2 = new GridBagConstraints(); gridBagConstraints2.insets = new java.awt.Insets(5,3,5,5); gridBagConstraints2.gridy = 0; gridBagConstraints2.anchor = java.awt.GridBagConstraints.EAST; gridBagConstra...
python
def get(self, pk=None, **filters): """ Retrieve an object instance. If a single argument is supplied, object is queried by primary key, else filter queries will be applyed. If more than one object was found raise MultipleObjectsReturned. If no object found, raise DoesNotExist. Ra...
python
def _compile(self, target, results_dir, source): """Compile given source to an object file.""" obj = self._objpath(target, results_dir, source) safe_mkdir_for(obj) abs_source = os.path.join(get_buildroot(), source) # TODO: include dir should include dependent work dir when headers are copied there...
python
def poll(self, endpoint, pFormat=PrometheusFormat.PROTOBUF, headers=None): """ Polls the metrics from the prometheus metrics endpoint provided. Defaults to the protobuf format, but can use the formats specified by the PrometheusFormat class. Custom headers can be added to the def...
java
public static void swap(float[] floatArray1, int array1Index, float[] floatArray2, int array2Index) { if(floatArray1[array1Index] != floatArray2[array2Index]) { float hold = floatArray1[array1Index]; floatArray1[array1Index] = floatArray2[array2Index]; floatArray2[array2Index...
java
public static void validate(BigInteger nummer, Ort ort) { if (nummer.compareTo(BigInteger.ONE) < 0) { throw new InvalidValueException(nummer, "number"); } validate(ort); }
python
def create_menubar(MAIN): """Create the whole menubar, based on actions.""" actions = MAIN.action menubar = MAIN.menuBar() menubar.clear() """ ------ FILE ------ """ menu_file = menubar.addMenu('File') menu_file.addAction(MAIN.info.action['open_dataset']) submenu_recent = menu_file.addM...
java
@Override public java.util.List<com.liferay.commerce.product.model.CPMeasurementUnit> getCPMeasurementUnitsByUuidAndCompanyId( String uuid, long companyId) { return _cpMeasurementUnitLocalService.getCPMeasurementUnitsByUuidAndCompanyId(uuid, companyId); }
python
def config(name='ckeditor', custom_config='', **kwargs): """Config CKEditor. :param name: The target input field's name. If you use Flask-WTF/WTForms, it need to set to field's name. Default to ``'ckeditor'``. :param custom_config: The addition config, for example ``uiColor: '#9AB8F...
java
public static void main(String[] args) { JmxDemo demo=new JmxDemo(); demo.addNotificationListener((notification, handback) -> System.out.println(">> " + notification + ", handback=" + handback), null, "myHandback"); demo.startNotifications(); MBeanServer server=Util.getMBeanServer(); ...
java
public static UserInfoList userInfoBatchget(String access_token,String lang,List<String> openids,int emoji){ StringBuilder sb = new StringBuilder(); sb.append("{\"user_list\": ["); for(int i = 0;i < openids.size();i++){ sb.append("{") .append("\"openid\": \"").append(openids.get(i)).append("\",") .ap...
python
def hrlist(self, name_start, name_end, limit=10): """ Return a list of the top ``limit`` hash's name between ``name_start`` and ``name_end`` in descending order .. note:: The range is (``name_start``, ``name_end``]. The ``name_start`` isn't in the range, but ``name_end`` is. ...
python
def _get_enquire_mset(database, enquire, start_offset, end_offset, checkatleast=DEFAULT_CHECK_AT_LEAST): """ A safer version of Xapian.enquire.get_mset Simply wraps the Xapian version and catches any `Xapian.DatabaseModifiedError`, attempting a `database.reopen` as needed. Requ...
python
def decode_der(cert_der): """Decode cert DER string to Certificate object. Args: cert_der : Certificate as a DER encoded string Returns: cryptography.Certificate() """ return cryptography.x509.load_der_x509_certificate( data=cert_der, backend=cryptography.hazmat.backends.defau...
java
public void openFirstLevel() { if (!m_categories.isEmpty()) { for (int i = 0; i < m_scrollList.getWidgetCount(); i++) { CmsTreeItem item = (CmsTreeItem)m_scrollList.getItem(i); item.setOpen(true); } } }
java
private static void purgeMatching(File dir, List<Pattern> patterns, long minTxIdToKeep) throws IOException { for (File f : FileUtil.listFiles(dir)) { if (!f.isFile()) continue; for (Pattern p : patterns) { Matcher matcher = p.matcher(f.getName()); if (matcher.matches()) { ...
java
public boolean isExist(String property) { try { new ValueExpression(property).evaluate(node); } catch (MissingNodeException e) { return false; } return true; }
python
def addValue(self, source, data): """Adds a value from the given source.""" self.__result[self._dataFormat.getValue(data)].append(source)
java
public ServiceFuture<ShareInner> createOrUpdateAsync(String deviceName, String name, String resourceGroupName, ShareInner share, final ServiceCallback<ShareInner> serviceCallback) { return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, share), serviceCallb...