language
stringclasses
2 values
func_code_string
stringlengths
63
466k
java
public static Provider resourceProvider(ClassLoader classLoader, String pathToResource, Charset encoding) throws IOException { InputStream resourceAsStream = classLoader.getResourceAsStream(pathToResource); if (resourceAsStream == null) { throw new IOException("Cannot find " + pathToResource...
python
def mask_coverage(coverage: mx.sym.Symbol, source_length: mx.sym.Symbol) -> mx.sym.Symbol: """ Masks all coverage scores that are outside the actual sequence. :param coverage: Input coverage vector. Shape: (batch_size, seq_len, coverage_num_hidden). :param source_length: Source length. Shape: (batch_si...
python
def to_geoviews(self, gvtype=None, datasets=None, kdims=None, vdims=None, dynamic=False): """Convert satpy Scene to geoviews. Args: gvtype (gv plot type): One of gv.Image, gv.LineContours, gv.FilledContours, gv.Points Default to :class:`geoviews.Image`. ...
java
public long[] updateReplicas(TransactionState snapshotTransactionState) { long[] replicasAdded = new long[0]; if (m_replicasUpdatedRequired) { tmLog.info(m_whoami + " updated replica list to: " + CoreUtils.hsIdCollectionToString(m_replicas)); replicasAdded = m...
java
public DoubleStreamEx takeWhile(DoublePredicate predicate) { return VER_SPEC.callWhile(this, Objects.requireNonNull(predicate), false); }
java
public final void mT__77() throws RecognitionException { try { int _type = T__77; int _channel = DEFAULT_TOKEN_CHANNEL; // InternalXbaseWithAnnotations.g:75:7: ( 'try' ) // InternalXbaseWithAnnotations.g:75:9: 'try' { match("try"); ...
python
def equal(x, y): """ Return True if x == y and False otherwise. This function returns False whenever x and/or y is a NaN. """ x = BigFloat._implicit_convert(x) y = BigFloat._implicit_convert(y) return mpfr.mpfr_equal_p(x, y)
python
def parse(self, rrstr): # type: (bytes) -> None ''' Parse a Rock Ridge Child Link record out of a string. Parameters: rrstr - The string to parse the record out of. Returns: Nothing. ''' if self._initialized: raise pycdlibexception.P...
python
def unpersist(self, blocking=False): """Marks the :class:`DataFrame` as non-persistent, and remove all blocks for it from memory and disk. .. note:: `blocking` default has changed to False to match Scala in 2.0. """ self.is_cached = False self._jdf.unpersist(blocking) ...
python
def _write_conf(conf, path=MAIN_CF): ''' Write out configuration file. ''' with salt.utils.files.fopen(path, 'w') as fh_: for line in conf: line = salt.utils.stringutils.to_str(line) if isinstance(line, dict): fh_.write(' '.join(line)) else: ...
python
async def storm(self, text, opts=None, num=None, cmdr=False): ''' A helper for executing a storm command and getting a list of storm messages. Args: text (str): Storm command to execute. opts (dict): Opt to pass to the cortex during execution. num (int): Numb...
python
def active_all(self, user=None): """ Method to soft-delete all notifications of a User (if supplied) :param user: Notification recipient. :return: Updates QuerySet as soft-deleted. """ qs = self.deleted() if user: qs = qs.filter(recipient=user) ...
java
@Override public BatchGetDeploymentTargetsResult batchGetDeploymentTargets(BatchGetDeploymentTargetsRequest request) { request = beforeClientExecution(request); return executeBatchGetDeploymentTargets(request); }
python
def register(self, prefix, viewset, basename, factory=None, permission=None): """ Factory and permission are likely only going to exist until I have enough time to write a permissions module for PRF. :param prefix: the uri route prefix. :param viewset: The ViewSet class to route...
python
def _request_finished(self, reply): """Callback for download once the request has finished.""" url = to_text_string(reply.url().toEncoded(), encoding='utf-8') if url in self._paths: path = self._paths[url] if url in self._workers: worker = self._workers[url] ...
python
def parse_http_date(date): """ Parse a date format as specified by HTTP RFC7231 section 7.1.1.1. The three formats allowed by the RFC are accepted, even if only the first one is still in widespread use. Return an integer expressed in seconds since the epoch, in UTC. Implementation copied from...
python
def start(self, rootJob): """ Invoke a Toil workflow with the given job as the root for an initial run. This method must be called in the body of a ``with Toil(...) as toil:`` statement. This method should not be called more than once for a workflow that has not finished. :param...
python
def avatar(self, size: int = 256) -> str: """Generate a random avatar.. :param size: Size of avatar. :return: Link to avatar. """ url = 'https://api.adorable.io/avatars/{0}/{1}.png' return url.format(size, self.password(hashed=True))
java
void computeSegmentEnergy( GrowQueue_I32 corners ) { if( energySegment.length < corners.size() ) { energySegment = new double[ corners.size() ]; } for (int i = 0,j=corners.size()-1; i < corners.size(); j=i,i++) { energySegment[j] = computeSegmentEnergy(corners, j, i); } }
java
protected HtmlResponse doRedirect(Class<?> actionType, UrlChain chain) { assertArgumentNotNull("actionType", actionType); assertArgumentNotNull("chain", chain); return newHtmlResponseAsRedirect(toActionUrl(actionType, chain)); }
java
public synchronized void put(final EvaluatorManager evaluatorManager) { final String evaluatorId = evaluatorManager.getId(); if (this.wasClosed(evaluatorId)) { throw new IllegalArgumentException( "Trying to re-add an Evaluator that has already been closed: " + evaluatorId); } final Evaluat...
python
def solve_for(self, var=None): """Ensure that the children is within its parent """ if not self.enable: return margin = self.margin_method() def parent_width(): return self.parent_se[0].value - self.parent_nw[0].value def parent_height(): ...
java
public static SQLiteDatabase openDatabase( String path, CursorFactory factory, int flags, int walConnectionPoolSize, DatabaseErrorHandler errorHandler, com.couchbase.lite.internal.database.sqlite.SQLiteConnectionListener connectionListener) { SQLiteDatabase db = n...
python
def get_object(self, catalog, portal_type, title=None, **kwargs): """This will return an object from the catalog. Logs a message and returns None if no object or multiple objects found. All keyword arguments are passed verbatim to the contentFilter """ if not title and not kwargs...
java
@Override public int getConnectedBondsCount(int idx) { final IAtom atom = getAtom(idx); int count = 0; for (int i = 0; i < bondCount; i++) { if (bonds[i].contains(atom)) ++count; } // no need to check the contains(atom) as getAtom does this already ...
java
public void setRangeList(int i, Annotation v) { if (OntRelationMention_Type.featOkTst && ((OntRelationMention_Type)jcasType).casFeat_rangeList == null) jcasType.jcas.throwFeatMissing("rangeList", "de.julielab.jules.types.OntRelationMention"); jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(...
java
@Override public Long sunionstore(final byte[] dstkey, final byte[]... keys) { checkIsInMultiOrPipeline(); client.sunionstore(dstkey, keys); return client.getIntegerReply(); }
python
def encode(self, data): '''Encode a message (ie, add the ecc symbols) using Reed-Solomon, whatever the length of the message because we use chunking''' if isinstance(data, str): data = bytearray(data, "latin-1") chunk_size = self.nsize - self.nsym enc = bytearray() fo...
java
@Override public void setString(int parameterIndex, String x) throws SQLException { checkParameterBounds(parameterIndex); this.parameters[parameterIndex-1] = x == null ? VoltType.NULL_STRING_OR_VARBINARY : x; }
java
@Override public void run() { try { log.info("UDP - client started: " + this.hostname + ":" + this.port); isRunning = true; buf = new ByteBuffer(5000); buf.setString(getInitMessage()); // A buffer size of 5000 to handle the server_param message. ...
java
public <T extends Enum<T>> T getEnum(Property<T> property, Class<T> enumClass) throws ConfigurationException { return tryGet(property, s -> Enum.valueOf(enumClass, s)); }
java
private Constant parseConstant(Node el, boolean ignoreCase) { return new Constant( nodeAttribute(el, TAG_CONSTANT_ATTR_VALUE), nodeAttribute(el, TAG_CONSTANT_ATTR_IGNORE_CASE, ignoreCase), nodeAttribute(el, TAG_ATTR_GHOST, PatternElement.DEFAULT_GHOST_VALUE) ...
java
public static <T extends ParameterDescription> ElementMatcher.Junction<T> hasType(ElementMatcher<? super TypeDescription> matcher) { return hasGenericType(erasure(matcher)); }
python
def version(self): """Get the QS Mobile version.""" # requests.get destroys the ? import urllib with urllib.request.urlopen(URL_VERSION.format(self._url)) as response: return response.read().decode('utf-8') return False
python
def get_agents(self): """Gets the agent list resulting from the search. return: (osid.authentication.AgentList) - the agent list raise: IllegalState - list already retrieved *compliance: mandatory -- This method must be implemented.* """ if self.retrieved: ...
java
@Override public void addRole(final String role) { CommonHelper.assertNotBlank("role", role); this.roles.add(role); }
python
def validate(config): ''' Validate the beacon configuration ''' # Configuration for adb beacon should be a dictionary with states array if not isinstance(config, list): log.info('Configuration for adb beacon must be a list.') return False, ('Configuration for adb beacon must be a lis...
python
def when_matches(self, path, good_value, bad_values=None, timeout=None, event_timeout=None): """Resolve when an path value equals value Args: path (list): The path to wait to good_value (object): the value to wait for bad_values (list): values to...
java
static public String getSFTimestampAsString( SFTimestamp sfTS, int columnType, int scale, SnowflakeDateTimeFormat timestampNTZFormatter, SnowflakeDateTimeFormat timestampLTZFormatter, SnowflakeDateTimeFormat timestampTZFormatter, SFSession session) throws SFException { // Derive the ...
java
public QueryParser getForClass(Class<? extends SolrDataQuery> clazz) { QueryParser queryParser = cache.get(clazz); if (queryParser == null) { for (QueryParserPair pair : parserPairs) { if (pair.canParser(clazz)) { this.cache.put(clazz, pair.getParser()); queryParser = pair.getParser(); break;...
java
public void onNodeStarted(final IExecutionNode node) { if (!node.equals(this.theLastNode)) { if (this.theLastNode != null) { printStarted("Starting: " + format(this.theLastNode)); } this.theLastNode = node; } else { // not sure how this ...
python
def sync(self): '''Write the dict to disk''' if self.flag == 'r': return filename = self.filename tempname = filename + '.tmp' fileobj = open(tempname, 'wb' if self.file_format == 'pickle' else 'w') try: self.dump(fileobj) except Exception:...
python
def run_cmd(cmd, input=None, timeout=30, max_try=3, num_try=1): '''Run command `cmd`. It's like that, and that's the way it is. ''' if type(cmd) == str: cmd = cmd.split() process = subprocess.Popen(cmd, stdin=open('/dev/null', 'r'), ...
java
@NonNull @CheckResult public static <T> LifecycleTransformer<T> bindActivity(@NonNull final Observable<ActivityEvent> lifecycle) { return bind(lifecycle, ACTIVITY_LIFECYCLE); }
python
def _get_prepped_model_field(model_obj, field): """ Gets the value of a field of a model obj that is prepared for the db. """ # Get the field field = model_obj._meta.get_field(field) # Get the value value = field.get_db_prep_save(getattr(model_obj, field.attname), connection) # Return...
java
public static Condition exactText(final String text) { return new Condition("exact text") { @Override public boolean apply(Driver driver, WebElement element) { return Html.text.equals(element.getText(), text); } @Override public String toString() { return name + " '" +...
python
def isNegativeStrand(self): """ Check if this genomic interval is on the negative strand. :return: True if this element is on the negative strand """ if self.strand is None and self.DEFAULT_STRAND == self.NEGATIVE_STRAND: return True return self.strand == self.NEGATIVE_STRAND
python
def cli(env, identifier): """Detail firewall.""" mgr = SoftLayer.FirewallManager(env.client) firewall_type, firewall_id = firewall.parse_id(identifier) if firewall_type == 'vlan': rules = mgr.get_dedicated_fwl_rules(firewall_id) else: rules = mgr.get_standard_fwl_rules(firewall_id)...
python
def open(self, path): """Open a contactless reader identified by the search *path*. The :meth:`open` method searches and then opens a contactless reader device for further communication. The *path* argument can be flexibly constructed to identify more or less precisely the devic...
python
def meanvT(self,R,romberg=False,nsigma=None,phi=0.): """ NAME: meanvT PURPOSE: calculate <vT> at R by marginalizing over velocity INPUT: R - radius at which to calculate <vT> (can be Quantity) OPTIONAL INPUT: nsigma - number of s...
java
@Override public void onMapReady(GoogleMap googleMap) { mMap = googleMap; // Add a marker in Sydney and move the camera LatLng sydney = new LatLng(-34, 151); mMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney")); mMap.moveCamera(CameraUpdateFactory.n...
java
public void marshall(CreateRemoteAccessSessionRequest createRemoteAccessSessionRequest, ProtocolMarshaller protocolMarshaller) { if (createRemoteAccessSessionRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMar...
java
@SuppressWarnings("unchecked") public static <T> T get(String key, Class<T> valueClass) { return (T) values.get(key); }
python
def post(self, client_method, data, post_params=None, is_json=True): """Make a POST request""" url = self._wa.apollo_url + self.CLIENT_BASE + client_method if post_params is None: post_params = {} headers = { 'Content-Type': 'application/json' } ...
java
protected void onNext() { stateMachine.next(); updateButtonState(); final String name = getStateMachine().getCurrentState().getName(); final CardLayout cardLayout = getWizardContentPanel().getCardLayout(); cardLayout.show(getWizardContentPanel(), name); }
python
def get_author_tags(index_page): """ Parse `authors` from HTML ``<meta>`` and dublin core. Args: index_page (str): HTML content of the page you wisht to analyze. Returns: list: List of :class:`.SourceString` objects. """ dom = dhtmlparser.parseString(index_page) authors = ...
java
@SuppressWarnings("nullness") // static method, so null first arg is OK: oi.factory private @NonNull Object getRefArg(OptionInfo oi, String argName, String argValue) throws ArgException { Object val; try { if (oi.constructor != null) { val = oi.constructor.newInstance(new Object[] {argVal...
java
@RequestMapping(value = "/api/path/{pathIdentifier}", method = RequestMethod.GET) @ResponseBody public EndpointOverride getPath(Model model, @PathVariable String pathIdentifier, @RequestParam(required = false) String profileIdentifier, ...
java
@SuppressWarnings("unchecked") private <T extends BaseTopicWrapper<T>> void doSpecTopicFirstPass(final BuildData buildData, final Map<SpecTopic, Set<String>> usedIdAttributes, final List<Entity> entities) throws BuildProcessingException { final List<SpecTopic> specTopics = buildData.getBuildData...
java
public Collection<ApplicableToProduct> getNonApplicableResourcesForName(String resourceName) { List<ApplicableToProduct> result = nameToNonApplicableResources.get(resourceName); if (result == null) { // We don't expect this to happen, if we're looking for non-applicable resources, it's beca...
java
protected BufferedImage create_BACKGROUND_Image(final int WIDTH, final int HEIGHT, BufferedImage image) { if (WIDTH <= 0 || HEIGHT <= 0) { return UTIL.createImage(1, 1, Transparency.TRANSLUCENT); } if (image == null) { image = UTIL.createImage(WIDTH, HEIGHT, Transparency...
python
def yesterday(hour=None, minute=None): """ Gives the ``datetime.datetime`` object corresponding to yesterday. The default value for optional parameters is the current value of hour and minute. I.e: when called without specifying values for parameters, the resulting object will refer to the time = no...
java
public boolean closeClassLoader(final ClassLoader cl) throws ValidatorManagerException { boolean res = false; if (cl == null) { return res; } final Class classURLClassLoader = URLClassLoader.class; Field f = null; try { f = classURLClassLoader.getDeclaredField("ucp"); } catch (fi...
python
def addstr(self, h, w, text, attrs=0): """ A safe addstr wrapper """ self.update_window_size() if h > self.height or w > self.width: return try: # Python curses addstr doesn't deal with non-ascii characters #self.window.addstr(h, w, tex...
python
def to_escpos(self): """ converts the current style to an escpos command string """ cmd = '' ordered_cmds = self.cmds.keys() ordered_cmds.sort(lambda x,y: cmp(self.cmds[x]['_order'], self.cmds[y]['_order'])) for style in ordered_cmds: cmd += self.cmds[style][self.get(...
java
public void setImage( II grayII , Planar<II> colorII ) { InputSanityCheck.checkSameShape(grayII,colorII); if( colorII.getNumBands() != numBands ) throw new IllegalArgumentException("Expected planar images to have " +numBands+" not "+colorII.getNumBands()); this.grayII = grayII; this.colorII = colorII; ...
python
def loadUi(self, filename, baseinstance=None): """ Generate a loader to load the filename. :param filename | <str> baseinstance | <QWidget> :return <QWidget> || None """ try: xui = ElementTree.parse(file...
python
def assert_records_equal_nonvolatile(first, second, volatile_fields, indent=0): """Compare two test_record tuples, ignoring any volatile fields. 'Volatile' fields include any fields that are expected to differ between successive runs of the same test, mainly timestamps. All other fields are recursively compar...
python
def skew_normal_expval(mu, tau, alpha): """ Expectation of skew-normal random variables. """ delta = alpha / np.sqrt(1. + alpha ** 2) return mu + np.sqrt(2 / pi / tau) * delta
java
@Override public List<URI> importServices(InputStream servicesContentStream, String mediaType) throws SalException { boolean isNativeFormat = MediaType.NATIVE_MEDIATYPE_SYNTAX_MAP.containsKey(mediaType); // Throw error if Format Unsupported if (!isNativeF...
python
def enable_autozoom(self, option): """Set ``autozoom`` behavior. Parameters ---------- option : {'on', 'override', 'once', 'off'} Option for zoom behavior. A list of acceptable options can also be obtained by :meth:`get_autozoom_options`. Raises ...
python
def get_event(self, event_name, event_history=None): """Get an event from the database. Gets an event from the named event list removing the event and adding it to the event history. Args: event_name (str): Event list key. event_history (str, optional): Event hi...
java
@Pure public GeoLocationPoint getGeoPosition() { final Rectangle2d b = getBoundingBox(); if (b == null) { return null; } return new GeoLocationPoint(b.getCenterX(), b.getCenterY()); }
python
def _qu_fix(self, sents_syllables): """ Ensure that 'qu' is not treated as its own syllable. :param sents_syllables: Sentence of words of syllables. :return: syllabified syllables with 'qu' counted as a single consonant :rtype : list """ for sentence in sents_syl...
python
def _dehex(s): """Liberally convert from hex string to binary string.""" import re import binascii # Remove all non-hexadecimal digits s = re.sub(br'[^a-fA-F\d]', b'', s) # binscii.unhexlify works in Python 2 and Python 3 (unlike # thing.decode('hex')). return binascii.unhexlify(s)
python
def get_tagged_version(): """ Determine the current version of this package. Precise long version numbers are used if the Git repository is found. They contain: the Git tag, the commit serial and a short commit id. otherwise a short version number is used if installed from Pypi. """ with op...
python
def force_balanced_LP(self): r"""Force balanced lamination parameters The lamination parameters `\xi_{A2}` and `\xi_{A4}` are set to null to force a balanced laminate. """ dummy, xiA1, xiA2, xiA3, xiA4 = self.xiA self.xiA = np.array([1, xiA1, 0, xiA3, 0], dtype=np.float...
java
public static TransactionEdit createCommitted(long writePointer, Set<ChangeId> changes, long nextWritePointer, boolean canCommit) { return new TransactionEdit(writePointer, 0L, State.COMMITTED, 0L, changes, nextWritePointer, canCommit, null, ...
java
public PrivateKey getPrivateKeyFromString(String key) throws MangooEncryptionException { Objects.requireNonNull(key, Required.KEY.toString()); try { return KeyFactory.getInstance(ALGORITHM).generatePrivate(new PKCS8EncodedKeySpec(decodeBase64(key))); } catch (InvalidKeySpecE...
java
public static byte[] getMerkleRootHash(Queue<byte[]> hashQueue, @NonNull HashAlgorithm algorithm) { while (hashQueue.size() > 1) { byte[] hashValue = ArrayUtils.addAll(hashQueue.poll(), hashQueue.poll()); switch (algorithm) { case SHA1 : hashQueue.add(DigestUtils.sha1(hashValue)); case SHA2...
python
def _write_attribute_categorical(series, fp): """Write categories of a categorical/nominal attribute""" if is_categorical_dtype(series.dtype): categories = series.cat.categories string_values = _check_str_array(categories) else: categories = series.dropna().unique() string_va...
java
@Nullable public static IJson readFromStream (@Nonnull final InputStream aIS, @Nonnull final Charset aFallbackCharset) { return readFromStream (aIS, aFallbackCharset, null); }
python
def _binary_arithemtic(self, left, binary, right): """ Parameters ---------- operand: Column object, integer or float Value on which to apply operator to this column binary: char binary arithmetic operator (-, +, *, /, ^, %) Returns ------...
java
private List<TestCaseModel> buildModel(List<AggregatedTestResultEvent> testEvents) { List<TestCaseModel> tests = new ArrayList<>(); for (AggregatedTestResultEvent e : testEvents) { TestCaseModel model = new TestCaseModel(); if (e.getStatus() == TestStatus.IGNORED || e.getStatus() == TestS...
python
def _line_2_pair(line): '''Return bash variable declaration as name-value pair. Name as lower case str. Value itself only without surrounding '"' (if any). For example, _line_2_pair('NAME="Ubuntu"') will return ('name', 'Ubuntu') ''' key, val = line.split('=') return key.lower(), val.strip('"'...
java
public Bundler putParcelableArrayList(String key, ArrayList<? extends Parcelable> value) { bundle.putParcelableArrayList(key, value); return this; }
python
def _send_ffs(self, pid, n_blocks, fr): """Send a flood-fill start packet. The cores and regions that the application should be loaded to will be specified by a stream of flood-fill core select packets (FFCS). """ sfr = fr | (1 << 31) self._send_scp( 255, 255...
java
protected void markMerge(int regionA, int regionB) { int dA = mergeList.data[regionA]; int dB = mergeList.data[regionB]; // Quick check to see if they reference the same node if( dA == dB ) { return; } // search down to the root node (set-find) int rootA = regionA; while( dA != rootA ) { rootA...
python
def _create_source(self, src): """Create a pyLikelihood Source object from a `~fermipy.roi_model.Model` object.""" if src['SpatialType'] == 'SkyDirFunction': pylike_src = pyLike.PointSource(self.like.logLike.observation()) pylike_src.setDir(src.skydir.ra.deg, src.skydir....
python
def code_data_whitening(self, decoding, inpt): """ XOR Data Whitening :param decoding: :param inpt: :return: """ inpt_copy = array.array("B", inpt) return self.apply_data_whitening(decoding, inpt_copy)
java
public HFCAAffiliation createDecendent(String name) throws InvalidArgumentException, AffiliationException { if (this.deleted) { throw new AffiliationException("Affiliation has been deleted"); } validateAffiliationNames(name); return new HFCAAffiliation(this.name + "." + name,...
java
public String getIndexPatternOlderThanDays(String prefix, int days) { // select all indices, then exclude months and days that are not older than the days parameter // Example: // stagemonitor-metrics-*,-stagemonitor-metrics-2015.10.*,-stagemonitor-metrics-2015.09.30 final StringBuilder indexPattern = new Strin...
java
public ParticleSystem duplicate() throws SlickException { for (int i=0;i<emitters.size();i++) { if (!(emitters.get(i) instanceof ConfigurableEmitter)) { throw new SlickException("Only systems contianing configurable emitters can be duplicated"); } } ParticleSystem theCopy = null; try { B...
java
private void solidColor(Attributes attributes) throws SVGParseException { debug("<solidColor>"); if (currentElement == null) throw new SVGParseException("Invalid document. Root element must be <svg>"); SVG.SolidColor obj = new SVG.SolidColor(); obj.document = svgDocument; ...
java
private void initWriteBuffer() throws IOException { if (headeroutbuf == null) { int buflen = DWORDSIZE + // room for next SWORDSIZE + // room for hash DWORDSIZE + /...
java
public void marshall(DescribeTrustsRequest describeTrustsRequest, ProtocolMarshaller protocolMarshaller) { if (describeTrustsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(describeTrustsRe...
python
def pipeline_counter(self): """ Get pipeline counter of current job instance. Because instantiating job instance could be performed in different ways and those return different results, we have to check where from to get counter of the pipeline. :return: pipeline counter. ...
python
def user_field(user, field, *args): """ Gets or sets (optional) user model fields. No-op if fields do not exist. """ if not field: return User = get_user_model() try: field_meta = User._meta.get_field(field) max_length = field_meta.max_length except FieldDoesNotExist:...
java
@Deprecated public CellStyle createStyleForCell(int x, int y) { final Cell cell = getOrCreateCell(x, y); final CellStyle cellStyle = this.workbook.createCellStyle(); cell.setCellStyle(cellStyle); return cellStyle; }
java
public void limitMaximumPageSize(int limit) { if (getPagination() == PaginationTo.NO_PAGINATION) { setPagination(new PaginationTo()); } Integer pageSize = getPagination().getSize(); if ((pageSize == null) || (pageSize.intValue() > limit)) { getPagination().setSize((Integer.valueOf(...