language
stringclasses
2 values
func_code_string
stringlengths
63
466k
python
def plot_spectra_pieces_pdf(ss, aint=10, pdf_filename='pieces.pdf', setup=_default_setup): """ Plots spectra, overlapped, in small wavelength intervals into a PDF file, one interval per page of the PDF file. Args: ss: list of Spectrum objects aint: wavelength interval for each plot pd...
java
public void marshall(EventAggregate eventAggregate, ProtocolMarshaller protocolMarshaller) { if (eventAggregate == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(eventAggregate.getAggregateValue(), A...
python
def illmat(D, random_state=None): """Generate a <D x D> ill-conditioned correlation matrix with random coefficients Parameters: ----------- D : int Dimension of the matrix Return: ------- cmat : ndarray DxD matrix with +1 as diagonal elements, mirrored random nu...
java
public String getTokens() { String tokens = attrMixin.getAttribute(TOKENS); return tokens.isEmpty() ? null : tokens; }
python
def publish_event(self, channel, event, message): '''Publish a new event ``message`` to a ``channel``. ''' assert self.protocol is not None, "Protocol required" msg = {'event': event, 'channel': channel} if message: msg['data'] = message return self.publish(ch...
python
def set_up(): """ Set ups the V8 machinery:\ platform, VM and context. This function is not thread-safe,\ it must be called from a place\ where is guaranteed it will be\ called once and only once.\ Probably within the main-thread\ at import time. """ global _context if ...
java
public final static Observable<Long> averageLong(Observable<Long> source) { return source.lift(new OperatorAverageLong<Long>(MathObservable.<Long>identity())); }
python
def get_config(): """ Reads the music download filepath from scdl.cfg """ global token config = configparser.ConfigParser() config.read(os.path.join(os.path.expanduser('~'), '.config/scdl/scdl.cfg')) try: token = config['scdl']['auth_token'] path = config['scdl']['path'] ...
python
def remove_other_ldflags(self, flags, target_name=None, configuration_name=None): """ Removes the given flags from the OTHER_LDFLAGS section of the target on the configurations :param flags: A string or array of strings. If none, removes all values from the flag. :param target_name: Targ...
java
public static By getByForParentElement(By by) { if (by instanceof ByXPath) { String xpath = by.toString().replace("By.xpath: ", "").replaceFirst("^.?//", ".//"); return By.xpath(xpath); } return by; }
java
public org.mariadb.jdbc.internal.com.send.authentication.ed25519.math.GroupElement dbl() { switch (this.repr) { case P2: case P3: // Ignore T for P3 representation FieldElement XX, YY, B, A, AA, Yn, Zn; XX = this.X.square(); YY = this.Y.square(); B = this.Z.squareAndDoubl...
python
def field_pklist_from_json(self, data): """Load a PkOnlyQueryset from a JSON dict. This uses the same format as cached_queryset_from_json """ model = get_model(data['app'], data['model']) return PkOnlyQueryset(self, model, data['pks'])
python
def rank_remove(self, rank, items, cutoff): """ remove tokens or stems (specified in items) based on rank's (df or tfidf) value being less than cutoff to remove all words with rank R or less, specify cutoff = self.xxx_ranking[R][1] """ def remove(tokens): re...
python
async def get_buttons(self): """ Returns `buttons`, but will make an API call to find the input chat (needed for the buttons) unless it's already cached. """ if not self.buttons and self.reply_markup: chat = await self.get_input_chat() if not chat: ...
java
public void setNavigationDrawer(final int status){ final View homeView = getter.getView("home", 0); final View leftDrawer = getter.getView("left_drawer", 0); try{ switch (status) { case CLOSED: if(leftDrawer != null && homeView != null && leftDrawer.isShown()){ clicker.clickOnScreen(homeView...
python
def create_multiple_droplets(self, names, image, size, region, ssh_keys=None, backups=None, ipv6=None, private_networking=None, user_data=None, **kwargs): r""" Create multiple new droplets at once with the...
java
public Tabs setAjaxBeforeActivateEvent(ITabsAjaxEvent beforeActivateEvent) { this.ajaxEvents.put(TabEvent.beforeActivate, beforeActivateEvent); setBeforeActivateEvent(new TabsAjaxBeforeActivateJsScopeUiEvent(this, TabEvent.beforeActivate, false)); return this; }
java
public boolean containsKey(final int key) { boolean found = false; @DoNotSub final int setNumber = Hashing.hash(key, mask); @DoNotSub final int setBeginIndex = setNumber << setSizeShift; for (@DoNotSub int i = setBeginIndex, setEndIndex = setBeginIndex + setSize; i < setEndIndex; i+...
java
public static <T> OffsetPaginatedList.Builder<T> builder() { return new AutoValue_OffsetPaginatedList.Builder<T>().items(new ArrayList<>()) .metadata( LimitParameter.getDefaultLimitFieldName(), null, OffsetParameter.getDefaultOffsetFieldName(), null, null, null); }
java
protected final void acceptAnnotations(final MethodVisitor mv) { int n = visibleTypeAnnotations == null ? 0 : visibleTypeAnnotations .size(); for (int i = 0; i < n; ++i) { TypeAnnotationNode an = visibleTypeAnnotations.get(i); an.accept(mv.visitInsnAnnotation(an.t...
java
public OvhTask serviceName_virtualMac_POST(String serviceName, String ipAddress, OvhVmacTypeEnum type, String virtualMachineName) throws IOException { String qPath = "/dedicated/server/{serviceName}/virtualMac"; StringBuilder sb = path(qPath, serviceName); HashMap<String, Object>o = new HashMap<String, Object>();...
python
def symmetrization(es, fs, f2e_train, e2f_train): ''' forpus for translation from fs to es return alignment **from fs to es** ''' f2e = viterbi_alignment(es, fs, *f2e_train).items() e2f = viterbi_alignment(fs, es, *e2f_train).items() """ es: English words ...
java
@Override public final PageFactory<? extends IRequestablePage> addingService( ServiceReference<PageFactory<? extends IRequestablePage>> reference) { PageFactory<? extends IRequestablePage> pageSource = super.addingService(reference); paxWicketPageFactory.add(pageSource); return p...
java
public final <E> FluentCloseableIterable<E> transformAndConcat(Function<? super T, ? extends Iterable<E>> function) { return from(CloseableIterables.concat(transform(function))); }
java
@Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case XbasePackage.XMEMBER_FEATURE_CALL__MEMBER_CALL_TARGET: return getMemberCallTarget(); case XbasePackage.XMEMBER_FEATURE_CALL__MEMBER_CALL_ARGUMENTS: return getMemberCallArguments(); case Xbas...
python
def fts_match_all(self, fts, inv): """Return `True` if all segments in `inv` matches the features in fts Args: fts (list): a collection of (value, feature) tuples inv (list): a collection of IPA segments represented as Unicode strings Returns: ...
python
def get_architecture(arch=None): """Returns the definition for the specified architecture string. If no string is specified, the system default is returned (as defined by the PROCESSOR_ARCHITEW6432 or PROCESSOR_ARCHITECTURE environment variables). """ if arch is None: arch = os.environ....
python
def stan_rdump(data, filename): """ Dump a dictionary with model data into a file using the R dump format that Stan supports. Parameters ---------- data : dict filename : str """ for name in data: if not is_legal_stan_vname(name): raise ValueError("Variable name...
java
public HsqlName newAutoName(String prefix, HsqlName schema, HsqlName parent, int type) { HsqlName name = newAutoName(prefix, (String) null, schema, parent, type); return name; }
java
@XmlElementDecl(namespace = "http://www.opengis.net/citygml/bridge/2.0", name = "BridgeInstallation", substitutionHeadNamespace = "http://www.opengis.net/citygml/2.0", substitutionHeadName = "_CityObject") public JAXBElement<BridgeInstallationType> createBridgeInstallation(BridgeInstallationType value) { re...
java
private void showButtons() { if (!areButtonsShowing) { buttonContainer.clearAnimation(); buttonContainer.startAnimation(slideUp); buttonContainer.setVisibility(View.VISIBLE); areButtonsShowing = true; } }
python
def after_each_callback(eng, callback_func, obj): """Take action after every WF callback.""" obj.callback_pos = eng.state.callback_pos obj.extra_data["_last_task_name"] = callback_func.__name__ task_history = get_task_history(callback_func) if "_task_history" not in obj.extra_dat...
java
@CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) public final <U> Flowable<T> delaySubscription(Publisher<U> subscriptionIndicator) { ObjectHelper.requireNonNull(subscriptionIndicator, "subscriptionIndicator is null"); return RxJavaPlugin...
java
@Override public ListRulesPackagesResult listRulesPackages(ListRulesPackagesRequest request) { request = beforeClientExecution(request); return executeListRulesPackages(request); }
python
def validate_template_name(self, key, value): """Validate template name. :param key: The template path. :param value: The template name. :raises ValueError: If template name is wrong. """ if value not in dict(current_app.config['PAGES_TEMPLATES']): raise Valu...
python
def get_object(self, name, obj): """ :param name: -- string name of backend :param name: str :param obj: -- model object :type obj: django.db.models.Model :return: backend object :rtype: object """ return self[name](obj, **self.opts(name))
java
public Waiter<DescribeNodeAssociationStatusRequest> nodeAssociated() { return new WaiterBuilder<DescribeNodeAssociationStatusRequest, DescribeNodeAssociationStatusResult>() .withSdkFunction(new DescribeNodeAssociationStatusFunction(client)) .withAcceptors(new NodeAssociated.IsSU...
python
def get_image_tar(image_path): '''get an image tar, either written in memory or to the file system. file_obj will either be the file object, or the file itself. ''' bot.debug('Generate file system tar...') file_obj = Client.image.export(image_path=image_path) if file_obj is None: ...
python
def blocking(self): """ Display queries holding locks other queries are waiting to be released. Record( pid=40821, source='', running_for=datetime.timedelta(0, 0, 2857), waiting=False, query='SELECT pg_sleep(10);' ) ...
java
public void getRDSOperationComplete(ProviderContext ctx, String operation) throws CloudException, InternalException { SQLAdmin sqlAdmin = provider.getGoogleSQLAdmin(); long timeout = System.currentTimeMillis() + (CalendarWrapper.MINUTE * 20L); while(timeout > System.currentTimeMillis()) { ...
python
def bounds_tree(bounds): """ Given a set of axis aligned bounds, create an r-tree for broad- phase collision detection Parameters --------- bounds: (n, dimension*2) list of non- interleaved bounds for a 2D bounds tree: [(minx, miny, maxx, maxy), ...] Returns -...
python
def analogy(self, pos, neg, n=10, metric="cosine"): """ Analogy similarity. Parameters ---------- pos : list neg : list Returns ------- Tuple of 2 numpy.array: 1. position in self.vocab 2. cosine similarity Exampl...
java
public static List<String> extract(String text, int size) { IPhraseExtractor extractor = new MutualInformationEntropyPhraseExtractor(); return extractor.extractPhrase(text, size); }
java
public EEnum getPGPRGRGLength() { if (pgprgrgLengthEEnum == null) { pgprgrgLengthEEnum = (EEnum)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(124); } return pgprgrgLengthEEnum; }
python
def Parse(self, rdf_data): """Process rdf data through the filter. Filters sift data according to filter rules. Data that passes the filter rule is kept, other data is dropped. If no filter method is provided, the data is returned as a list. Otherwise, a items that meet filter conditions are retur...
java
@Override public <E> E search(final Object searchableAnnotatedObject) { try { return search(this.<E>asList(searchableAnnotatedObject, configureMatcher(getSearchableMetaData( searchableAnnotatedObject)))); } finally { MatcherHolder.unset(); } }
java
public List<JournalManager> getNonFileJournalManagers() { List<JournalManager> list = new ArrayList<JournalManager>(); for (JournalManager jm : getJournalManagers()) { if (!(jm instanceof FileJournalManager)) { list.add(jm); } } return list; }
java
@Override public boolean onEvent(EventMessage<?> event) { AuthorizationResultEvent resultEvent; if (!(event.getPayload() instanceof AuthorizationResultEvent)) { // not the right type of event... not 'handled' return false; } resultEvent = (AuthorizationResul...
java
public ServiceFuture<VirtualNetworkInner> updateTagsAsync(String resourceGroupName, String virtualNetworkName, final ServiceCallback<VirtualNetworkInner> serviceCallback) { return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkName), serviceCallback); }
java
public void setProxyAuthenticationMethods(List<ProxyAuthenticationMethod> proxyAuthenticationMethods) { if(proxyAuthenticationMethods == null) { this.proxyAuthenticationMethods = null; } else { ValidationUtils.assertNotEmpty(proxyAuthenticationMethods, "proxyAuthenticationMethods...
python
def _convert_bin_to_datelike_type(bins, dtype): """ Convert bins to a DatetimeIndex or TimedeltaIndex if the orginal dtype is datelike Parameters ---------- bins : list-like of bins dtype : dtype of data Returns ------- bins : Array-like of bins, DatetimeIndex or TimedeltaIndex...
java
RingbufferContainer getRingBufferContainer() { final RingbufferService service = getService(); final ObjectNamespace ns = RingbufferService.getRingbufferNamespace(name); RingbufferContainer ringbuffer = service.getContainerOrNull(getPartitionId(), ns); if (ringbuffer == null) { ...
python
def parse_param(self, core_param): """ Returns data about a specific parameter. :param core_param: The ``Parameter`` to introspect :type core_param: A ``<botocore.parameters.Parameter>`` subclass :returns: A dict of the relevant information """ return { ...
java
public List<Completer> setOptionCompleters( Map<BuiltInProperty, Collection<String>> customCompletions) { Map<String, Completer> comp = new HashMap<>(); final String start = "START"; comp.put(start, new StringsCompleter("!set")); Collection<BuiltInProperty> booleanProperties = new ArrayList<>(); ...
python
def render(self, context, instance, placeholder): ''' Create a UUID and check if a voucher with that ID exists before rendering ''' context = super(GiftCertificateFormPlugin, self).render(context, instance, placeholder) # Paypal "live" mode is "production" to checkout.js mode = get...
java
public void setEventSubscriptions(java.util.Collection<EventSubscription> eventSubscriptions) { if (eventSubscriptions == null) { this.eventSubscriptions = null; return; } this.eventSubscriptions = new java.util.ArrayList<EventSubscription>(eventSubscriptions); }
java
@Nonnull public static LBiIntPredicate biIntPredicateFrom(Consumer<LBiIntPredicateBuilder> buildingFunction) { LBiIntPredicateBuilder builder = new LBiIntPredicateBuilder(); buildingFunction.accept(builder); return builder.build(); }
python
def fetch(self, rebuild=False, cache=True): """Fetches the table and applies all post processors. Args: rebuild (bool): Rebuild the table and ignore cache. Default: False cache (bool): Cache the finished table for faster future loading. Default: True """ ...
java
private void init() { logger.info("metadata init()."); writeLock.lock(); try { // Required keys initCache(CLUSTER_KEY); // If stores definition storage engine is not null, initialize metadata // Add the mapping from key to the storage engine used if(this...
python
def parse(self, data): """ Parses the SWF. The @data parameter can be a file object or a SWFStream """ self._data = data = data if isinstance(data, SWFStream) else SWFStream(data) self._header = SWFHeader(self._data) if self._header.compressed: ...
python
def skip(self, num_bytes): """Jump the ahead the specified bytes in the buffer.""" if num_bytes is None: self._offset = len(self._data) else: self._offset += num_bytes
java
public void marshall(EC2TagSet eC2TagSet, ProtocolMarshaller protocolMarshaller) { if (eC2TagSet == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(eC2TagSet.getEc2TagSetList(), EC2TAGSETLIST_BINDING)...
python
def fbeta_score(targets, predictions, beta=1.0, average='macro'): r""" Compute the F-beta score. The F-beta score is the weighted harmonic mean of precision and recall. The score lies in the range [0,1] with 1 being ideal and 0 being the worst. The `beta` value is the weight given to `precision` vs...
java
protected SegmentType getSegmentType(JComponent c) { Object buttonType = c.getClientProperty("JButton.buttonType"); SegmentType segmentType = SegmentType.NONE; if (buttonType != null && buttonType instanceof String && ((String) buttonType).startsWith("segmented")) { String pos...
java
void addtoAsysncSendQueue(JmsMsgProducerImpl msgProducer, CompletionListener cListner, Message msg, int sendMethodType, Object[] params) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "addtoAsysncSendQueue", new Object[] { msgProducer, cListner, cListner, se...
python
def load(handle): """Loads a module from a handle. Currently this method only works with Tensorflow 2.x and can only load modules created by calling tensorflow.saved_model.save(). The method works in both eager and graph modes. Depending on the type of handle used, the call may involve downloading a Tenso...
python
def list(showgroups): """ Show list of Anchore data feeds. """ ecode = 0 try: result = {} subscribed = {} available = {} unavailable = {} current_user_data = contexts['anchore_auth']['user_info'] feedmeta = anchore_feeds.load_anchore_feedmeta() ...
java
public DifferentialFunction getFunctionById(@NonNull String id) { if (!ops.containsKey(id)) { throw new ND4JIllegalStateException("No function with id " + id + " found!"); } return ops.get(id).getOp(); }
python
def set_or_delete(dictionary, key, value): """ Set value as value of dict key key. If value is None, delete key key from dict. :param dictionary: Dictionary to work on. :param key: Key to set or delete. If deleting and key does not exist in dict, nothing is done. :param value: Value to set. If valu...
python
def _load_scoped_variable_models(self): """ Adds models for each scoped variable of the state """ self.scoped_variables = [] for scoped_variable in self.state.scoped_variables.values(): self._add_model(self.scoped_variables, scoped_variable, ScopedVariableModel)
java
public static void elementMult(DMatrixD1 a , DMatrixD1 b ) { if( a.numCols != b.numCols || a.numRows != b.numRows ) { throw new MatrixDimensionException("The 'a' and 'b' matrices do not have compatible dimensions"); } int length = a.getNumElements(); for( int i = 0; i <...
java
@XmlElementDecl(namespace = "http://www.w3.org/1998/Math/MathML", name = "merror") public JAXBElement<MerrorType> createMerror(MerrorType value) { return new JAXBElement<MerrorType>(_Merror_QNAME, MerrorType.class, null, value); }
python
def is_driver(self): """Check whether the file is a Windows driver. This will return true only if there are reliable indicators of the image being a driver. """ # Checking that the ImageBase field of the OptionalHeader is above or # equal to 0x80000000 (that is, whether...
python
def _open_url(self): """<Enter> or <space>""" load_text = "Loading URL..." if not self.run else "Executing: {}".format(self.run) if os.environ.get('BROWSER') not in ['elinks', 'links', 'w3m', 'lynx']: self._footer_start_thread(load_text, 5)
java
public IfcLaborResourceTypeEnum createIfcLaborResourceTypeEnumFromString(EDataType eDataType, String initialValue) { IfcLaborResourceTypeEnum result = IfcLaborResourceTypeEnum.get(initialValue); if (result == null) throw new IllegalArgumentException( "The value '" + initialValue + "' is not a valid enum...
java
public void getAllExchangeCurrency(Callback<List<String>> callback) throws NullPointerException { gw2API.getAllExchangeCurrency().enqueue(callback); }
java
public static responderpolicy_stats get(nitro_service service, String name) throws Exception{ responderpolicy_stats obj = new responderpolicy_stats(); obj.set_name(name); responderpolicy_stats response = (responderpolicy_stats) obj.stat_resource(service); return response; }
java
public static String getFileSuffix(byte[] bytes) { if (bytes == null || bytes.length < 10) { return null; } if (bytes[0] == 'G' && bytes[1] == 'I' && bytes[2] == 'F') { return "GIF"; } else if (bytes[1] == 'P' && bytes[2] == 'N' && bytes[3] == 'G') { ...
java
public static String logSamlObject(final OpenSamlConfigBean configBean, final XMLObject samlObject) throws SamlException { val repeat = "*".repeat(SAML_OBJECT_LOG_ASTERIXLINE_LENGTH); LOGGER.debug(repeat); try (val writer = transformSamlObject(configBean, samlObject, true)) { LOGGER....
java
public static boolean shouldBeUsed(String authMode) { return authMode != null && (authMode.equalsIgnoreCase(AUTHMODE_SERVICE_ALL) || authMode.equalsIgnoreCase(AUTHMODE_SERVICE_ANY)); }
python
def _get_queries(self, migration, method): """ Get all of the queries that would be run for a migration. :param migration: The migration :type migration: orator.migrations.migration.Migration :param method: The method to execute :type method: str :rtype: list ...
java
public String getTargetBus() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "getTargetBus"); String bus = null; if(parent instanceof LinkPublicationPointControl) { LinkPublicationPointControl lppc = (LinkPublicationPointControl)parent; bus = lp...
python
def do_propdel(self, subcmd, opts, *args): """Remove PROPNAME from files, dirs, or revisions. usage: 1. propdel PROPNAME [PATH...] 2. propdel PROPNAME --revprop -r REV [URL] 1. Removes versioned props in working copy. 2. Removes unversioned remote prop o...
python
def human_time(seconds): """ Returns a human-friendly time string that is always exactly 6 characters long. Depending on the number of seconds given, can be one of:: 1w 3d 2d 4h 1h 5m 1m 4s 15s Will be in color if console coloring is turned on. Param...
python
def edit(self, typeValue, connectionString, move=True, runAsync=False): """ You can use this operation to update the configuration store. Typically, this operation is used to change the location of the store. When ArcGIS Server is installed,...
java
private void configureClearTextWithHttpUpgrade(SocketChannel ch) { HttpClientCodec sourceCodec = new HttpClientCodec(); Http2ClientUpgradeCodec upgradeCodec = new Http2ClientUpgradeCodec(connectionHandler); HttpClientUpgradeHandler upgradeHandler = new HttpClientUpgradeHandler(sourceCodec, upgra...
python
def to_unix_ts(start_time): """Given a datetime object, returns its value as a unix timestamp""" if isinstance(start_time, datetime): if is_timezone_aware(start_time): start_time = start_time.astimezone(pytz.utc) else: log.warning( "Non timezone-aware date...
python
def load_DragonDosBinary(self, data, strip_padding=True): """ Dragon DOS Binary Format http://dragon32.info/info/binformt.html Offset: Type: Value: 0 byte $55 Constant 1 byte Filetype 2:3 word Load Address 4:...
java
public CmsPushButton createFavButton() { CmsPushButton favButton = new CmsPushButton(); favButton.setImageClass(I_CmsButton.ButtonData.ADD_TO_FAVORITES.getSmallIconClass()); favButton.setTitle(I_CmsButton.ButtonData.ADD_TO_FAVORITES.getTitle()); favButton.setButtonStyle(I_CmsButton.Butt...
java
public static void main(String [] args) { String result = run(args); if (result.length() != 0) { System.err.println(result); System.exit(1); } }
python
def Eoi(compiler, cont): '''end of parse_state''' return il.If(il.Ge(il.GetItem(il.parse_state, il.Integer(1)), il.Len(il.GetItem(il.parse_state, il.Integer(0)))), cont(TRUE), il.failcont(FALSE))
java
public void buildSerializableMethods(XMLNode node, Content classContentTree) { Content serializableMethodTree = methodWriter.getSerializableMethodsHeader(); MemberDoc[] members = currentClass.serializationMethods(); int membersLength = members.length; if (membersLength > 0) { ...
python
def _update(self, dataFile, handle): """ Update the priority of the file handle. The element is first removed and then added to the left of the deque. """ self._cache.remove((dataFile, handle)) self._add(dataFile, handle)
java
private ChannelDO modelToDo(Channel channel) { ChannelDO channelDO = new ChannelDO(); try { channelDO.setId(channel.getId()); channelDO.setName(channel.getName()); channelDO.setDescription(channel.getDescription()); channelDO.setStatus(channel.getStatus()...
python
def disable(self): """ Disable the crash reporter. No reports will be sent or saved. """ if CrashReporter.active: CrashReporter.active = False # Restore the original excepthook sys.excepthook = self._excepthook self.stop_watcher() ...
python
def get_vertices_per_edge(mesh_v, mesh_f): """Returns an Ex2 array of adjacencies between vertices, where each element in the array is a vertex index. Each edge is included only once. If output of get_faces_per_edge is provided, this is used to avoid call to get_vert_connectivity()""" vc = sp.coo_m...
java
private Future<?> sendKeys(final MapStoreContext mapStoreContext, final boolean replaceExistingValues) { if (keyLoadFinished.isDone()) { keyLoadFinished = new LoadFinishedFuture(); Future<Boolean> sent = execService.submit(MAP_LOAD_ALL_KEYS_EXECUTOR, () -> { sendKeysInBa...
python
def boolean_add(self, mesh, inplace=False): """ Add a mesh to the current mesh. Does not attempt to "join" the meshes. Parameters ---------- mesh : vtki.PolyData The mesh to add. inplace : bool, optional Updates mesh in-place while retur...
java
public void setAmbient(float red, float green, float blue){ ambient[0]=red; ambient[1]=green; ambient[2]=blue; Am = true; }
java
@Nullable public <T> T readLockedAtomic (@Nonnull final IThrowingSupplier <T, IOException> aRunnable) throws IOException { m_aRWLock.readLock ().lock (); try { if (isClosing ()) LOGGER.info ("Cannot executed something read locked, because Lucene is shutting down"); else retur...