language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def direction(self):
"""Returns the direction of the variable if it is a parameter. Possible values
are ["": no intent, "(in)", "(out)", "(inout)"].
"""
if self._direction is None:
if hasattr(self, "parameters"):
#This is actually a function that inherited fro... |
python | def _pathogenSamplePlot(self, pathogenName, sampleNames, ax):
"""
Make an image of a graph giving pathogen read count (Y axis) versus
sample id (X axis).
@param pathogenName: A C{str} pathogen name.
@param sampleNames: A sorted C{list} of sample names.
@param ax: A matpl... |
java | private Schema read(JsonReader reader, Set<String> knownRecords) throws IOException {
JsonToken token = reader.peek();
switch (token) {
case NULL:
return null;
case STRING: {
// Simple type or know record type
String name = reader.nextString();
if (knownRecords.contai... |
python | def get_dim(self, X):
"""
Get the output dimensionality of this basis.
This makes a cheap call to transform with the initial parameter values
to ascertain the dimensionality of the output features.
Parameters
----------
X : ndarray
(N, d) array of ob... |
java | protected GVRVideoSceneObjectPlayer<ExoPlayer> makeExoPlayer(String movieFileName ) {
GVRVideoSceneObjectPlayer<ExoPlayer> gvrVideoSceneObjectPlayer = null;
try {
//final Context context = activityContext;
final Context context = gvrContext.getContext();
final Strin... |
python | def _Purge(self, event, by_tags):
"""Purge all events that have occurred after the given event.step.
If by_tags is True, purge all events that occurred after the given
event.step, but only for the tags that the event has. Non-sequential
event.steps suggest that a TensorFlow restart occurred, and we dis... |
java | public NotifictionResultEnum createNotifictionResultEnumFromString(EDataType eDataType, String initialValue) {
NotifictionResultEnum result = NotifictionResultEnum.get(initialValue);
if (result == null)
throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDat... |
python | def _validate_alias_file_content(alias_file_path, url=''):
"""
Make sure the alias name and alias command in the alias file is in valid format.
Args:
The alias file path to import aliases from.
"""
alias_table = get_config_parser()
try:
alias_table.read(alias_file_path)
... |
java | @SuppressWarnings("SameParameterValue")
private static void insertionSort(int[] order, double[] values, int start, int n, int limit) {
for (int i = start + 1; i < n; i++) {
int t = order[i];
double v = values[order[i]];
int m = Math.max(i - limit, start);
for ... |
java | public boolean isInstalled()
throws ManagedSdkVerificationException, ManagedSdkVersionMismatchException {
if (getSdkHome() == null) {
return false;
}
if (!Files.isDirectory(getSdkHome())) {
return false;
}
if (!Files.isRegularFile(getGcloudPath())) {
return false;
}
/... |
java | public String getSubString(long pos, int length) throws SQLException {
if (pos < 1) {
throw ExceptionMapper.getSqlException("position must be >= 1");
}
if (length < 0) {
throw ExceptionMapper.getSqlException("length must be > 0");
}
try {
String val = toString();
return va... |
java | public static long[] random(int card, int capacity, Random random) {
if(card < 0 || card > capacity) {
throw new IllegalArgumentException("Cannot set " + card + " out of " + capacity + " bits.");
}
// FIXME: Avoid recomputing the cardinality.
if(card < capacity >>> 1) {
long[] bitset = BitsU... |
java | public void delete(long msgId) {
String url = WxEndpoint.get("url.mass.message.delete");
String request = "{\"msg_id\":%s}";
logger.debug("delete message: {}", msgId);
wxClient.post(url, String.format(request, msgId));
} |
python | def _derZ(self,x,y,z):
'''
Returns the first derivative of the function with respect to Z at each
value in (x,y,z). Only called internally by HARKinterpolator3D._derZ.
'''
m = len(x)
temp = np.zeros((m,self.funcCount))
for j in range(self.funcCount):
... |
python | def to_series(self, only=None,
intensive_columns=["temperature", "pressure"],
check_data=True):
"""
Produce a data record for `ChemicalEquation`.
All possible linear differences for all numeric attributes are computed
and stored in the returned `panda... |
java | public void cleanupParams(int size, long interval) {
timer.cancel();
timer.schedule(new Cleanup(content,size), interval, interval);
} |
python | def run(self, command):
"""
Runs a command as if from the command-line
without the need for using popen or subprocess
"""
if isinstance(command, basestring):
command = command.split()
else:
command = list(command)
self.external.omero_cli(co... |
java | public static String replaceAll(final String input, final Pattern regex,
final Function<MatchResult, String> replacementFunction) {
final StringBuffer output = new StringBuffer();
final Matcher matcher = regex.matcher(input);
while (matcher.find()) {
final MatchResult match = matcher.toMatchResu... |
java | public GenericUtilities.TypeCategory getTypeCategory() {
if (hasParameters() && variable == null && extension == null) {
return GenericUtilities.TypeCategory.PARAMETERIZED;
} else if (!hasParameters() && variable != null && extension == null) {
if ("*".equals(variable)) {
... |
java | public static CmsInfoButton getJavaStatisticButton(CmsMemoryStatus memory) {
Map<String, String> infoMap = new LinkedHashMap<String, String>();
infoMap.put(
CmsVaadinUtils.getMessageText(Messages.GUI_CACHE_JAVA_HEAP_MAX_0),
CmsFileUtil.formatFilesize(
memory.get... |
python | def origin_displacement(self):
"""
planar distance of start point from self.location along :math:`-Z` axis
"""
return self.start_point.sub(self.location.origin).dot(-self.location.zDir) |
python | def _get_api_url(self, secure=None, **formatters):
'''Constructs Postmark API url
:param secure: Use the https Postmark API.
:param \*\*formatters: :func:`string.format` keyword arguments to
format the url with.
:rtype: Postmark API url
'''
if self.endpoint i... |
python | def on_use_runtime_value_toggled(self, widget, path):
"""Try to set the use runtime value flag to the newly entered one
"""
try:
data_port_id = self.list_store[path][self.ID_STORAGE_ID]
self.toggle_runtime_value_usage(data_port_id)
except TypeError as e:
... |
python | def add_input(self, input):
'''
Add a single build XML output file to our data.
'''
events = xml.dom.pulldom.parse(input)
context = []
for (event,node) in events:
if event == xml.dom.pulldom.START_ELEMENT:
context.append(node)
i... |
java | public List<Object> getClauseValue(Parameter param) {
Parameter match = null;
if (typedParameter != null && typedParameter.jpaParameters != null) {
for (Parameter p : typedParameter.jpaParameters) {
if (p.equals(param)) {
match = p;
if ... |
java | public Config loadConfig(final @Nullable String confname, final String rootPath, final boolean reset) {
final Config config = loadConfig(confname, rootPath);
if (reset) COREUTILS_CONTEXT.eventBus().post(new ConfigurationChangedEvent(config));
return config;
} |
java | private void setAccessibleSafely(AccessibleObject classMember)
{
try {
// We do this in a try/catch to avoid false positives caused by existing SecurityManagers.
classMember.setAccessible(true);
} catch (SecurityException se) {
logger.debug("Failed to call setAcce... |
python | def _dump_inline_table(section):
"""Preserve inline table in its compact syntax instead of expanding
into subsection.
https://github.com/toml-lang/toml#user-content-inline-table
"""
retval = ""
if isinstance(section, dict):
val_list = []
for k, v in section.items():
... |
python | def pack_command(self, *args):
"Pack a series of arguments into a value Redis command"
args_output = SYM_EMPTY.join([
SYM_EMPTY.join(
(SYM_DOLLAR, str(len(k)).encode(), SYM_CRLF, k, SYM_CRLF))
for k in imap(self.encoder.encode, args)])
output = SYM_EMPTY.j... |
java | @Override
public final void copyStartElement(InputElementStack elemStack, AttributeCollector ac)
throws IOException, XMLStreamException
{
/* In case of repairing stream writer, we can actually just
* go ahead and first output the element: stream writer should
* be able to resol... |
python | def reelect_app(self, request, app):
"""tries to connect to the same app on differnet host from dist-info"""
# disconnect app explicitly to break possibly existing connection
app.disconnect()
endpoints_size = len(app.locator.endpoints)
# try x times, where x is the number of di... |
java | protected void reportKeyGroupOfElementAtIndex(int index, int keyGroup) {
final int keyGroupIndex = keyGroup - firstKeyGroup;
elementKeyGroups[index] = keyGroupIndex;
++counterHistogram[keyGroupIndex];
} |
python | def confd_state_internal_callpoints_typepoint_id(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
confd_state = ET.SubElement(config, "confd-state", xmlns="http://tail-f.com/yang/confd-monitoring")
internal = ET.SubElement(confd_state, "internal")
... |
java | public int getAttributeNode(int nodeHandle, String namespaceURI, String name) {
int nsIndex = m_nsNames.stringToIndex(namespaceURI),
nameIndex = m_localNames.stringToIndex(name);
nodeHandle &= NODEHANDLE_MASK;
... |
java | static <R> BiPredicate<R, Throwable> resultPredicateFor(Predicate<R> resultPredicate) {
return (t, u) -> {
if (u == null) {
return resultPredicate.test(t);
} else {
// resultPredicate is only defined over the success type.
// It doesn't know how to handle a failure of type Throwa... |
java | private ArrayList<Range<T>> subtractContained(Range<T> contained)
{
ArrayList<Range<T>> difference = new ArrayList<Range<T>>(2);
if (!left.equals(contained.left))
difference.add(new Range<T>(left, contained.left, partitioner));
if (!right.equals(contained.right))
dif... |
python | def parse_value(self, value_string: str):
"""
Parses the amount string.
"""
self.value = Decimal(value_string)
return self.value |
java | public static final <T extends Calendar> Function<T, LocalDate> calendarToLocalDate(Chronology chronology) {
return FnLocalDate.calendarToLocalDate(chronology);
} |
java | private void setIdValue(Object target, JsonNode idValue) throws IllegalAccessException {
Field idField = configuration.getIdField(target.getClass());
ResourceIdHandler idHandler = configuration.getIdHandler(target.getClass());
if (idValue != null) {
idField.set(target, idHandler.fromString(idValue.asText()));... |
java | protected void removeSequence(String sequenceName)
{
// lookup the sequence map for calling DB
Map mapForDB = (Map) sequencesDBMap.get(getBrokerForClass()
.serviceConnectionManager().getConnectionDescriptor().getJcdAlias());
if(mapForDB != null)
{
s... |
java | static public Set<String> getDescendantPathNames(File dir, boolean includeDirectories) {
Set<String> paths = new HashSet<String>();
if( dir.exists() && dir.isDirectory() ) {
String[] names = dir.list();
for(String name : names){
File child = new File(dir,name);
getPathNames(child, paths, null, include... |
python | def make(self):
"""
Make the lock file.
"""
try:
# Create the lock file
self.mkfile(self.lock_file)
except Exception as e:
self.die('Failed to generate lock file: {}'.format(str(e))) |
python | def output(*args, **kwargs):
'''Analog of print() but with an indent option
'''
indent = kwargs.pop('indent', 0)
sep = kwargs.pop('sep', None)
kwargs['sep'] = u'' # Sanity
if sep is None:
sep = u' '
indent_str = u' ' * (indent * tab_width)
text = sep.join(map(str_, args))
co... |
java | @Override
public T data(Object... values) {
if (values == null || values.length == 0) {
return (T) this;
}
if (this.data == null) {
if (this.type == AxisType.category) {
data = new ArrayList<Object>();
} else {
throw new Run... |
java | public void setLandmarks(java.util.Collection<Landmark> landmarks) {
if (landmarks == null) {
this.landmarks = null;
return;
}
this.landmarks = new java.util.ArrayList<Landmark>(landmarks);
} |
java | private static int firstIslamicStartYearFromGrego(int year) {
// ad hoc conversion, improve under #10752
// rough est for now, ok for grego 1846-2138,
// otherwise occasionally wrong (for 3% of years)
int cycle, offset, shift = 0;
if (year >= 1977) {
cycle = (year - 1... |
python | def bind(cls, origin, handler, *, name=None):
"""Bind this object to the given origin and handler.
:param origin: An instance of `Origin`.
:param handler: An instance of `bones.HandlerAPI`.
:return: A subclass of this class.
"""
name = cls.__name__ if name is None else n... |
java | @Override
public void setOverriding(boolean b)
{
if (this.keyHook != null)
{
this.keyHook.isDown = false;
this.keyHook.justPressed = false;
this.keyHook.isOverridingPresses = b;
}
} |
python | def delete(self, tag, ref):
"""Delete from the vgroup the member identified by its tag
and reference number.
Args::
tag tag of the member to delete
ref reference number of the member to delete
Returns::
None
Only the link of the member wit... |
java | @Override protected void initGraphics() {
super.initGraphics();
mouseEventHandler = e -> {
final EventType TYPE = e.getEventType();
if (MouseEvent.MOUSE_PRESSED == TYPE) {
tile.setActive(!tile.isActive());
tile.fireEvent(SWITCH_PRESSED);
... |
java | public void animateContentViewTranslationX(float x, float alpha,
Animator.AnimatorListener listener,
int duration) {
if (DBG) Log.v(TAG, "animateContentViewTranslationX - " +
"x=" + x + ", alpha... |
python | def _bind_model(self):
"""
This method binds the various model objects together in the correct hierarchy
and adds referneces to this database object in the groups.
"""
if self.groups[0].level != 0:
self.log.info("Got invalid first group: {0}".format(self.groups[0]))
... |
python | def _generic_model(self, z3_model):
"""
Converts a Z3 model to a name->primitive dict.
"""
model = { }
for m_f in z3_model:
n = _z3_decl_name_str(m_f.ctx.ctx, m_f.ast).decode()
m = m_f()
me = z3_model.eval(m)
model[n] = self._abstra... |
java | protected void process(DBIDRef id, ArrayDBIDs ids, DBIDArrayIter it, int n, WritableDBIDDataStore pi, WritableDoubleDataStore lambda, WritableDoubleDataStore m) {
slinkstep3(id, it, n, pi, lambda, m);
slinkstep4(id, it, n, pi, lambda);
} |
python | def publish_workflow_submission(self,
user_id,
workflow_id_or_name,
parameters):
"""Publish workflow submission parameters."""
msg = {
"user": user_id,
"workflow_id_or_name... |
java | public static void addHeaders(BoundRequestBuilder builder,
Map<String, String> headerMap) {
for (Entry<String, String> entry : headerMap.entrySet()) {
String name = entry.getKey();
String value = entry.getValue();
builder.addHeader(name, value);
}
} |
python | async def quit(self):
"""
Sends a SMTP 'QUIT' command. - Ends the session.
For further details, please check out `RFC 5321 § 4.1.1.10`_.
Returns:
(int, str): A (code, message) 2-tuple containing the server
response. If the connection is already closed when c... |
python | def join(
self,
inner_enumerable,
outer_key=lambda x: x,
inner_key=lambda x: x,
result_func=lambda x: x
):
"""
Return enumerable of inner equi-join between two enumerables
:param inner_enumerable: inner enumerable to join to self
... |
java | public void createErrorMessage(String errorMessage) {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
pw.println(errorMessage);
pw.close();
messager.printMessage(Diagnostic.Kind.ERROR,
sw.toString());
} |
python | def convert_simple_rnn(builder, layer, input_names, output_names, keras_layer):
"""Convert an SimpleRNN layer from keras to coreml.
Parameters
----------
keras_layer: layer
A keras layer object.
builder: NeuralNetworkBuilder
A neural network builder object.
"""
# Get input ... |
java | public MapWithProtoValuesFluentAssertion<M> usingDoubleToleranceForFieldDescriptorsForValues(
double tolerance, FieldDescriptor firstFieldDescriptor, FieldDescriptor... rest) {
return usingConfig(
config.usingDoubleToleranceForFieldDescriptors(
tolerance, asList(firstFieldDescriptor, rest)... |
java | private List<Bean> findReferences(BeanId reference, Collection<Bean> predecessors,
ArrayList<Bean> matches, ArrayList<Bean> checked) {
for (Bean predecessor : predecessors) {
findReferences(reference, predecessor, matches, checked);
}
return matches;
} |
python | def compose(*decorators):
"""Helper to compose decorators::
@a
@b
def f():
pass
Is equivalent to::
@compose(a, b)
def f():
...
"""
def composed(f):
for decor in reversed(decorators):
f = decor(f)
return f
... |
java | private static void deleteCacheFile(final File cacheFile) {
try {
if (cacheFile.delete()) {
LOG.warn(String.format(MSG_CACHE_FILE_IS_DAMAGED_AND_DELETED, cacheFile.getPath()));
} else {
LOG.warn(String.format(MSG_CACHE_FILE_IS_DAMAGED, cacheFile.getPath()));
}
} catch (final Exception e) {
LOG.w... |
python | def vhosts():
'''
Show the settings as parsed from the config file (currently
only shows the virtualhost settings) (``apachectl -S``).
Because each additional virtual host adds to the execution
time, this command may require a long timeout be specified
by using ``-t 10``.
CLI Example:
... |
python | def set_editor_ids_order(self, ordered_editor_ids):
"""
Order the root file items in the Outline Explorer following the
provided list of editor ids.
"""
if self.ordered_editor_ids != ordered_editor_ids:
self.ordered_editor_ids = ordered_editor_ids
i... |
java | public void close() {
for (Entry<Object, Object> singletons : singletonCache.entrySet()) {
Object key = singletons.getKey();
Object obj = singletons.getValue();
if (key instanceof BeanBox) {
BeanBox box = (BeanBox) key;
if (box.getPreDestroy() != null)
try {
box.getPreDestroy().invoke(obj)... |
python | def NS(s, o):
"""
Nash Sutcliffe efficiency coefficient
input:
s: simulated
o: observed
output:
ns: Nash Sutcliffe efficient coefficient
"""
# s,o = filter_nan(s,o)
return 1 - np.sum((s-o)**2)/np.sum((o-np.mean(o))**2) |
java | @Deprecated
public Report setDeviceInfo(String key, Object value) {
diagnostics.device.put(key, value);
return this;
} |
java | Element getElementById(String name) {
for (Attr attr : attributes) {
if (attr.isId() && name.equals(attr.getValue())) {
return this;
}
}
/*
* TODO: Remove this behavior.
* The spec explicitly says that this is a bad idea. From
*... |
java | public Expression<Float> eq(float value) {
String valueString = "'" + value + "'";
return new Expression<Float>(this, Operation.eq, valueString);
} |
java | public <V> void setColumnValue(T instance, String columnName, V value) {
Field field = fields.get(columnName);
if (field == null) {
throw new IllegalArgumentException("Column not found: "
+ columnName);
}
try {
field.set(instance, value);
... |
python | def _fit_strel_to_im_2d(im, strel, r, x, y):
r"""
Helper function to add a structuring element to a 2D image.
Used by RSA. Makes sure if center is less than r pixels from edge of image
that the strel is sliced to fit.
"""
elem = strel.copy()
x_dim, y_dim = im.shape
x_min = x-r
x_max ... |
java | private void processFiles() throws CompilationFailedException, IOException, URISyntaxException {
GroovyShell groovy = new GroovyShell(conf);
setupContextClassLoader(groovy);
Script s = groovy.parse(getScriptSource(isScriptFile, script));
if (args.isEmpty()) {
try(BufferedRe... |
java | private int generateCrc(byte[] data, int off, int len, RecordType type) {
Crc32c crc = new Crc32c();
crc.update(type.value());
crc.update(data, off, len);
return (int) LevelDbConstants.maskCrc(crc.getValue());
} |
java | @Override
public List<CPDefinitionSpecificationOptionValue> findByCPSpecificationOptionId(
long CPSpecificationOptionId) {
return findByCPSpecificationOptionId(CPSpecificationOptionId,
QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} |
python | def _fulfillment_from_details(data, _depth=0):
"""Load a fulfillment for a signing spec dictionary
Args:
data: tx.output[].condition.details dictionary
"""
if _depth == 100:
raise ThresholdTooDeep()
if data['type'] == 'ed25519-sha-256':
public_key = base58.b58decode(data['p... |
java | public GVRAnimation setOnFinish(GVROnFinish callback) {
mOnFinish = callback;
// Do the instance-of test at set-time, not at use-time
mOnRepeat = callback instanceof GVROnRepeat ? (GVROnRepeat) callback
: null;
if (mOnRepeat != null) {
mRepeatCount = -1; // l... |
python | def load_config_from_cli_arguments(self, *args, **kwargs):
"""
Get config values of passed in CLI options.
:param dict kwargs: CLI options
"""
self._load_config_from_cli_argument(key='handlers_package', **kwargs)
self._load_config_from_cli_argument(key='auth', **kwargs)
... |
java | @Override
public UniversalIdStrMessage fromBytes(byte[] data) {
try {
UniversalIdStrMessage other = BaseUniversalMessage.fromBytes(data,
UniversalIdStrMessage.class);
fromMap(other.toMap());
return this;
} catch (InstantiationException | Illega... |
java | protected byte[] initPlainData(int payloadSize, @Nullable byte[] initVector) {
byte[] plainData = new byte[OVERHEAD_SIZE + payloadSize];
if (initVector == null) {
ByteBuffer byteBuffer = ByteBuffer.wrap(plainData);
byteBuffer.putLong(INITV_TIMESTAMP_OFFSET, millisToSecsAndMicros(System.currentTimeM... |
java | @Autowired
public void setDataTypeImportOrder(List<IPortalDataType> dataTypeImportOrder) {
final ArrayList<PortalDataKey> dataKeyImportOrder =
new ArrayList<>(dataTypeImportOrder.size() * 2);
for (final IPortalDataType portalDataType : dataTypeImportOrder) {
final List<P... |
java | public com.google.api.ads.admanager.axis.v201902.Targeting getBuiltInTargeting() {
return builtInTargeting;
} |
python | def getopenfilenames(parent=None, caption='', basedir='', filters='',
selectedfilter='', options=None):
"""Wrapper around QtGui.QFileDialog.getOpenFileNames static method
Returns a tuple (filenames, selectedfilter) -- when dialog box is canceled,
returns a tuple (empty list, empty s... |
java | public void setBinding(String binding)
throws JspException {
if (binding!= null && !UIComponentTag.isValueReference(binding)) {
// PENDING i18n
throw new JspException("Invalid Expression:"+binding);
}
this.binding = binding;
} |
python | def create_vhost(self, name, tracing=False):
"""
Create an individual vhost.
:param name: The vhost name
:type name: str
:param tracing: Set to ``True`` to enable tracing
:type tracing: bool
"""
data = {'tracing': True} if tracing else {}
self._a... |
python | def rmtree_p(self):
""" Like :meth:`rmtree`, but does not raise an exception if the
directory does not exist. """
try:
self.rmtree()
except OSError:
_, e, _ = sys.exc_info()
if e.errno != errno.ENOENT:
raise
return self |
python | def populateViewTree(self, view):
'''
Populates the View tree.
'''
vuid = view.getUniqueId()
text = view.__smallStr__()
if view.getParent() is None:
self.viewTree.insert('', Tkinter.END, vuid, text=text)
else:
self.viewTree.insert(view.get... |
python | def compile_excludes(self):
"""Compile a set of regexps for files to be exlcuded from scans."""
self.compiled_exclude_files = []
for pattern in self.exclude_files:
try:
self.compiled_exclude_files.append(re.compile(pattern))
except re.error as e:
... |
java | public Number getTotalCount(Criterion... criterion) throws HibernateException {
Criteria criteria = getSession().createCriteria(entityClass);
addCriterionsToCriteria(criteria, criterion);
criteria.setProjection(Projections.rowCount());
return (Long) criteria.uniqueResult();
} |
java | public void setModel(SoundCloudTrack track) {
mModel = track;
if (mModel != null) {
Picasso.with(getContext())
.load(SoundCloudArtworkHelper.getArtworkUrl(mModel, SoundCloudArtworkHelper.XLARGE))
.placeholder(R.color.grey_light)
.fi... |
python | def main():
'''
Organization function
-setups logging
-gets inputdata
-calls plotting function
'''
args = get_args()
try:
utils.make_output_dir(args.outdir)
utils.init_logs(args)
args.format = nanoplotter.check_valid_format(args.format)
settings = vars(arg... |
java | public AmqpTemplate getAmqpTemplate(String queueName)
{
// このメソッドを呼び出す前に、
// this#initContextMap()を利用してcontextMapを初期しておくこと。
if (this.contextMap == null)
{
return null;
}
RabbitmqClusterContext context = this.contextMap.get(queueName);
if (context... |
java | public void setColumns(int n) {
if (n < 1) throw new IllegalArgumentException("Min column count is 1");
if (n > 5) throw new IllegalArgumentException("Max column count is 5");
if (n == columns) return;
this.columns = n;
refresh(this.columns);
} |
java | private Region find(long size) {
validate(!VALIDATING || Long.bitCount(size) == 1);
Node<Region> currentNode = getRoot();
Region currentRegion = currentNode.getPayload();
if (currentRegion == null || (currentRegion.available() & size) == 0) {
//no region big enough for us...
return null;
... |
python | def detect_direct_function_shadowing(contract):
"""
Detects and obtains functions which are shadowed immediately by the provided ancestor contract.
:param contract: The ancestor contract which we check for function shadowing within.
:return: A list of tuples (overshadowing_function, overshadowed_immedia... |
java | public void setPaxLoggingManager( PaxLoggingManager paxLoggingManager, String name )
{
m_delegate = paxLoggingManager.getLogger( name, JCL_FQCN );
} |
java | protected void _initPathStartPoint() {
_touch();
if (m_moveToPoint == null)
m_moveToPoint = new Point(m_description);
else
m_moveToPoint.assignVertexDescription(m_description);
} |
python | def load(self, environment, name, globals=None):
"""Loads a template. This method looks up the template in the cache
or loads one by calling :meth:`get_source`. Subclasses should not
override this method as loaders working on collections of other
loaders (such as :class:`PrefixLoader` ... |
python | def nunique(self, axis=0, dropna=True):
"""
Count distinct observations over requested axis.
Return Series with number of distinct observations. Can ignore NaN
values.
.. versionadded:: 0.20.0
Parameters
----------
axis : {0 or 'index', 1 or 'columns'},... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.