language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | private boolean checkMisroutedFragmentTaskMessage(FragmentTaskMessage message) {
if (m_scheduler.isLeader() || message.isForReplica()) {
return false;
}
TransactionState txnState = (((SpScheduler)m_scheduler).getTransactionState(message.getTxnId()));
// If a fragment is par... |
python | def ParseRecord(self, parser_mediator, key, structure):
"""Parses a matching entry.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
key (str): name of the parsed structure.
structure (pyparsing.ParseResults... |
python | def on_train_begin(self, **kwargs:Any)->None:
"Initialize inner arguments."
self.wait, self.opt = 0, self.learn.opt
super().on_train_begin(**kwargs) |
java | protected void grow() {
if(dists == EMPTY_DISTS) {
dists = new double[INITIAL_SIZE];
ids = new int[INITIAL_SIZE];
return;
}
final int len = dists.length;
final int newlength = len + (len >> 1) + 1;
double[] odists = dists;
dists = new double[newlength];
System.arraycopy(odi... |
java | public static String normalizeSeparators(final String filename) {
if (filename == null) {
return null;
}
switch (SYSTEM_SEPARATOR) {
case UNIX_SEPARATOR:
return filename.replace(WINDOWS_SEPARATOR, UNIX_SEPARATOR);
case WINDOWS_SEPARATOR:
return... |
python | def hexcolor(color):
" returns hex color given a tuple, wx.Color, or X11 named color"
# first, if this is a hex color already, return!
# Python 3: needs rewrite for str/unicode change
if isinstance(color, six.string_types):
if color[0] == '#' and len(color)==7:
return color.lower()
... |
java | public String getHome() {
if (m_homeFolderPath == null) {
if (CmsStringUtil.isNotEmpty(System.getProperty(SOLR_HOME_PROPERTY))) {
m_home = System.getProperty(SOLR_HOME_PROPERTY);
} else {
m_home = OpenCms.getSystemInfo().getAbsoluteRfsPathRelativeToWebInf... |
java | public void add(Object id, String text)
{
List<Term> termList = preprocess(text);
add(id, termList);
} |
python | def load_card(self, code, cache=True):
"""
Load a card with the given code from the database. This calls each
save event hook on the save string before commiting it to the database.
Will cache each resulting card for faster future lookups with this
method while respecting the li... |
java | @Deprecated
public static byte[] doubleFormating(Double doubleNum, String characterSetName, int fieldLength, int sizeDecimalPart)
throws UnsupportedEncodingException {
return doubleFormating(doubleNum, Charset.forName(characterSetName), fieldLength, sizeDecimalPart);
} |
java | public Element externalize(Datastore datastore) throws UnsupportedOperationException {
if (datastore == null) {
throw new IllegalArgumentException("Datastore cannot be null");
}
final Element elem;
if (datastore instanceof CsvDatastore) {
final Resource resource... |
java | private boolean canScrollInAllDirection() {
return mTransformedImageBounds.left < mViewBounds.left - EPS &&
mTransformedImageBounds.top < mViewBounds.top - EPS &&
mTransformedImageBounds.right > mViewBounds.right + EPS &&
mTransformedImageBounds.bottom > mViewBounds.bottom + EPS;
} |
java | protected <T> List<T> processWrapperList(TypeReference typeRef, URL url, String errorMessageSuffix) throws MovieDbException {
WrapperGenericList<T> val = processWrapper(typeRef, url, errorMessageSuffix);
return val.getResults();
} |
java | public void buildModuleDescription(XMLNode node, Content moduleContentTree) {
if (!configuration.nocomment) {
moduleWriter.addModuleDescription(moduleContentTree);
}
} |
python | def ikey(self, value):
"""The ikey property.
Args:
value (string). the property value.
"""
if value == self._defaults['iKey'] and 'iKey' in self._values:
del self._values['iKey']
else:
self._values['iKey'] = value |
java | @Override
final public ManagedConnection createManagedConnection(
final Subject subject, final ConnectionRequestInfo requestInfo)
throws ResourceException {
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
... |
java | public static int resultSetTypeToSqlLite(int columnType) {
int type;
switch (columnType) {
case Types.INTEGER:
case Types.BIGINT:
case Types.SMALLINT:
case Types.TINYINT:
case Types.BOOLEAN:
type = ResultUtils.FIELD_TYPE_INTEGER;
break;
case Types.VARCHAR:
case Types.DATE:
type = ResultUtil... |
python | def add_repository(self, name, repository_type, repository_class,
aggregate_class, make_default, configuration):
"""
Generic method for adding a repository.
"""
repo_mgr = self.get_registered_utility(IRepositoryManager)
if name is None:
# If no ... |
python | def add_from_vla_obs (src, Lband, Cband):
"""Add an entry into the models table for a source based on L-band and
C-band flux densities.
"""
if src in models:
raise PKError ('already have a model for ' + src)
fL = np.log10 (1425)
fC = np.log10 (4860)
lL = np.log10 (Lband)
lC = ... |
python | def fromtext(source=None, encoding=None, errors='strict', strip=None,
header=('lines',)):
"""
Extract a table from lines in the given text file. E.g.::
>>> import petl as etl
>>> # setup example file
... text = 'a,1\\nb,2\\nc,2\\n'
>>> with open('example.txt', 'w') ... |
java | public void setValue(String name, String value) {
Properties properties = loadProperties();
try (
OutputStream output = new FileOutputStream(file);
) {
properties.setProperty(name, value);
properties.store(output, "");
output.close();
} catch(IOExcept... |
python | def _proxy(self, url, urlparams=None):
"""Do the actual action of proxying the call.
"""
for k,v in request.params.iteritems():
urlparams[k]=v
query = urlencode(urlparams)
full_url = url
if query:
if not full_url.endswith("?"):
full... |
java | protected Set<?> getPrevRenderedRows() {
Set<?> keys = getComponentModel().prevRenderedRows;
if (keys == null) {
return Collections.emptySet();
} else {
return Collections.unmodifiableSet(keys);
}
} |
java | private ByteBuffer encryptPacket(ByteBuffer packet) {
final ByteBuffer payload = (ByteBuffer) ByteBuffer.allocate(SHA1_LENGTH + packet.remaining())
.put(sha1(packet))
.put((ByteBuffer) packet.flip())
.flip();
final EncryptionResult er = encrypt(password, p... |
java | private void uploadFilesToDFS(IStructuredSelection selection)
throws InvocationTargetException, InterruptedException {
// Ask the user which files to upload
FileDialog dialog =
new FileDialog(Display.getCurrent().getActiveShell(), SWT.OPEN
| SWT.MULTI);
dialog.setText("Select the ... |
python | def delete_webhook(self, id, **kwargs): # noqa: E501
"""Delete a specific webhook # noqa: E501
# noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_webhook(id, async_req... |
java | public RunnerResults runTasks(FileSet input, BaseFolder output, String manifestFileName, List<InternalTask> tasks) throws IOException, TaskSystemException {
Progress progress = new Progress();
logger.info(name + " started on " + progress.getStart());
int i = 0;
NumberFormat nf = NumberFormat.getPercentInstance(... |
python | def get_stacked_pianoroll(self):
"""
Return a stacked multitrack pianoroll. The shape of the return array is
(n_time_steps, 128, n_tracks).
Returns
-------
stacked : np.ndarray, shape=(n_time_steps, 128, n_tracks)
The stacked pianoroll.
"""
m... |
python | def median_bias(n):
"""Calculate the bias of the median average PSD computed from `n` segments.
Parameters
----------
n : int
Number of segments used in PSD estimation.
Returns
-------
ans : float
Calculated bias.
Raises
------
ValueError
For non-intege... |
python | def get_model(servoid):
""" Get the servo model
This function gets the model of the herkules servo, provided its id
Args:
servoid(int): the id of the servo
Returns:
int: an integer corresponding to the model number
0x06 for DRS-602
0x04 for DRS-402
... |
java | public IStreamableFileService getService(File fp) {
logger.debug("Get service for file: {}", fp.getName());
// Return first service that can handle the passed file
for (IStreamableFileService service : this.services) {
if (service.canHandle(fp)) {
logger.debug("F... |
python | def _braket_fmt(self, expr_type):
"""Return a format string for printing an `expr_type`
ket/bra/ketbra/braket"""
mapping = {
'bra': {
True: '<{label}|^({space})',
'subscript': '<{label}|_({space})',
False: '<{label}|'},
'ke... |
python | def normalize_pts(pts, ymax, scaler=2):
"""
scales all coordinates and flip y axis due to different
origin coordinates (top left vs. bottom left)
"""
return [(x * scaler, ymax - (y * scaler)) for x, y in pts] |
java | public void createEmptyElements(final ZipUTF8Writer writer) throws IOException {
this.logger.log(Level.FINER, "Writing empty ods elements to zip file");
for (final String elementName : EMPTY_ELEMENT_NAMES) {
this.logger.log(Level.FINEST, "Writing odselement: {0} to zip file", elementName)... |
java | private static boolean isJpegHeader(final byte[] imageHeaderBytes, final int headerSize) {
return headerSize >= JPEG_HEADER.length &&
ImageFormatCheckerUtils.startsWithPattern(imageHeaderBytes, JPEG_HEADER);
} |
python | def send_vdp_query_msg(self, mode, mgrid, typeid, typeid_ver, vsiid_frmt,
vsiid, filter_frmt, gid, mac, vlan, oui_id,
oui_data):
"""Constructs and Sends the VDP Query Message.
Please refer http://www.ieee802.org/1/pages/802.1bg.html VDP
Sect... |
java | public void setSemtype(String v) {
if (SurfaceForm_Type.featOkTst && ((SurfaceForm_Type)jcasType).casFeat_semtype == null)
jcasType.jcas.throwFeatMissing("semtype", "ch.epfl.bbp.uima.types.SurfaceForm");
jcasType.ll_cas.ll_setStringValue(addr, ((SurfaceForm_Type)jcasType).casFeatCode_semtype, v);} |
python | def skip(roman_numeral, skip=1):
"""Skip the given places to the next roman numeral.
Examples:
>>> skip('I')
'II'
>>> skip('VII')
'I'
>>> skip('I', 2)
'III'
"""
i = numerals.index(roman_numeral) + skip
return numerals[i % 7] |
java | protected void notifyModified() {
log.debug("notifyModified - modified: {} update counter: {}", modified.get(), updateCounter.get());
if (updateCounter.get() == 0) {
if (modified.get()) {
// client sent at least one update -> increase version of SO
update... |
java | public IRedisClient getRedisClient(final String host, final int port, final String username,
final String password, final PoolConfig poolConfig) {
String poolName = calcRedisPoolName(host, port, username, password, poolConfig);
try {
JedisClientPool redisClientPool = cacheRedisC... |
java | public static void addOptionalFeatures(ImageRequestBuilder imageRequestBuilder, Config config) {
if (config.usePostprocessor) {
final Postprocessor postprocessor;
switch (config.postprocessorType) {
case "use_slow_postprocessor":
postprocessor = DelayPostprocessor.getMediumPostprocesso... |
python | def _genEmptyResults(self):
""" Uses allowed keys to generate a empty dict to start counting from
:return:
"""
allowedKeys = self._allowedKeys
keysDict = OrderedDict() # Note: list comprehension take 0 then 2 then 1 then 3 etc for some reason. we want strict order
for ... |
java | public Long getMaxFileSize()
{
if (childNode.getTextValueForPatternName("max-file-size") != null && !childNode.getTextValueForPatternName("max-file-size").equals("null")) {
return Long.valueOf(childNode.getTextValueForPatternName("max-file-size"));
}
return null;
} |
python | def get_best_electronegativity_anonymous_mapping(self, struct1, struct2):
"""
Performs an anonymous fitting, which allows distinct species in one
structure to map to another. E.g., to compare if the Li2O and Na2O
structures are similar. If multiple substitutions are within tolerance
... |
java | public Object getAttribute(String attributeName) {
try {
final int index = Integer.parseInt(attributeName) - 1;
if (index < reportable.getMaxEntriesToKeep()) {
return reportable.get(index).getValue();
}
} catch (NumberFormatException e) {
LOGGER.error("Should never happen!... |
python | def _construct_lambda_function(self):
"""Constructs and returns the Lambda function.
:returns: a list containing the Lambda function and execution role resources
:rtype: list
"""
lambda_function = LambdaFunction(self.logical_id, depends_on=self.depends_on,
... |
python | def _SanitizeField(self, field):
"""Sanitizes a field for output.
This method removes the field delimiter from the field string.
Args:
field (str): field value.
Returns:
str: formatted field value.
"""
if self._FIELD_DELIMITER and isinstance(field, py2to3.STRING_TYPES):
re... |
python | def checkoutbranch(accountable, options):
"""
Create a new issue and checkout a branch named after it.
"""
issue = accountable.checkout_branch(options)
headers = sorted(['id', 'key', 'self'])
rows = [headers, [itemgetter(header)(issue) for header in headers]]
print_table(SingleTable(rows)) |
java | @SuppressWarnings({"ResultOfMethodCallIgnored"})
public static void visitFiles(final File pDirectory, final FileFilter pFilter, final Visitor<File> pVisitor) {
Validate.notNull(pDirectory, "directory");
Validate.notNull(pVisitor, "visitor");
pDirectory.listFiles(new FileFilter() {
... |
python | def thread_pool(self, thread_pool_patterns=None, params=None):
"""
Get information about thread pools.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-thread-pool.html>`_
:arg thread_pool_patterns: A comma-separated list of regular-expressions
to filter... |
python | def _is_out_of_order(segmentation):
"""
Check if a given segmentation is out of order.
Examples
--------
>>> _is_out_of_order([[0, 1, 2, 3]])
False
>>> _is_out_of_order([[0, 1], [2, 3]])
False
>>> _is_out_of_order([[0, 1, 3], [2]])
True
"""
last_stroke = -1
for symbo... |
python | def add_real_directory(self, source_path, read_only=True, lazy_read=True,
target_path=None):
"""Create a fake directory corresponding to the real directory at the
specified path. Add entries in the fake directory corresponding to
the entries in the real directory.
... |
java | public void setExpiredEnd(Date expiredEnd) throws InvalidArgumentException {
if (expiredEnd == null) {
throw new InvalidArgumentException("Date can't be null");
}
queryParms.put("expired_end", Util.dateToString(expiredEnd));
} |
java | static CertStore getInstance(AccessDescription ad) {
if (!ad.getAccessMethod().equals((Object)
AccessDescription.Ad_CAISSUERS_Id)) {
return null;
}
GeneralNameInterface gn = ad.getAccessLocation().getName();
if (!(gn instanceof URIName)) {
return n... |
python | def init_pp(X, n_clusters, random_state):
"""K-means initialization using k-means++
This uses scikit-learn's implementation.
"""
x_squared_norms = row_norms(X, squared=True).compute()
logger.info("Initializing with k-means++")
with _timer("initialization of %2d centers" % n_clusters, _logger=lo... |
java | public String queryLock (NodeObject.Lock lock)
{
for (NodeObject nodeobj : getNodeObjects()) {
if (nodeobj.locks.contains(lock)) {
return nodeobj.nodeName;
}
}
return null;
} |
java | public static base_response unset(nitro_service client, sslservicegroup resource, String[] args) throws Exception{
sslservicegroup unsetresource = new sslservicegroup();
unsetresource.servicegroupname = resource.servicegroupname;
return unsetresource.unset_resource(client,args);
} |
java | public MasterSlaveServersConfig addSlaveAddress(String... addresses) {
for (String address : addresses) {
slaveAddresses.add(URIBuilder.create(address));
}
return this;
} |
java | protected final void firePrimitiveChanged() {
final BusChangeEvent event = new BusChangeEvent(
// source of the event
this,
// type of the event
BusChangeEventType.change(getClass()),
// subobject
this,
// index in parent
indexInParent(),
// propertyName
null,
// old proper... |
java | public void checkMultiSessionAllGlobalConfig(TransferSpecs transferSpecs) {
if(asperaTransferManagerConfig.isMultiSession()){
for(TransferSpec transferSpec : transferSpecs.transfer_specs) {
//If multisession defined as global use 'all' suffix, else check if a number has been specified
transferSpec.setRem... |
python | def set_level(self, level, realms):
"""Set the realm level in the realms hierarchy
:return: None
"""
self.level = level
if not self.level:
logger.info("- %s", self.get_name())
else:
logger.info(" %s %s", '+' * self.level, self.get_name())
... |
java | public Map<String, Iterable<WorkUnitState>> getPreviousWorkUnitStatesByDatasetUrns() {
Map<String, Iterable<WorkUnitState>> previousWorkUnitStatesByDatasetUrns = Maps.newHashMap();
if (this.workUnitAndDatasetStateFunctional != null) {
materializeWorkUnitAndDatasetStates(null);
}
for (WorkUnitState... |
java | public static <C extends Compound> String checksum(Sequence<C> sequence) {
CRC64Checksum checksum = new CRC64Checksum();
for (C compound : sequence) {
checksum.update(compound.getShortName());
}
return checksum.toString();
} |
python | def groups(self, user, include=None):
"""
Retrieve the groups for this user.
:param include: list of objects to sideload. `Side-loading API Docs
<https://developer.zendesk.com/rest_api/docs/core/side_loading>`__.
:param user: User object or id
"""
return sel... |
java | private PayloadTemplateMessageBuilder parsePayloadTemplateBuilder(Element messageElement) {
PayloadTemplateMessageBuilder messageBuilder;
messageBuilder = parsePayloadElement(messageElement);
Element xmlDataElement = DomUtils.getChildElementByTagName(messageElement, "data");
... |
python | def _parseMzml(self):
""" #TODO: docstring """
#TODO: this is already pretty nested, reduce that eg by using a function
# processRunNode
for event, element, elementTag in self:
if elementTag == 'mzML':
metadataNode = ETREE.Element(self.elementTag,
... |
java | void bindInjectedObject() throws InjectionException
{
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled())
Tr.entry(tc, "bindInjectedObject: " + toSimpleString(), bindingObjectToString(ivBindingObject));
// d660700 - resolveJndiNa... |
java | @Override
public AcceptReservedInstancesExchangeQuoteResult acceptReservedInstancesExchangeQuote(AcceptReservedInstancesExchangeQuoteRequest request) {
request = beforeClientExecution(request);
return executeAcceptReservedInstancesExchangeQuote(request);
} |
python | def derivative_surface(obj):
""" Computes the hodograph (first derivative) surface of the input surface.
This function constructs the hodograph (first derivative) surface from the input surface by computing the degrees,
knot vectors and the control points of the derivative surface.
The return value of... |
java | public static int takeInt(ByteBuffer buffer) {
int val = 0;
boolean started = false;
boolean minus = false;
int i;
for (i = buffer.position(); i < buffer.limit(); i++) {
byte b = buffer.get(i);
if (b <= SPACE) {
if (started)
... |
python | def parse_yaml(self, y):
'''Parse a YAML specification of a component into this object.'''
self._reset()
self.id = y['id']
self.path_uri = y['pathUri']
if 'activeConfigurationSet' in y:
self.active_configuration_set = y['activeConfigurationSet']
else:
... |
python | def iterate_with_selected_objects_in_order(analysis_objects: Mapping[Any, Any],
analysis_iterables: Dict[str, Sequence[Any]],
selection: Union[str, Sequence[str]]) -> Iterator[List[Tuple[Any, Any]]]:
""" Iterate over an analysis d... |
java | @Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AfplibPackage.LINE_DATA_OBJECT_POSITION_MIGRATION__TEMP_ORIENT:
return TEMP_ORIENT_EDEFAULT == null ? tempOrient != null : !TEMP_ORIENT_EDEFAULT.equals(tempOrient);
}
return super.eIsSet(featureID);
} |
java | @Override
protected void initEvalParams() {
_sParam = new BackwardEvalParam(_acronym._shortForm);
_lParam = new BackwardEvalParam(_acronym._longForm);
_partialWordParam = null;
} |
python | def collect_and_report(self):
"""
Target function for the metric reporting thread. This is a simple loop to
collect and report entity data every 1 second.
"""
logger.debug("Metric reporting thread is now alive")
def metric_work():
self.process()
... |
java | public static boolean isPrintable(int ch)
{
int cat = getType(ch);
// if props == 0, it will just fall through and return false
return (cat != UCharacterCategory.UNASSIGNED &&
cat != UCharacterCategory.CONTROL &&
cat != UCharacterCategory.FORMAT &&
... |
java | public static String stringFor(int n)
{
switch (n)
{
case CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_BLOCK : return "CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_BLOCK";
case CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_X : return "CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_X";
case CU_DEVICE_... |
java | private static Set<PackingPlan.ContainerPlan> buildContainerPlans(
Map<Integer, Container> containerInstances) {
Set<PackingPlan.ContainerPlan> containerPlans = new LinkedHashSet<>();
for (Integer containerId : containerInstances.keySet()) {
Container container = containerInstances.get(containerId)... |
java | public StrBuilder setLength(final int length) {
if (length < 0) {
throw new StringIndexOutOfBoundsException(length);
}
if (length < size) {
size = length;
} else if (length > size) {
ensureCapacity(length);
final int oldEnd = size;
... |
java | public String[] init() throws IOException {
// ヘッダーを元に、カラム情報の番号を補完する
final String[] headers = getHeader(true);
init(headers);
return headers;
} |
java | @Override
public void removeByGroupId(long groupId) {
for (CommerceNotificationTemplate commerceNotificationTemplate : findByGroupId(
groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(commerceNotificationTemplate);
}
} |
python | def get_tight_bbox(fig, bbox_extra_artists=[], pad=None):
"""
Compute a tight bounding box around all the artists in the figure.
"""
renderer = fig.canvas.get_renderer()
bbox_inches = fig.get_tightbbox(renderer)
bbox_artists = bbox_extra_artists[:]
bbox_artists += fig.get_default_bbox_extra_... |
java | public AbstractPrintQuery addAttribute(final CIAttribute... _attributes)
throws EFapsException
{
if (isMarked4execute()) {
for (final CIAttribute attr : _attributes) {
addAttribute(attr.name);
}
}
return this;
} |
python | def _set_interface_dynamic_bypass(self, v, load=False):
"""
Setter method for interface_dynamic_bypass, mapped from YANG variable /mpls_config/router/mpls/mpls_cmds_holder/mpls_interface/interface_dynamic_bypass (container)
If this variable is read-only (config: false) in the
source YANG file, then _set... |
java | @Override
public IReaction getReaction(int position) {
if (!hashMapChain.containsValue(position)) return null;
Set<Entry<IReaction, Integer>> entries = hashMapChain.entrySet();
for (Iterator<Entry<IReaction, Integer>> it = entries.iterator(); it.hasNext();) {
Entry<IReaction, I... |
python | def check_simple(self, checks, radl):
"""Check types, operators and units in simple features."""
for f in self.features:
if not isinstance(f, Feature) or f.prop not in checks:
continue
f._check(checks[f.prop], radl) |
java | public Object use(GroovyObject object, Closure closure) {
// grab existing meta (usually adaptee but we may have nested use calls)
MetaClass origMetaClass = object.getMetaClass();
object.setMetaClass(this);
try {
return closure.call();
} finally {
object.s... |
python | def modify_db_cluster(DBClusterIdentifier=None, NewDBClusterIdentifier=None, ApplyImmediately=None, BackupRetentionPeriod=None, DBClusterParameterGroupName=None, VpcSecurityGroupIds=None, Port=None, MasterUserPassword=None, OptionGroupName=None, PreferredBackupWindow=None, PreferredMaintenanceWindow=None, EnableIAMData... |
java | public Long getParameterLong(String name) throws RepositoryConfigurationException
{
try
{
return StringNumberParser.parseLong(getParameterValue(name));
}
catch (NumberFormatException e)
{
throw new RepositoryConfigurationException(name + ": unparseable Long. " + e, e);... |
python | def traceplot(trace: sample_types, labels: List[Union[str, Tuple[str, str]]] = None, ax: Any = None,
x0: int = 0) -> Any:
"""
Plot samples values.
:param trace: result of MCMC run
:param labels: labels of vertices to be plotted. if None, all vertices are plotted.
:param ax: Matplotli... |
python | def load_texture(renderer, file):
"""Load an image directly into a render texture.
Args:
renderer: The renderer to make the texture.
file: The image file to load.
Returns:
A new texture
"""
return Texture._from_ptr(check_ptr_err(lib.IMG_LoadTexture(renderer._ptr, file))) |
python | def initialize(self, originalTimeSeries, calculatedTimeSeries):
"""Initializes the ErrorMeasure.
During initialization, all :py:meth:`BaseErrorMeasure.local_errors` are calculated.
:param TimeSeries originalTimeSeries: TimeSeries containing the original data.
:param TimeSeries calcu... |
java | @Override
public void eUnset(int featureID) {
switch (featureID) {
case DroolsPackage.IMPORT_TYPE__NAME:
setName(NAME_EDEFAULT);
return;
}
super.eUnset(featureID);
} |
python | def yield_module_imports_nodes(root, checks=import_nodes()):
"""
Yield all nodes that provide an import
"""
if not isinstance(root, asttypes.Node):
raise TypeError('provided root must be a node')
for child in yield_function(root, deep_filter):
for f, condition in checks:
... |
python | def update(self, volume, display_name=None, display_description=None):
"""
Update the specified values on the specified volume. You may specify
one or more values to update. If no values are specified as non-None,
the call is a no-op; no exception will be raised.
"""
retu... |
python | def delete(self) :
"""deletes the collection from the database"""
r = self.connection.session.delete(self.URL)
data = r.json()
if not r.status_code == 200 or data["error"] :
raise DeletionError(data["errorMessage"], data) |
python | def _add_task(self, tile_address, coroutine):
"""Add a task from within the event loop.
All tasks are associated with a tile so that they can be cleanly
stopped when that tile is reset.
"""
self.verify_calling_thread(True, "_add_task is not thread safe")
if tile_addres... |
java | @Override
public <G> Choice6<A, B, C, D, E, G> fmap(Function<? super F, ? extends G> fn) {
return Monad.super.<G>fmap(fn).coerce();
} |
python | def p_list(self, kind, cur_p='', ):
'''
List the post .
'''
if cur_p == '':
current_page_number = 1
else:
current_page_number = int(cur_p)
current_page_number = 1 if current_page_number < 1 else current_page_number
pager_num = int(MWiki.t... |
java | public ApiResponse<List<CorporationAssetsNamesResponse>> postCorporationsCorporationIdAssetsNamesWithHttpInfo(
Integer corporationId, List<Long> requestBody, String datasource, String token) throws ApiException {
com.squareup.okhttp.Call call = postCorporationsCorporationIdAssetsNamesValidateBeforeC... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.