language
stringclasses
2 values
func_code_string
stringlengths
63
466k
java
public static RowProcessor find(String query, Object ... params) { return new DB(DB.DEFAULT_NAME).find(query, params); }
java
public static void dump(ClassLoader cl) { System.err.println("Dump Loaders:"); while (cl != null) { System.err.println(" loader " + cl); cl = cl.getParent(); } }
java
public void findMatch(ArrayList<String> speechResult) { loadCadidateString(); for (String matchCandidate : speechResult) { Locale localeDefault = mGvrContext.getActivity().getResources().getConfiguration().locale; if (volumeUp.equals(matchCandidate)) { startVol...
java
public com.google.cloud.datalabeling.v1beta1.LabelAudioTranscriptionOperationMetadataOrBuilder getAudioTranscriptionDetailsOrBuilder() { if (detailsCase_ == 10) { return (com.google.cloud.datalabeling.v1beta1.LabelAudioTranscriptionOperationMetadata) details_; } return com.google.cloud...
python
def _get_axis_bounds(self, dim, bunch): """Return the min/max of an axis.""" if dim in self.attributes: # Attribute: specified lim, or compute the min/max. vmin, vmax = bunch['lim'] assert vmin is not None assert vmax is not None return vmin, v...
java
private void drawOnto(Graphics2D pGraphics) throws IOException { context = new QuickDrawContext(pGraphics); readPICTopcodes(imageInput); if (DEBUG) { System.out.println("Done reading PICT body!"); } }
java
@Override protected int add2Select(final SQLSelect _select) { _select.column(2, "ID").column(2, JCRStoreResource.COLNAME_IDENTIFIER) .leftJoin(JCRStoreResource.TABLENAME_STORE, 2, "ID", 0, "ID"); return 1; }
java
public VacuumConsumableStatus consumableStatus() throws CommandExecutionException { JSONArray resp = sendToArray("get_consumable"); JSONObject stat = resp.optJSONObject(0); if (stat == null) throw new CommandExecutionException(CommandExecutionException.Error.INVALID_RESPONSE); return new...
python
def proj_l2ball(b, s, r, axes=None): r""" Project :math:`\mathbf{b}` into the :math:`\ell_2` ball of radius :math:`r` about :math:`\mathbf{s}`, i.e. :math:`\{ \mathbf{x} : \|\mathbf{x} - \mathbf{s} \|_2 \leq r \}`. Note that ``proj_l2ball(b, s, r)`` is equivalent to :func:`.prox.proj_l2` ``(b - ...
python
def last_datapoint(self, sid, epoch=False): """ Parameters ---------- sid : str SensorId epoch : bool default False If True return as epoch If False return as pd.Timestamp Returns ------- pd.Timestamp | int,...
java
public StrBuilder insert(final int index, final char value) { validateIndex(index); ensureCapacity(size + 1); System.arraycopy(buffer, index, buffer, index + 1, size - index); buffer[index] = value; size++; return this; }
java
private int _readChar () { try { final int c = m_aReader.read (); if (m_bTrackPosition) { if (m_nBackupChars > 0) { // If previously a char was backed up, don't increase the position! m_nBackupChars--; } else m_aPos.updatePositio...
python
def filter_transcription_factor(stmts_in, **kwargs): """Filter out RegulateAmounts where subject is not a transcription factor. Parameters ---------- stmts_in : list[indra.statements.Statement] A list of statements to filter. save : Optional[str] The name of a pickle file to save th...
java
public void marshall(ModelPackageContainerDefinition modelPackageContainerDefinition, ProtocolMarshaller protocolMarshaller) { if (modelPackageContainerDefinition == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarsha...
python
def do_delete(self, args): '''delete the entire contents of the current namespace''' namespace = self.config['namespace'] if not args.assume_yes: response = raw_input('Delete everything in {0!r}? Enter namespace: ' .format(namespace)) if ...
python
def _clear(reason, idle_pool, using_pool, channel_pool, conn_id): """ clear the bad connection :param reason: :param idle_pool: :param using_pool: :param channel_pool: :param conn_id: :return: """ with _lock(): try: ...
java
public void initializeFinished() { if (CmsLog.INIT.isInfoEnabled()) { CmsLog.INIT.info(Messages.get().getBundle().key(Messages.INIT_VFS_CONFIG_FINISHED_0)); } }
java
public static String getPathToChild(Resource file, Resource dir) { if (dir == null || !file.getResourceProvider().getScheme().equals(dir.getResourceProvider().getScheme())) return null; boolean isFile = file.isFile(); String str = "/"; while (file != null) { if (file.equals(dir)) { if (isFile) return str.sub...
java
boolean processBytesFromPeer(ByteBuf data) throws GeneralSecurityException { checkState(unwrapper != null, "protector already created"); try (BufUnwrapper unwrapper = this.unwrapper) { int bytesRead = 0; boolean done = false; for (ByteBuffer nioBuffer : unwrapper.readableNioBuffers(data)) { ...
java
public Integer getAssistedQueryColumnCount(final String logicTableName) { for (ShardingEncryptorStrategy each : shardingEncryptorStrategies.values()) { int result = each.getAssistedQueryColumnCount(logicTableName); if (result > 0) { return result; } } ...
java
public EventSubscriptionEntity findMessageStartEventSubscriptionByNameAndTenantId(String messageName, String tenantId) { Map<String, String> parameters = new HashMap<String, String>(); parameters.put("messageName", messageName); parameters.put("tenantId", tenantId); return (EventSubscriptionEntity) get...
python
def _ask_for_ledger_status(self, node_name: str, ledger_id): """ Ask other node for LedgerStatus """ self.request_msg(LEDGER_STATUS, {f.LEDGER_ID.nm: ledger_id}, [node_name, ]) logger.info("{} asking {} for ledger status of ledger {}".format(self, node_na...
java
public JcNumber cos() { JcNumber ret = new JcNumber(null, this.argument, new FunctionInstance(FUNCTION.Math.COS, 1)); QueryRecorder.recordInvocationConditional(this, "cos", ret); return ret; }
python
def handle_delete_user(self, req): """Handles the DELETE v2/<account>/<user> call for deleting a user from an account. Can only be called by an account .admin. :param req: The swob.Request to process. :returns: swob.Response, 2xx on success. """ # Validate path ...
java
boolean isNodeTypeInUse( Name nodeTypeName ) throws InvalidQueryException { String nodeTypeString = nodeTypeName.getString(context.getNamespaceRegistry()); String expression = "SELECT * from [" + nodeTypeString + "] LIMIT 1"; TypeSystem typeSystem = context.getValueFactories().getTypeSystem(); ...
java
@Override public void close () throws IOException { if (in != null) { in.close (); in = null; m_aBuf = null; } }
python
def __retry_session(self, retries=10, backoff_factor=0.3, status_forcelist=(500, 502, 504), session=None): """ Retry the connection using requests if it fails. Use this as a wrapper to request from datapoint """ # requests.Session ...
java
public static Map<String,String> order(Map<String, String> map){ HashMap<String, String> tempMap = new LinkedHashMap<String, String>(); List<Map.Entry<String, String>> infoIds = new ArrayList<Map.Entry<String, String>>( map.entrySet()); Collections.sort(infoIds, new Comparator<Map.Entry<String, String>>() { ...
python
def remember(self, request, username, **kw): """ Returns 'WWW-Authenticate' header with a value that should be used in 'Authorization' header. """ if self.credentials_callback: token = self.credentials_callback(username, request) api_key = 'ApiKey {}:{}'.format(us...
java
public int estimateMaximumBytes() { int count = this.size(); for (String key: _rsets.keySet()) { CachedResultSet crs = _rsets.get(key); if (crs.rows != null) { count += crs.columns.length*crs.rows.size(); } } return count * 64; }
java
public void addActionImport(Class<?> cls) { EdmActionImport actionImportAnnotation = cls.getAnnotation(EdmActionImport.class); ActionImportImpl.Builder actionImportBuilder = new ActionImportImpl.Builder() .setEntitySetName(actionImportAnnotation.entitySet()) .setActionNam...
java
private void setConfigEntityMapping(Map<String, Object> configProps) throws WIMException { List<String> entityTypes = getSupportedEntityTypes(); String rdnProp; String type = null; entityConfigMap = new HashMap<String, String>(); for (int i = 0; i < entityTypes.size(); i++) { ...
java
public void end(Xid xid, int flags) throws XAException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "end", new Object[]{"XID="+xid, _manager.xaFlagsToString(flags)}); try { _manager.end(new PersistentTranId(xid), flags); /...
python
def reinit(self): """Use carefully to reset the episode count to 0.""" sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect((self.server, self.port)) self._hello(sock) comms.send_message(sock, ("<Init>" + self._get_token() + "</Init>").encode()) reply = ...
java
public static String format(BigDecimal number, String pattern) { return format(number.doubleValue(), pattern); }
python
def path_exists(self, dest, weight=None): """Return whether there is a path leading from me to ``dest``. With ``weight``, only consider edges that have a stat by the given name. Raise ``ValueError`` if ``dest`` is not a node in my character or the name of one. """ ...
python
def order_market_sell(self, **params): """Send in a new market sell order :param symbol: required :type symbol: str :param quantity: required :type quantity: decimal :param newClientOrderId: A unique id for the order. Automatically generated if not sent. :type ne...
java
@Override protected void preparePaintComponent(final Request request) { explanationWithTimeStamp.setText("The time the page was rendered was " + (new Date()).toString()); tabset1TabClient.setContent(new ExplanatoryText( "This content was present when the page first rendered at " + (new Date()).toString())); ...
java
public PagedList<String> listWebAppsByHybridConnection(final String resourceGroupName, final String name, final String namespaceName, final String relayName) { ServiceResponse<Page<String>> response = listWebAppsByHybridConnectionSinglePageAsync(resourceGroupName, name, namespaceName, relayName).toBlocking().si...
python
def _perform_system_check(self): """ Perform a system check to define if we need to throttle to handle all the incoming messages """ if Global.CONFIG_MANAGER.tracing_mode: Global.LOGGER.debug("performing a system check") now = datetime.datetime.now() ...
python
def container(dec): """Meta-decorator (for decorating decorators) Keeps around original decorated function as a property ``orig_func`` :param dec: Decorator to decorate :type dec: function :returns: Decorated decorator """ # Credits: http://stackoverflow.com/a/1167248/1798683 @wraps(d...
python
def _get_resolution(age, values): """ Calculates the resolution (res) Thanks Deborah! """ res = [] try: # Get the nan index from the values and remove from age # age2 = age[np.where(~np.isnan(values))[0]] # res = np.diff(age2) # Make sure that age and values are ...
python
def divide_works(self, corpus): """Use the work-breaking option. TODO: Maybe incorporate this into ``convert_corpus()`` TODO: Write test for this """ if corpus == 'tlg': orig_dir_rel = '~/cltk_data/originals/tlg' works_dir_rel = '~/cltk_data/greek/text/tlg...
java
public static void setMinTime(int mintime) { System.setProperty(MIN_TIME, String.valueOf(mintime)); TimerTrace.mintime = mintime; }
python
def panic(self, *args): """ Creates a fatal error and exit """ self._err("fatal", *args) if self.test_errs_mode is False: # pragma: no cover sys.exit(1)
python
def signin_redirect(redirect=None, user=None): """ Redirect user after successful sign in. First looks for a ``requested_redirect``. If not supplied will fall-back to the user specific account page. If all fails, will fall-back to the standard Django ``LOGIN_REDIRECT_URL`` setting. Returns a string...
java
public Observable<Page<FirewallRuleInner>> listFirewallRulesAsync(final String resourceGroupName, final String accountName) { return listFirewallRulesWithServiceResponseAsync(resourceGroupName, accountName) .map(new Func1<ServiceResponse<Page<FirewallRuleInner>>, Page<FirewallRuleInner>>() { ...
java
public static BinaryAnnotationMappingDeriver getInstance(String path) { if (instance == null) { synchronized (LOCK) { if (instance == null) { instance = path == null ? new BinaryAnnotationMappingDeriver() : new BinaryAnnotationMappingDe...
python
def export_by_tag_csv(ekey, dstore): """ :param ekey: export key, i.e. a pair (datastore key, fmt) :param dstore: datastore object """ token, tag = ekey[0].split('/') data = extract(dstore, token + '/' + tag) fnames = [] writer = writers.CsvWriter(fmt=writers.FIVEDIGITS) for stat, ar...
java
public void cancelSegments(IntSet cancelledSegments) { if (segments.removeAll(cancelledSegments)) { if (trace) { log.tracef("Cancelling outbound transfer to node %s, segments %s (remaining segments %s)", destination, cancelledSegments, segments); } ent...
java
public void unpack(long[] buffer, int offset, int len, int bitSize, InputStream input) throws IOException { checkArgument(len <= MAX_BUFFERED_POSITIONS, "Expected ORC files to have runs of at most 512 bit packed longs"); switch (bitSize) { case 1: unpack1(buff...
java
private void executeInternalBatch(int size) throws SQLException { executeQueryPrologue(true); results = new Results(this, 0, true, size, false, resultSetScrollType, resultSetConcurrency, autoGeneratedKeys, protocol.getAutoIncrementIncrement()); if (protocol .executeBatchClient(protocol.i...
java
public void EBEsAssignAxialForces(int hi){ AxialForcei_ = new double[numberOfElements_]; AxialForcej_ = new double[numberOfElements_]; for(int el=0;el<numberOfElements_;el++){ AxialForcei_[el] = Efforti_[aX_][el][hi]; AxialForcej_[el] = Effortj_[aX_][el][hi]; } }
java
boolean eligibleForLock(EJSDeployedSupport methodContext, ContainerTx tx) // d671368 { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); // If the bean is active on a thread and the threads match, then allow // the bean to be locked. This is a reentrant call, and transaction ...
python
def unregisterHandler(self, fh): """ Unregister a file descriptor. Clean data, if such operation has been scheduled. Parameters ---------- fh : int File descriptor. """ try: self.fds.remove(fh) except KeyError: pass ...
python
def cli(ctx, project_dir): """Verify the verilog code.""" exit_code = SCons(project_dir).verify() ctx.exit(exit_code)
java
public void bulkAction(List<SQSMessageIdentifier> messageIdentifierList, int indexOfMessage) throws JMSException { assert indexOfMessage > 0; assert indexOfMessage <= messageIdentifierList.size(); Map<String, List<String>> receiptHandleWithSameQueueUrl = new HashMap<String, List<St...
java
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { try { if (com.google.api.ads.adwords.axis.v201809.o.TrafficEstimatorServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) { com.google.api.ads.adwords.axis.v201809.o.Tr...
python
def update(self, repo_dir, **kwargs): """This function updates an existing checkout of source code.""" del kwargs rev = self._args.get("revision") if rev: return [{"args": ["git", "checkout", rev], "cwd": repo_dir}] + _ff_command( rev, repo_dir ) ...
python
def tagger(self): """ A property to link into IntentEngine's intent_parsers. Warning: this is only for backwards compatiblility and should not be used if you intend on using domains. Return: the domains intent_parsers from its IntentEngine """ domain = 0 ...
java
public static Bridge get(final String id) throws Exception { final BandwidthClient client = BandwidthClient.getInstance(); return get(client, id); }
java
public OperationExecutionRecord measureAfter() { // measure after final long tout = TIME.getTime(); OperationExecutionRecord record = new OperationExecutionRecord(signature, sessionId, traceId, tin, tout, hostname, eoi, ess); CTRLINST.newMonitoringRecord(record); // cleanup if (entrypoint) { CFREGISTRY.u...
python
def get_file_perms(self, filename, note=None, loglevel=logging.DEBUG): """Returns the permissions of the file on the target as an octal string triplet. @param filename: Filename to get permissions of. @param note: See send() @type filename: ...
java
private double determinant3x3(double t00, double t01, double t02, double t10, double t11, double t12, double t20, double t21, double t22) { return (t00 * (t11 * t22 - t12 * t21) + t01 * (t12 * t20 - t10 * t22) + ...
java
protected Boolean _hasSideEffects(XIfExpression expression, ISideEffectContext context) { if (hasSideEffects(expression.getIf(), context)) { return true; } final Map<String, List<XExpression>> buffer1 = context.createVariableAssignmentBufferForBranch(); if (hasSideEffects(expression.getThen(), context.branch...
python
def parse_delay(data): """ Prase the delay """ # parse data from the details view rsp = requests.get(data['details']) soup = BeautifulSoup(rsp.text, "html.parser") # get departure delay delay_departure_raw = soup.find('div', class_="routeStart").find('span', class_=["delay", "delayO...
python
def addColumn(self, columnName, dtype, defaultValue): """Adds a column with the given parameters to the underlying model This method is also a slot. If no model is set, nothing happens. Args: columnName (str): The name of the new column. dtype (numpy.dtype): The...
java
@Override @SuppressWarnings("fallthrough") public Node optimizeSubtree(Node node) { switch (node.getToken()) { case ASSIGN_SUB: return reduceSubstractionAssignment(node); case TRUE: case FALSE: return reduceTrueFalse(node); case NEW: node = tryFoldStandardConstr...
java
public static void closeScope(Object name) { //we remove the scope first, so that other threads don't see it, and see the next snapshot of the tree ScopeNode scope = (ScopeNode) MAP_KEY_TO_SCOPE.remove(name); if (scope != null) { ScopeNode parentScope = scope.getParentScope(); if (parentScope !=...
python
def create(cls, data=None, api_key=None, endpoint=None, add_headers=None, data_key=None, response_data_key=None, method='POST', **kwargs): """ Create an instance of the Entity model by calling to the API endpoint. This ensures that server knows about the creation before returning...
python
def step2(self, pub_key, salt): """Second authentication step.""" self._check_initialized() pk_str = binascii.hexlify(pub_key).decode() salt = binascii.hexlify(salt).decode() self.client_session_key, _, _ = self.session.process(pk_str, salt) _LOGGER.debug('Client session ...
python
def radial_symmetry(mesh): """ Check whether a mesh has rotational symmetry. Returns ----------- symmetry : None or str None No rotational symmetry 'radial' Symmetric around an axis 'spherical' Symmetric around a point axis : None or (3,) float Rota...
java
public static void sendRedirect( HttpServletResponse response, String location, int status ) throws IllegalStateException, IOException { // Response must not be committed if(response.isCommitted()) throw new IllegalStateException("Unable to redirect: Response already committed"); response.setHeader("Locat...
java
public ListObjectsResponse listObjects(String bucketName, String prefix) { return this.listObjects(new ListObjectsRequest(bucketName, prefix)); }
python
def _handle_read_chunk(self): """Some data can be read""" new_data = b'' buffer_length = len(self.read_buffer) try: while buffer_length < self.MAX_BUFFER_SIZE: try: piece = self.recv(4096) except OSError as e: ...
java
@Nullable @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2) public static IBinder optBinder(@Nullable Bundle bundle, @Nullable String key) { return optBinder(bundle, key, null); }
java
public XObject execute( XPathContext xctxt, int currentNode, DTM dtm, int expType) throws javax.xml.transform.TransformerException { // For now, the current node is already pushed. return execute(xctxt); }
java
@Override public void setID(String id) { String oldID = this.id; this.id = prepareForAssignment(this.id, id); this.registerOwnID(oldID, this.id); }
java
private void writeHeader(long fileLength, int elementCount, long firstPosition, long lastPosition) throws IOException { raf.seek(0); if (versioned) { writeInt(buffer, 0, VERSIONED_HEADER); writeLong(buffer, 4, fileLength); writeInt(buffer, 12, elementCount); writeLong(buffer, 16, ...
python
def fetch(): """ Downloads the Lenz, Hensley & Doré (2017) dust map, placing it in the default :obj:`dustmaps` data directory. """ doi = '10.7910/DVN/AFJNWJ' fname = os.path.join( data_dir(), 'lenz2017', 'ebv_lhd.hpx.fits') fetch_utils.dataverse_download_doi( ...
java
private static String findJavaVersionString(MavenProject project) { while (project != null) { String target = project.getProperties().getProperty("maven.compiler.target"); if (target != null) { return target; } for (org.apache.maven.model.Plugin pl...
java
public UI wrapLayout(Layout layout) { // TODO: add a header to switch the style, etc // TODO: add bookmark to set the style if (server.getConfig().isDevelopmentHeader()) { final VerticalSplitPanel mainLayout = new VerticalSplitPanel(); mainLayout.setSizeFull(); ...
java
public static <T> TypeChecker<Collection<? extends T>> tCollection(TypeChecker<? extends T> elementChecker) { return new CollectionTypeChecker<>(Collection.class, elementChecker); }
java
public void setPOMVersion(final String pomVersion) { if (pomVersion == null && this.pomVersion == null) { return; } else if (pomVersion == null) { removeChild(this.pomVersion); this.pomVersion = null; } else if (this.pomVersion == null) { this.pomV...
java
public static int count(Connection connection, String sql, String[] selectionArgs) { if (!sql.toLowerCase().contains(" count(*) ")) { int index = sql.toLowerCase().indexOf(" from "); if (index == -1) { return -1; } sql = "select count(*)" + sql.substring(index); } int count = querySingleInteg...
python
def _add_study_provenance( self, phenotyping_center, colony, project_fullname, pipeline_name, pipeline_stable_id, procedure_stable_id, procedure_name, parameter_stable_id, parameter_name, ...
java
public void terminate(boolean delay) { // Overload the value specified at pipe creation. this.delay = delay; // If terminate was already called, we can ignore the duplicit invocation. if (state == State.TERM_REQ_SENT_1 || state == State.TERM_REQ_SENT_2) { return; ...
java
@Override public boolean cancel() { if (Config.DEBUG) { Log.v(TAG, "cancel() " + getName()); } return mInfo.queue.cancel(getName()); }
python
def load_metadata(self, data_dir, feature_name=None): """See base class for details.""" # Restore names if defined names_filepath = _get_names_filepath(data_dir, feature_name) if tf.io.gfile.exists(names_filepath): self.names = _load_names_from_file(names_filepath)
python
def validate_page(ctx, param, value): """Ensure that a valid value for page is chosen.""" # pylint: disable=unused-argument if value == 0: raise click.BadParameter( "Page is not zero-based, please set a value to 1 or higher.", param=param ) return value
python
def print_huffman_code_cwl(code,p,v): """ code - code dictionary with symbol -> code map, p, v is probability map """ cwl = 0.0 for k,_v in code.items(): print(u"%s -> %s"%(k,_v)) cwl += p[v.index(k)]*len(_v) print(u"cwl = %g"%cwl) return cwl,code.values()
java
public static void write(final String data, final Writer output) throws IOException { if (data != null) { output.write(data); } }
python
def get_keys_from_value(self, value): """ Gets the keys from given value. :param value: Value. :type value: object :return: Keys. :rtype: object """ return [key for key, data in self.iteritems() if data == value]
java
public BoxUser.Info getInfo(String... fields) { URL url; if (fields.length > 0) { String queryString = new QueryStringBuilder().appendParam("fields", fields).toString(); url = USER_URL_TEMPLATE.buildWithQuery(this.getAPI().getBaseURL(), queryString, this.getID()); } else ...
python
def _finalize_axis(self, key, **kwargs): """ Extends the ElementPlot _finalize_axis method to set appropriate labels, and axes options for 3D Plots. """ axis = self.handles['axis'] self.handles['fig'].set_frameon(False) axis.grid(self.show_grid) axis.view_...
java
public void disableComputeNodeScheduling(String poolId, String nodeId, DisableComputeNodeSchedulingOption nodeDisableSchedulingOption, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException { ComputeNodeDisableSchedulingOptions options = new ComputeNodeDisableSchedulingOption...
java
public Query constrainedBy( Constraint constraint ) { return new Query(source, constraint, orderings(), columns, getLimits(), distinct); }
python
def check_valid(number, input_base=10): """ Checks if there is an invalid digit in the input number. Args: number: An number in the following form: (int, int, int, ... , '.' , int, int, int) (iterable container) containing positive integers of the input base ...
java
private String createMailToLink(String to, String bcc, String cc, String subject, String body) { Validate.notNull(to, "You must define a to-address"); final StringBuilder urlBuilder = new StringBuilder("mailto:"); addEncodedValue(urlBuilder, "to", to); if (bcc != null || cc !...
java
public static <T extends java.util.Date> T setSeconds(final T date, final int amount) { return set(date, Calendar.SECOND, amount); }