language
stringclasses
2 values
func_code_string
stringlengths
63
466k
python
def control(self): """the type of control this player exhibits""" if self.isComputer: value = c.COMPUTER else: value = c.PARTICIPANT return c.PlayerControls(value)
python
def get_submissions(): """API endpoint to get submissions in JSON format""" print(request.args.to_dict()) print(request.args.get('search[value]')) print(request.args.get('draw', 1)) # submissions = session.query(Submission).all() if request.args.get('correct_filter', 'all') == 'all': co...
java
public Vector3d transform(Vector3dc v, Vector3d dest) { double sin = Math.sin(angle); double cos = Math.cosFromSin(sin, angle); double dot = x * v.x() + y * v.y() + z * v.z(); dest.set(v.x() * cos + sin * (y * v.z() - z * v.y()) + (1.0 - cos) * dot * x, v.y() * cos + sin...
java
public Observable<Page<GeoRegionInner>> listGeoRegionsAsync() { return listGeoRegionsWithServiceResponseAsync() .map(new Func1<ServiceResponse<Page<GeoRegionInner>>, Page<GeoRegionInner>>() { @Override public Page<GeoRegionInner> call(ServiceResponse<Page<GeoRegionInn...
python
def simulate(self, timepoints): """ Simulate initialised solver for the specified timepoints :param timepoints: timepoints that will be returned from simulation :return: a list of trajectories for each of the equations in the problem. """ solver = self._solver la...
python
def find_ontology(self, txt): """ top level function used for new data processing which attempts to find a level in a heirarchy and return the key and filename usage res = FindOntology('file') # returns 'SYSTEM-PC-FILE' """ totFound = 0 searchString = txt.upper()...
java
public CmsResource createResource( String resourcename, I_CmsResourceType type, byte[] content, List<CmsProperty> properties) throws CmsException, CmsIllegalArgumentException { return type.createResource(this, m_securityManager, resourcename, content, properties); }
java
private String expandLHS(final String lhs, int lineOffset) { substitutions = new ArrayList<Map<String, String>>(); // logger.info( "*** LHS>" + lhs + "<" ); final StringBuilder buf = new StringBuilder(); final String[] lines = lhs.split( (lhs...
python
def query(cls, project=None, visibility=None, q=None, id=None, offset=None, limit=None, api=None): """ Query (List) apps. :param project: Source project. :param visibility: private|public for private or public apps. :param q: List containing search terms. :p...
python
def rename_dfa_states(dfa: dict, suffix: str): """ Side effect on input! Renames all the states of the DFA adding a **suffix**. It is an utility function to be used to avoid automata to have states with names in common. Avoid suffix that can lead to special name like "as", "and",... :param di...
java
public List<JsonObject> executeParametrizedStatement(String statement, List<String> parameterNames, List<Object> parameterValues) { JsonObject namedParams = JsonObject.create(); for (int param = 0; param < parameterNames.size(); param++) { ...
java
public static Map<String, String> mergeDefaults( CmsObject cms, CmsResource resource, Map<String, String> properties, Locale locale, ServletRequest request) { Map<String, CmsXmlContentProperty> propertyConfig = null; if (CmsResourceTypeXmlContent.isXmlContent(res...
java
@Override public boolean add(final CustomizationSupplier<T> entry) { if (list.contains(entry)) { throw new IllegalArgumentException("duplicate entry"); } return list.add(entry); }
java
public void createTenant(String tenantId) { TenantBean tenant = new TenantBean(tenantId); try { URL endpoint = serverUrl.toURI().resolve("tenants").toURL(); //$NON-NLS-1$ Request request = new Request.Builder() .url(endpoint) .post(toBody(t...
python
def accelerator_experiments(self, key, value): """Populate the ``accelerator_experiments`` key.""" result = [] a_value = force_single_element(value.get('a')) e_values = [el for el in force_list(value.get('e')) if el != '-'] zero_values = force_list(value.get('0')) if a_value and not e_values: ...
python
def call(self, cleanup_protecteds): ''' Start the actual minion as a caller minion. cleanup_protecteds is list of yard host addresses that should not be cleaned up this is to fix race condition when salt-caller minion starts up If sub-classed, don't **ever** forget to run: ...
java
protected boolean canScroll(View v, boolean checkV, int dy, int x, int y) { if (v instanceof ViewGroup) { final ViewGroup group = (ViewGroup) v; final int scrollX = v.getScrollX(); final int scrollY = v.getScrollY(); final int count = group.getChildCount(); ...
java
@Override public List<CPDefinition> findByCPTaxCategoryId(long CPTaxCategoryId) { return findByCPTaxCategoryId(CPTaxCategoryId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); }
python
def _set_amz_headers(self): """ Sets x-amz-* error response fields from response headers. """ if self._response.headers: # keeping x-amz-id-2 as part of amz_host_id. if 'x-amz-id-2' in self._response.headers: self.host_id = self._response.headers['...
java
private synchronized Worker createWorker(int i) throws IOException { Preconditions.checkState(mState == State.STARTED, "Must be in a started state to create workers"); File confDir = new File(mWorkDir, "conf-worker" + i); File logsDir = new File(mWorkDir, "logs-worker" + i); File ramdisk = new F...
python
def evaluate(self, X, *args, return_values_of="auto", return_as_dictionary=False, **kwargs): """ Evaluate the given problem. The function values set as defined in the function. The constraint values ar...
python
def spendables_for_address(self, address): """ Return a list of Spendable objects for the given bitcoin address. """ spendables = [] url_append = "?unspentOnly=true&token=%s&includeScript=true" % self.api_key url = self.base_url("addrs/%s%s" % (address, url_append...
python
def infer_newX(model, Y_new, optimize=True, init='L2'): """ Infer the distribution of X for the new observed data *Y_new*. :param model: the GPy model used in inference :type model: GPy.core.Model :param Y_new: the new observed data for inference :type Y_new: numpy.ndarray :param optimize: ...
java
public boolean insert(int newIndex) { // Ignore objects which do not belong in this quad tree INDArray point = data.slice(newIndex); if (!boundary.containsPoint(point)) return false; cumSize++; double mult1 = (double) (cumSize - 1) / (double) cumSize; double ...
java
public File getGeneratedCssFile(String path) { String rootDir = tempDir + JawrConstant.CSS_SMARTSPRITES_TMP_DIR; String fPath = null; if (jawrConfig.isWorkingDirectoryInWebApp()) { fPath = jawrConfig.getContext().getRealPath(rootDir + getCssPath(path)); } else { fPath = rootDir + getCssPath(path); } ...
java
public Observable<HierarchicalChildEntity> getHierarchicalEntityChildAsync(UUID appId, String versionId, UUID hEntityId, UUID hChildId) { return getHierarchicalEntityChildWithServiceResponseAsync(appId, versionId, hEntityId, hChildId).map(new Func1<ServiceResponse<HierarchicalChildEntity>, HierarchicalChildEnti...
java
public static Trades adaptTrades(List<BTCTurkTrades> btcTurkTrades, CurrencyPair currencyPair) { List<Trade> trades = new ArrayList<>(); BigDecimal lastTradeId = new BigDecimal("0"); for (BTCTurkTrades btcTurkTrade : btcTurkTrades) { if (btcTurkTrade.getTid().compareTo(lastTradeId) > 0) { last...
java
@PostConstruct public final void init() { long timeToKeepAfterAccessInMillis = this.jobQueue.getTimeToKeepAfterAccessInMillis(); if (timeToKeepAfterAccessInMillis >= 0) { if (TimeUnit.SECONDS.toMillis(this.abandonedTimeout) >= this.jobQueue.getTimeToKeepAfterAccessInM...
java
private static CustomPropertyDescriptor tryBuildFinal(Field field, Class<?> clazz) throws IntrospectionException { String name = field.getName(); String readMethodName; log.debug("尝试为final类型的字段{}创建字段说明", name); if (Boolean.class....
java
static SelectStatement forSelection(CFMetaData cfm, Selection selection) { return new SelectStatement(cfm, 0, defaultParameters, selection, null); }
python
def search(self,search_text=None,response_type=None,params=None): """ Function to request economic data series that match search text. `<https://research.stlouisfed.org/docs/api/fred/series_search.html>`_ :arg str search_text: The words to match against economic data series. Required. ...
python
def assign_authorization_to_vault(self, authorization_id, vault_id): """Adds an existing ``Authorization`` to a ``Vault``. arg: authorization_id (osid.id.Id): the ``Id`` of the ``Authorization`` arg: vault_id (osid.id.Id): the ``Id`` of the ``Vault`` raise: Alread...
python
def free_params(self, value): """Set the free parameters. Note that this bypasses enforce_bounds. """ value = scipy.asarray(value, dtype=float) self.K_up_to_date = False self.k.free_params = value[:self.k.num_free_params] self.w.free_params = value[self.k.num_free_params:...
java
public synchronized OtpErlangPid createPid() { final OtpErlangPid p = new OtpErlangPid(node, pidCount, serial, creation); pidCount++; if (pidCount > 0x7fff) { pidCount = 0; serial++; if (serial > 0x1fff) { /* 13 bits */ serial...
python
def rewind(self): '''Return the uncompressed stream file position indicator to the beginning of the file''' if self.mode != READ: raise OSError("Can't rewind in write mode") self.fileobj.seek(0) self._new_member = True self.extrabuf = b"" self.extrasiz...
java
public java.util.Map captureStatistics() { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, "captureStatistics"); java.util.Map statistics = new java.util.HashMap(); statistics.put("maximumAvailableSize", ...
java
private static <T extends Annotation> Class<? extends Annotation> getRepeatableAnnotationContainerClassFor(Class<T> annotationClass) { Repeatable repeatableAnnotation = annotationClass.getDeclaredAnnotation(Repeatable.class); return (repeatableAnnotation == null) ? null : repeatableAnnotation.value(); ...
java
@Override public SubsetMove getRandomMove(SubsetSolution solution, Random rnd) { // get set of candidate IDs for deletion (fixed IDs are discarded) Set<Integer> delCandidates = getRemoveCandidates(solution); // compute maximum number of deletions int curMaxDel = maxDeletions(delCandi...
python
def display_image(self, reset=1): """Utility routine used to display an updated frame from a framebuffer. """ try: fb = self.server.controller.get_frame(self.frame) except KeyError: # the selected frame does not exist, create it fb = self.server.contro...
java
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @SuppressWarnings({ "unchecked", "rawtypes" }) public static <T> Maybe<T> merge(MaybeSource<? extends MaybeSource<? extends T>> source) { ObjectHelper.requireNonNull(source, "source is null"); return RxJavaPlugins.onAssembly(new Mayb...
java
@SuppressWarnings("unchecked") public EList<IfcRelCoversSpaces> getCoversSpaces() { return (EList<IfcRelCoversSpaces>) eGet(Ifc2x3tc1Package.Literals.IFC_COVERING__COVERS_SPACES, true); }
java
public BatchOptions jitterDuration(final int jitterDuration) { BatchOptions clone = getClone(); clone.jitterDuration = jitterDuration; return clone; }
python
def save_yaml_file(file, val): """ Save data to yaml file :param file: Writable object or path to file :type file: FileIO | str | unicode :param val: Value or struct to save :type val: None | int | float | str | unicode | list | dict """ opened = False if not hasattr(file, "write")...
python
def qr_code(self, instance): """ Display picture of QR-code from used secret """ try: return self._qr_code(instance) except Exception as err: if settings.DEBUG: import traceback return "<pre>%s</pre>" % traceback.format_exc(...
java
@Override public Set<KamNode> getAdjacentNodes(KamNode kamNode, EdgeDirectionType edgeDirection) { return wrapNodes(kam.getAdjacentNodes(kamNode, edgeDirection)); }
python
def traverse(self): """Enumerate children and build associated objects """ builder = self.child_builder for child in self._children: with pushd(str(child)): yield child, builder(child)
python
def update_node(cls, cluster_id_label, command, private_dns, parameters=None): """ Add a node to an existing cluster """ conn = Qubole.agent(version=Cluster.api_version) parameters = {} if not parameters else parameters data = {"command" : command, "private_dns" : private...
java
public Observable<OperationStatus> deleteHierarchicalEntityAsync(UUID appId, String versionId, UUID hEntityId) { return deleteHierarchicalEntityWithServiceResponseAsync(appId, versionId, hEntityId).map(new Func1<ServiceResponse<OperationStatus>, OperationStatus>() { @Override public Oper...
java
@Override public BatchDeleteConnectionResult batchDeleteConnection(BatchDeleteConnectionRequest request) { request = beforeClientExecution(request); return executeBatchDeleteConnection(request); }
java
public double errorMembership( double[] sampleA ) { double[] eig = sampleToEigenSpace(sampleA); double[] reproj = eigenToSampleSpace(eig); double total = 0; for( int i = 0; i < reproj.length; i++ ) { double d = sampleA[i] - reproj[i]; total += d*d; } ...
python
def update_settings(self, settings, force=False, timeout=-1): """ Updates interconnect settings on the logical interconnect. Changes to interconnect settings are asynchronously applied to all managed interconnects. (This method is not available from API version 600 onwards) Args:...
java
public static <Value extends Comparable<Value>> int nullSafeCompare(final Value first, final Value second) { if (first == null) { return second == null ? EQUAL_COMPARE_RESULT : LOWER_THAN_COMPARE_RESULT; } return second == null ? GREATER_THAN_COMPARE_RESULT : first.compareTo(second);...
java
private String acquireString() throws IOException, JspException { if (isAbsoluteUrl) { // for absolute URLs, delegate to our peer BufferedReader r = new BufferedReader(acquireReader()); StringBuffer sb = new StringBuffer(); int i; // under JIT, testin...
java
public String toFormattedString(boolean includeColumnNames) { final int MAX_PRINTABLE_CHARS = 30; // chose print width for geography column such that it can print polygon in // aligned manner with geography column for a polygon up to: // a polygon composed of 4 vertices + 1 repeat verte...
java
@SuppressWarnings("unchecked") private void siftDown (int k, E x) { int half = size >>> 1; // loop while a non-leaf while (k < half) { int child = (k << 1) + 1; // assume left child is least E c = (E)queue[child]; int right = child + 1; if (right < size && c.compareTo((E)queue[right]) > 0) c = (E)queue...
java
public void configure(LifecycleEnvironment environment, MetricRegistry registry) { for (ReporterFactory reporter : reporters) { try { final ScheduledReporterManager manager = new ScheduledReporterManager(reporter.build(registry), ...
python
def _clean_body_df(self, df): """Format the dataframe, remove empty rows, and add units attribute.""" if self.suffix == '-drvd.txt': df = df.dropna(subset=('temperature', 'reported_relative_humidity', 'u_wind', 'v_wind'), how='all').reset_index(drop=True) ...
java
@Override public void run() { /* Wait for connections... */ while (true) { // Accept requests from clients. try { clientSocket = serverSocket.accept(); /* Create a process for the communication and start it */ final AbstractClientHandler clientHandler = newClientHandler(clientSocket); f...
python
def guess_cls(self): """Guess the packet class that must be used on the interface""" # Get the data link type try: ret = fcntl.ioctl(self.ins, BIOCGDLT, struct.pack('I', 0)) ret = struct.unpack('I', ret)[0] except IOError: cls = conf.default_l2 ...
java
public OffsetTime withOffsetSameInstant(ZoneOffset offset) { if (offset.equals(this.offset)) { return this; } int difference = offset.getTotalSeconds() - this.offset.getTotalSeconds(); LocalTime adjusted = time.plusSeconds(difference); return new OffsetTime(adjusted, ...
python
def find_home_config_files(filetype=['json', 'yaml']): """Return configs of ``.vcspull.{yaml,json}`` in user's home directory.""" configs = [] yaml_config = os.path.expanduser('~/.vcspull.yaml') has_yaml_config = os.path.exists(yaml_config) json_config = os.path.expanduser('~/.vcspull.json') ha...
java
public static KeyChain configureKeyChain(Name deviceName) throws net.named_data.jndn.security.SecurityException { // access key chain in ~/.ndn; creates if necessary PrivateKeyStorage keyStorage = new FilePrivateKeyStorage(); IdentityStorage identityStorage = new BasicIdentityStorage(); ...
python
def stripascii(string): """Return string truncated at last byte that is 7-bit ASCII. Clean NULL separated and terminated TIFF strings. >>> stripascii(b'string\\x00string\\n\\x01\\x00') b'string\\x00string\\n' >>> stripascii(b'\\x00') b'' """ # TODO: pythonize this i = len(string) ...
python
def _get_view_infos( self, trimmed=False): """query the sherlock-catalogues database view metadata """ self.log.debug('starting the ``_get_view_infos`` method') sqlQuery = u""" SELECT v.*, t.description as "master table" FROM crossmatch_catalogues.tcs...
python
def inflate(self): """Load the resource from the server, if not already loaded.""" if not self._is_inflated: if self._is_inflating: # catch infinite recursion when attempting to inflate # an object that doesn't have enough data to inflate msg...
python
def epochs_joint(ts, variability=None, threshold=0.0, minlength=1.0, proportion=0.75, plot=True): """Identify epochs within a multivariate time series where at least a certain proportion of channels are "stationary", based on a previously computed variability measure. (Note: This req...
java
public static DescriptorExtensionList<FileSystemProvisioner,FileSystemProvisionerDescriptor> all() { return Jenkins.getInstance().<FileSystemProvisioner,FileSystemProvisionerDescriptor>getDescriptorList(FileSystemProvisioner.class); }
java
public HybridRunbookWorkerGroupInner get(String resourceGroupName, String automationAccountName, String hybridRunbookWorkerGroupName) { return getWithServiceResponseAsync(resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName).toBlocking().single().body(); }
python
def import_items(item_seq, dest_model, batch_len=500, clear=False, dry_run=True, start_batch=0, end_batch=None, overwrite=True, run_update=False, ignore_related=True, ignore_errors=False, verbosity=1): """Import a sequence (que...
python
def default_ms(name, tabdesc=None, dminfo=None): """ Creates a default Measurement Set called name. Any Table Description elements in tabdesc will overwrite the corresponding element in a default Measurement Set Table Description (columns, hypercolumns and keywords). In practice, you probably want ...
python
def user_parse(data): """Parse information from provider.""" id_ = data.get('id') yield 'id', id_ yield 'email', data.get('email') yield 'first_name', data.get('first_name') yield 'last_name', data.get('last_name') yield 'username', data.get('name') yield ...
python
def check_error(status): """Set a generic function as the restype attribute of all OpenJPEG functions that return a BOOL_TYPE value. This way we do not have to check for error status in each wrapping function and an exception will always be appropriately raised. """ global ERROR_MSG_LST if ...
java
public void marshall(ListDevicesRequest listDevicesRequest, ProtocolMarshaller protocolMarshaller) { if (listDevicesRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(listDevicesRequest.getArn...
python
def _critical_point_for( self, mount: top_types.Mount, cp_override: CriticalPoint = None) -> top_types.Point: """ Return the current critical point of the specified mount. The mount's critical point is the position of the mount itself, if no pipette is attached, or the p...
python
def FromString(cls, string_rep): """Create a DataStreamSelector from a string. The format of the string should either be: all <type> OR <type> <id> Where type is [system] <stream type>, with <stream type> defined as in DataStream Args: rep ...
java
private JsonObject getDefaultWatermark() { Schema schema = new Schema(); String dataType; String columnName = "derivedwatermarkcolumn"; schema.setColumnName(columnName); WatermarkType wmType = WatermarkType.valueOf( this.workUnitState.getProp(ConfigurationKeys.SOURCE_QUERYBASED_WATERMARK_T...
java
private Map<Object, Object> getClassPathManifestAttributes() { Map<Object, Object> manifestAttributes = null; try { LOGGER.debug("Using Manifest file:{}", getClass().getClassLoader().getResource(MANIFEST).getPath()); Manifest manifest = new Manifest(getClass().getClassLoader().getResourceAsS...
python
def on_start(self): """ start the service """ LOGGER.debug("natsd.Service.on_start") self.service = threading.Thread(target=self.run_event_loop, name=self.serviceQ + " service thread") self.service.start() while not self.is_started: time.sleep(0.01)
java
private TreeNode insert(TreeNode node, NumberVector nv) { // Find closest child: ClusteringFeature[] cfs = node.children; assert (cfs[0] != null) : "Unexpected empty node!"; // Find the best child: ClusteringFeature best = cfs[0]; double bestd = distance.squaredDistance(nv, best); for(int i...
python
def split_predicate(ex: Extraction) -> Extraction: """ Ensure single word predicate by adding "before-predicate" and "after-predicate" arguments. """ rel_toks = ex.toks[char_to_word_index(ex.rel.span[0], ex.sent) \ : char_to_word_index(ex.rel.span[1], ex.sent) + 1] if ...
python
def destroy(cls, url): """ This operation deletes an existing endpoint from the list of all endpoints, and makes the server stop listening on the endpoint. *Note*: deleting and disconnecting an endpoint is allowed in the system database only. Calling this action ...
java
private static List<String> filterDelimeterElement(List<String> arr, char[] delimeter){ List<String> list = new ArrayList<String>(); for(String s : arr){ if(s == null || s.isEmpty()){ continue; } if(s.length() > 1){ list.add(s); ...
java
public int insertMetaBeanById(String tableName, MicroMetaBean microMetaBean) { //JdbcTemplate jdbcTemplate = (JdbcTemplate) MicroDbHolder.getDbSource(dbName); JdbcTemplate jdbcTemplate =getMicroJdbcTemplate(); final MicroMetaBean insertBean=microMetaBean; String timeName=getTimeName(); String sql = "inse...
java
@Override public double getStandardDeviation(RandomVariable probabilities) { if(isDeterministic()) { return 0.0; } if(size() == 0) { return Double.NaN; } return Math.sqrt(getVariance(probabilities)); }
java
public Traverson startWith(final String uriTemplate, final Map<String, Object> vars) { return startWith(fromTemplate(uriTemplate).expand(vars)); }
java
public void writeThisClass(String strClassName, String strRecordType) { Record recFileHdr = this.getRecord(FileHdr.FILE_HDR_FILE); try { recFileHdr.addNew(); recFileHdr.getField(FileHdr.FILE_NAME).setString(strClassName); recFileHdr.setKeyArea(FileHdr.FILE_NAME_...
python
def later_than(after, before): """ True if then is later or equal to that """ if isinstance(after, str): after = str_to_time(after) elif isinstance(after, int): after = time.gmtime(after) if isinstance(before, str): before = str_to_time(before) elif isinstance(before, int): ...
python
def get_pac(url=None, js=None, from_os_settings=True, from_dns=True, timeout=2, allowed_content_types=None, **kwargs): """ Convenience function for finding and getting a parsed PAC file (if any) that's ready to use. :param str url: Download PAC from a URL. If provided, `from_os_settings` and `...
python
def to_netcdf(ds, *args, **kwargs): """ Store the given dataset as a netCDF file This functions works essentially the same as the usual :meth:`xarray.Dataset.to_netcdf` method but can also encode absolute time units Parameters ---------- ds: xarray.Dataset The dataset to store ...
java
public void execute() throws BuildException { try { log( "Generating test cases for inputDef=" + options_.getInputDef()); File logFile = getLogFile(); if( logFile != null) { System.setProperty( "tcases.log.file", logFile.getAbsolutePath()); log( "For details, see...
java
protected DocumentReference createDocument(String docType, Object document, String ownerType, Long ownerId, Long processInstanceId, String searchKey1, String searchKey2) throws EventHandlerException { ListenerHelper helper = new ListenerHelper(); return helper.createDocument(docType, doc...
java
public Observable<ServiceResponse<Page<JobExecutionInner>>> listByJobExecutionWithServiceResponseAsync(final String resourceGroupName, final String serverName, final String jobAgentName, final String jobName, final UUID jobExecutionId) { return listByJobExecutionSinglePageAsync(resourceGroupName, serverName, jo...
python
def authorize(self, request, *args, **kwargs): """ authorization logic raises PermissionDenied if user is not authorized """ user = request.user if not user.is_authenticated or not user.socialaccount_set.exists(): raise PermissionDenied()
python
def imshow(image, format, **kwargs): """Draw an image in the current context figure. Parameters ---------- image: image data Image data, depending on the passed format, can be one of: - an instance of an ipywidgets Image - a file name - a raw byte string f...
java
private Object setElementCollection(Object entity, Object thriftColumnValue, MetamodelImpl metaModel, Attribute attribute) { String cqlColumnMetadata = null; Map<ByteBuffer, String> schemaTypes = this.clientBase.getCqlMetadata().getValue_types(); for (Map.Entry<ByteBuffer, String...
java
private HttpLocalFormat getFormat() { HttpLocalFormat format = threadStorage.get(); if (null == format) { format = new HttpLocalFormat(); threadStorage.set(format); } return format; }
python
def inspect_mem(self, mem): """ Get the values in a map during the current simulation cycle. :param mem: the memory to inspect :return: {address: value} Note that this returns the current memory state. Modifying the dictonary will also modify the state in the simulator ...
python
def get_sigma(database_file_name='', e_min=np.NaN, e_max=np.NaN, e_step=np.NaN, t_kelvin=None): """retrieve the Energy and sigma axis for the given isotope :param database_file_name: path/to/file with extension :type database_file_name: string :param e_min: left energy range in eV of new interpolated d...
python
def get_default_val(self): """Helper to expand default value (support callables).""" val = self.default while callable(val): val = val() return val
java
private void checkNotClosed() throws SISessionUnavailableException { if (tc.isEntryEnabled()) SibTr.entry(tc, "checkNotClosed"); // Check that the consumer session isn't closed _consumerSession.checkNotClosed(); // Now check that this consumer hasn't closed. synchronized (this) { ...