language
stringclasses
2 values
func_code_string
stringlengths
63
466k
python
def from_dict(cls, d): """ Returns: CompleteDos object from dict representation. """ tdos = Dos.from_dict(d) struct = Structure.from_dict(d["structure"]) pdoss = {} for i in range(len(d["pdos"])): at = struct[i] orb_dos = {} for...
python
def cluster_commit(): ''' Commit Cluster Changes .. versionchanged:: 2015.8.0 CLI Example: .. code-block:: bash salt '*' riak.cluster_commit ''' ret = {'comment': '', 'success': False} cmd = __execute_cmd('riak-admin', 'cluster commit') if cmd['retcode'] != 0: r...
java
private String readString() throws IOException { StringBuffer sb = new StringBuffer(); int delim = lastChar; int l = lineNo; int c = colNo; readChar(); while ((-1 != lastChar) && (delim != lastChar)) { StringBuffer digitB...
java
@Override public void put(final String varName, final Object object) { runWithContext(new RhinoCallable<Void, RuntimeException>() { @Override protected Void doCall(Context cx, Scriptable scope) { scope.put(varName, scope, object != null ? Context.javaToJS(object, scop...
python
def save_json_to_file(i): """ Input: { json_file - file name dict - dict to save (sort_keys) - if 'yes', sort keys (safe) - if 'yes', ignore non-JSON values (only for Debugging - changes original dict!) } Output: { ...
python
def launch(self, args, ctx, grid_dims, block_dims, shared_mem=0): """Launch cuda kernel. Parameters ---------- args : tuple of NDArray or numbers List of arguments for kernel. NDArrays are expected for pointer types (e.g. `float*`, `double*`) while numbers are ex...
java
public Vector3d set(int index, DoubleBuffer buffer) { MemUtil.INSTANCE.get(this, index, buffer); return this; }
python
def to_str(self, s): ''' In py2 converts a unicode to str (bytes) using utf-8. -- in py3 raises an error if it's not str already. ''' if s.__class__ != str: if not IS_PY3K: s = s.encode('utf-8') else: raise AssertionError('E...
java
public OvhOrder dedicated_nasha_new_duration_GET(String duration, OvhNasHAZoneEnum datacenter, OvhNasHAOfferEnum model) throws IOException { String qPath = "/order/dedicated/nasha/new/{duration}"; StringBuilder sb = path(qPath, duration); query(sb, "datacenter", datacenter); query(sb, "model", model); String ...
java
@Override public C setScale(final double x, final double y) { getAttributes().setScale(x, y); return cast(); }
java
static int dayNumToDate(DayOfWeek dow0, int nDays, int weekNum, DayOfWeek dow, int d0, int nDaysInMonth) { //if dow is wednesday, then this is the date of the first wednesday int firstDateOfGivenDow = 1 + ((7 + dow.getCalendarConstant() - dow0.getCalendarConstant()) % 7); int date; if (weekNum > 0) { date =...
python
def are_equal(self, sp1, sp2): """ True if there is some overlap in composition between the species Args: sp1: First species. A dict of {specie/element: amt} as per the definition in Site and PeriodicSite. sp2: Second species. A dict of {specie/element: a...
java
public final long[] evalDayStartEndFor(final Date pDateFor) { Calendar cal = Calendar.getInstance(new Locale("en", "US")); cal.setTime(pDateFor); cal.set(Calendar.HOUR_OF_DAY, 0); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); cal.set(Calendar.MILLISECOND, 0); long[] result = new ...
python
def _negotiateAssociation(self, endpoint): """Make association requests to the server, attempting to create a new association. @returns: a new association object @rtype: L{openid.association.Association} """ # Get our preferred session/association type from the negotiat...
python
def get_transient(self, name): '''Restores TransientFile object with given name. Should be used when form is submitted with file name and no file''' # security checks: basically no folders are allowed assert not ('/' in name or '\\' in name or name[0] in '.~') transient = Transie...
java
public static String pick(String[] values) { if (values == null || values.length == 0) return ""; int index = RandomInteger.nextInteger(values.length); return values[index]; }
java
private static void internalVerticalBlur( int[] pixels, int[] outCol, int w, int h, int col, int diameter, int[] div) { final int lastInByte = w * (h - 1) + col; final int radiusTimesW = (diameter >> 1) * w; final int diameterMinusOneTimesW = (diameter - 1) * w; int a = 0, r = 0, g = 0, b = 0; ...
python
def update_exif_GEXIV2(oldfile,newfile): """Transfers oldfile's exif to newfile's exif and updates the width/height EXIF fields""" # Requires gexiv2 and pygobject package in gentoo # (USE=introspection) try: from gi.repository import GExiv2 except: print("Couldn't import GExiv...
python
def upload_entities_tsv(namespace, workspace, entities_tsv): """Upload entities from a tsv loadfile. File-based wrapper for api.upload_entities(). A loadfile is a tab-separated text file with a header row describing entity type and attribute names, followed by rows of entities and their attribute v...
java
public static OverwritePolicy byDateFromTo(String attribute, Calendar start, Calendar end) { return new DateRangeOverwritePolicy(attribute, start, end); }
java
public static <K, V> TreeMap<K, V> treeMapOf(K k1, V v1, K k2, V v2) { TreeMap<K, V> treeMap = new TreeMap<>(); treeMap.put(k1, v1); treeMap.put(k2, v2); return treeMap; }
python
def system(session): """Run the system test suite.""" # Sanity check: Only run system tests if the environment variable is set. if not os.environ.get('GOOGLE_APPLICATION_CREDENTIALS', ''): session.skip('Credentials must be set via environment variable.') # Use pre-release gRPC for system tests...
java
public static void displayAction( CmsResource elementResource, I_CmsFormatterBean formatter, Map<String, String> settings, boolean editable, boolean canCreate, boolean canDelete, String creationSiteMap, String postCreateHandler, PageContext context...
java
private org.apache.hadoop.conf.Configuration loadHadoopConfigFromFlink() { org.apache.hadoop.conf.Configuration hadoopConfig = new org.apache.hadoop.conf.Configuration(); for (String key : flinkConfig.keySet()) { for (String prefix : flinkConfigPrefixes) { if (key.startsWith(prefix)) { String newKey = h...
python
def update_braintree_gateway_by_id(cls, braintree_gateway_id, braintree_gateway, **kwargs): """Update BraintreeGateway Update attributes of BraintreeGateway This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> ...
java
@Override public Attribute getAttribute(Object feature, String name) throws LayerException { return convertAttribute(asFeature(feature).getAttribute(name), name); }
python
def _set_drop_precedence_force(self, v, load=False): """ Setter method for drop_precedence_force, mapped from YANG variable /ipv6_acl/ipv6/access_list/extended/seq/drop_precedence_force (ip-access-list:drop-prec-uint) If this variable is read-only (config: false) in the source YANG file, then _set_drop_...
python
def split_tag(section): """ Split the JSDoc tag text (everything following the @) at the first whitespace. Returns a tuple of (tagname, body). """ splitval = re.split('\s+', section, 1) tag, body = len(splitval) > 1 and splitval or (splitval[0], '') return tag.strip(), body.strip()
python
def gather(self, iterable): """Calls the lookup with gather True Passing iterable and yields the result. """ for result in self.lookup(iterable, gather=True): yield result
python
def attribute(element, attribute, default=None): """ Returns the value of an attribute, or a default if it's not defined :param element: The XML Element object :type element: etree._Element :param attribute: The name of the attribute to evaluate :type attribute: basestring :param default...
java
public GetOpenIDConnectProviderResult withClientIDList(String... clientIDList) { if (this.clientIDList == null) { setClientIDList(new com.amazonaws.internal.SdkInternalList<String>(clientIDList.length)); } for (String ele : clientIDList) { this.clientIDList.add(ele); ...
python
def beginWithoutDiscovery(self, service, anonymous=False): """Start OpenID verification without doing OpenID server discovery. This method is used internally by Consumer.begin after discovery is performed, and exists to provide an interface for library users needing to perform their own ...
java
public static synchronized void configure(final String options, final Instrumentation instrumentation) throws Exception { if (SigarAgent.instrumentation != null) { logger.severe("Duplicate agent setup attempt."); return; } SigarAgent.options = options; SigarAgent.instrumentation = instrumentation; ...
java
protected byte[] getBytesInternal() { byte cached[]; if(hasNoValueCache() || (cached = valueCache.lowerBytes) == null) { valueCache.lowerBytes = cached = getBytesImpl(true); } return cached; }
python
def _is_valid_templates_dict(policy_templates_dict, schema=None): """ Is this a valid policy template dictionary :param dict policy_templates_dict: Data to be validated :param dict schema: Optional, dictionary containing JSON Schema representing policy template :return: True, if...
python
def scan2(self, tablename, expr_values=None, alias=None, attributes=None, consistent=False, select=None, index=None, limit=None, return_capacity=None, filter=False, segment=None, total_segments=None, exclusive_start_key=None, **kwargs): """ Perform a full-table ...
java
public static <T> CloseableIterable<T> concat(final CloseableIterable<? extends Iterable<? extends T>> inputs) { return wrap(Iterables.concat(inputs), inputs); }
python
def getInfo(self, CorpNum, MgtKeyType, MgtKey): """ ์ƒํƒœ์ •๋ณด ํ™•์ธ args CorpNum : ํšŒ์› ์‚ฌ์—…์ž ๋ฒˆํ˜ธ MgtKeyType : ๊ด€๋ฆฌ๋ฒˆํ˜ธ ์œ ํ˜• one of ['SELL','BUY','TRUSTEE'] MgtKey : ํŒŒํŠธ๋„ˆ ๊ด€๋ฆฌ๋ฒˆํ˜ธ return ์ฒ˜๋ฆฌ๊ฒฐ๊ณผ. consist of code and message raise ...
java
@Override public UpdateUserSecurityProfilesResult updateUserSecurityProfiles(UpdateUserSecurityProfilesRequest request) { request = beforeClientExecution(request); return executeUpdateUserSecurityProfiles(request); }
java
public final void mT__136() throws RecognitionException { try { int _type = T__136; int _channel = DEFAULT_TOKEN_CHANNEL; // InternalSARL.g:122:8: ( 'try' ) // InternalSARL.g:122:10: 'try' { match("try"); } state...
java
static URL lookupResource(String path) { for (LocaleDrivenResourceProvider provider : getLocaleDrivenResourceProviders()) { try { URL url = provider.lookup(path); if (url != null) { return url; } } catch (Exception e) { ...
python
def add_search_engine(self, name, engine): '''Adds a search engine with the given name. ``engine`` must be the **class** object rather than an instance. The class *must* be a subclass of :class:`dossier.web.SearchEngine`, which should provide a means of obtaining recommendations...
java
public void openRead(ReadStreamOld rs) throws IOException { closeWrite(); TempReadStream tempReadStream = new TempReadStream(_head); //tempReadStream.setPath(getPath()); tempReadStream.setFreeWhenDone(true); _head = null; _tail = null; rs.init(tempReadStream); }
java
public void displayOSInfo( Log log, boolean info ) { String string = "OS Info: Arch: " + Os.OS_ARCH + " Family: " + Os.OS_FAMILY + " Name: " + Os.OS_NAME + " Version: " + Os.OS_VERSION; if ( !info ) { log.debug( string ); } else ...
python
async def sort(self, name, start=None, num=None, by=None, get=None, desc=False, alpha=False, store=None, groups=None): """Sort and return the list, set or sorted set at ``name``. :start: and :num: allow for paging through the sorted data :by: allows using an external ke...
python
def transform_array(rot_mtx,vec_array): '''transform_array( matrix, vector_array ) -> vector_array ''' return map( lambda x,m=rot_mtx:transform(m,x), vec_array )
java
public static Pipe newPipe(byte[] data, int offset, int length) throws IOException { return newPipe(new ByteArrayInputStream(data, offset, length)); }
java
public XSModel parseString(String schema, String baseURI){ return xsLoader.load(new DOMInputImpl(null, null, baseURI, schema, null)); }
java
public boolean contains(Object o) { if (o instanceof String) { return set.contains(((String) o).toLowerCase()); } else { return set.contains(o); } }
python
def fetch_extra_data(resource): """Return a dict with extra data retrieved from cern oauth.""" person_id = resource.get('PersonID', [None])[0] identity_class = resource.get('IdentityClass', [None])[0] department = resource.get('Department', [None])[0] return dict( person_id=person_id, ...
python
def delete_job(job_id): """Deletes a job.""" try: current_app.apscheduler.remove_job(job_id) return Response(status=204) except JobLookupError: return jsonify(dict(error_message='Job %s not found' % job_id), status=404) except Exception as e: return jsonify(dict(error_me...
python
def get_manufacturer_string(self): """ Get the Manufacturer String from the HID device. :return: The Manufacturer String :rtype: unicode """ self._check_device_status() str_p = ffi.new("wchar_t[]", 255) rv = hidapi.hid_get_manufacturer_string(self._device...
python
async def src_reload(app, path: str = None): """ prompt each connected browser to reload by sending websocket message. :param path: if supplied this must be a path relative to app['static_path'], eg. reload of a single file is only supported for static resources. :return: number of sources relo...
python
def _strip_key(dictionary, keyword): ''' look for a certain key within a dictionary and nullify ti's contents, check within nested dictionaries and lists as well. Certain attributes such as "generation" will change even when there were no changes made to the entity. ''' for key, value in six.i...
java
private static RandomVariable[] numberListToDoubleArray(List<RandomVariable> listOfNumbers) { RandomVariable[] array = new RandomVariable[listOfNumbers.size()]; for(int i=0; i<array.length; i++) { array[i] = listOfNumbers.get(i); } return array; }
java
static void writeIoDevice(IoDevice ioDevice, BufferedWriter writer, int priority) throws IOException { writer.write(XML_START_TAG); XMLUtils.writeXmlAttribute(VENDOR_ID, ioDevice.getVendorId(), writer); XMLUtils.writeXmlAttribute(PRODUCT_ID, ioDevice.getProductId(), writer); ...
python
def solve_equilibrium_point(self, analyzer1, analyzer2, delu_dict={}, delu_default=0, units="nanometers"): """ Gives the radial size of two particles where equilibrium is reached between both particles. NOTE: the solution here is not the same as th...
java
private static double IndianToJD(int year, int month, int date) { int leapMonth, gyear, m; double start, jd; gyear = year + INDIAN_ERA_START; if(isGregorianLeap(gyear)) { leapMonth = 31; start = gregorianToJD(gyear, 3, 21); } else { leapMonth = 30; ...
python
def sequence_to_string( a_list, open_bracket_char='[', close_bracket_char=']', delimiter=", " ): """a dedicated function that turns a list into a comma delimited string of items converted. This method will flatten nested lists.""" return "%s%s%s" % ( open_bracket_char, delim...
java
private DescribeSubnetsResponseType describeSubnets() { DescribeSubnetsResponseType ret = new DescribeSubnetsResponseType(); ret.setRequestId(UUID.randomUUID().toString()); SubnetSetType subnetSetType = new SubnetSetType(); for (Iterator<MockSubnet> mockSubnet = mockSubnetController.des...
java
private DefaultSubscriptionBase getDefaultSubscriptionBase(final Entity subscriptionBase, final Catalog catalog, final InternalTenantContext context) throws CatalogApiException { if (subscriptionBase instanceof DefaultSubscriptionBase) { return (DefaultSubscriptionBase) subscriptionBase; } e...
python
def ext_pillar(minion_id, # pylint: disable=W0613 pillar, # pylint: disable=W0613 conf): ''' Parse varstack data and return the result ''' vs = varstack.Varstack(config_filename=conf) return vs.evaluate(__grains__)
python
def git_clone(prettyname: str, url: str, directory: str, branch: str = None, commit: str = None, clone_options: List[str] = None, run_func: Callable[[List[str]], Any] = None) -> bool: """ Fetches a Git repository, unless we have it already. Args: ...
python
def __print_command_help(self, session, namespace, cmd_name): """ Prints the documentation of the given command :param session: Session handler :param namespace: Name space of the command :param cmd_name: Name of the command """ # Extract documentation ar...
python
def create_weights(nodes, dist): """Create weights for the Laja method.""" poly = chaospy.quad.generate_stieltjes(dist, len(nodes)-1, retall=True)[0] poly = chaospy.poly.flatten(chaospy.poly.Poly(poly)) weights_inverse = poly(nodes) weights = numpy.linalg.inv(weights_inverse) return weights[:, 0...
python
def example_metadata(study_name, draft_name): """Example of building a metadata doc""" odm = ODM("SYSTEM_NAME", filetype=ODM.FILETYPE_SNAPSHOT) study = Study(study_name, project_type=Study.PROJECT) # Push study element into odm odm << study # Create global variables and set them into study. ...
java
public static StreamingOutput buildResponseOfDomLR(final IStorage pDatabase, final IBackendFactory pStorageFac, final IRevisioning pRevision) { final StreamingOutput sOutput = new StreamingOutput() { @Override public void write(final OutputStream output) throws IOException, Web...
python
def add(self, fixed=None, random=None, priors=None, family='gaussian', link=None, categorical=None, append=True): '''Adds one or more terms to the model via an R-like formula syntax. Args: fixed (str): Optional formula specification of fixed effects. random (list): O...
java
public Vector position(VesselPosition relativeTo) { // TODO longitude wrapping check double xMetres = (lon - relativeTo.lon()) * relativeTo.metresPerDegreeLongitude(); double yMetres = (lat - relativeTo.lat()) * relativeTo.metresPerDegreeLatitude(); return new Vector(xMetres, yMetres); ...
python
def setSpeed(self, vehID, speed): """setSpeed(string, double) -> None Sets the speed in m/s for the named vehicle within the last step. """ self._connection._sendDoubleCmd( tc.CMD_SET_VEHICLE_VARIABLE, tc.VAR_SPEED, vehID, speed)
java
public OvhOfferTask billingAccount_number_serviceName_convertToLine_POST(String billingAccount, String serviceName, String offer) throws IOException { String qPath = "/telephony/{billingAccount}/number/{serviceName}/convertToLine"; StringBuilder sb = path(qPath, billingAccount, serviceName); HashMap<String, Objec...
java
@Override protected List<List<T>> mate(List<T> parent1, List<T> parent2, int numberOfCrossoverPoints, Random rng) { List<T> offspring1 = new ArrayList<T>(parent1); // Use a random-access list for performan...
java
@Nonnull public ApiFuture<DocumentSnapshot> get(@Nonnull DocumentReference documentRef) { Preconditions.checkState(isEmpty(), READ_BEFORE_WRITE_ERROR_MSG); return ApiFutures.transform( firestore.getAll(new DocumentReference[] {documentRef}, /*fieldMask=*/ null, transactionId), new ApiFunction...
python
def get_path(self, file): """Get the full path of the notebook found in the directory specified by self.path. """ class_path = inspect.getfile(self.__class__) parent_path = os.path.dirname(class_path) path = os.path.join(parent_path,self.path,file) return os.path...
java
public IRestfulClientFactory getRestfulClientFactory() { if (myRestfulClientFactory == null) { try { myRestfulClientFactory = (IRestfulClientFactory) ReflectionUtil.newInstance(Class.forName("ca.uhn.fhir.rest.client.apache.ApacheRestfulClientFactory"), FhirContext.class, this); } catch (ClassNotFoundExcepti...
python
def import_class(import_path, name=None): """ Imports and returns class for full class path string. Ex. 'foo.bar.Bogus' -> <class 'foo.bar.Bogus'> """ if not name: import_path, name = import_path.rsplit('.', 1) mod = import_module(import_path) try: return getattr(mod, name) ...
java
public JdbcMapperBuilder<T> addMapping(final String column, final int index, final int sqlType, Object... properties) { return addMapping(new JdbcColumnKey(column, index, sqlType), properties); }
python
def base_add_isoquant_data(features, quantfeatures, acc_col, quantacc_col, quantfields): """Generic function that takes a peptide or protein table and adds quant data from ANOTHER such table.""" quant_map = get_quantmap(quantfeatures, quantacc_col, quantfields) for feature in ...
java
public T removeHeader(String name) { if(name != null) { headers.remove(name.trim()); } return (T)this; }
java
private String generateXml(String encrypt, String signature, String timestamp, String nonce) { String format = "<xml>\n" + "<Encrypt><![CDATA[%1$s]]></Encrypt>\n" + "<MsgSignature><![CDATA[%2$s]]></MsgSignature>\n" + "<TimeStamp>%3$s</TimeStamp>\n" + "<N...
python
def unpack_db_to_component_dfs(self, convert_dates=False): """Returns the set of known tables in the adjustments file in DataFrame form. Parameters ---------- convert_dates : bool, optional By default, dates are returned in seconds since EPOCH. If convert...
java
public static ByteArrayInputStream toStream(ByteBuffer byteBuffer) { if (byteBuffer == null) { return new ByteArrayInputStream(new byte[0]); } return new ByteArrayInputStream(copyBytesFrom(byteBuffer)); }
java
@Override public void eUnset(int featureID) { switch (featureID) { case TypesPackage.JVM_ANNOTATION_REFERENCE__ANNOTATION: setAnnotation((JvmAnnotationType)null); return; case TypesPackage.JVM_ANNOTATION_REFERENCE__EXPLICIT_VALUES: getExplicitValues().clear(); return; } super.eUnset(feat...
java
public ModelBuilder properties(Map<String, ModelProperty> properties) { this.properties.putAll(nullToEmptyMap(properties)); return this; }
python
def application_2_json(self): """ transform ariane_clip3 Application object to Ariane server JSON obj :return: Ariane JSON obj """ LOGGER.debug("Application.application_2_json") json_obj = { 'applicationID': self.id, 'applicationName': self.name, ...
python
def update_trigger(self, trigger): """ Updates on the Alert API the trigger record having the ID of the specified Trigger object: the remote record is updated with data from the local Trigger object. :param trigger: the Trigger with updated data :type trigger: `pyowm.alertapi30....
java
protected void initListener(XmlParser.Node node) { String className=node.getString("listener-class",false,true); Object listener=null; try { Class listenerClass=getWebApplicationContext().loadClass(className); listener=listenerClass.newInstance(); } ...
java
private boolean hasNonComplexMember(Complex cx) { for (PhysicalEntity mem : cx.getComponent()) { if (!(mem instanceof Complex) || hasNonComplexMember((Complex) mem)) { return true; } } return false; }
python
def _str_datetime_now(self, x=None): """Return datetime string for use with time attributes. Handling depends on input: 'now' - returns datetime for now number - assume datetime values, generate string other - no change, return same value """ if (x == ...
python
def create(cls, selective: typing.Optional[base.Boolean] = None): """ Create new force reply :param selective: :return: """ return cls(selective=selective)
python
def _pruned(self, path): """Is a stat tree node pruned? Goes through the list of prune rules to find one that applies. Chronologically newer rules are higher-precedence than older ones. If no rule applies, the stat is not pruned by default.""" if path[0] == '/': path = path[1:] for rule ...
java
@FFDCIgnore(Exception.class) public boolean isEntityInRealm(String uniqueName) { if (isSafRegistry()) { try { return userRegistry.isValidUser(uniqueName); } catch (Exception e) { /* Ignore. */ } try { return us...
java
@SuppressWarnings("unchecked") @Override public Class<T> versionClass() { if (this.retentionPolicies.size() == 1) { return (Class<T>) this.retentionPolicies.get(0).versionClass(); } Class<T> klazz = (Class<T>) this.retentionPolicies.get(0).versionClass(); for (RetentionPolicy<T> policy : this...
python
def index_impl(self): """Return {runName: {tagName: {displayName: ..., description: ...}}}.""" if self._db_connection_provider: # Read tags from the database. db = self._db_connection_provider() cursor = db.execute(''' SELECT Tags.tag_name, Tags.display_name, ...
python
def get_repositories_by_ids(self, repository_ids=None): """Gets a ``RepositoryList`` corresponding to the given ``IdList``. In plenary mode, the returned list contains all of the repositories specified in the ``Id`` list, in the order of the list, including duplicates, or an error resul...
python
def _get_path_assembly_mapping_data( self, source_assembly, target_assembly, retries=10 ): """ Get local path to assembly mapping data, downloading if necessary. Parameters ---------- source_assembly : {'NCBI36', 'GRCh37', 'GRCh38'} assembly to remap from ...
python
def parse_requirements( requirements_path: str = 'requirements.txt') -> t.List[str]: """Read contents of requirements.txt file and return data from its relevant lines. Only non-empty and non-comment lines are relevant. """ requirements = [] with HERE.joinpath(requirements_path).open() as re...
python
def get_all_methods(self, entry_point=ALL, protocol=ALL, sort_methods=False): """Return a list of all methods in the registry supported by the given entry_point / protocol pair""" if sort_methods: return [ method for (_, method) in sorted(self._registry.items()) if method.is...
java
public ConditionalBranchDescrBuilder<CEDescrBuilder<P, T>> conditionalBranch() { ConditionalBranchDescrBuilder<CEDescrBuilder<P, T>> conditionalBranch = new ConditionalBranchDescrBuilderImpl<CEDescrBuilder<P, T>>( this ); ((ConditionalElementDescr) descr).addDescr(conditionalBranch.getDescr()); ...
python
def noise_from_psd(length, delta_t, psd, seed=None): """ Create noise with a given psd. Return noise with a given psd. Note that if unique noise is desired a unique seed should be provided. Parameters ---------- length : int The length of noise to generate in samples. delta_t : flo...