language
stringclasses
2 values
func_code_string
stringlengths
63
466k
java
@Override public String toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) { StringBuilder buf = new StringBuilder(); if (message != null) { buf.append("<error type=\"cancel\">"); buf.append('<').append(message).append(" xmlns=\"").append(NAMESPACE).append...
java
public PagedList<ApplicationSecurityGroupInner> listByResourceGroupNext(final String nextPageLink) { ServiceResponse<Page<ApplicationSecurityGroupInner>> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); return new PagedList<ApplicationSecurityGroupInner>(response.bo...
python
def df_filter_col_sum(df, threshold, take_abs=True): ''' filter columns in matrix at some threshold and remove rows that have all zero values ''' from copy import deepcopy from .__init__ import Network net = Network() if take_abs is True: df_copy = deepcopy(df['mat'].abs()) else: df_copy = deepc...
python
def generate_obj(self): """Generates the secret object, respecting existing information and user specified options""" secret_obj = {} if self.existing: secret_obj = deepcopy(self.existing) for key in self.keys: key_name = key['name'] if self.e...
python
def _exception_raise(self): """ Raises a pending exception that was recorded while getting a Task ready for execution. """ exc = self.exc_info()[:] try: exc_type, exc_value, exc_traceback = exc except ValueError: exc_type, exc_value = exc ...
java
protected long[] createItemIdArray() { int size = operationList.size(); long[] itemIds = new long[size]; for (int i = 0; i < size; i++) { CollectionTxnOperation operation = (CollectionTxnOperation) operationList.get(i); itemIds[i] = CollectionTxnUtil.getItemId(operation);...
java
public Acl getBucketAcl(String bucketName) { // [START getBucketAcl] Acl acl = storage.getAcl(bucketName, User.ofAllAuthenticatedUsers()); // [END getBucketAcl] return acl; }
java
public double computePower(int idx){ double r = real[idx]; double i = imag[idx]; power[idx] = r*r+i*i; return power[idx]; }
java
public static Backbone compute(final Collection<Formula> formulas, final Collection<Variable> variables) { return compute(formulas, variables, BackboneType.POSITIVE_AND_NEGATIVE); }
python
def get_comments_by_query(self, comment_query): """Gets a list of comments matching the given search. arg: comment_query (osid.commenting.CommentQuery): the search query array return: (osid.commenting.CommentList) - the returned ``CommentList`` raise: ...
python
def parse_owl_xml(url): """Downloads and parses an OWL resource in OWL/XML format using the :class:`OWLParser`. :param str url: The URL to the OWL resource :return: A directional graph representing the OWL document's hierarchy :rtype: networkx.DiGraph """ res = download(url) owl = OWLParser...
java
public void characters(final char[] ch, final int start, final int length) throws SAXException { charBuffer.append(ch, start, length); }
java
@Override public IPv6Address[] spanWithPrefixBlocks() { if(isSequential()) { return spanWithPrefixBlocks(this); } @SuppressWarnings("unchecked") ArrayList<IPv6Address> list = (ArrayList<IPv6Address>) spanWithBlocks(true); return list.toArray(new IPv6Address[list.size()]); }
python
def calendar(ctx, date, agenda, year): """Show a 3-month calendar of meetups. \b date: The date around which the calendar is centered. May be: - YYYY-MM-DD, YY-MM-DD, YYYY-MM or YY-MM (e.g. 2015-08) - MM (e.g. 08): the given month in the current year - pN (e.g. p1): N-th last month ...
java
@Override public void visitCode(Code obj) { String nameAndSignature = getMethod().getName() + getMethod().getSignature(); if (SignatureBuilder.SIG_READ_OBJECT.equals(nameAndSignature)) { inReadObject = true; inWriteObject = false; } else if (SIG_WRITE_OBJECT.equals(na...
java
protected void ratio(List<MethodDto> performanceVOList, String entryName) { double allTotalTime = this.getAllTotalTime(performanceVOList, entryName); Map<String, Double> interfaceTotalTimeMap = this.getInterfaceTotalTime(performanceVOList); for (MethodDto performanceVO : performanceVOList) { String interfa...
python
def tunnel_open(self): ''' Open tunnel ''' if (self.server.is_server_running() == 'no' or self.server.is_server_running() == 'maybe'): print("Error: Sorry, you need to have the server running to open a " "tunnel. Try 'server on' first.") else: ...
python
def get_num_shards(num_samples: int, samples_per_shard: int, min_num_shards: int) -> int: """ Returns the number of shards. :param num_samples: Number of training data samples. :param samples_per_shard: Samples per shard. :param min_num_shards: Minimum number of shards. :return: Number of shard...
java
public java.util.List<String> getFleetIds() { if (fleetIds == null) { fleetIds = new com.amazonaws.internal.SdkInternalList<String>(); } return fleetIds; }
java
final void clearSmokeAndMirrorsProperties() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "clearSmokeAndMirrorsProperties"); /* JMSXAppId */ getHdr2().setChoiceField(JsHdr2Access.XAPPID, JsHdr2Access.IS_XAPPID_EMPTY); /* JMSXUserID...
java
static IntegerParser parseInt(String input, int startpos, int len, boolean includeSign) { int pos = startpos; boolean isNegative = false; long value = 0; char ch; if (pos >= len) return null; // String is empty - no number found if (includeSign)...
python
def infomax(data, weights=None, l_rate=None, block=None, w_change=1e-12, anneal_deg=60., anneal_step=0.9, extended=False, n_subgauss=1, kurt_size=6000, ext_blocks=1, max_iter=200, random_state=None, verbose=None): """Run the (extended) Infomax ICA decomposition on raw data b...
python
def user_dj(uid, offset=0, limit=30): """获取用户电台数据 :param uid: 用户的ID,可通过登录或者其他接口获取 :param offset: (optional) 分段起始位置,默认 0 :param limit: (optional) 数据上限多少行,默认 30 """ if uid is None: raise ParamsError() r = NCloudBot() r.method = 'USER_DJ' r.data = {'offset': offset, 'limit': li...
python
def set_network_connection(self, network): """ Set the network connection for the remote device. Example of setting airplane mode:: driver.mobile.set_network_connection(driver.mobile.AIRPLANE_MODE) """ mode = network.mask if isinstance(network, self.ConnectionType) ...
python
def d(self, depth=1): """Launches an interactive console at the point where it's called.""" info = self.inspect.getframeinfo(self.sys._getframe(1)) s = self.Stanza(self.indent) s.add([info.function + ': ']) s.add([self.MAGENTA, 'Interactive console opened', self.NORMAL]) ...
java
@Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case AfplibPackage.BBC__BCDO_NAME: return getBCdoName(); case AfplibPackage.BBC__TRIPLETS: return getTriplets(); } return super.eGet(featureID, resolve, coreType); }
python
def update_history(cloud_hero): """ Send each command to the /history endpoint. """ user_command = ' '.join(sys.argv) timestamp = int(time.time()) command = (user_command, timestamp) cloud_hero.send_history([command])
java
@SuppressWarnings("unchecked") public Set<Project> getAllProjects(String identifier) throws GreenPepperServerException { log.debug("Retrieving All Projects"); Vector<Object> projectsParams = (Vector<Object>)execute(XmlRpcMethodName.getAllProjects, identifier); return XmlRpcDataMarshaller.toPr...
java
@Override protected UniversalIdIntQueueMessage readFromQueueStorage(Connection conn) { Map<String, Object> dbRow = getJdbcHelper().executeSelectOne(conn, SQL_READ_FROM_QUEUE); if (dbRow != null) { UniversalIdIntQueueMessage msg = new UniversalIdIntQueueMessage(); return msg.f...
java
static public ContentHandleFactory newFactory() { return new ContentHandleFactory() { @Override public Class<?>[] getHandledClasses() { return new Class<?>[]{ JsonNode.class }; } @Override public boolean isHandled(Class<?> type) { return JsonNode.class.isAssignableFrom(...
java
private void parseString(final String eventSerialized) { final StringTokenizer st = new StringTokenizer(eventSerialized, ClassUtility.SEPARATOR); if (st.countTokens() >= 5) { sequence(Integer.parseInt(st.nextToken())) .eventType(JRebi...
java
@SuppressWarnings("unchecked") public final SelfType startTime(final DateTime when, final TimeSpan jitter) { // Find the current week day in the same time zone as the "when" time passed in. final DateTime now = new DateTime().withZone(when.getZone()); final int startWeekDay = when.getDa...
java
AttributeSet withAttributes(Attributes attributes) { return new AttributeSet(attributes, this.locale, this.level, this.section, this.printCondition, this.internals); }
java
@Override void getTableNamesForRead(OrderedHashSet set) { /* A VoltDB Extension. * Base table could be null for views. */ if (baseTable != null && !baseTable.isTemp()) { for (int i = 0; i < baseTable.fkConstraints.length; i++) { set.add(baseTable.fkCons...
python
def ipmi_method(self, command): """Use ipmitool to run commands with ipmi protocol """ ipmi = ipmitool(self.console, self.password, self.username) if command == "reboot": self.ipmi_method(command="status") if self.output == "Chassis Power is off": ...
python
def get_item(self, path): """ Get resource item :param path: string :return: PIL.Image """ if self.source_folder: item_path = '%s/%s/%s' % ( current_app.static_folder, self.source_folder, path.strip('...
java
protected <T> T deserialiseResponseMessage(CloseableHttpResponse response, Type type) throws IOException { T body = null; HttpEntity entity = response.getEntity(); if (entity != null && type != null) { try (InputStream inputStream = entity.getContent()) { try { ...
python
def main(configpath = None, startup = None, daemon = False, pidfile = None, fork = None): """ The most simple way to start the VLCP framework :param configpath: path of a configuration file to be loaded :param startup: startup modules list. If None, `server.startup` in the configuration files ...
java
public static CellConstraints xywh(int col, int row, int colSpan, int rowSpan) { return xywh(col, row, colSpan, rowSpan, CellConstraints.DEFAULT, CellConstraints.DEFAULT); }
python
def find_all_checks(self, **kwargs): """ Finds all checks for this entity with attributes matching ``**kwargs``. This isn't very efficient: it loads the entire list then filters on the Python side. """ checks = self._check_manager.find_all_checks(**kwargs) for ch...
java
public void setFilter(UnicodeFilter filter) { if (filter == null) { this.filter = null; } else { try { // fast high-runner case this.filter = new UnicodeSet((UnicodeSet)filter).freeze(); } catch (Exception e) { this.filt...
python
def transitive_invalidation_hash(self, fingerprint_strategy=None, depth=0): """ :API: public :param FingerprintStrategy fingerprint_strategy: optional fingerprint strategy to use to compute the fingerprint of a target :return: A fingerprint representing this target and all of its dependencies. ...
java
public void set(String name, Object obj) throws IOException { if (!(obj instanceof Integer)) { throw new IOException("Attribute must be of type Integer."); } if (name.equalsIgnoreCase(REASON)) { reasonCode = ((Integer)obj).intValue(); } else { throw ne...
java
public static <T> QueueRandomizer<T> aNewQueueRandomizer(final Randomizer<T> delegate, final int nbElements) { return new QueueRandomizer<>(delegate, nbElements); }
python
def join(cls, scope): """ Get or create a conversation for the given scope and active hook context. The current remote unit for the active hook context will be added to the conversation. Note: This uses :mod:`charmhelpers.core.unitdata` and requires that :meth:`~charmhe...
python
def calc_offset(lines, target, invert_search=False): """ Function to search for a line in a list starting with a target string. If `target` is `None` or an empty string then `0` is returned. This allows checking `target` here instead of having to check for an empty target in the calling function. E...
python
def type_list(self, index_name): ''' List the types available in an index ''' request = self.session url = 'http://%s:%s/%s/_mapping' % (self.host, self.port, index_name) response = request.get(url) if request.status_code == 200: return response[index_...
python
def submit_unseal_key(self, key=None, reset=False, migrate=False): """Enter a single master key share to progress the unsealing of the Vault. If the threshold number of master key shares is reached, Vault will attempt to unseal the Vault. Otherwise, this API must be called multiple times until ...
python
def _parse_args() -> argparse.Namespace: """Helper function to create the command-line argument parser for faaspact_verifier. Return the parsed arguments as a Namespace object if successful. Exits the program if unsuccessful or if the help message is printed. """ description = ('Run pact verifier t...
python
def allow_origin(self, request): # type: (BaseHttpRequest) -> str """ Generate allow origin header """ origins = self.origins if origins is AnyOrigin: return '*' else: origin = request.origin return origin if origin in origins e...
python
def _compute_distance_term(self, C, rhypo): """ Returns the distance scaling term """ return (C["c2"] * rhypo) + (C["c3"] * np.log10(rhypo))
java
public boolean validateMetaDataType(MetaDataType metaDataType, DiagnosticChain diagnostics, Map<Object, Object> context) { return validate_EveryDefaultConstraint(metaDataType, diagnostics, context); }
java
protected void addLevelInfo(TypeElement parent, Collection<TypeElement> collection, boolean isEnum, Content contentTree) { if (!collection.isEmpty()) { Content ul = new HtmlTree(HtmlTag.UL); for (TypeElement local : collection) { HtmlTree li = new HtmlTree(Htm...
java
public boolean isToolSelected(int tool) { boolean selected = false; switch (tool) { case IBurpExtenderCallbacks.TOOL_PROXY: selected = jCheckBoxProxy.isSelected(); break; case IBurpExtenderCallbacks.TOOL_REPEATER: selected = jCheckB...
python
def is_callable(self): """ Ensures :attr:`subject` is a callable. """ if not callable(self._subject): raise self._error_factory(_format("Expected {} to be callable", self._subject))
python
def installed(name, channel=None): ''' Ensure that the named snap package is installed name The snap package channel Optional. The channel to install the package from. ''' ret = {'name': name, 'changes': {}, 'pchanges': {}, 'result': None, ...
python
def get_context_data(self, **kwargs): """ Populate the context of the template with all published entries and all the categories. """ context = super(Sitemap, self).get_context_data(**kwargs) context.update( {'entries': Entry.published.all(), 'cat...
python
def similar_artists(self, artist_id: str) -> List[NameExternalIDPair]: """ Returns zero or more similar artists (in the form of artist name - external ID pairs) to the one corresponding to the given artist ID. Arguments: artist_id ([str]): The Spotify ID of the artist for wh...
python
def start(self): """ Starts services. """ cert_path = os.path.join(self.work_dir, 'certificates') public_keys_dir = os.path.join(cert_path, 'public_keys') private_keys_dir = os.path.join(cert_path, 'private_keys') client_secret_file = os.path.join(private_keys_dir, "client.key")...
java
@Deprecated protected int handleGetExtendedYear() { // Ethiopic calendar uses EXTENDED_YEAR aligned to // Amelete Mihret year always. int eyear; if (newerField(EXTENDED_YEAR, YEAR) == EXTENDED_YEAR) { eyear = internalGet(EXTENDED_YEAR, 1); // Default to year 1 } e...
python
def DbGetDeviceAlias(self, argin): """ Return alias for device name if found. :param argin: The device name :type: tango.DevString :return: The alias found :rtype: tango.DevString """ self._log.debug("In DbGetDeviceAlias()") ret, dev_name, dfm = check_device_name...
java
private static List<AbstractMolecule> buildMolecule(HELM2Notation helm2notation) throws BuilderMoleculeException, ChemistryException { return BuilderMolecule.buildMoleculefromPolymers(helm2notation.getListOfPolymers(), HELM2NotationUtils.getAllEdgeConnections(helm2notation.getListOfConnections())); }
python
def _parse_materials(header, views): """ Convert materials and images stored in a GLTF header and buffer views to PBRMaterial objects. Parameters ------------ header : dict Contains layout of file views : (n,) bytes Raw data Returns ------------ materials : list ...
python
def project_activity(index, start, end): """Compute the metrics for the project activity section of the enriched github issues index. Returns a dictionary containing a "metric" key. This key contains the metrics for this section. :param index: index object :param start: start date to get the d...
java
protected void addCacheDependency(String dependantCacheName) { protobufSchemaCache = (Cache<String, String>) SecurityActions.getUnwrappedCache(cacheManager, PROTOBUF_METADATA_CACHE_NAME).getAdvancedCache().withEncoding(IdentityEncoder.class); // add stop dependency cacheManager.addCacheDependency(depe...
python
def _workaround_no_vector_images(project): """Replace vector images with fake ones.""" RED = (255, 0, 0) PLACEHOLDER = kurt.Image.new((32, 32), RED) for scriptable in [project.stage] + project.sprites: for costume in scriptable.costumes: if costume.image.format == "SVG": ...
python
def generate_random_string(size=6, chars=string.ascii_uppercase + string.digits): """Generate random string. :param size: Length of the returned string. Default is 6. :param chars: List of the usable characters. Default is string.ascii_uppercase + string.digits. :type size: int :type chars: str ...
python
def _create(self, tree): """ Run a SELECT statement """ tablename = tree.table indexes = [] global_indexes = [] hash_key = None range_key = None attrs = {} for declaration in tree.attrs: name, type_ = declaration[:2] if len(declarat...
python
def find_files(folder): """Discover stereo photos and return them as a pairwise sorted list.""" files = [i for i in os.listdir(folder) if i.startswith("left")] files.sort() for i in range(len(files)): insert_string = "right{}".format(files[i * 2][4:]) files.insert(i * 2 + 1, insert_strin...
java
private static int primitiveWidth(TypeDesc type) { switch (type.getTypeCode()) { default: return 0; case TypeDesc.BOOLEAN_CODE: return 1; case TypeDesc.BYTE_CODE: return 2; case TypeDesc.SHORT_CODE: return 3; case ...
java
public ApiSuccessResponse cancelConsultationChat(String id, CancelConsultData cancelConsultData) throws ApiException { ApiResponse<ApiSuccessResponse> resp = cancelConsultationChatWithHttpInfo(id, cancelConsultData); return resp.getData(); }
python
def HandleSimpleResponses( self, timeout_ms=None, info_cb=DEFAULT_MESSAGE_CALLBACK): """Accepts normal responses from the device. Args: timeout_ms: Timeout in milliseconds to wait for each response. info_cb: Optional callback for text sent from the bootloader. R...
python
def get_endpoint_obj(client, endpoint, object_id): ''' Tiny helper function that gets used all over the place to join the object ID to the endpoint and run a GET request, returning the result ''' endpoint = '/'.join([endpoint, str(object_id)]) return client.authenticated_request(endpoint).json()
java
public void createEphemeral(final String path) throws ZkInterruptedException, IllegalArgumentException, ZkException, RuntimeException { create(path, null, CreateMode.EPHEMERAL); }
python
def run(scenario, config=None, base_config=None, outputs=None, return_config=False): """ Runs a scenario through the Hector climate model. Parameters ---------- scenario : DataFrame DataFrame with emissions. See ``pyhector.rcp26`` for an example and :mod:`pyhector.units` for units o...
java
@Override public void clearCache() { entityCache.clearCache(CommerceUserSegmentEntryImpl.class); finderCache.clearCache(FINDER_CLASS_NAME_ENTITY); finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION); finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION); }
java
public static <T> T assertNotNull(T argument, String msg) { if (argument == null) throw new IllegalArgumentException(msg); return argument; }
java
public static <K, V> MutableList<V> toSortedList( Map<K, V> map, Comparator<? super V> comparator) { return Iterate.toSortedList(map.values(), comparator); }
python
def compress(obj, level=6, return_type="bytes"): """Compress anything to bytes or string. :param obj: could be any object, usually it could be binary, string, or regular python objec.t :param level: :param return_type: if bytes, then return bytes; if str, then return base64.b64encode by...
java
public List<AbstractCommand> getCommands() { return commands.values().stream() .map(id -> AbstractCommand.search(id)) .collect(Collectors.toList()); }
python
def add_flowspec_local(flowspec_family, route_dist, rules, **kwargs): """Adds Flow Specification route from VRF identified by *route_dist*. """ try: # Create new path and insert into appropriate VRF table. tm = CORE_MANAGER.get_core_service().table_manager tm.update_flowspec_vrf_tabl...
java
private void restoreTemplateScope(InternalContextAdapterImpl ica, Scope currentTemplateScope) { if (currentTemplateScope.getParent() != null) { ica.put(TEMPLATE_SCOPE_NAME, currentTemplateScope.getParent()); } else if (currentTemplateScope.getReplaced() != null) { ica.put(TEM...
java
List<CmsResource> getPublishResources() { List<CmsResource> result = new ArrayList<CmsResource>(); if (m_currentResource != null) { result.add(m_currentResource); CmsObject cms = A_CmsUI.getCmsObject(); CmsSolrQuery query = m_currentConfigParser.getInitialQuery(); ...
java
public static Document toDocument(JAXBElement<?> jaxbElement, boolean prettyPrint) { Document document = null; try { DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory .newInstance(); documentBuilderFactory.setNamespaceAware(true); documentBuilderFactory.setIgnoringElementCont...
python
def save(self, wfs, filename=None): '''Save a Werkzeug FileStorage object''' if self.basename and not filename: ext = extension(filename or wfs.filename) filename = '.'.join([self.basename(self._instance), ext]) prefix = self.upload_to(self._instance) if callable(self.upl...
java
protected void initDefaultFonts() { defaultFonts = new HashMap<String, String>(3); defaultFonts.put(Font.SERIF, Font.SERIF); defaultFonts.put(Font.SANS_SERIF, Font.SANS_SERIF); defaultFonts.put(Font.MONOSPACED, Font.MONOSPACED); }
python
def normalize(text, variant=VARIANT1, case_sensitive=False): """Create a normalized version of `text`. With `variant` set to ``VARIANT1`` (default), german umlauts are transformed to plain chars: ``ä`` -> ``a``, ``ö`` -> ``o``, ...:: >>> print(normalize("mäßig")) massig With `variant` set...
python
def map(coro, iterable, limit=0, loop=None, timeout=None, return_exceptions=False, *args, **kw): """ Concurrently maps values yielded from an iterable, passing then into an asynchronous coroutine function. Mapped values will be returned as list. Items order will be preserved based on origin...
python
def _is_final(meta, arg): """Checks whether given class or method has been marked with the ``@final`` decorator. """ if inspect.isclass(arg) and not isinstance(arg, ObjectMetaclass): return False # of classes, only subclasses of Object can be final # account for met...
java
public static systemdatasource get(nitro_service service) throws Exception{ systemdatasource obj = new systemdatasource(); systemdatasource[] response = (systemdatasource[])obj.get_resources(service); return response[0]; }
java
public synchronized void unuse() { assert(inUse); inUse = false; compiler = null; fileManager = null; fileManagerBase = null; smartFileManager = null; context = null; subTasks = null; }
java
public int addExplicitListItem(UUID appId, String versionId, UUID entityId, AddExplicitListItemOptionalParameter addExplicitListItemOptionalParameter) { return addExplicitListItemWithServiceResponseAsync(appId, versionId, entityId, addExplicitListItemOptionalParameter).toBlocking().single().body(); }
java
protected void buildRevisionHistoryFromTemplate(final BuildData buildData, final String revisionHistoryXml) throws BuildProcessingException { log.info("\tBuilding " + REVISION_HISTORY_FILE_NAME); Document revHistoryDoc; try { revHistoryDoc = XMLUtilities.convertStringToD...
python
def echo_html(self, url_str): ''' Show the HTML ''' logger.info('info echo html: {0}'.format(url_str)) condition = self.gen_redis_kw() url_arr = self.parse_url(url_str) sig = url_arr[0] num = (len(url_arr) - 2) // 2 catinfo = MCategory.get_by_...
python
def draw_rect( self, x: int, y: int, width: int, height: int, ch: int, fg: Optional[Tuple[int, int, int]] = None, bg: Optional[Tuple[int, int, int]] = None, bg_blend: int = tcod.constants.BKGND_SET, ) -> None: """Draw characters and col...
python
def unescape_html(statement): """ Convert escaped html characters into unescaped html characters. For example: "&lt;b&gt;" becomes "<b>". """ import html statement.text = html.unescape(statement.text) return statement
java
protected X509CRL downloadCRLFromWeb(String crlURL) throws IOException, CertificateVerificationException { URL url = new URL(crlURL); try (InputStream crlStream = url.openStream()) { CertificateFactory cf = CertificateFactory.getInstance(Constants.X_509); return (X509CRL) cf....
java
public Collection<AdminObject> getAdminObjects() { if (adminObjects == null) return Collections.emptyList(); return Collections.unmodifiableCollection(adminObjects); }
python
def create(cls, name, master_engines, comment=None): """ Create a refresh task for master engines. :param str name: name of task :param master_engines: list of master engines for this task :type master_engines: list(MasterEngine) :param str comment: optional com...
java
public static String determineType(String[] vector, Boolean doPreferDouble) { boolean isNumber = true; boolean isInteger = true; boolean isLogical = true; boolean allNA = true; for (String s : vector) { if (s == null || s.startsWith("NA") || s.startsWith("Na") || s.matches("^\\s*$")) { ...