language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def plot_dropout_rate_heterogeneity(
model,
suptitle="Heterogeneity in Dropout Probability",
xlabel="Dropout Probability p",
ylabel="Density",
suptitle_fontsize=14,
**kwargs
):
"""
Plot the estimated gamma distribution of p.
p - (customers' probability of dropping out immediately af... |
java | public void updateRecord(final ORecordInternal<?> record) {
if (isEnabled() && record.getIdentity().getClusterId() != excludedCluster && record.getIdentity().isValid()) {
underlying.lock(record.getIdentity());
try {
if (underlying.get(record.getIdentity()) != record)
underlying.pu... |
java | private int typeDepth(Class<?> match, Class<?> actual)
{
if (actual == null) {
return Integer.MAX_VALUE / 2;
}
if (match.equals(Object.class)) {
return Integer.MAX_VALUE / 4;
}
if (match.equals(actual)) {
return 0;
}
int cost = 1 + typeDepth(match, actual.g... |
python | def filtered(w=250):
"""
In this example we filter the image into several channels using gabor filters. L6 activity is used to select
one of those channels. Only activity selected by those channels burst.
"""
# prepare filter bank kernels
kernels = []
for theta in range(4):
theta = theta / 4. * np.pi
... |
python | def count_leases_by_owner(self, leases): # pylint: disable=no-self-use
"""
Returns a dictionary of leases by current owner.
"""
owners = [l.owner for l in leases]
return dict(Counter(owners)) |
java | @VisibleForTesting
protected void initMetadata(HttpHeaders headers) throws IOException {
checkState(
!metadataInitialized,
"can not initialize metadata, it already initialized for '%s'", resourceIdString);
long sizeFromMetadata;
String range = headers.getContentRange();
if (range != n... |
java | public final void postAggArithOper(PostAggItem postAggItem) throws RecognitionException {
Token arith=null;
try {
// druidG.g:554:2: (arith= ARITH_OPER )
// druidG.g:554:3: arith= ARITH_OPER
{
arith=(Token)match(input,ARITH_OPER,FOLLOW_ARITH_OPER_in_postAggArithOper3606);
postAggItem.fn = (arith!=n... |
java | public static URL createURL(String protocol,
String host,
int port,
String file) throws MalformedURLException {
URLStreamHandlerFactory factory = _factories.get(protocol);
// If there is no URLStreamHandlerF... |
java | @Override
protected boolean performRequest() {
boolean cancelledDone = false;
// If we were worken up because we have work to do, do it.
Set<SelectionKey> keySet = selector.selectedKeys();
Iterator<SelectionKey> selectedIterator = keySet.iterator();
if (TraceComponent.isAnyT... |
java | @Override
public String getBatchAppNameFromInstance(long instanceId) throws NoSuchJobInstanceException, JobSecurityException {
return persistenceManagerService.getJobInstanceAppName(authorizedInstanceRead(instanceId));
} |
java | private Thread getScannerThread() {
return new Thread(() -> {
Scanner scanIn = new Scanner(System.in);
while (true) {
String line = scanIn.nextLine();
if (line.isEmpty()) {
break;
}
ByteBuf buf = ByteBuf.wrapForReading(encodeAscii(line + "\r\n"));
eventloop.execute(() -> socket.write(bu... |
python | def _store16(ins):
""" Stores 2nd operand content into address of 1st operand.
store16 a, x => *(&a) = x
Use '*' for indirect store on 1st operand.
"""
output = []
output = _16bit_oper(ins.quad[2])
try:
value = ins.quad[1]
indirect = False
if value[0] == '*':
... |
python | def validate_rpc_sha(repo_dir, commit):
"""Validate/update a SHA given for the rpc-openstack repo."""
# Is the commit valid? Just in case the commit is a
# PR ref, we try both the ref given and the ref prepended
# with the remote 'origin'.
try:
osa_differ.validate_commits(repo_dir, [commit]... |
java | public static void closeBoth(Closeable first, Closeable second) throws IOException
{
//noinspection EmptyTryBlock
try (Closeable ignore1 = second; Closeable ignore2 = first) {
// piggy-back try-with-resources semantics
}
} |
java | @Override
public void run() {
// Workaround for Issue #4 (http://code.google.com/p/jdiameter/issues/detail?id=4)
// BEGIN WORKAROUND // Give some time to initialization...
int sleepTime = 250;
logger.debug("Sleeping for {}ms before starting transport so that listeners can all be added and ready f... |
java | private void accumulateNormal(final Element center, final Element pre,
final Element post) {
double cx = center.getDouble("x");
double cy = center.getDouble("y");
double cz = center.getDouble("z");
double ax = post.getDouble("x") - cx;
double ay = post.getDouble("y")... |
python | def insert(collection_name, docs, check_keys,
safe, last_error_args, continue_on_error, opts):
"""Get an **insert** message."""
options = 0
if continue_on_error:
options += 1
data = struct.pack("<i", options)
data += bson._make_c_string(collection_name)
encoded = [bson.BSON.en... |
java | public float getFloat(int key)
{
Object value = map.get(key);
if (!(value instanceof Float))
{
return 0.0f;
}
Float result = (Float)value;
return result;
} |
python | def convert(self, blob, **kw):
"""Convert using unoconv converter."""
timeout = self.run_timeout
with make_temp_file(blob) as in_fn, make_temp_file(
prefix="tmp-unoconv-", suffix=".pdf"
) as out_fn:
args = ["-f", "pdf", "-o", out_fn, in_fn]
# Hack for... |
java | public void setLCID(Integer newLCID) {
Integer oldLCID = lcid;
lcid = newLCID;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.GSCS__LCID, oldLCID, lcid));
} |
java | public synchronized Object co_resume(Object arg_object,int thisCoroutine,int toCoroutine) throws java.lang.NoSuchMethodException
{
if(!m_activeIDs.get(toCoroutine))
throw new java.lang.NoSuchMethodException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COROUTINE_NOT_AVAIL, new Object[]{Integer.toString(... |
java | public static CPSpecificationOption fetchByG_K(long groupId, String key,
boolean retrieveFromCache) {
return getPersistence().fetchByG_K(groupId, key, retrieveFromCache);
} |
python | def set_data(self, ids=None):
"""
Set the data for all specified measurements (all if None given).
"""
fun = lambda x: x.set_data()
self.apply(fun, ids=ids, applyto='measurement') |
java | void writeRpcException(final RpcException e, final HttpServletResponse resp)
throws IOException {
String message = e.getMessage() != null ? e.getMessage() : CLIENT_ERROR_MESSAGE;
resp.setStatus(e.getStatus());
resp.setContentType(TEXT_CONTENT_TYPE);
resp.getWriter().write(message);
} |
python | def add_letter_to_axis(ax, let, col, x, y, height):
"""Add 'let' with position x,y and height height to matplotlib axis 'ax'.
"""
if len(let) == 2:
colors = [col, "white"]
elif len(let) == 1:
colors = [col]
else:
raise ValueError("3 or more Polygons are not supported")
f... |
java | private String resolveExpressionString(final String unresolvedString) throws OperationFailedException {
// parseAndResolve should only be providing expressions with no leading or trailing chars
assert unresolvedString.startsWith("${") && unresolvedString.endsWith("}");
// Default result is no ... |
python | def close_connection(self):
"""
Close connection kept by :meth:`connection`.
If commit is needed, :meth:`sqlite3.Connection.commit`
is called first and then :meth:`sqlite3.Connection.interrupt`
is called.
A few methods/generators support :meth:`close_connection`:
... |
java | public static Predicate[] acceptVisitor(Predicate[] predicates, Visitor visitor, Indexes indexes) {
Predicate[] target = predicates;
boolean copyCreated = false;
for (int i = 0; i < predicates.length; i++) {
Predicate predicate = predicates[i];
if (predicate instanceof Vi... |
java | public CachedInstanceQuery getCachedQuery4Request()
{
if (this.query == null) {
try {
this.query = CachedInstanceQuery.get4Request(this.typeUUID)
.setIncludeChildTypes(isIncludeChildTypes())
.setCompanyDependent(isCo... |
python | def _registered(self):
"""
A optional boolean property indidcating whether this job store is registered. The
registry is the authority on deciding if a job store exists or not. If True, this job
store exists, if None the job store is transitioning from True to False or vice versa,
... |
python | def setup(self, bitdepth=16):
"""Set the client format parameters, specifying the desired PCM
audio data format to be read from the file. Must be called
before reading from the file.
"""
fmt = self.get_file_format()
newfmt = copy.copy(fmt)
newfmt.mFormatID = AUDI... |
java | @Override
public void setXYZ(int index, Point3D pt) {
if (index < 0 || index >= getPointCount())
throw new IndexOutOfBoundsException();
addAttribute(Semantics.Z);
_verifyAllStreams();
notifyModified(DirtyFlags.DirtyCoordinates);
AttributeStreamOfDbl v = (AttributeStreamOfDbl) m_vertexAttributes[0];
v.... |
python | def get_degradations(self):
"""Extract Degradation INDRA Statements."""
deg_events = self.tree.findall("EVENT/[type='ONT::CONSUME']")
for event in deg_events:
if event.attrib['id'] in self._static_events:
continue
affected = event.find(".//*[@role=':AFFECT... |
python | def connect_login(self):
"""
Try to login to the Remote SSH Server.
:return: Response text on successful login
:raise: `AuthenticationFailed` on unsuccessful login
"""
self.client.connect(self.options['server'], self.options['port'], self.options['username'],
... |
java | public boolean endsWith(CharSequence suffix) {
int suffixLen = suffix.length();
return regionMatches(length() - suffixLen, suffix, 0, suffixLen);
} |
python | def browse(self):
"""
Save response in temporary file and open it in GUI browser.
"""
_, path = tempfile.mkstemp()
self.save(path)
webbrowser.open('file://' + path) |
python | def ipython_only(option):
"""Mark that an option should only be exposed in IPython.
Parameters
----------
option : decorator
A click.option decorator.
Returns
-------
ipython_only_dec : decorator
A decorator that correctly applies the argument even when not
using IP... |
python | def build_sort():
'''Build sort query paramter from kwargs'''
sorts = request.args.getlist('sort')
sorts = [sorts] if isinstance(sorts, basestring) else sorts
sorts = [s.split(' ') for s in sorts]
return [{SORTS[s]: d} for s, d in sorts if s in SORTS] |
python | def list(self, limit=None, offset=None):
"""Gets a list of all domains, or optionally a page of domains."""
uri = "/%s%s" % (self.uri_base, self._get_pagination_qs(limit, offset))
return self._list(uri) |
java | public String getIconUrl() {
if (FullTextLink_Type.featOkTst && ((FullTextLink_Type)jcasType).casFeat_iconUrl == null)
jcasType.jcas.throwFeatMissing("iconUrl", "de.julielab.jules.types.FullTextLink");
return jcasType.ll_cas.ll_getStringValue(addr, ((FullTextLink_Type)jcasType).casFeatCode_iconUrl);} |
python | def add(self, word):
"""
添加敏感词方法(设置敏感词后,App 中用户不会收到含有敏感词的消息内容,默认最多设置 50 个敏感词。) 方法
@param word:敏感词,最长不超过 32 个字符。(必传)
@return code:返回码,200 为正常。
@return errorMessage:错误信息。
"""
desc = {
"name": "CodeSuccessReslut",
"desc": " http 成功返回结果",
... |
java | protected void appendCopiesAfter(PointableRoaringArray highLowContainer, short beforeStart) {
int startLocation = highLowContainer.getIndex(beforeStart);
if (startLocation >= 0) {
startLocation++;
} else {
startLocation = -startLocation - 1;
}
extendArray(highLowContainer.size() - start... |
python | def section_end_distances(neurites, neurite_type=NeuriteType.all):
'''section end to end distances in a collection of neurites'''
return map_sections(sectionfunc.section_end_distance, neurites, neurite_type=neurite_type) |
java | public M moveUp(int amount)
{
Checks.notNegative(amount, "Provided amount");
if (selectedPosition == -1)
throw new IllegalStateException("Cannot move until an item has been selected. Use #selectPosition first.");
if (ascendingOrder)
{
Checks.check(selectedPosi... |
java | @SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case XtextPackage.PARSER_RULE__DEFINES_HIDDEN_TOKENS:
setDefinesHiddenTokens((Boolean)newValue);
return;
case XtextPackage.PARSER_RULE__HIDDEN_TOKENS:
getHiddenTokens().clear();
get... |
java | private void dfs(Visitor visitor, int v, int[] cc, int id) {
visitor.visit(v);
cc[v] = id;
for (int t = 0; t < n; t++) {
if (graph[v][t] != 0.0) {
if (cc[t] == -1) {
dfs(visitor, t, cc, id);
}
}
}
} |
python | def open(self, hostname, port=22, username=None, password=None,
private_key=None, key_passphrase=None,
allow_agent=False, timeout=None):
""" Open a connection to a remote SSH server
In order to connect, either one of these credentials must be
supplied:
... |
python | def sort_shells(shells, use_copy=True):
"""
Sort a list of basis set shells into a standard order
The order within a shell is by decreasing value of the exponent.
The order of the shell list is in increasing angular momentum, and then
by decreasing number of primitives, then decreasing value of th... |
java | public static File ensureParentDir(File file) {
if (file != null && !file.getParentFile().isDirectory() && !file.getParentFile().mkdirs()) {
throw new IllegalStateException("Can't create directory \"" + file.getParent() + "\".");
}
return file;
} |
java | public static <T extends Object & Comparable<? super T>> T min(Collection<? extends T> coll) {
return Collections.min(coll);
} |
python | def update_association(assc_gene2gos, go2obj):
"""Add the GO parents of a gene's associated GO IDs to the gene's association."""
# Replaces update_association in GODag
goids_avail = set(go2obj)
# Get all assc GO IDs that are current
goid_sets = assc_gene2gos.values()
goids_assoc_all = set.union(... |
java | public static StreamDecoder forDecoder(ReadableByteChannel ch,
CharsetDecoder dec,
int minBufferCap)
{
return new StreamDecoder(ch, dec, minBufferCap);
} |
python | def get_platform_info():
"""Gets platform info
:return: platform info
"""
try:
system_name = platform.system()
release_name = platform.release()
except:
system_name = "Unknown"
release_name = "Unknown"
return {
... |
java | public static List<Instance> getAllInstances( AbstractApplication application ) {
List<Instance> result = new ArrayList<> ();
for( Instance instance : application.getRootInstances())
result.addAll( InstanceHelpers.buildHierarchicalList( instance ));
return result;
} |
java | public void set_attribute_info(final DeviceProxy deviceProxy, final AttributeInfoEx[] attr)
throws DevFailed {
checkIfTango(deviceProxy, "set_attribute_config");
build_connection(deviceProxy);
if (deviceProxy.access == TangoConst.ACCESS_READ) {
throwNotAuthorizedException(deviceProxy.devnam... |
python | def sorts_query(sortables):
""" Turn the Sortables into a SQL ORDER BY query """
stmts = []
for sortable in sortables:
if sortable.desc:
stmts.append('{} DESC'.format(sortable.field))
else:
stmts.append('{} ASC'.format(sortable.field))
... |
python | def setChanged(self,value=1):
"""Set changed flag"""
# set through dictionary to avoid another call to __setattr__
if value:
self.__dict__['flags'] = self.flags | _changedFlag
else:
self.__dict__['flags'] = self.flags & ~_changedFlag |
java | public void setBccAddresses(java.util.Collection<String> bccAddresses) {
if (bccAddresses == null) {
this.bccAddresses = null;
return;
}
this.bccAddresses = new java.util.ArrayList<String>(bccAddresses);
} |
python | def url(self, **urlargs):
'''Build a ``url`` from ``urlargs`` key-value parameters
'''
if self.defaults:
d = self.defaults.copy()
d.update(urlargs)
urlargs = d
url = '/'.join(self._url_generator(urlargs))
if not url:
return '/'
... |
java | public Matrix4d scale(Vector3dc xyz, Matrix4d dest) {
return scale(xyz.x(), xyz.y(), xyz.z(), dest);
} |
java | protected void processThreadPoolExecutor(
final Metrics metrics,
final String name,
final ThreadPoolExecutor executorService) {
final String prefix = String.join(
"/",
ROOT_NAMESPACE,
name);
metrics.setGauge(
... |
java | public void setImageDetails(java.util.Collection<ImageDetail> imageDetails) {
if (imageDetails == null) {
this.imageDetails = null;
return;
}
this.imageDetails = new java.util.ArrayList<ImageDetail>(imageDetails);
} |
python | def glimpse(self, *tags, compact = False):
"""Creates a printable table with the most frequently occurring values of each of the requested _tags_, or if none are provided the top authors, journals and citations. The table will be as wide and as tall as the terminal (or 80x24 if there is no terminal) so `print(R... |
java | protected void handleAppendRequestFailure(MemberState member, AppendRequest request, Throwable error) {
// Log the failed attempt to contact the member.
failAttempt(member, error);
} |
java | public static byte[] getNTLMv2Response(String target, String user,
String password, byte[] targetInformation, byte[] challenge,
byte[] clientNonce, long time) throws Exception {
byte[] ntlmv2Hash = ntlmv2Hash(target, user, password);
byte[] blob = createBlob(targetInformation, cl... |
python | def publish_twitter(twitter_contact, owner):
""" Publish in twitter the dashboard """
dashboard_url = CAULDRON_DASH_URL + "/%s" % (owner)
tweet = "@%s your http://cauldron.io dashboard for #%s at GitHub is ready: %s. Check it out! #oscon" \
% (twitter_contact, owner, dashboard_url)
status = quot... |
java | void insertInputGate(final int pos, final ExecutionGate inputGate) {
if (this.inputGates[pos] != null) {
throw new IllegalStateException("Input gate at position " + pos + " is not null");
}
this.inputGates[pos] = inputGate;
} |
java | public Observable<ManagedDatabaseInner> createOrUpdateAsync(String resourceGroupName, String managedInstanceName, String databaseName, ManagedDatabaseInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, managedInstanceName, databaseName, parameters).map(new Func1<ServiceResponse<... |
python | def save_bd5(
space, filename,
group_index=0, object_name="molecule", spatial_unit="meter", time_unit="second",
trunc=False, with_radius=False):
"""Save a space in the BDML-BD5 format (https://github.com/openssbd/BDML-BD5).
Open file for read/write, if it already exists, and create a ne... |
java | public ArrayList<DensityGrid> getNeighbours()
{
ArrayList<DensityGrid> neighbours = new ArrayList<DensityGrid>();
DensityGrid h;
int[] hCoord = this.getCoordinates();
for (int i = 0 ; i < this.dimensions ; i++)
{
hCoord[i] = hCoord[i]-1;
h = new DensityGrid(hCoord);
neighbours.add(h);
hCoo... |
java | public double optDouble(int index, double fallback) {
Object object = opt(index);
Double result = JSON.toDouble(object);
return result != null ? result : fallback;
} |
java | private void createDataset(String datasetId, @Nullable String location)
throws IOException, InterruptedException {
Dataset dataset = new Dataset();
DatasetReference reference = new DatasetReference();
reference.setProjectId(projectId);
reference.setDatasetId(datasetId);
dataset.setDatasetRefer... |
python | def will_print(level=1):
"""Returns True if the current global status of messaging would print a
message using any of the printing functions in this module.
"""
if level == 1:
#We only affect printability using the quiet setting.
return quiet is None or quiet == False
else:
r... |
python | def delete_network(self, network):
'''
Deletes the specified network
'''
net_id = self._find_network_id(network)
ret = self.network_conn.delete_network(network=net_id)
return ret if ret else True |
python | def all(cls, api_key=None, idempotency_key=None,
stripe_account=None, **params):
"""Return a deferred."""
url = cls.class_url()
return make_request(
cls, 'get', url, stripe_acconut=None, params=params) |
java | public static final byte selectRandom(frequency[] a) {
int len = a.length;
double r = random(1.0);
for (int i = 0; i < len; i++)
if (r < a[i].p)
return a[i].c;
return a[len - 1].c;
} |
python | def get_project(self, project_id):
""" Get project info """
try:
result = self._request('/getproject/',
{'projectid': project_id})
return TildaProject(**result)
except NetworkError:
return [] |
python | def get_pfam_details(self, pfam_accession):
'''Returns a dict pdb_id -> chain(s) -> chain and SCOPe details.'''
results = self.execute_select('''
SELECT DISTINCT scop_node.*, scop_node.release_id AS scop_node_release_id,
pfam.release_id AS pfam_release_id, pfam.name AS pfam_name... |
python | def create_missing(self):
"""Conditionally mark ``docker_upstream_name`` as required.
Mark ``docker_upstream_name`` as required if ``content_type`` is
"docker".
"""
if getattr(self, 'content_type', '') == 'docker':
self._fields['docker_upstream_name'].required = Tru... |
java | private LocatedBlock getBlockAt(long offset, boolean updatePosition,
boolean throwWhenNotFound)
throws IOException {
assert (locatedBlocks != null) : "locatedBlocks is null";
// search cached blocks first
locatedBlocks.blockLocationInfoExpiresIfNeeded();
LocatedBlock blk = locatedBlocks.getB... |
python | def media_type_matches(lhs, rhs):
"""
Returns ``True`` if the media type in the first argument <= the
media type in the second argument. The media types are strings
as described by the HTTP spec.
Valid media type strings include:
'application/json; indent=4'
'application/json'
'text/*... |
java | public <TAbstract, TImplementation extends TAbstract> InjectorConfiguration withScopedAlias(
Class scope,
Class<TAbstract> abstractDefinition,
Class<TImplementation> implementationDefinition
) {
if (abstractDefinition.equals(Injector.class)) {
throw new DependencyInjectio... |
python | def K_globe_stop_check_valve_Crane(D1, D2, fd=None, style=0):
r'''Returns the loss coefficient for a globe stop check valve as shown in
[1]_.
If β = 1:
.. math::
K = K_1 = K_2 = N\cdot f_d
Otherwise:
.. math::
K_2 = \frac{K + \left[0.5(1-\beta^2) ... |
python | def distribute_payoff(self, match_set):
"""Distribute the payoff received in response to the selected
action of the given match set among the rules in the action set
which deserve credit for recommending the action. The match_set
argument is the MatchSet instance which suggested the sele... |
python | def print_periodic_table(filter_function: callable = None):
"""
A pretty ASCII printer for the periodic table, based on some
filter_function.
Args:
filter_function: A filtering function taking an Element as input
and returning a boolean. For example, setting
... |
python | def months_per_hour(self):
"""A list of tuples representing months per hour in this analysis period."""
month_hour = []
hour_range = xrange(self.st_hour, self.end_hour + 1)
for month in self.months_int:
month_hour.extend([(month, hr) for hr in hour_range])
return mont... |
java | public Symbol resolveIdent(String name) {
if (name.equals(""))
return syms.errSymbol;
JavaFileObject prev = log.useSource(null);
try {
JCExpression tree = null;
for (String s : name.split("\\.", -1)) {
if (!SourceVersion.isIdentifier(s)) // TOD... |
java | public Object checkRemoteException(Object objData) throws org.jbundle.model.RemoteException
{
if (objData instanceof RemoteException)
throw (RemoteException)objData;
return objData;
} |
java | @Override
public CPInstance findByG_NotST_First(long groupId, int status,
OrderByComparator<CPInstance> orderByComparator)
throws NoSuchCPInstanceException {
CPInstance cpInstance = fetchByG_NotST_First(groupId, status,
orderByComparator);
if (cpInstance != null) {
return cpInstance;
}
StringBundl... |
python | def get(self, term):
# type: (Any) -> Type[ChomskyTermNonterminal]
"""
Get nonterminal rewritable to term.
If the rules is not in the grammar, nonterminal and rule rewritable to terminal are add into grammar.
:param term: Term for which get the nonterminal.
:return: Choms... |
java | public static void toKMLPolygon(Polygon polygon, ExtrudeMode extrude, int altitudeModeEnum, StringBuilder sb) {
sb.append("<Polygon>");
appendExtrude(extrude, sb);
appendAltitudeMode(altitudeModeEnum, sb);
sb.append("<outerBoundaryIs>");
toKMLLinearRing(polygon.getExteriorRing(),... |
python | def update(self, percent=None, text=None):
""" Update the progress bar percentage and message. """
if percent is not None:
self.percent = percent
if text is not None:
self.message = text
super().update() |
python | def get_train_err(htfa, data, F):
"""Calcuate training error
Parameters
----------
htfa : HTFA
An instance of HTFA, factor anaysis class in BrainIAK.
data : 2D array
Input data to HTFA.
F : 2D array
HTFA factor matrix.
Returns
-------
float
... |
java | public String escapeTableName(final String tableName) {
// step 1: to quote or no? how many single quotes?
boolean toQuote = false;
int apostropheCount = 0;
for (int i = 0; i < tableName.length(); i++) {
final char c = tableName.charAt(i);
if (Character.isWh... |
java | @Override
@SuppressWarnings("unchecked")
public <E> E getState(Class<E> stateType) {
return stateType == S6aSessionState.class ? (E) this.sessionData.getS6aSessionState() : null;
} |
java | public static PdfAction createImportData(String file) {
PdfAction action = new PdfAction();
action.put(PdfName.S, PdfName.IMPORTDATA);
action.put(PdfName.F, new PdfString(file));
return action;
} |
python | def convert_path_to_flask(path):
"""
Converts a Path from an Api Gateway defined path to one that is accepted by Flask
Examples:
'/id/{id}' => '/id/<id>'
'/{proxy+}' => '/<path:proxy>'
:param str path: Path to convert to Flask defined path
:return str: Path rep... |
python | def get_locations_list(self, lower_bound=0, upper_bound=None):
"""
Return the internal location list.
Args:
lower_bound:
upper_bound:
Returns:
"""
real_upper_bound = upper_bound
if upper_bound is None:
real_upper_bound = self.... |
java | public void putInWakeUpQueue(SerialMessage serialMessage) {
if (this.wakeUpQueue.contains(serialMessage)) {
logger.debug("Message already on the wake-up queue for node {}. Discarding.", this.getNode().getNodeId());
return;
}
logger.debug("Putting message in wakeup queue for node {}.", this.getNode... |
java | private void findIntervals(JCas jcas) {
ArrayList<Timex3Interval> newAnnotations = new ArrayList<Timex3Interval>();
FSIterator iterTimex3 = jcas.getAnnotationIndex(Timex3.type).iterator();
while (iterTimex3.hasNext()) {
Timex3Interval annotation=new Timex3Interval(jcas);
Timex3 timex3 = (Timex3) iterTime... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.