language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | public List<I_CmsWorkplaceAppConfiguration> getAppConfigurations(String... appIds) {
List<I_CmsWorkplaceAppConfiguration> result = new ArrayList<I_CmsWorkplaceAppConfiguration>();
for (int i = 0; i < appIds.length; i++) {
I_CmsWorkplaceAppConfiguration config = getAppConfiguration(appIds[i]... |
java | public static appfwprofile_cookieconsistency_binding[] get(nitro_service service, String name) throws Exception{
appfwprofile_cookieconsistency_binding obj = new appfwprofile_cookieconsistency_binding();
obj.set_name(name);
appfwprofile_cookieconsistency_binding response[] = (appfwprofile_cookieconsistency_bindin... |
java | @Override
public CPInstance fetchCPInstanceByReferenceCode(long companyId,
String externalReferenceCode) {
return cpInstancePersistence.fetchByC_ERC(companyId, null);
} |
python | def create(self, quality_score, issue=values.unset):
"""
Create a new FeedbackInstance
:param unicode quality_score: The call quality expressed as an integer from 1 to 5
:param FeedbackInstance.Issues issue: Issues experienced during the call
:returns: Newly created FeedbackIns... |
java | @SuppressWarnings("unused")
public synchronized Channel findOrCreateChannel(ChannelData channelData) throws ChannelException {
String channelName = channelData.getName();
Channel ret = this.existingChannels.get(channelName);
if (ret == null) {
// Create the new channel with the i... |
java | @Override
public RowIterator firstRow(Session session, PersistentStore store) {
int tempDepth = 0;
readLock.lock();
try {
NodeAVL x = getAccessor(store);
NodeAVL l = x;
while (l != null) {
x = l;
l = x.getLeft(store);
... |
java | public static base_response delete(nitro_service client, String profilename) throws Exception {
vpnclientlessaccessprofile deleteresource = new vpnclientlessaccessprofile();
deleteresource.profilename = profilename;
return deleteresource.delete_resource(client);
} |
java | public String[] get_device_name(Database database, String serverName, String classname)
throws DevFailed {
if (!database.isAccess_checked()) checkAccess(database);
String[] array;
array = new String[2];
array[0] = serverName;
array[1] = classname;
DeviceData ... |
java | private void generatePrices(final Metadata m, final Element e) {
for (final Price price : m.getPrices()) {
if (price == null) {
continue;
}
final Element priceElement = new Element("price", NS);
if (price.getType() != null) {
priceE... |
python | def cli(obj, ids, query, filters, tags):
"""Remove tags from alerts."""
client = obj['client']
if ids:
total = len(ids)
else:
if query:
query = [('q', query)]
else:
query = build_query(filters)
total, _, _ = client.get_count(query)
ids = [a... |
java | public Observable<FailoverGroupInner> beginUpdateAsync(String resourceGroupName, String serverName, String failoverGroupName, FailoverGroupUpdate parameters) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, serverName, failoverGroupName, parameters).map(new Func1<ServiceResponse<FailoverGroupInne... |
python | def need_rejoin(self):
"""Check whether the group should be rejoined
Returns:
bool: True if consumer should rejoin group, False otherwise
"""
if not self._subscription.partitions_auto_assigned():
return False
if self._auto_assign_all_partitions():
... |
java | public static Stream<MutableIntTuple> stream(
Order order, IntTuple min, IntTuple max)
{
if (order == null)
{
return null;
}
Utils.checkForEqualSize(min, max);
MutableIntTuple localMin = IntTuples.copy(min);
MutableIntTuple localMax = IntT... |
python | def update_active_id_list(self, update_active_ids_finished_cb):
"""Request an update of the active id list"""
if not self._update_active_ids_finished_cb:
self._update_active_ids_finished_cb = update_active_ids_finished_cb
self.active_anchor_ids = []
self.active_ids_v... |
java | @Indexable(type = IndexableType.DELETE)
@Override
public CommercePriceEntry deleteCommercePriceEntry(
CommercePriceEntry commercePriceEntry) throws PortalException {
return commercePriceEntryPersistence.remove(commercePriceEntry);
} |
java | public void dispatchCharactersEvents(org.xml.sax.ContentHandler ch)
throws org.xml.sax.SAXException
{
} |
python | def _fit_and_score_ensemble(self, X, y, cv, **fit_params):
"""Create a cross-validated model by training a model for each fold with the same model parameters"""
fit_params_steps = self._split_fit_params(fit_params)
folds = list(cv.split(X, y))
# Take care of custom kernel functions
... |
java | public StartRecordingResponse startRecording(String sessionId, String recording) {
checkStringNotEmpty(sessionId, "The parameter sessionId should NOT be null or empty string.");
checkStringNotEmpty(recording, "The parameter recording should NOT be null or empty string.");
StartRecordingRequest r... |
python | def runExperiment( self, e ):
"""Run the experiment across the parameter space in parallel using
all the engines in the cluster. This method returns immediately.
The experiments are run asynchronously, with the points in the parameter
space being explored randomly so that intermediate r... |
java | public static <T> List<T> interleave_all(List<List<T>> splitup) {
ArrayList<T> rtn = new ArrayList<>();
int maxLength = 0;
for (List<T> e : splitup) {
int len = e.size();
if (maxLength < len) {
maxLength = len;
}
}
for (int i =... |
python | def all_near_zero(a: Union[float, complex, Iterable[float], np.ndarray],
*,
atol: float = 1e-8) -> bool:
"""Checks if the tensor's elements are all near zero.
Args:
a: Tensor of elements that could all be near zero.
atol: Absolute tolerance.
"""
retur... |
java | public void elementwiseProductInPlace(ConcatVector other) {
for (int i = 0; i < pointers.length; i++) {
if (pointers[i] == null) continue;
if (copyOnWrite[i]) {
copyOnWrite[i] = false;
pointers[i] = pointers[i].clone();
}
if (i >= other.pointers.length || other.pointers[i] ... |
java | public static syslog_snmp delete(nitro_service client, syslog_snmp resource) throws Exception
{
resource.validate("delete");
return ((syslog_snmp[]) resource.delete_resource(client))[0];
} |
python | def no_param_shortcut(parser, token):
"""
Shortcut to transmogrify thumbnail
"""
bits = smart_split(token.contents)
tagname = bits.next()
try:
imageurl = bits.next()
except StopIteration:
raise template.TemplateSyntaxError("%r tag requires at least the image url" % tagname)
... |
python | def detach_client(self, app):
"""
Detach the client that belongs to this CLI.
"""
connection = self.get_connection()
if connection:
connection.detach_and_close()
# Redraw all clients -> Maybe their size has to change.
self.invalidate() |
python | def build_job_configs(self, args):
"""Hook to build job configurations
"""
job_configs = {}
components = Component.build_from_yamlfile(args['comp'])
NAME_FACTORY.update_base_dict(args['data'])
ret_dict = make_catalog_comp_dict(library=args['library'],
... |
java | private void processWorkList(IClassPath classPath, LinkedList<WorkListItem> workList, IClassPathBuilderProgress progress)
throws InterruptedException, IOException, ResourceNotFoundException {
// Build the classpath, scanning codebases for nested archives
// and referenced codebases.
... |
python | def insert_or_merge_entity(self, table_name, entity, timeout=None):
'''
Merges an existing entity or inserts a new entity if it does not exist
in the table.
If insert_or_merge_entity is used to merge an entity, any properties from
the previous entity will be retained if the re... |
java | @Override
public ReportTaskRunnerHeartbeatResult reportTaskRunnerHeartbeat(ReportTaskRunnerHeartbeatRequest request) {
request = beforeClientExecution(request);
return executeReportTaskRunnerHeartbeat(request);
} |
python | def breakdown_tt2000(tt2000, to_np=None): # @NoSelf
"""
Breaks down the epoch(s) into UTC components.
For CDF_EPOCH:
they are 7 date/time components: year, month, day,
hour, minute, second, and millisecond
For CDF_EPOCH16:
they are 10 dat... |
java | public ConnectionInner createOrUpdate(String resourceGroupName, String automationAccountName, String connectionName, ConnectionCreateOrUpdateParameters parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, automationAccountName, connectionName, parameters).toBlocking().single().body();
... |
python | def to_ip(self, values, from_unit):
"""Return values in IP and the units to which the values have been converted."""
if from_unit == 'Btu/h-ft2-F':
return values, from_unit
else:
return self.to_unit(values, 'Btu/h-ft2-F', from_unit), 'Btu/h-ft2-F' |
python | def calculate_twi(self, esfile, save_path, use_cache=True, do_edges=False,
skip_uca_twi=False):
"""
Calculates twi for supplied elevation file
Parameters
-----------
esfile : str
Path to elevation file to be processed
save_path: str
... |
java | static @CheckForNull Fingerprint load(@Nonnull File file) throws IOException {
XmlFile configFile = getConfigFile(file);
if(!configFile.exists())
return null;
long start=0;
if(logger.isLoggable(Level.FINE))
start = System.currentTimeMillis();
try {
... |
java | public void comment(char ch[], int start, int length) throws org.xml.sax.SAXException
{
append(m_doc.createComment(new String(ch, start, length)));
} |
java | public Observable<Page<DataLakeStoreAccountInfoInner>> listDataLakeStoreAccountsNextAsync(final String nextPageLink) {
return listDataLakeStoreAccountsNextWithServiceResponseAsync(nextPageLink)
.map(new Func1<ServiceResponse<Page<DataLakeStoreAccountInfoInner>>, Page<DataLakeStoreAccountInfoInner>>(... |
java | public static boolean isDirectory(OwncloudResource owncloudResource) {
return UNIX_DIRECTORY.equals(
Optional.ofNullable(owncloudResource)
.map(resource -> resource.getMediaType().toString())
.orElse(null));
} |
java | @Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case AfplibPackage.MPORG__RG_LENGTH:
return getRGLength();
case AfplibPackage.MPORG__TRIPLETS:
return getTriplets();
}
return super.eGet(featureID, resolve, coreType);
} |
java | public static int findNthByte(byte [] utf, int start, int length, byte b, int n) {
int pos = -1;
int nextStart = start;
for (int i = 0; i < n; i++) {
pos = findByte(utf, nextStart, length, b);
if (pos < 0) {
return pos;
}
nextStart = pos + 1;
}
return pos;
} |
python | def draw_tree(node, child_iter=lambda n: n.children, text_str=lambda n: str(n)):
"""
Args:
node: the root of the tree to be drawn,
child_iter: function that when called with a node, returns an iterable over all its children
text_str: turns a node into the text to be displayed in the tree... |
python | def connect(self):
"""
Connect to the SMTP server.
"""
# TODO: local_hostname should be configurable
self.client = smtplib.SMTP(self.options['server'], self.options['port'],
local_hostname='local.domain', timeout=15) |
python | def update_search_window(self, search_window, x_center, y_center):
"""
update the search area for the lens equation solver
:param search_window: search_window: window size of the image position search with the lens equation solver.
:param x_center: center of search window
:param... |
java | public KeyBundle getKey(String keyIdentifier) {
KeyIdentifier id = new KeyIdentifier(keyIdentifier);
return getKey(id.vault(), id.name(), id.version() == null ? "" : id.version());
} |
python | def expand_fc_groups(users):
""" If user is a firecloud group, return all members of the group.
Caveat is that only group admins may do this.
"""
groups = None
for user in users:
fcgroup = None
if '@' not in user:
fcgroup = user
elif user.lower().endswith('@firecl... |
java | protected static List<PropertyDescriptor> getWriteableProperties(Class cls)
{
BeanWrapper beanWrapper = new BeanWrapperImpl(cls);
List<PropertyDescriptor> writeableProperties =
new ArrayList<PropertyDescriptor>();
PropertyDescriptor[] props = beanWrapper.getPropertyDescri... |
java | public static DateTime getUniversalTimestamp(final GroupByQuery query)
{
final Granularity gran = query.getGranularity();
final String timestampStringFromContext = query.getContextValue(CTX_KEY_FUDGE_TIMESTAMP, "");
if (!timestampStringFromContext.isEmpty()) {
return DateTimes.utc(Long.parseLong(ti... |
java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
xen_nsvpx_image_responses result = (xen_nsvpx_image_responses) service.get_payload_formatter().string_to_resource(xen_nsvpx_image_responses.class, response);
if(result.errorcode != 0)
{
if (result... |
python | def reset(self):
"""Reset the display."""
if self._rst is None:
return
# Set reset high for a millisecond.
self._rst.value = True
time.sleep(0.001)
# Set reset low for 10 milliseconds.
self._rst.value = False
time.sleep(0.010)
# Set res... |
java | public Observable<Page<ResourceMetricDefinitionInner>> listWorkerPoolInstanceMetricDefinitionsAsync(final String resourceGroupName, final String name, final String workerPoolName, final String instance) {
return listWorkerPoolInstanceMetricDefinitionsWithServiceResponseAsync(resourceGroupName, name, workerPoolN... |
python | def edit_service(self, loadbal_id, service_id, ip_address_id=None,
port=None, enabled=None, hc_type=None, weight=None):
"""Edits an existing service properties.
:param int loadbal_id: The id of the loadbal where the service resides
:param int service_id: The id of the servi... |
java | public final void remove(GroupAddress a, boolean fromUpdating)
{
if (fromUpdating)
updating.remove(a);
else
invalidating.remove(a);
} |
java | public Reference runReference(SystemUnderTest sut, Specification specification, Requirement requirement, String locale)
throws GreenPepperServerException
{
if (sut.getProject() == null)
{
throw new IllegalArgumentException("Missing Project in SystemUnderTest");
}
if (specification.getRepository() == nul... |
java | public static boolean eval(Object condition) {
if (condition == null) {
return false;
} else if (condition instanceof String) {
return eval((String) condition);
} else if (condition instanceof Boolean) {
return (Boolean) condition;
} else if (condition... |
java | public void addSubscriptionDriver() {
setExtProperty("driver.subscription", "db");
String dbName = getExtProperty("db.name");
String packageName = getDbPackage(dbName);
setExtProperty("db.subscription.driver", "org.opencms.db." + packageName + ".CmsSubscriptionDriver");
setExtPr... |
java | public DescribeCacheClustersResult withCacheClusters(CacheCluster... cacheClusters) {
if (this.cacheClusters == null) {
setCacheClusters(new com.amazonaws.internal.SdkInternalList<CacheCluster>(cacheClusters.length));
}
for (CacheCluster ele : cacheClusters) {
this.cacheC... |
python | def shrink_wrap(self):
"""Tightly bound the current text respecting current padding."""
self.frame.size = (self.text_size[0] + self.padding[0] * 2,
self.text_size[1] + self.padding[1] * 2) |
java | public void setNodePropertyOverrides(java.util.Collection<NodePropertyOverride> nodePropertyOverrides) {
if (nodePropertyOverrides == null) {
this.nodePropertyOverrides = null;
return;
}
this.nodePropertyOverrides = new java.util.ArrayList<NodePropertyOverride>(nodePrope... |
java | final int helpJoinOnce(WorkQueue joiner, ForkJoinTask<?> task) {
int s;
while ((s = task.status) >= 0 &&
(joiner.isEmpty() ?
tryHelpStealer(joiner, task) :
joiner.tryRemoveAndExec(task)) != 0)
;
return s;
} |
python | def parse_mime_type(mime_type):
"""Parses a mime-type into its component parts.
Carves up a mime-type and returns a tuple of the (type, subtype, params)
where 'params' is a dictionary of all the parameters for the media range.
For example, the media range 'application/xhtml;q=0.5' would get parsed
... |
java | public int getMinorPart() {
int cdp = getCurrencyUnit().getDecimalPlaces();
return amount.setScale(cdp, RoundingMode.DOWN)
.remainder(BigDecimal.ONE)
.movePointRight(cdp).intValueExact();
} |
python | def _build_verb_statement_mapping():
"""Build the mapping between ISI verb strings and INDRA statement classes.
Looks up the INDRA statement class name, if any, in a resource file,
and resolves this class name to a class.
Returns
-------
verb_to_statement_type : dict
Dictionary mapping... |
java | public boolean isStart(String name)
{
if(name == null || this.startSubjectNamePattern == null)
return false;
return Text.matches(name, this.startSubjectNamePattern);
} |
java | public List<Epic> getEpics(Object groupIdOrPath) throws GitLabApiException {
return (getEpics(groupIdOrPath, getDefaultPerPage()).all());
} |
python | def DeserializeExclusiveData(self, reader):
"""
Deserialize full object.
Args:
reader (neo.IO.BinaryReader):
Raises:
Exception: If the transaction type is incorrect or if there are no claims.
"""
self.Type = TransactionType.ClaimTransaction
... |
java | public BatchFraction jdbcJobRepository(final String name, final DatasourcesFraction datasource) {
return jdbcJobRepository(new JDBCJobRepository<>(name).dataSource(datasource.getKey()));
} |
java | public static boolean isLetter (char c)
{
// [84] Letter ::= BaseChar | Ideographic
// [85] BaseChar ::= ... too much to repeat
// [86] Ideographic ::= ... too much to repeat
//
// Optimize the typical case.
//
if (c >= 'a' && c <= 'z')
return true;
if (c == '/')
return false;
if (c >= 'A' && c ... |
python | def get_admin_ids(self):
"""Method to get the administrator id list."""
admins = self.json_response.get("admin_list", None)
admin_ids = [admin_id for admin_id in admins["userid"]]
return admin_ids |
python | def initiate_sniff(self, initial=False):
"""
Initiate a sniffing task. Make sure we only have one sniff request
running at any given time. If a finished sniffing request is around,
collect its result (which can raise its exception).
"""
if self.sniffing_task and self.snif... |
python | def patch(self, predicate_value, attrs, predicate_attribute="_id"):
"""Update an existing document via a $set query, this will apply only these attributes.
:param predicate_value: The value of the predicate
:param dict attrs: The dictionary to apply to this object
:param str predicate_a... |
java | @Action(name = "Add JSON Property to Object",
outputs = {
@Output(OutputNames.RETURN_RESULT),
@Output(OutputNames.RETURN_CODE),
@Output(OutputNames.EXCEPTION)
},
responses = {
@Response(text = ResponseNam... |
python | def get_parent_banks(self, bank_id):
"""Gets the parents of the given bank.
arg: bank_id (osid.id.Id): a bank ``Id``
return: (osid.assessment.BankList) - the parents of the bank
raise: NotFound - ``bank_id`` is not found
raise: NullArgument - ``bank_id`` is ``null``
... |
java | protected int digit(int pos, int base) {
char c = ch;
if ('0' <= c && c <= '9')
return Character.digit(c, base); //a fast common case
int codePoint = peekSurrogates();
int result = codePoint >= 0 ? Character.digit(codePoint, base) : Character.digit(c, base);
if (resul... |
python | def scc(graph):
''' Computes the strongly connected components of a graph '''
order = []
vis = {vertex: False for vertex in graph}
graph_transposed = {vertex: [] for vertex in graph}
for (v, neighbours) in graph.iteritems():
for u in neighbours:
add_edge(graph_transposed, u, v)... |
python | def standardize_input_data(data):
"""
Ensure utf-8 encoded strings are passed to the indico API
"""
if type(data) == bytes:
data = data.decode('utf-8')
if type(data) == list:
data = [
el.decode('utf-8') if type(data) == bytes else el
for el in data
]
... |
python | def _decode(cls, value):
"""Decode the given value, reverting '%'-encoded groups."""
value = cls._DEC_RE.sub(lambda x: '%c' % int(x.group(1), 16), value)
return json.loads(value) |
python | def translate(self, mo):
"""Extract a structure from a match object, while translating the types in the process."""
attrs = {}
groupdict = mo.groupdict()
for name, value in compat_iteritems(groupdict):
if value is None:
value = None
elif self._int_... |
python | def entities_per_chunk(chunk):
"""Given a chunk, find all entities (mobs, items, vehicles)"""
entities = []
for entity in chunk['Entities']:
x,y,z = entity["Pos"]
entities.append(Entity(entity["id"].value, (x.value,y.value,z.value)))
return entities |
java | public synchronized void getOrCreateVertx(
final VertxPlatformConfiguration config, final VertxListener listener) {
Vertx vertx = vertxPlatforms.get(config.getVertxPlatformIdentifier());
if (vertx != null) {
listener.whenReady(vertx);
return;
}
VertxOptions options = new VertxOption... |
python | def calc_synch_snu_ujy(b, ne, delta, sinth, width, elongation, dist, ghz, E0=1.):
"""Calculate a flux density from pure gyrosynchrotron emission.
This combines Dulk (1985) equations 40 and 41, which are fitting functions
assuming a power-law electron population, with standard radiative transfer
through... |
java | public void setValue(String name, Object value)
{
map.get(name).stream().forEach((im) ->
{
im.invoke(value);
} |
java | @Override
public void newEntityPolySeq(EntityPolySeq epolseq) {
logger.debug("NEW entity poly seq " + epolseq);
int eId = -1;
try {
eId = Integer.parseInt(epolseq.getEntity_id());
} catch (NumberFormatException e) {
logger.warn("Could not parse entity id from EntityPolySeq: "+e.getMessage());
}
Ent... |
java | public Bucket getDefaultEventBasedHold(String bucketName) throws StorageException {
// [START storage_get_default_event_based_hold]
// Instantiate a Google Cloud Storage client
Storage storage = StorageOptions.getDefaultInstance().getService();
// The name of a bucket, e.g. "my-bucket"
// String bu... |
java | public void start()
{
if (mAnimations.size() == 0)
{
return;
}
mIsRunning = true;
for (GVRAnimation anim : mAnimations)
{
anim.start(getGVRContext().getAnimationEngine());
}
} |
java | public static void main(String[] args) throws InterruptedException
{
// Open the output file
FileWriter fw = null;
BufferedWriter bw = null;
try {
fw = new FileWriter(fileName);
bw = new BufferedWriter(fw);
} catch (IOException e) {
System.... |
java | LinkedHashMap/*< String, SharedFlowController >*/ getDefaultSharedFlows( RequestContext context )
throws ClassNotFoundException, InstantiationException, IllegalAccessException
{
SharedFlowRefConfig[] defaultRefs = ConfigUtil.getConfig().getSharedFlowRefs();
if ( defaultRefs != null )
... |
java | public AiNode findNode(String name) {
/* classic recursive depth first search */
if (m_name.equals(name)) {
return this;
}
for (AiNode child : m_children) {
if (null != child.findNode(name)) {
return child;
}
}... |
python | def findOrLoadRenderModel(self, pchRenderModelName):
"Purpose: Finds a render model we've already loaded or loads a new one"
pRenderModel = None
for model in self.m_vecRenderModels:
if model.getName() == pchRenderModelName:
pRenderModel = model
b... |
python | def downloadarchive(self, project, targetfile, archiveformat = 'zip'):
"""Download all output files as a single archive:
* *targetfile* - path for the new local file to be written
* *archiveformat* - the format of the archive, can be 'zip','gz','bz2'
Example::
client.downl... |
python | def _validate_resource_path(path):
"""
Validate the resource paths according to the docs.
https://setuptools.readthedocs.io/en/latest/pkg_resources.html#basic-resource-access
>>> warned = getfixture('recwarn')
>>> warnings.simplefilter('always')
>>> vrp = NullProvider._v... |
java | public <T extends OmiseObject> T deserialize(InputStream input, TypeReference<T> ref) throws IOException {
return objectMapper.readerFor(ref).readValue(input);
} |
java | private void registerListeners() {
protocol.registerExecuteHandler(this::execute);
protocol.registerBackupHandler(this::backup);
protocol.registerRestoreHandler(this::restore);
protocol.registerCloseHandler(this::close);
protocol.registerMetadataHandler(this::metadata);
} |
java | @FFDCIgnore(IllegalArgumentException.class)
private String evaluateCallerSearchBase(boolean immediateOnly) {
try {
return elHelper.processString("callerSearchBase", this.idStoreDefinition.callerSearchBase(), immediateOnly);
} catch (IllegalArgumentException e) {
if (TraceComp... |
python | def command_deps_status(self):
"""Print dependencies status
"""
image = ""
for arg in self.args:
if arg.startswith("--graph="):
image = arg.split("=")[1]
if len(self.args) == 1 and self.args[0] == "deps-status":
DependenciesStatus(image).sh... |
python | def fstyle_changed(self, settings, key, user_data):
"""If the gconf var style/font/style be changed, this method
will be called and will change the font style in all terminals
open.
"""
font = Pango.FontDescription(settings.get_string(key))
for i in self.guake.notebook_ma... |
python | def export(self, class_name, method_name, export_data=False,
export_dir='.', export_filename='data.json',
export_append_checksum=False, **kwargs):
"""
Port a trained estimator to the syntax of a chosen programming
language.
Parameters
----------
... |
java | @Override
public void registerResourceProvider(ResourceProvider provider) {
provider.setResources(this);
String scheme = provider.getScheme();
if (StringUtil.isEmpty(scheme)) return;
ResourceProviderFactory[] tmp = new ResourceProviderFactory[resources.length + 1];
for (int i = 0; i < resources.length; i++) {... |
python | def _on_open(self, _):
"""Joins the hack.chat channel and starts pinging."""
nick = self._format_nick(self._nick, self._pwd)
data = {"cmd": "join", "channel": self._channel, "nick": nick}
self._send_packet(data)
self._thread = True
threading.Thread(target=self._ping).star... |
python | def save(self, filelike):
"""Save the file as a PDF.
Parameters
----------
filelike: path or file-like object
The filename or file-like object to save the labels under. Any
existing contents will be overwritten.
"""
# Shade any remaining missing ... |
java | public static int dayOfWeek(long day) {
long[] remainder = new long[1];
floorDivide(day + Calendar.THURSDAY, 7, remainder);
int dayOfWeek = (int)remainder[0];
dayOfWeek = (dayOfWeek == 0) ? 7 : dayOfWeek;
return dayOfWeek;
} |
java | public static Level getJavaUtilLoggingLevelFor(final Log mavenLog) {
// Check sanity
Validate.notNull(mavenLog, "mavenLog");
Level toReturn = Level.SEVERE;
if (mavenLog.isDebugEnabled()) {
toReturn = Level.FINER;
} else if (mavenLog.isInfoEnabled()) {
t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.