language
stringclasses
2 values
func_code_string
stringlengths
63
466k
java
@Override public ListConnectorDefinitionsResult listConnectorDefinitions(ListConnectorDefinitionsRequest request) { request = beforeClientExecution(request); return executeListConnectorDefinitions(request); }
python
def _fill_empty_sessions(self, fill_subjects, fill_visits): """ Fill in tree with additional empty subjects and/or visits to allow the study to pull its inputs from external repositories """ if fill_subjects is None: fill_subjects = [s.id for s in self.subjects] ...
java
@Override protected void putVariables(Map<String, String> variables) { variables.put(ScopeFormat.SCOPE_OPERATOR_ID, String.valueOf(operatorID)); variables.put(ScopeFormat.SCOPE_OPERATOR_NAME, operatorName); // we don't enter the subtask_index as the task group does that already }
python
def setup_columns(self): """Creates the treeview stuff""" tv = self.view['tv_categories'] # sets the model tv.set_model(self.model) # creates the columns cell = gtk.CellRendererText() tvcol = gtk.TreeViewColumn('Name', cell) def cell_data_func(c...
java
public void setResourceTypes(java.util.Collection<String> resourceTypes) { if (resourceTypes == null) { this.resourceTypes = null; return; } this.resourceTypes = new com.amazonaws.internal.SdkInternalList<String>(resourceTypes); }
java
public static MetadataTemplate updateMetadataTemplate(BoxAPIConnection api, String scope, String template, List<FieldOperation> fieldOperations) { JsonArray array = new JsonArray(); for (FieldOperation fieldOperation : fieldOperations) { JsonObject jsonObject = getFieldOperatio...
java
public static <T, M> LabeledTextFieldPanel<T, M> newLabeledTextFieldPanel(final String id, final IModel<M> model, final IModel<String> labelModel) { final LabeledTextFieldPanel<T, M> labeledTextField = new LabeledTextFieldPanel<>(id, model, labelModel); labeledTextField.setOutputMarkupId(true); return label...
python
def draw_image(self, image, xmin=0, ymin=0, xmax=None, ymax=None): """Draw an image. Do not forget to use :meth:`set_axis_equal` to preserve the aspect ratio of the image, or change the aspect ratio of the plot to the aspect ratio of the image. :param image: Pillow Image object...
java
public void deleteComputeNodeUser(String poolId, String nodeId, String userName, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException { ComputeNodeDeleteUserOptions options = new ComputeNodeDeleteUserOptions(); BehaviorManager bhMgr = new BehaviorManager(this.custom...
java
@SuppressWarnings("WeakerAccess") public void registerFont(String fontName, File fontFile) { if (!fontFile.exists()) throw new IllegalArgumentException("Font " + fontFile + " does not exist!"); FontEntry entry = new FontEntry(); entry.overrideName = fontName; entry.file = fontFile; fontFiles.add(entry); ...
python
def transform(self, X): """Scikit-learn required: Reduces the feature set down to the top `n_features_to_select` features. Parameters ---------- X: array-like {n_samples, n_features} Feature matrix to perform feature selection on Returns ------- X_re...
python
def __execute_kadmin(cmd): ''' Execute kadmin commands ''' ret = {} auth_keytab = __opts__.get('auth_keytab', None) auth_principal = __opts__.get('auth_principal', None) if __salt__['file.file_exists'](auth_keytab) and auth_principal: return __salt__['cmd.run_all']( 'ka...
java
ParseTree toParseTree() { List<ParseTree> children = new ArrayList<ParseTree>(); for (TreeNode child = latestChild; child != null; child = child.previous) { children.add(child.toParseTree()); } Collections.reverse(children); return new ParseTree(name, beginIndex, endIndex, result, children); ...
java
public boolean add(E e) { typeCheck(e); int eOrdinal = e.ordinal(); int eWordNum = eOrdinal >>> 6; long oldElements = elements[eWordNum]; elements[eWordNum] |= (1L << eOrdinal); boolean result = (elements[eWordNum] != oldElements); if (result) size++...
java
@Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case SimpleAntlrPackage.OPTIONS__OPTION_VALUES: return getOptionValues(); } return super.eGet(featureID, resolve, coreType); }
python
def get_kwargs(self): """Return kwargs dict for text""" kwargs = {} for attr in self.attrs: val = self.attrs[attr] if val is not None: kwargs[attr] = repr(val) code = ", ".join(repr(key) + ": " + kwargs[key] for key in kwargs) code = "{...
python
def get_consumption(self): """Get current power consumption in mWh.""" self.get_status() try: self.consumption = self.data['power'] except TypeError: self.consumption = 0 return self.consumption
java
public void cancelSubscription() throws NotConnectedException, InterruptedException { Presence unsubscribed = new Presence(item.getJid(), Type.unsubscribed); connection().sendStanza(unsubscribed); }
python
def rms(self, stride=1): """Calculate the root-mean-square value of this `TimeSeries` once per stride. Parameters ---------- stride : `float` stride (seconds) between RMS calculations Returns ------- rms : `TimeSeries` a new `Time...
java
@Override public Iterable<Long> ids() { return new Iterable<Long>() { /** * {@inheritDoc} */ @Override public Iterator<Long> iterator() { return new Iterator<Long>() { int index = -1; private Iterator<Long> currentResults = null; /** * {@inheritDoc} */ @Overrid...
java
@NonNull public final List<Router> getChildRouters() { List<Router> routers = new ArrayList<>(childRouters.size()); routers.addAll(childRouters); return routers; }
java
public static BinaryTypeSignature createObjectTypeSignature(String internalName) { if (internalName.charAt(internalName.length() - 1) != ';') return new BinaryObjectTypeSignature(internalName); return new BinaryGenericTypeSignature(internalName); }
java
public void addAtom(IPDBAtom oAtom, IMonomer oMonomer) { super.addAtom(oAtom, oMonomer); if (!sequentialListOfMonomers.contains(oMonomer.getMonomerName())) sequentialListOfMonomers.add(oMonomer.getMonomerName()); }
python
def add_media(dest, media): """ Optimized version of django.forms.Media.__add__() that doesn't create new objects. """ if django.VERSION >= (2, 2): dest._css_lists += media._css_lists dest._js_lists += media._js_lists elif django.VERSION >= (2, 0): combined = dest + media ...
python
def ImportStopTimes(self, stoptimes_file): "Imports the lid_fahrzeitart.mdv file." for line, strli, direction, seq, stoptime_id, drive_secs, wait_secs in \ ReadCSV(stoptimes_file, ['LI_NR', 'STR_LI_VAR', 'LI_RI_NR', 'LI_LFD_NR', 'FGR_NR', 'FZT_REL', 'HZEIT']): pattern = self.p...
python
def get_buffer(self): """Get buffer which needs to be bulked to elasticsearch""" # Get sources for documents which are in Elasticsearch # and they are not in local buffer if self.doc_to_update: self.update_sources() ES_buffer = self.action_buffer self.clean_...
java
public JsonPath build(String path) { String[] strings = splitPath(path); if (strings.length == 0 || (strings.length == 1 && "".equals(strings[0]))) { throw new ResourceException("Path is empty"); } JsonPath previousJsonPath = null, currentJsonPath = null; PathIds pathId...
python
def convert_from(self, base): """Convert a BOOST_METAPARSE_STRING mode document into one with this mode""" if self.identifier == 'bmp': return base elif self.identifier == 'man': result = [] prefix = 'BOOST_METAPARSE_STRING("' while True: ...
python
def parse_discovery_service_response(url="", query="", returnIDParam="entityID"): """ Deal with the response url from a Discovery Service :param url: the url the user was redirected back to or :param query: just the query part of the URL. :param returnIDParam: This i...
java
public List<Integer> getTrackIds() { ArrayList<Integer> results = new ArrayList<Integer>(trackCount); Enumeration<? extends ZipEntry> entries = zipFile.entries(); while (entries.hasMoreElements()) { ZipEntry entry = entries.nextElement(); if (entry.getName().startsWith(CA...
java
public static void set(Message message, ExplicitMessageEncryptionProtocol protocol) { if (!hasProtocol(message, protocol.namespace)) { message.addExtension(new ExplicitMessageEncryptionElement(protocol)); } }
java
public OvhTask serviceName_account_userPrincipalName_mfa_disable_POST(String serviceName, String userPrincipalName, Long period) throws IOException { String qPath = "/msServices/{serviceName}/account/{userPrincipalName}/mfa/disable"; StringBuilder sb = path(qPath, serviceName, userPrincipalName); HashMap<String, ...
java
public static byte[] generateSalt() throws NoSuchAlgorithmException { SecureRandom random = SecureRandom.getInstance("SHA1PRNG"); byte[] salt = new byte[8]; random.nextBytes(salt); return salt; }
python
def facilityMsToNet(SsVersionIndicator_presence=0): """FACILITY Section 9.3.9.2""" a = TpPd(pd=0x3) b = MessageType(mesType=0x3a) # 00111010 c = Facility() packet = a / b / c if SsVersionIndicator_presence is 1: d = SsVersionIndicatorHdr(ieiSVI=0x7F, eightBitSVI=0x0) packet = pa...
python
def _set_autobw_threshold_table_bandwidth(self, v, load=False): """ Setter method for autobw_threshold_table_bandwidth, mapped from YANG variable /mpls_config/router/mpls/mpls_cmds_holder/autobw_threshold_table/autobw_threshold_table_bandwidth (list) If this variable is read-only (config: false) in the ...
java
public static BaasResult<BaasDocument> fetchSync(String collection, String id,boolean withAcl) { if (collection == null) throw new IllegalArgumentException("collection cannot be null"); if (id == null) throw new IllegalArgumentException("id cannot be null"); BaasDocument doc = new BaasDocument(c...
python
def draw_dithered_color(cb, x, y, palette, dither, n, n_max, crosshairs_coord=None): """ Draws a dithered color block on the terminal, given a palette. :type cb: cursebox.CurseBox """ i = n * (len(palette) - 1) / n_max c1 = palette[int(math.floor(i))] c2 = palette[int(math.ceil(i))] valu...
java
void copyOngoingCreates(Block block) throws CloneNotSupportedException { ActiveFile af = ongoingCreates.get(block); if (af == null) { return; } ongoingCreates.put(block, af.getClone()); }
java
public void addSurface(Se3_F64 rectToWorld , double widthWorld , GrayF32 texture ) { SurfaceRect s = new SurfaceRect(); s.texture = texture.clone(); s.width3D = widthWorld; s.rectToWorld = rectToWorld; ImageMiscOps.flipHorizontal(s.texture); scene.add(s); }
java
public Iterator<Map.Entry<G,Integer>> iterator() { List<Iterator<Map.Entry<G,Integer>>> iters = new ArrayList<Iterator<Map.Entry<G,Integer>>>(orderAndSizeToGraphs.size()); for (Map<G,Integer> m : orderAndSizeToGraphs.values()) iters.add(m.entrySet().iterator()); return n...
java
public ResultSet runSelect(String logMessage, String query, Object[] arguments) throws SQLException { long before = System.currentTimeMillis(); try { return runSelect(query, arguments); } finally { if (logger.isDebugEnabled()) { long after = System...
java
@Override public Tree generateListenerDescriptor(String service) { LinkedHashMap<String, Object> descriptor = new LinkedHashMap<>(); readLock.lock(); try { for (HashMap<String, Strategy<ListenerEndpoint>> groups : listeners.values()) { for (Strategy<ListenerEndpoint> strategy : groups.values()) { for...
java
private void insertNewLease(String recoveryIdentity, String recoveryGroup, Connection conn) throws SQLException { if (tc.isEntryEnabled()) Tr.entry(tc, "insertNewLease", this); short serviceId = (short) 1; String insertString = "INSERT INTO " + _lea...
java
public List<Invocation> find(List<?> mocks) { List<Invocation> unused = new LinkedList<Invocation>(); for (Object mock : mocks) { List<Stubbing> fromSingleMock = MockUtil.getInvocationContainer(mock).getStubbingsDescending(); for(Stubbing s : fromSingleMock) { if ...
python
def diversity(layer): """Encourage diversity between each batch element. A neural net feature often responds to multiple things, but naive feature visualization often only shows us one. If you optimize a batch of images, this objective will encourage them all to be different. In particular, it caculuates th...
java
public boolean isNewerThan(SetElement other) { if (other == null) { return true; } return this.timestamp.isNewerThan(other.timestamp); }
python
def largest_rotated_rect(w, h, angle): """ Get largest rectangle after rotation. http://stackoverflow.com/questions/16702966/rotate-image-and-crop-out-black-borders """ angle = angle / 180.0 * math.pi if w <= 0 or h <= 0: return 0, 0 width_is_longer =...
python
def resid_dev(self, endog, mu, scale=1.): r""" Binomial deviance residuals Parameters ----------- endog : array-like Endogenous response variable mu : array-like Fitted mean response variable scale : float, optional An optional...
python
def _show_popup(self, index=0): """ Shows the popup at the specified index. :param index: index :return: """ full_prefix = self._helper.word_under_cursor( select_whole_word=False).selectedText() if self._case_sensitive: self._completer.setC...
java
public void performOperation(Object resource, String operation, Object[] args) { CompensatingTransactionOperationRecorder recorder = operationFactory .createRecordingOperation(resource, operation); CompensatingTransactionOperationExecutor executor = recorder ....
java
public InputStream getResourceAsStream(final String name) { for ( final ClassLoader classLoader : this.classLoaders ) { InputStream stream = classLoader.getResourceAsStream( name ); if ( stream != null ) { return stream; } } return null; }
python
def forward_inference(self, variables, evidence=None, args=None): """ Forward inference method using belief propagation. Parameters: ---------- variables: list list of variables for which you want to compute the probability evidence: dict a dict ...
python
def get_token_accuracy(targets, outputs, ignore_index=None): """ Get the accuracy token accuracy between two tensors. Args: targets (1 - 2D :class:`torch.Tensor`): Target or true vector against which to measure saccuracy outputs (1 - 3D :class:`torch.Tensor`): Prediction or output vector ...
python
def scalars_route(self, request): """Given a tag regex and single run, return ScalarEvents. This route takes 2 GET params: run: A run string to find tags for. tag: A string that is a regex used to find matching tags. The response is a JSON object: { // Whether the regular expression is va...
java
public void releaseResources(List<ResourceRequest> released) throws IOException { if (failException != null) { throw failException; } List<Integer> releasedIds = new ArrayList<Integer>(); for (ResourceRequest req : released) { releasedIds.add(req.getId()); } cmNotifier.addCall( ...
java
private Map<String, Object> cloneAttributes(Map<String, Object> attrs) { Map<String, Object> result = new HashMap<String, Object>(); for (Entry<String, Object> entry : attrs.entrySet()) { if (entry.getValue() instanceof CmsJspStandardContextBean) { result.put(entry.getKey(),...
python
def alias_proficiency(self, proficiency_id, alias_id): """Adds an ``Id`` to a ``Proficiency`` for the purpose of creating compatibility. The primary ``Id`` of the ``Proficiency`` is determined by the provider. The new ``Id`` performs as an alias to the primary ``Id``. If the alias is a ...
java
private static String checkDisplayName(final FormItemList formItemList, final CreateUserResponse createUserResponse) { final String displayName = formItemList .getField(ProtocolConstants.Parameters.Create.User.DISPLAY_NAME); if (displayName != null) { return displayName; } else { createUserResponse.d...
python
def jwk_wrap(key, use="", kid=""): """ Instantiate a Key instance with the given key :param key: The keys to wrap :param use: What the key are expected to be use for :param kid: A key id :return: The Key instance """ if isinstance(key, rsa.RSAPublicKey) or isinstance(key, rsa.RSAPrivate...
java
private Jedis getAndSetConnection() { Jedis conn = factory.getConnection(); this.connection = conn; // If resource is not null means a transaction in progress. if (settings != null) { for (String key : settings.keySet()) { conn.configS...
python
def add(self, path): """Adds a new resource with the given path to the resource set. Parameters: * **path (str, unicode):** path of the resource to be protected Raises: TypeError when the path is not a string or a unicode string """ if not isinstance(pat...
java
public void addDerivedSipSessions(MobicentsSipSession derivedSession) { if(derivedSipSessions == null) { this.derivedSipSessions = new ConcurrentHashMap<String, MobicentsSipSession>(); } derivedSipSessions.putIfAbsent(derivedSession.getKey().getToTag(), derivedSession); }
java
public static <T extends Client<I, O>, R extends Client<I, O>, I extends Request, O extends Response> ClientDecoration of(Class<I> requestType, Class<O> responseType, Function<T, R> decorator) { return new ClientDecorationBuilder().add(requestType, responseType, decorator).build(); }
java
static SafeHtml roleItem(final String css, final Role role) { if (role.isStandard()) { return ITEMS.item(css, role.getName(), role.getName()); } else { return ITEMS.scopedRole(css, role.getName(), baseAndScope(role), shortBaseAndScope(role)); } }
python
def chu_liu_edmonds(length: int, score_matrix: numpy.ndarray, current_nodes: List[bool], final_edges: Dict[int, int], old_input: numpy.ndarray, old_output: numpy.ndarray, representatives: List[Set[int...
python
def _zforce(self,R,z,phi=0.,t=0.): """ NAME: _zforce PURPOSE: evaluate the vertical force for this potential INPUT: R - Galactocentric cylindrical radius z - vertical height phi - azimuth t - time OUTPUT: ...
java
public <T extends DObject> void unsubscribeFromObject (int oid, Subscriber<T> target) { // queue up an access object event postEvent(new AccessObjectEvent<T>(oid, target, AccessObjectEvent.UNSUBSCRIBE)); }
python
def loadFromFile(self, path): """ Load JSON config file from disk at the given path :param str path: path to config file """ if '~' in path: path = os.path.expanduser(path) f = open(path) body = f.read() f.close() self._path = path ...
python
def setbridgeprio(self, prio): """ Set bridge priority value. """ _runshell([brctlexe, 'setbridgeprio', self.name, str(prio)], "Could not set bridge priority in %s." % self.name)
python
def SetDefaultAgency(self, agency, validate=True): """Make agency the default and add it to the schedule if not already added""" assert isinstance(agency, self._gtfs_factory.Agency) self._default_agency = agency if agency.agency_id not in self._agencies: self.AddAgencyObject(agency, validate=valid...
python
def _create_spreadsheet(name, title, path, settings): """ Create Google spreadsheet. """ if not settings.client_secrets: return None create = raw_input("Would you like to create a Google spreadsheet? [Y/n] ") if create and not create.lower() == "y": return puts("Not creating sp...
java
private static final void swap(double[] data, int a, int b) { double tmp = data[a]; data[a] = data[b]; data[b] = tmp; }
python
def block_count(self): """ Reports the number of blocks in the ledger and unchecked synchronizing blocks :raises: :py:exc:`nano.rpc.RPCException` >>> rpc.block_count() { "count": 1000, "unchecked": 10 } """ resp = self.call(...
python
def email_confirm(request, confirmation_key, template_name='userena/email_confirm_fail.html', success_url=None, extra_context=None): """ Confirms an email address with a confirmation key. Confirms a new email address by running :func:`User.objects.confirm_email` meth...
python
def _update_control_section(self): """ private method to synchronize the control section counters with the various parts of the control file. This is usually called during the Pst.write() method. """ self.control_data.npar = self.npar self.control_data.nobs = self.nobs ...
java
public C4Replicator createReplicator( C4Socket openSocket, int push, int pull, byte[] options, C4ReplicatorListener listener, Object replicatorContext) throws LiteCoreException { return new C4Replicator(handle, openSocket.handle, push, pull, options, l...
python
def export(self, top=True): """Exports object to its string representation. Args: top (bool): if True appends `internal_name` before values. All non list objects should be exported with value top=True, all list objects, that are embedded in as fields inlist ...
python
def write_loudest_events(page, bins, onsource=False): """ Write injection chisq plots to markup.page object page """ th = ['']+['Mchirp %s - %s' % tuple(bin) for bin in bins] td = [] plots = ['BestNR','SNR'] if onsource: trial = 'ONSOURCE' else: trial = 'OFFTRIAL_...
java
public void setHandler(IScopeHandler handler) { log.debug("setHandler: {} on {}", handler, name); this.handler = handler; if (handler instanceof IScopeAware) { ((IScopeAware) handler).setScope(this); } }
python
def handle_exec(args): """usage: cosmic-ray exec <session-file> Perform the remaining work to be done in the specified session. This requires that the rest of your mutation testing infrastructure (e.g. worker processes) are already running. """ session_file = get_db_name(args.get('<session-file...
python
def _get_attribute_dimension(trait_name, mark_type=None): """Returns the dimension for the name of the trait for the specified mark. If `mark_type` is `None`, then the `trait_name` is returned as is. Returns `None` if the `trait_name` is not valid for `mark_type`. """ if(mark_type is None): ...
python
def truncate(self, percentage): """ Truncate ``percentage`` / 2 [%] of whole time from first and last time. :param float percentage: Percentage of truncate. :Sample Code: .. code:: python from datetimerange import DateTimeRange time_range = ...
java
public TransformersSubRegistration registerSubsystemTransformers(final String name, final ModelVersionRange range, final ResourceTransformer subsystemTransformer, final OperationTransformer operationTransformer, boolean placeholder) { final PathAddress subsystemAddress = PathAddress.EMPTY_ADDRESS.append(PathEle...
python
def get(self): """Reads the remote file from Gist and save it locally""" if self.gist: content = self.github.read_gist_file(self.gist) self.local.save(content)
java
private void validateExpr(SqlNode expr, SqlValidatorScope scope) { if (expr instanceof SqlCall) { final SqlOperator op = ((SqlCall) expr).getOperator(); if (op.isAggregator() && op.requiresOver()) { throw newValidationError(expr, RESOURCE.absentOverClause()); } } // Call on the expression to va...
java
public boolean concatenateAligned(BitOutputStream src) { int bitsToAdd = src.totalBits - src.totalConsumedBits; if (bitsToAdd == 0) return true; if (outBits != src.consumedBits) return false; if (!ensureSize(bitsToAdd)) return false; if (outBits == 0) { System.arrayco...
java
public List<T> sortTopologically(Set<T> payloads) { List<T> result = new ArrayList<>(); Set<T> input = new HashSet<>(payloads); Deque<DirectedAcyclicGraphNode<T>> toVisit = new ArrayDeque<>(mRoots); while (!toVisit.isEmpty()) { DirectedAcyclicGraphNode<T> visit = toVisit.removeFirst(); T pa...
java
@Override public String[] getFileSuffixes() { String[] suffixes = filterEmptyStrings(settings.getStringArray(GroovyPlugin.FILE_SUFFIXES_KEY)); if (suffixes.length == 0) { suffixes = StringUtils.split(GroovyPlugin.DEFAULT_FILE_SUFFIXES, ","); } return addDot(suffixes); }
python
def genms(self, scans=[]): """ Generate an MS that contains all calibrator scans with 1 s integration time. """ if len(scans): scanstr = string.join([str(ss) for ss in sorted(scans)], ',') else: scanstr = self.allstr print 'Splitting out all cal scans (%...
java
@Override public Deque<MutablePair<DeltaType, Object>> getByKey(String key) { lock.readLock().lock(); try { Deque<MutablePair<DeltaType, Object>> deltas = this.items.get(key); if (deltas != null) { // returning a shallow copy return new LinkedList<>(deltas); } } finally {...
java
public List<String> extractSuffixByWords(int length, int size, boolean extend) { TFDictionary suffixTreeSet = new TFDictionary(); for (String key : tfDictionary.keySet()) { List<Term> termList = StandardTokenizer.segment(key); if (termList.size() > length) ...
python
def deref(data, spec: dict): """ Return dereference data :param data: :param spec: :return: """ if isinstance(data, Sequence): is_dict = False gen = enumerate(data) elif not isinstance(data, Mapping): return data elif '$ref' in data: return deref(get_r...
java
public base_response loginchallengeresponse(String response) throws Exception { loginchallengeresponse logincr = new loginchallengeresponse(response); base_response result = logincr.perform_operation(this); if (result.errorcode == 0) this.sessionid = result.sessionid; return result; }
python
def _new_device_id(self, key): """ Generate a new device id or return existing device id for key :param key: Key for device :type key: unicode :return: The device id :rtype: int """ device_id = Id.SERVER + 1 if key in self._key2deviceId: ...
java
@Override public final void execute() throws MojoExecutionException, MojoFailureException { if (skipTests) { if (session.getGoals().contains("jmeter:gui")) { if (!"default-cli".equals(mojoExecution.getExecutionId()) && !"compile".equals(mojoExecution.getLifecyclePhase())) { ...
java
private void resetDefaults( TableView tView ) { Object[] colNames = tView.getColNames(); Object[][] tableValues = tView.getCalcdValues(); // dumpObjs( tableValues, System.out); JTable table = new JTable( tableValues, colNames ); tView.setViewColumnsWidth( table ); setTitl...
java
public void addClause(final Literal... literals) { if (this.miniSat == null && this.cleaneLing == null) this.result.add(this.f.clause(literals)); else if (this.miniSat != null) { final LNGIntVector clauseVec = new LNGIntVector(literals.length); for (final Literal lit : literals) { int ...
python
def unique_ordered(data): """ Returns the same as np.unique, but ordered as per the first occurrence of the unique value in data. Examples --------- In [1]: a = [0, 3, 3, 4, 1, 3, 0, 3, 2, 1] In [2]: np.unique(a) Out[2]: array([0, 1, 2, 3, 4]) In [3]: trimesh.grouping.unique_order...
java
public static void main(String[] args) throws IOException, NoSuchAlgorithmException, InvalidKeyException, XmlPullParserException { try { /* play.min.io for test and development. */ MinioClient minioClient = new MinioClient("https://play.min.io:9000", "Q3AM3UQ867SPQQA43P2F", ...
java
public <T extends InvocationMarshaller<?>> T registerDispatcher ( InvocationDispatcher<T> dispatcher, String group) { _omgr.requireEventThread(); // sanity check // get the next invocation code int invCode = nextInvCode(); // create the marshaller and initialize it ...