language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | private FormLayout initForm() {
FormLayout form = new FormLayout();
form.setWidth("100%");
m_dateField = new CmsDateField();
m_dateField.setCaption(
CmsVaadinUtils.getMessageText(org.opencms.workplace.commons.Messages.GUI_LABEL_DATE_PUBLISH_SCHEDULED_0));
form.addCom... |
python | def load_sgems_exp_var(filename):
""" read an SGEM experimental variogram into a sequence of
pandas.DataFrames
Parameters
----------
filename : (str)
an SGEMS experimental variogram XML file
Returns
-------
dfs : list
a list of pandas.DataFrames of x, y, pairs for each
... |
python | def gen_df(cls, options, width, spread_type="call", spread_kind="buy"):
"""
Generate Pandas Dataframe of Vertical
:param options: python dict of options.
:param width: offset for spread. Must be integer.
:param spread_type: call or put. defaults to "call".
:param spread_... |
python | def _populate_common_request(self, request):
'''Populate the Request with common fields.'''
url_record = self._item_session.url_record
# Note that referrer may have already been set by the --referer option
if url_record.parent_url and not request.fields.get('Referer'):
self.... |
python | def addStreamHandler(self,lvl=20):
"""
This function will add a stream handler to a log with the provided level.
Args:
lvl (int): The severity level of messages printed to the screen with
the stream handler, default = 20.
"""
sh = log... |
java | private static String toXMLString(Collection<TypedDependency> dependencies) {
StringBuilder buf = new StringBuilder("<dependencies style=\"typed\">\n");
for (TypedDependency td : dependencies) {
String reln = td.reln().toString();
String gov = td.gov().value();
int govIdx = td.gov().index... |
java | public synchronized void removeObserver(final ApptentiveNotificationObserver observer) {
for (ApptentiveNotificationObserverList observers : observerListLookup.values()) {
observers.removeObserver(observer);
}
} |
python | def as_json_range(self, name):
"""Represent the parameter range as a dictionary suitable for a request to
create an Amazon SageMaker hyperparameter tuning job using one of the deep learning frameworks.
The deep learning framework images require that hyperparameters be serialized as JSON.
... |
python | def Runtime_compileScript(self, expression, sourceURL, persistScript, **kwargs
):
"""
Function path: Runtime.compileScript
Domain: Runtime
Method name: compileScript
Parameters:
Required arguments:
'expression' (type: string) -> Expression to compile.
'sourceURL' (type: string) -> Sou... |
java | @Override
public void execute(IntuitMessage intuitMessage) throws FMSException {
LOG.debug("Enter CompressionInterceptor...");
String serializedData = intuitMessage.getRequestElements().getSerializedData();
if (StringUtils.hasText(serializedData)) {
byte[] compressedData = null;
String compres... |
python | def iterGrid(self, minZoom, maxZoom):
"Yields the tileBounds, zoom, tileCol and tileRow"
assert minZoom in range(0, len(self.RESOLUTIONS))
assert maxZoom in range(0, len(self.RESOLUTIONS))
assert minZoom <= maxZoom
for zoom in xrange(minZoom, maxZoom + 1):
[minRow, m... |
python | def get_size(self, value=None):
"""Return the size in bytes.
Args:
value (bytes): In structs, the user can assign other value instead
of this class' instance. Here, in such cases, ``self`` is a
class attribute of the struct.
Returns:
int:... |
java | @Override
public void writeXML(Document xml) {
writeAMF3();
buf.put(AMF3.TYPE_XML);
if (hasReference(xml)) {
putInteger(getReferenceId(xml) << 1);
return;
}
final byte[] encoded = encodeString(XMLUtils.docToString(xml));
putInteger(enc... |
java | public static int getLastIndexOfIgnoreCase (@Nullable final String sText,
final char cSearch,
@Nonnull final Locale aSortLocale)
{
return sText != null && sText.length () >= 1
... |
java | public Result run(Database db, Relation<O> relation) {
DistanceQuery<O> dq = db.getDistanceQuery(relation, getDistanceFunction());
ArrayDBIDs ids = DBIDUtil.ensureArray(relation.getDBIDs());
final int size = ids.size();
if(size > 0x10000) {
throw new AbortException("This implementation does not s... |
python | def _set_process_list(self, v, load=False):
"""
Setter method for process_list, mapped from YANG variable /cpu_state/process_list (container)
If this variable is read-only (config: false) in the
source YANG file, then _set_process_list is considered as a private
method. Backends looking to populate ... |
python | def get_bond(iface):
'''
Return the content of a bond script
CLI Example:
.. code-block:: bash
salt '*' ip.get_bond bond0
'''
path = os.path.join(_DEB_NETWORK_CONF_FILES, '{0}.conf'.format(iface))
return _read_file(path) |
java | void resetHead(long index) {
for (SegmentedJournalReader reader : readers) {
if (reader.getNextIndex() < index) {
reader.reset(index);
}
}
} |
java | public Optional<String> getEncryptionKey(final RegisteredService registeredService) {
val property = getEncryptionKeyRegisteredServiceProperty();
if (property.isAssignedTo(registeredService)) {
val key = property.getPropertyValue(registeredService).getValue();
return Optional.of(... |
java | public static File.PSetAclAction toProto(SetAclAction aclAction) {
switch (aclAction) {
case REPLACE:
return File.PSetAclAction.REPLACE;
case MODIFY:
return File.PSetAclAction.MODIFY;
case REMOVE:
return File.PSetAclAction.REMOVE;
case REMOVE_ALL:
return File.... |
java | public static Builder builder(final Resource r) {
return builder(r.getIdentifier()).interactionModel(r.getInteractionModel())
.container(r.getContainer().orElse(null))
.memberRelation(r.getMemberRelation().orElse(null))
.membershipResource(... |
java | public void setSelectAllText(final String selectAllText) {
if (selectAllText != null)
attrMixin.setAttribute(SELECT_ALL_TEXT, selectAllText);
else
attrMixin.removeAttribute(SELECT_ALL_TEXT);
} |
java | public FullyQualifiedNameFQNFormat createFullyQualifiedNameFQNFormatFromString(EDataType eDataType, String initialValue) {
FullyQualifiedNameFQNFormat result = FullyQualifiedNameFQNFormat.get(initialValue);
if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enume... |
python | def set_eps(self, eps):
"""
If :obj:`eps` is True,
the PostScript surface will output Encapsulated PostScript.
This method should only be called
before any drawing operations have been performed on the current page.
The simplest way to do this is to call this method
... |
java | @Override
public void onViewChild(ModelNode address, String childName) {
TreeItem rootNode = findTreeItem(tree, address);
TreeItem childNode = null;
for(int i=0; i<rootNode.getChildCount(); i++)
{
TreeItem candidate = rootNode.getChild(i);
if(childName.equals(... |
java | public static String nullifyBadInput(String input)
{
if (input != null)
{
if (input.matches(emptyRegex))
{
return null;
}
return input.trim();
}
return null;
} |
python | def _all_queue_names(self):
"""
Return a list of all unique queue names in our config.
:return: list of all queue names (str)
:rtype: :std:term:`list`
"""
queues = set()
endpoints = self.config.get('endpoints')
for e in endpoints:
for q in end... |
python | def fetch(self):
"""Load from the associated Git repository."""
os.makedirs(os.path.dirname(self.cached_repo), exist_ok=True)
if not os.path.exists(self.cached_repo):
self._log.warning("Index not found, caching %s in %s", self.repo, self.cached_repo)
git.clone(self.remote... |
python | def retrieve_file_handles_of_same_dataset(self, **args):
'''
:return: List of handles, or empty list. Should never return None.
:raise: SolrSwitchedOff
:raise SolrError: If both strategies to find file handles failed.
'''
mandatory_args = ['drs_id', 'version_number', 'dat... |
python | def from_networkx_graph(cls, G, vartype=None, node_attribute_name='bias',
edge_attribute_name='bias'):
"""Create a binary quadratic model from a NetworkX graph.
Args:
G (:obj:`networkx.Graph`):
A NetworkX graph with biases stored as node/edge attr... |
python | def separators(self, reordered = True):
"""
Returns a list of separator sets
"""
if reordered:
return [list(self.snrowidx[self.sncolptr[k]+self.snptr[k+1]-self.snptr[k]:self.sncolptr[k+1]]) for k in range(self.Nsn)]
else:
return [list(self.__p[self.snrow... |
python | def _get_key_info(self):
"""EscapedKeyAction doesn't send it as Unicode and the vk and
scan code are generated differently"""
vkey_scan = LoByte(VkKeyScan(self.key))
return (vkey_scan, MapVirtualKey(vkey_scan, 0), 0) |
java | void removeExistingGlue() {
for (int i = outputStream.size() - 1; i >= 0; i--) {
RTObject c = outputStream.get(i);
if (c instanceof Glue) {
outputStream.remove(i);
} else if (c instanceof ControlCommand) { // e.g.
// BeginString
break;
}
}
outputStreamDirty();
} |
java | @Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case AfplibPackage.BMO__OVLY_NAME:
return getOvlyName();
case AfplibPackage.BMO__TRIPLETS:
return getTriplets();
}
return super.eGet(featureID, resolve, coreType);
} |
python | def find_visible_elements(self, selector, by=By.CSS_SELECTOR, limit=0):
""" Returns a list of matching WebElements that are visible.
If "limit" is set and > 0, will only return that many elements. """
self.wait_for_ready_state_complete()
if page_utils.is_xpath_selector(selector):
... |
python | def p_program(p):
""" program : line
"""
if p[1] is not None:
[MEMORY.add_instruction(x) for x in p[1] if isinstance(x, Asm)] |
python | def _get_ANSI_colored_font( color ):
''' Returns an ANSI escape code (a string) corresponding to switching the font
to given color, or None, if the given color could not be associated with
the available colors.
See also:
https://en.wikipedia.org/wiki/ANSI_escape_cod... |
java | private void onBytesRead(int bytesRead) {
unnotifiedByteCount += bytesRead;
if (unnotifiedByteCount >= notifyThresHold) {
onNotifyBytesRead();
notifiedByteCount += unnotifiedByteCount;
unnotifiedByteCount = 0;
}
} |
python | async def send_notification(self, method, args=()):
'''Send an RPC notification over the network.'''
message = self.connection.send_notification(Notification(method, args))
await self._send_message(message) |
python | def refresh_content(self, order=None, name=None):
"""
Re-download all submissions and reset the page index
"""
order = order or self.content.order
# Preserve the query if staying on the current page
if name is None:
query = self.content.query
else:
... |
java | protected static List<CmsContainerElementBean> loadGroupContainerElements(CmsObject cms, CmsResource resource)
throws CmsException {
CmsXmlGroupContainer xmlGroupContainer = CmsXmlGroupContainerFactory.unmarshal(cms, resource);
CmsGroupContainerBean groupContainer = xmlGroupContainer.getGroupCo... |
python | def delete_authoring_nodes(self, editor):
"""
Deletes the Model authoring Nodes associated with given editor.
:param editor: Editor.
:type editor: Editor
:return: Method success.
:rtype: bool
"""
editor_node = foundations.common.get_first_item(self.get_e... |
python | def copy_with_new_relations(self, new_relations):
"""Create a new match object extended with new relations"""
result = self.__class__(self.forward.items())
result.add_relations(new_relations.items())
result.previous_ends1 = set(new_relations.values())
return result |
python | def resolve_orm_path(model, orm_path):
"""
Follows the queryset-style query path of ``orm_path`` starting from ``model`` class. If the
path ends up referring to a bad field name, ``django.db.models.fields.FieldDoesNotExist`` will
be raised.
"""
bits = orm_path.split('__')
endpoint_model =... |
java | @SuppressWarnings("unchecked")
public static <T, F extends FileInputFormat<T>> List<F> openAllInputs(
Class<F> inputFormatClass, String path, Configuration configuration) throws IOException {
Path nephelePath = new Path(path);
FileSystem fs = nephelePath.getFileSystem();
FileStatus fileStatus = fs.getFileStat... |
python | def from_request(cls, http_method, http_url, headers=None, parameters=None,
query_string=None):
"""Combines multiple parameter sources."""
if parameters is None:
parameters = {}
# Headers
if headers:
auth_header = None
for k, v in headers... |
python | def convert_uv(pinyin):
"""ü 转换,还原原始的韵母
ü行的韵跟声母j,q,x拼的时候,写成ju(居),qu(区),xu(虚),
ü上两点也省略;但是跟声母n,l拼的时候,仍然写成nü(女),lü(吕)。
"""
return UV_RE.sub(
lambda m: ''.join((m.group(1), UV_MAP[m.group(2)], m.group(3))),
pinyin) |
java | public List<String> getMolecularProperties(String notation) throws BuilderMoleculeException, CTKException,
ExtinctionCoefficientException, ValidationException, MonomerLoadingException, ChemistryException {
MoleculeProperty result = MoleculePropertyCalculator.getMoleculeProperties(validate(notation));
setMonom... |
python | def _checkRelatesTo(self, value):
'''WS-Address From
value -- From server returned.
'''
if value != self._messageID:
raise WSActionException, 'wrong WS-Address RelatesTo(%s), expecting %s'%(value,self._messageID) |
python | def down_alpha_beta(returns, factor_returns, **kwargs):
"""
Computes alpha and beta for periods when the benchmark return is negative.
Parameters
----------
see documentation for `alpha_beta`.
Returns
-------
alpha : float
beta : float
"""
return down(returns, factor_return... |
python | def _AddStopTimeObjectUnordered(self, stoptime, schedule):
"""Add StopTime object to this trip.
The trip isn't checked for duplicate sequence numbers so it must be
validated later."""
stop_time_class = self.GetGtfsFactory().StopTime
cursor = schedule._connection.cursor()
insert_query = "INSERT ... |
python | def main(self, *args, **kwargs):
"""Catch all exceptions."""
try:
result = super().main(*args, **kwargs)
return result
except Exception:
if HAS_SENTRY:
self._handle_sentry()
if not (sys.stdin.isatty() and sys.stdout.isatty()):
... |
python | def isoratio_init(self,isos):
'''
This file returns the isotopic ratio of two isotopes specified
as iso1 and iso2. The isotopes are given as, e.g.,
['Fe',56,'Fe',58] or ['Fe-56','Fe-58'] (for compatibility)
-> list.
'''
if len(isos) == 2:
dumb = []
... |
java | public static double metersYToLatitude( double y ) {
return Math.toDegrees(Math.atan(Math.sinh(y / EQUATORIALRADIUS)));
} |
python | def main():
"""
Runs a associator from the command-line. Calls JVM start/stop automatically.
Use -h to see all options.
"""
parser = argparse.ArgumentParser(
description='Executes an associator from the command-line. Calls JVM start/stop automatically.')
parser.add_argument("-j", metava... |
java | public void marshall(ZoneAwarenessConfig zoneAwarenessConfig, ProtocolMarshaller protocolMarshaller) {
if (zoneAwarenessConfig == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(zoneAwarenessConfig.ge... |
python | def _selectTransition(self, allocentricLocation, objectDict, visitCounts):
"""
Choose the transition that lands us in the location we've touched the least
often. Break ties randomly, i.e. choose the first candidate in a shuffled
list.
"""
candidates = list(transition
for t... |
java | @Deprecated
public static int hashCodeMulti(final Object... objects) {
int hash = 1;
if (objects != null) {
for (final Object object : objects) {
final int tmpHash = ObjectUtils.hashCode(object);
hash = hash * 31 + tmpHash;
}
}
... |
python | def square_off(samples, run_parallel):
"""Perform joint calling at all variants within a batch.
"""
to_process = []
extras = []
for data in [utils.to_single_data(x) for x in samples]:
added = False
if tz.get_in(("metadata", "batch"), data):
for add in genotype.handle_mult... |
java | public void marshall(RegisterThingRequest registerThingRequest, ProtocolMarshaller protocolMarshaller) {
if (registerThingRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(registerThingReques... |
python | def CheckPreviousBarline(self, staff):
"""method which checks the bar before the current for changes we need to make to it's barlines"""
measure_before_last = self.getMeasureAtPosition(-2, staff)
last_measure = self.getMeasureAtPosition(-1, staff)
if last_measure is not None and measure_... |
python | def CreatedField(name='created', tz_aware=False, **kwargs):
''' A shortcut field for creation time. It sets the current date and time
when it enters the database and then doesn't update on further saves.
If you've used the Django ORM, this is the equivalent of auto_now_add
:param tz_aware... |
python | def adjust_for_triggers(self):
"""Remove trigger-related plugins when needed
If there are no triggers defined, it's assumed the
feature is disabled and all trigger-related plugins
are removed.
If there are triggers defined, and this is a custom
base image, some trigger-... |
java | public static void makeWindowNonOpaque(Window window) {
if (PlatformUtils.isJava6()) {
// on non-mac platforms, try to use the facilities of Java 6 update 10.
if (!PlatformUtils.isMac()) {
quietlyTryToMakeWindowNonOqaque(window);
} else {
windo... |
java | public void getAllRecipeID(Callback<List<Integer>> callback) throws NullPointerException {
gw2API.getAllRecipeIDs().enqueue(callback);
} |
java | public static GraphRelationship[] toGRArray(Object[] o) {
GraphRelationship[] result = new GraphRelationship[o.length];
System.arraycopy(o, 0, result, 0, o.length);
return result;
} |
java | public static DeviceType getDevice(final HttpServletRequest request) {
// User agent
String userAgent = ((HttpServletRequest) request).getHeader("User-Agent");
if (Util.empty(userAgent)) {
LOG.warn("No User-Agent details in the request headers. Will assume normal device.");
return DeviceType.NORMAL;
}
... |
python | def get_by(self, field, value):
"""
Gets all Users that match the filter.
The search is case-insensitive.
Args:
field: Field name to filter. Accepted values: 'name', 'userName', 'role'
value: Value to filter.
Returns:
list: A list of Users.
... |
java | private List<Renderer<Video>> getRendererVideoPrototypes() {
List<Renderer<Video>> prototypes = new LinkedList<Renderer<Video>>();
LikeVideoRenderer likeVideoRenderer = new LikeVideoRenderer();
prototypes.add(likeVideoRenderer);
FavoriteVideoRenderer favoriteVideoRenderer = new FavoriteVideoRenderer();... |
java | public String getRestfulArtifactUrl(JobIdentifier jobIdentifier, String filePath) {
return format("/%s/%s", "files", jobIdentifier.artifactLocator(filePath));
} |
python | def _simplify_block(self, ail_block, stack_pointer_tracker=None):
"""
Simplify a single AIL block.
:param ailment.Block ail_block: The AIL block to simplify.
:param stack_pointer_tracker: The RegisterDeltaTracker analysis instance.
:return: A simplified ... |
python | def governor(self, Xgov, Pgov, Vgov):
""" Governor model.
Based on Governor.m from MatDyn by Stijn Cole, developed at Katholieke
Universiteit Leuven. See U{http://www.esat.kuleuven.be/electa/teaching/
matdyn/} for more information.
"""
governors = self.governors
... |
java | public static HttpServletResponse noCache(HttpServletResponse response) {
response.setHeader("cache-control", "no-cache");
response.setHeader("pragma", "no-cache");
response.setHeader("expires", "0");
return response;
} |
java | private Cluster expandCluster(final Cluster cluster,
final Point2D point,
final List<Point2D> neighbors,
final KDTree<Point2D> points,
final Map<Point2D, PointStatus> visit... |
python | def _assemble_modification(stmt):
"""Assemble Modification statements into text."""
sub_str = _assemble_agent_str(stmt.sub)
if stmt.enz is not None:
enz_str = _assemble_agent_str(stmt.enz)
if _get_is_direct(stmt):
mod_str = ' ' + _mod_process_verb(stmt) + ' '
else:
... |
python | def get_path(num):
"""Gets a path from the workitem number.
For example: 31942 will return 30000-39999/31000-31999/31900-31999
"""
num = int(num)
dig_len = len(str(num))
paths = []
for i in range(dig_len - 2):
divisor = 10 ** (dig_len - i - 1)
... |
java | protected void startInitialAlignment(boolean resetTxOffset) {
if (logger.isDebugEnabled()) {
logger.debug(String.format("(%s) Starting initial alignment", name));
}
// Comment from Oleg: this is done initialy to setup correct spot in tx
// buffer: dunno, I just believe, for ... |
python | def format(ctx):
""" Auto format package source files.
"""
isort_command = f"isort -rc {ctx.package.directory!s}"
black_command = f"black {ctx.package.directory.parent!s}"
report.info(ctx, "package.format", "sorting imports")
ctx.run(isort_command)
report.info(ctx, "package.format", "forma... |
java | @Override
public void setValue(org.openprovenance.prov.model.LangString value) {
this.value = value;
} |
python | def _sub_latlon(self, other):
'''
Called when subtracting a LatLon object from self
'''
inv = self._pyproj_inv(other)
heading = inv['heading_reverse']
distance = inv['distance']
return GeoVector(initial_heading = heading, distance = distance) |
java | public static UNode parse(File file, ContentType contentType) throws Exception {
try (Reader reader = new BufferedReader(new FileReader(file))) {
UNode result = null;
if (contentType.isJSON()) {
result = parseJSON(reader);
} else if (contentType.isXML()) ... |
python | def refresh_editor(self, color_scheme):
"""
Refresh editor settings (background and highlight colors) when color
scheme changed.
:param color_scheme: new color scheme.
"""
self.editor.background = color_scheme.background
self.editor.foreground = color_scheme.form... |
python | def get_array_items_description(item: Array) -> str:
"""Returns a description for an array's items.
:param item: The Array type whose items should be documented.
:returns: A string documenting what type the array's items should be.
"""
desc = ''
if isinstance(item.items, list):
# This m... |
python | def update(self, collection, selector, modifier, callback=None):
"""Insert an item into a collection
Arguments:
collection - the collection to be modified
selector - specifies which documents to modify
modifier - Specifies how to modify the documents
Keyword Arguments:
... |
java | @Override
public EClass getIfcModulusOfSubgradeReactionSelect() {
if (ifcModulusOfSubgradeReactionSelectEClass == null) {
ifcModulusOfSubgradeReactionSelectEClass = (EClass) EPackage.Registry.INSTANCE
.getEPackage(Ifc4Package.eNS_URI).getEClassifiers().get(1144);
}
return ifcModulusOfSubgradeReacti... |
python | def lsumdiffsquared(x,y):
"""
Takes pairwise differences of the values in lists x and y, squares
these differences, and returns the sum of these squares.
Usage: lsumdiffsquared(x,y)
Returns: sum[(x[i]-y[i])**2]
"""
sds = 0
for i in range(len(x)):
sds = sds + (x[i]-y[i])**2
return sds |
java | @XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "coverageFunction")
public JAXBElement<CoverageFunctionType> createCoverageFunction(CoverageFunctionType value) {
return new JAXBElement<CoverageFunctionType>(_CoverageFunction_QNAME, CoverageFunctionType.class, null, value);
} |
python | def _combine_results(self, match_as_dict):
'''Combine results from different parsed parts:
we look for non-empty results in values like
'postal_code_b' or 'postal_code_c' and store
them as main value.
So 'postal_code_b':'123456'
becomes:
... |
python | def end_element(self, name):
"""If end tag is our tag, call add_url()."""
self.in_tag = False
if name == self.tag:
self.add_url() |
java | @Pure
public static boolean epsilonEqualsDistance(Point3D<?, ?> p1, Point3D<?, ?> p2) {
final double distance = p1.getDistance(p2);
return distance >= -distancePrecision && distance <= distancePrecision;
} |
java | private void setStrokeColor(Color3f color) {
if (cacheStrokeR == color.x && cacheStrokeG == color.y && cacheStrokeB == color.z) {
// no need to re-set the stroke color, just use the cached values
} else {
cacheStrokeR = color.x;
cacheStrokeG = color.y;
cacheStrokeB = color.z;
setSt... |
python | def page_not_found(request, template_name='404.html'):
"""
Default 404 handler.
Templates: :template:`404.html`
Context:
request_path
The path of the requested URL (e.g., '/app/pages/bad_page/')
"""
response = render_in_page(request, template_name)
if response:
... |
java | protected String getLogString(ProfileRequestContext<?, ?> context) {
try {
AuthnRequest authnRequest = this.getAuthnRequest(context);
return String.format("request-id='%s',sp='%s'", authnRequest.getID(), authnRequest.getIssuer().getValue());
}
catch (Exception e) {
return "";
}
} |
python | def batch_fn(dataset, training, shapes, target_names,
batch_size=32, eval_batch_size=32, bucket_batch_length=32,
bucket_max_length=256, bucket_min_length=8,
bucket_length_step=1.1, buckets=None):
"""Batching function."""
del target_names
# If bucketing is not specified, chec... |
java | private void internalClose(Status internalError) {
log.log(Level.WARNING, "Cancelling the stream with status {0}", new Object[] {internalError});
stream.cancel(internalError);
serverCallTracer.reportCallEnded(internalError.isOk()); // error so always false
} |
python | def set_http_application_url_input_config_http_app_url_op_type(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
set_http_application_url = ET.Element("set_http_application_url")
config = set_http_application_url
input = ET.SubElement(set_http_appl... |
python | def snake_case_to_headless_camel_case(snake_string):
"""Convert snake_case to headlessCamelCase.
Args:
snake_string: The string to be converted.
Returns:
The input string converted to headlessCamelCase.
"""
return ''.join([snake_string.split('_')[0]] +
list(sub_string.capitalize()
... |
java | private void getCounts(String path, Counts counts) {
DataNode node = getNode(path);
if (node == null) {
return;
}
String[] children = null;
int len = 0;
synchronized (node) {
Set<String> childs = node.getChildren();
if (childs != null) ... |
java | @XmlElementDecl(namespace = "http://belframework.org/schema/1.0/xbel", name = "evidence")
public
JAXBElement<String> createEvidence(String value) {
return new JAXBElement<String>(_Evidence_QNAME, String.class, null,
value);
} |
java | public static String makeHTMLTable(String[][] table, String[] rowLabels, String[] colLabels) {
StringBuilder buff = new StringBuilder();
buff.append("<table class=\"auto\" border=\"1\" cellspacing=\"0\">\n");
// top row
buff.append("<tr>\n");
buff.append("<td></td>\n"); // the top left cell
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.