language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def calculate2d(self, force=True):
"""
recalculate 2d coordinates. currently rings can be calculated badly.
:param force: ignore existing coordinates of atoms
"""
for ml in (self.__reagents, self.__reactants, self.__products):
for m in ml:
m.calculate... |
python | def connection(self) -> Iterator[amqp.Connection]:
"""Returns a new connection as a context manager."""
TCP_USER_TIMEOUT = 18 # constant is available on Python 3.6+.
socket_settings = {TCP_USER_TIMEOUT: self.config.TCP_USER_TIMEOUT}
if sys.platform.startswith('darwin'):
del... |
java | public void marshall(EventDescription eventDescription, ProtocolMarshaller protocolMarshaller) {
if (eventDescription == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(eventDescription.getLatestDescr... |
java | @Override
public String sendEmailMessage(final EmailMessage emailMessage) throws MessagingException
{
Transport.send(emailMessage);
return emailMessage.getMessageID();
} |
python | def set_ipcsem_params(self, ftok=None, persistent=None):
"""Sets ipcsem lock engine params.
:param str|unicode ftok: Set the ipcsem key via ftok() for avoiding duplicates.
:param bool persistent: Do not remove ipcsem's on shutdown.
"""
self._set('ftok', ftok)
self._set... |
python | def bed(args):
"""
%prog bed bedfile bamfiles
Convert bam files to bed.
"""
p = OptionParser(bed.__doc__)
opts, args = p.parse_args(args)
if len(args) < 2:
sys.exit(not p.print_help())
bedfile = args[0]
bamfiles = args[1:]
for bamfile in bamfiles:
cmd = "bamToB... |
python | def build_body(self, template_file=INDEX):
"""
Params:
template_file (text): Path to an index.html template
Returns:
body (bytes): THe utf-8 encoded document body
"""
if self.params['error'] == 'access_denied':
message = docs.OAUTH_ACCESS_DEN... |
java | private void pbOpenActionPerformed (java.awt.event.ActionEvent evt)//GEN-FIRST:event_pbOpenActionPerformed
{//GEN-HEADEREND:event_pbOpenActionPerformed
// Add your handling code here:
pbTestActionPerformed(evt);
if (theConnection != null)
{
synchronized(Main.getProperties()... |
python | def _histogram_equalization_helper(valid_data, number_of_bins, clip_limit=None, slope_limit=None):
"""Calculate the simplest possible histogram equalization, using only valid data.
Returns:
cumulative distribution function and bin information
"""
# bucket all the selected data using np's hist... |
python | def check_perf():
"Suggest how to improve the setup to speed things up"
from PIL import features, Image
from packaging import version
print("Running performance checks.")
# libjpeg_turbo check
print("\n*** libjpeg-turbo status")
if version.parse(Image.PILLOW_VERSION) >= version.parse("5.3... |
python | def do_lmfit(data, params, B=None, errs=None, dojac=True):
"""
Fit the model to the data
data may contain 'flagged' or 'masked' data with the value of np.NaN
Parameters
----------
data : 2d-array
Image data
params : lmfit.Parameters
Initial model guess.
B : 2d-array
... |
python | def resources(self):
""" Returns a list of all :class:`~plexapi.myplex.MyPlexResource` objects connected to the server. """
data = self.query(MyPlexResource.key)
return [MyPlexResource(self, elem) for elem in data] |
java | public IssueCategory getByID(String categoryID)
{
IssueCategory issueCategory = this.issueCategories.get(categoryID);
if (issueCategory == null)
{
// We do not have this one yet, so store it as a placeholder. It will presumably be loaded later on.
issueCategory = new ... |
python | def asML(self):
"""
Convert this vector to the new mllib-local representation.
This does NOT copy the data; it copies references.
:return: :py:class:`pyspark.ml.linalg.SparseVector`
.. versionadded:: 2.0.0
"""
return newlinalg.SparseVector(self.size, self.indice... |
python | def webui_schematics_panels_panel_name(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
webui = ET.SubElement(config, "webui", xmlns="http://tail-f.com/ns/webui")
schematics = ET.SubElement(webui, "schematics")
panels = ET.SubElement(schematics, "... |
python | def set_rotation(self, rotation):
"""Set the rotation of the stereonet in degrees clockwise from North."""
self._rotation = np.radians(rotation)
self._polar.set_theta_offset(self._rotation + np.pi / 2.0)
self.transData.invalidate()
self.transAxes.invalidate()
self._set_li... |
java | @Deprecated
public <T> Class<T> getPropertyAsClass(String key, Class<T> targetType) {
Optional<String> property = propertyResolver.getProperty(NameUtils.hyphenate(key), String.class);
if (property.isPresent()) {
Optional<Class> aClass = ClassUtils.forName(property.get(), Thread.currentTh... |
python | def radlToSimple(radl_data):
"""
Return a list of maps whose values are only other maps or lists.
"""
aspects = (radl_data.ansible_hosts + radl_data.networks + radl_data.systems +
radl_data.configures + radl_data.deploys)
if radl_data.contextualize.items is not None:
aspects.... |
python | def append(self, bs):
"""Append a bitstring to the current bitstring.
bs -- The bitstring to append.
"""
# The offset is a hint to make bs easily appendable.
bs = self._converttobitstring(bs, offset=(self.len + self._offset) % 8)
self._append(bs) |
java | public static NodeImpl setTypeParameter(final NodeImpl node, final Class<?> containerClass,
final Integer typeArgumentIndex) {
return new NodeImpl( //
node.name, //
node.parent, //
node.isIterableValue, //
node.index, //
node.key, //
node.kind, //
node.p... |
python | def unload(module):
'''
Unload specified fault manager module
module: string
module to unload
CLI Example:
.. code-block:: bash
salt '*' fmadm.unload software-response
'''
ret = {}
fmadm = _check_fmadm()
cmd = '{cmd} unload {module}'.format(
cmd=fmadm,
... |
java | public MessageToSend prepareMessageToSend() {
originalMessage.getParts().clear();
originalMessage.getParts().addAll(publicParts);
return originalMessage;
} |
java | public final BatchCreateNotesResponse batchCreateNotes(
ProjectName parent, Map<String, Note> notes) {
BatchCreateNotesRequest request =
BatchCreateNotesRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.putAllNotes(notes)
.build();
ret... |
python | def serialize(ms, version=_default_version, properties=True,
pretty_print=False, color=False):
"""Serialize an MRS structure into a SimpleMRS string."""
delim = '\n' if pretty_print else _default_mrs_delim
output = delim.join(
_serialize_mrs(m, properties=properties,
... |
java | public BoxAuthenticationInfo getAuthInfo(String userId, Context context) {
return userId == null ? null : getAuthInfoMap(context).get(userId);
} |
java | public static Properties splitArrayElementsIntoProperties(String[] array, String delimiter) {
return splitArrayElementsIntoProperties(array, delimiter, null);
} |
python | def _display_choices(self, choices):
"""Prints a mapping of numbers to choices and returns the
mapping as a dictionary.
"""
print("Choose the number of the correct choice:")
choice_map = {}
for i, choice in enumerate(choices):
i = str(i)
print('{})... |
python | def _convert_service_properties_to_xml(logging, hour_metrics, minute_metrics,
cors, target_version=None, delete_retention_policy=None, static_website=None):
'''
<?xml version="1.0" encoding="utf-8"?>
<StorageServiceProperties>
<Logging>
<Version>ver... |
python | def permute(self, idx):
"""Permutes the columns of the factor matrices inplace
"""
# Check that input is a true permutation
if set(idx) != set(range(self.rank)):
raise ValueError('Invalid permutation specified.')
# Update factors
self.factors = [f[:, idx] fo... |
java | private void selectNode(final Object key, final Handler<AsyncResult<String>> doneHandler) {
context.execute(new Action<String>() {
@Override
public String perform() {
String address = nodeSelectors.get(key);
if (address != null) {
return address;
}
Set<String> n... |
java | public IScheduler getScheduler (final String schedName) throws SchedulerException
{
final SchedulerRepository schedRep = SchedulerRepository.getInstance ();
return schedRep.lookup (schedName);
} |
java | public void setCollections(java.util.Collection<CurrentMetricData> collections) {
if (collections == null) {
this.collections = null;
return;
}
this.collections = new java.util.ArrayList<CurrentMetricData>(collections);
} |
python | def _GetEventIdentifiers(self, event):
"""Retrieves different identifiers of the event.
Every event contains event data, which consists of attributes and values.
These attributes and values can be represented as a string and used for
sorting and uniquely identifying events. This function determines mul... |
python | def bind_extensions(app):
"""Configure extensions.
Args:
app (Flask): initialized Flask app instance
"""
# bind plugin to app object
app.db = app.config['PUZZLE_BACKEND']
app.db.init_app(app)
# bind bootstrap blueprints
bootstrap.init_app(app)
markdown(app)
@app.templa... |
python | def gaussian_distribution(mean, stdev, num_pts=50):
""" get an x and y numpy.ndarray that spans the +/- 4
standard deviation range of a gaussian distribution with
a given mean and standard deviation. useful for plotting
Parameters
----------
mean : float
the mean of the distribution
... |
java | public HostName toCanonicalHostName() {
HostName host = canonicalHost;
if(host == null) {
if(isMultiple()) {
throw new IncompatibleAddressException(this, "ipaddress.error.unavailable.numeric");
}
InetAddress inetAddress = toInetAddress();
String hostStr = inetAddress.getCanonicalHostName();//note: t... |
java | private JTextField getTextFieldContextName() {
if (txtContextName == null) {
txtContextName = new JTextField();
txtContextName.setText(SOABase.DEFAULT_NAME);
txtContextName.setColumns(10);
}
return txtContextName;
} |
java | private int findSmallestFrom(int startId, List<String> sortFlds, List<Integer> sortDirs) {
int minId = startId;
moveToId(startId);
while (super.next()) {
int id = currentId();
if (minId < 0 || compareRecords(minId, id, sortFlds, sortDirs) > 0)
minId = id;
moveToId(id);
}
return minId;
... |
java | public static <T> T max(Iterator<T> self) {
return max((Iterable<T>)toList(self));
} |
python | def wind_shear(shear: str, unit_alt: str = 'ft', unit_wind: str = 'kt') -> str:
"""
Format wind shear string into a spoken word string
"""
unit_alt = SPOKEN_UNITS.get(unit_alt, unit_alt)
unit_wind = SPOKEN_UNITS.get(unit_wind, unit_wind)
return translate.wind_shear(shear, unit_alt, unit_wind, sp... |
java | public void setCustomRules(java.util.Collection<CustomRule> customRules) {
if (customRules == null) {
this.customRules = null;
return;
}
this.customRules = new java.util.ArrayList<CustomRule>(customRules);
} |
python | def _prune_edges(G, X, traj_lengths, pruning_thresh=0.1, verbose=False):
'''Prune edges in graph G via cosine distance with trajectory edges.'''
W = G.matrix('dense', copy=True)
degree = G.degree(kind='out', weighted=False)
i = 0
num_bad = 0
for n in traj_lengths:
s, t = np.nonzero(W[i:i+n-1])
graph... |
java | public EClass getIfcCompositeCurveSegment() {
if (ifcCompositeCurveSegmentEClass == null) {
ifcCompositeCurveSegmentEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(93);
}
return ifcCompositeCurveSegmentEClass;
} |
python | def prompt_gui(path):
"""Prompt for a new filename via GUI."""
import subprocess
filepath, extension = os.path.splitext(path)
basename = os.path.basename(filepath)
dirname = os.path.dirname(filepath)
retry_text = 'Sorry, please try again...'
icon = 'video-x-generic'
# detect and conf... |
python | def rename_categories(self, key: str, categories: Sequence[Any]):
"""Rename categories of annotation ``key`` in
:attr:`obs`, :attr:`var` and :attr:`uns`.
Only supports passing a list/array-like ``categories`` argument.
Besides calling ``self.obs[key].cat.categories = categories`` -
... |
java | synchronized void register(LogWithPatternAndLevel log, Duration period) {
// if we haven't seen this period before, we'll need to add a schedule to the ScheduledExecutorService
// to perform a counter reset with that periodicity, otherwise we can count on the existing schedule
// taking care of... |
python | def _filterByPaddingNum(cls, iterable, num):
"""
Yield only path elements from iterable which have a frame
padding that matches the given target padding number
Args:
iterable (collections.Iterable):
num (int):
Yields:
str:
"""
... |
python | def membership_vector(clusterer, points_to_predict):
"""Predict soft cluster membership. The result produces a vector
for each point in ``points_to_predict`` that gives a probability that
the given point is a member of a cluster for each of the selected clusters
of the ``clusterer``.
Parameters
... |
python | def doublewell_eigs(n_grid, lag_time=1):
"""Analytic eigenvalues/eigenvectors for the doublwell system
TODO: DOCUMENT ME
"""
return _brownian_eigs(n_grid, lag_time, DOUBLEWELL_GRAD_POTENTIAL,
-np.pi, np.pi, reflect_bc=True) |
python | def apply(db, op):
"""
Apply operation in db
"""
dbname = op['ns'].split('.')[0] or "admin"
opts = bson.CodecOptions(uuid_representation=bson.binary.STANDARD)
db[dbname].command("applyOps", [op], codec_options=opts) |
python | def flip_ctrlpts2d_file(file_in='', file_out='ctrlpts_flip.txt'):
""" Flips u and v directions of a 2D control points file and saves flipped coordinates to a file.
:param file_in: name of the input file (to be read)
:type file_in: str
:param file_out: name of the output file (to be saved)
:type fil... |
python | def _get_ssl_sock(self):
"""Get raw SSL socket."""
assert self.scheme == u"https", self
raw_connection = self.url_connection.raw._connection
if raw_connection.sock is None:
# sometimes the socket is not yet connected
# see https://github.com/kennethreitz/requests/... |
python | def onMessageUnsent(
self,
mid=None,
author_id=None,
thread_id=None,
thread_type=None,
ts=None,
msg=None,
):
"""
Called when the client is listening, and someone unsends (deletes for everyone) a message
:param mid: ID of the unsent mes... |
python | def _generate_signature_for_function(self, func):
"""Given a function, returns a string representing its args."""
args_list = []
argspec = inspect.getargspec(func)
first_arg_with_default = (
len(argspec.args or []) - len(argspec.defaults or []))
for arg in argspec.args[:first_arg_with_defaul... |
java | public FieldValue evaluate(int index){
if(this.indexedNames == null){
throw new IllegalStateException();
}
FieldValue value = this.indexedValues[index];
if(value == EvaluationContext.UNDECLARED_VALUE){
FieldName name = this.indexedNames[index];
value = evaluate(name);
this.indexedValues[index] =... |
python | def should_see_link(self, link_url):
"""Assert a link with the provided URL is visible on the page."""
elements = ElementSelector(
world.browser,
str('//a[@href="%s"]' % link_url),
filter_displayed=True,
)
if not elements:
raise AssertionError("Expected link not found.") |
python | def seek_to(self, position):
"""Move the Shard's iterator to the earliest record after the :class:`~datetime.datetime` time.
Returns the first records at or past ``position``. If the list is empty,
the seek failed to find records, either because the Shard is exhausted or it
reached the... |
java | private void adaptForInsert(final ITreeData paramNewNode, final boolean addAsFirstChild) throws TTException {
assert paramNewNode != null;
if (paramNewNode instanceof ITreeStructData) {
final ITreeStructData strucNode = (ITreeStructData)paramNewNode;
final ITreeStructData parent... |
java | @BetaApi
public final Operation patchNetwork(
ProjectGlobalNetworkName network, Network networkResource, List<String> fieldMask) {
PatchNetworkHttpRequest request =
PatchNetworkHttpRequest.newBuilder()
.setNetwork(network == null ? null : network.toString())
.setNetworkResou... |
python | def draw_image(self, metric, limit=5):
"""Display a series of images at different time steps."""
rows = 1
cols = limit
self.ax.axis("off")
# Take the Axes gridspec and divide it into a grid
gs = matplotlib.gridspec.GridSpecFromSubplotSpec(
rows, cols, subplot_... |
python | def get_distributed_session_creator(server):
"""
Args:
server (tf.train.Server):
Returns:
tf.train.SessionCreator
"""
server_def = server.server_def
is_chief = (server_def.job_name == 'worker') and (server_def.task_index == 0)
init_op = tf.global_variables_initializer()
... |
java | public static Method[] getAllMethods(Class<?> clz) {
Set<Method> set = new HashSet<>();
List<Class<?>> classes = new ArrayList<>();
classes.add(clz);
classes.addAll(Arrays.asList(getAllSuperClasses(clz)));
classes.addAll(Arrays.asList(getAllInterfaces(clz)));
for (Class<?> c : classes) {
... |
java | boolean shouldExecuteOnProject() {
File report = pathResolver.relativeFile(fileSystem.baseDir(), configuration.getItReportPath());
boolean foundReport = report.exists() && report.isFile();
boolean shouldExecute = configuration.shouldExecuteOnProject(foundReport);
if (!foundReport && shouldExecute) {
... |
java | private static Class<?> getInvalidBusinessExtends(Class<?> wrapperInterface)
{
if ((EJBLocalObject.class).isAssignableFrom(wrapperInterface))
return EJBLocalObject.class;
if ((EJBLocalHome.class).isAssignableFrom(wrapperInterface))
return EJBLocalHome.class;
if ((EJBO... |
python | def AddClientKeywords(self, client_id, keywords):
"""Associates the provided keywords with the client."""
if client_id not in self.metadatas:
raise db.UnknownClientError(client_id)
for kw in keywords:
self.keywords.setdefault(kw, {})
self.keywords[kw][client_id] = rdfvalue.RDFDatetime.Now... |
python | def add_children_gos(self, gos):
"""Return children of input gos plus input gos."""
lst = []
obo_dag = self.obo_dag
get_children = lambda go_obj: list(go_obj.get_all_children()) + [go_obj.id]
for go_id in gos:
go_obj = obo_dag[go_id]
lst.extend(get_childre... |
java | @Override
public void stage3CreateKAMstore(final DBConnection db, String schemaName)
throws CreateKAMFailure {
if (db == null) {
throw new InvalidArgument("db", db);
}
try {
ksss.setupKAMStoreSchema(db, schemaName);
} catch (IOException e) {
... |
java | public boolean isNamespacePresent(final String requestedNamespace) {
checkArgument(requestedNamespace.length() > 0);
checkArgument(!requestedNamespace.endsWith(DELIM));
final String probe = requestedNamespace + DELIM;
return Iterables.any(params.keySet(), StringUtils.startsWith(probe));
} |
python | def _add_sections(self):
'''Add the found and required sections to the templ_dict.'''
for section in self.template_sections:
try:
sec_start = self._get_section_start_index(section)
except NonextantSectionException:
if section in self.sections_not_r... |
python | def getStates(self):
'''
Calculates updated values of normalized market resources and permanent income level.
Uses pLvlNow, aNrmNow, PermShkNow, TranShkNow.
Parameters
----------
None
Returns
-------
None
'''
pLvlPrev = self.pLvlN... |
python | def jsLocal(self, time_zone=''):
''' a method to report a javascript string from a labDT object
:param time_zone: [optional] string with timezone to report in
:return: string with date and time info
'''
# validate inputs
js_format = '%a %b %d %Y %H:%M:%S GMT%z (%Z... |
java | public CompletableFuture<SubscriptionRuntimeInfo> getSubscriptionRuntimeInfoAsync(String topicPath, String subscriptionName) {
EntityNameHelper.checkValidTopicName(topicPath);
EntityNameHelper.checkValidSubscriptionName(subscriptionName);
String path = EntityNameHelper.formatSubscriptionPath(to... |
python | def _create_board_image_cv(self, board=None):
"""Return a cv image of the board or empty board if not provided."""
board = board or base.Board() # empty board by default
tile_h, tile_w = self._TILE_SHAPE[0:2]
board_shape = tile_h * 8, tile_w * 8, 3
board_image = numpy.zeros(boar... |
java | public OvhSubscription subscription_subscriptionType_GET(String subscriptionType) throws IOException {
String qPath = "/me/subscription/{subscriptionType}";
StringBuilder sb = path(qPath, subscriptionType);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhSubscription.class);
} |
java | public Config setWanReplicationConfigs(Map<String, WanReplicationConfig> wanReplicationConfigs) {
this.wanReplicationConfigs.clear();
this.wanReplicationConfigs.putAll(wanReplicationConfigs);
for (final Entry<String, WanReplicationConfig> entry : this.wanReplicationConfigs.entrySet()) {
... |
python | def send(self, strict_validation=True):
"""Send the request and return the response or raise SearchAPIError.
Calling this method blocks the program until the response is returned,
if you want the request to be sent asynchronously please refer to the
send_async method.
... |
java | public void unregisterWorkflowDef(String name, Integer version) {
Preconditions.checkArgument(StringUtils.isNotBlank(name), "Workflow name cannot be blank");
Preconditions.checkNotNull(version, "Version cannot be null");
delete("metadata/workflow/{name}/{version}", name, version);
} |
java | public static Speed of(final double speed, final Unit unit) {
requireNonNull(unit);
return new Speed(Unit.METERS_PER_SECOND.convert(speed, unit));
} |
java | @Override
public Pair<T, I> get(int index) {
return indexToPair(matrix.get(index));
} |
java | public void marshall(UpdatePartitionRequest updatePartitionRequest, ProtocolMarshaller protocolMarshaller) {
if (updatePartitionRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(updatePartiti... |
java | public void fatalError(SAXParseException e) throws SAXException
{
if(null != m_errorHandler)
{
try
{
m_errorHandler.fatalError(e);
}
catch(SAXParseException se)
{
// ignore
}
// clearCoRoutine(e);
}
// This is not great, but we really would ra... |
java | public static <T> T implement(Class<T> type, Object object)
{
if (type.isInstance(object)) return type.cast(object);
return type.cast(Proxy.newProxyInstance(type.getClassLoader(),
new Class[]{type}, new DuckType(object)));
} |
python | def move_in(self, session, space, offset, length, width, extended=False):
"""Moves a block of data to local memory from the specified address space and offset.
Corresponds to viMoveIn* functions of the VISA library.
:param session: Unique logical identifier to a session.
:param space: ... |
java | public Object getValue(InternalWorkingMemory workingMemory,
Object object) {
return MVELSafeHelper.getEvaluator().executeExpression( mvelExpression,
object );
} |
java | public static SingleInputSemanticProperties readSingleConstantAnnotations(UserCodeWrapper<?> udf) {
// get constantSet annotation from stub
AllFieldsConstants allConstants = udf.getUserCodeAnnotation(AllFieldsConstants.class);
ConstantFields constantSet = udf.getUserCodeAnnotation(ConstantFields.class);
Cons... |
java | private static Element execute(SourceRange sourceRange, Property a,
Property b) {
assert (a != null);
assert (b != null);
Element result = null;
if ((a instanceof LongProperty) && (b instanceof LongProperty)) {
long l1 = ((Long) a.getValue()).longValue();
long l2 = ((Long) b.getValue()).longValue()... |
python | def get_distribution_dir(catalog_id, dataset_id, distribution_id,
catalogs_dir=CATALOGS_DIR, use_short_path=False):
"""Genera el path estรกndar de un catรกlogo en un filesystem."""
if use_short_path:
catalog_path = os.path.join(catalogs_dir, "catalog", catalog_id)
distribu... |
python | def handle(self, *args, **options):
"""
By default, we're going to do this in chunks. This way, if there ends up being an error,
we can check log messages and continue from that point after fixing the issue.
"""
# Note that by taking last_id here, we're going to miss any submissi... |
python | def get_field(brain_or_object, name, default=None):
"""Return the named field
"""
fields = get_fields(brain_or_object)
return fields.get(name, default) |
python | def decode(cls, line):
"""Remove backslash escaping from line.value."""
if line.encoded:
encoding = getattr(line, 'encoding_param', None)
if encoding and encoding.upper() == cls.base64string:
line.value = b64decode(line.value)
else:
lin... |
java | public static String getShortName(final ZoneId self, Locale locale) {
return self.getDisplayName(TextStyle.SHORT, locale);
} |
java | public void setReplyToAddresses(java.util.Collection<String> replyToAddresses) {
if (replyToAddresses == null) {
this.replyToAddresses = null;
return;
}
this.replyToAddresses = new com.amazonaws.internal.SdkInternalList<String>(replyToAddresses);
} |
java | public static <T> T last(Iterable<T> iterable) {
if (iterable instanceof List<?>) {
List<T> list = (List<T>) iterable;
if (list.isEmpty())
return null;
return list.get(list.size() - 1);
} else if (iterable instanceof SortedSet) {
SortedSet<T> sortedSet = (SortedSet<T>) iterable;
if (sortedSet.isE... |
python | def get_injectable_func_source_data(name):
"""
Return data about an injectable function's source, including file name,
line number, and source code.
Parameters
----------
name : str
Returns
-------
filename : str
lineno : int
The line number on which the function starts... |
python | def render_GET(self, request):
"""Renders a GET request, by showing this nodes stats and children."""
fullPath = request.path.split('/')
if not fullPath[-1]:
fullPath = fullPath[:-1]
parts = fullPath[2:]
statDict = util.lookup(scales.getStats(), parts)
if statDict is None:
request.s... |
python | def drop_duplicates(self, subset=None, keep='first', inplace=False):
"""
Return DataFrame with duplicate rows removed, optionally only
considering certain columns. Indexes, including time indexes
are ignored.
Parameters
----------
subset : column label or sequenc... |
java | public boolean remove(Object key, Object value) {
Set<V> values = map.get(key);
// If the key was not mapped to any values
if (values == null)
return false;
boolean removed = values.remove(value);
if (removed)
range--;
// if this was the last value... |
python | def log_entry_generator(log_instance):
"""
:yield: The next LogEntry from the REST API
:raise: StopIteration when there are no more log entries to show, please
note that if you call this again at a later time the REST API
could have different results and more data could be returned
... |
python | def getPopUpURL(self, CorpNum, NTSConfirmNum, UserID=None):
""" ํํ์ค ์ ์์ธ๊ธ๊ณ์ฐ์ ๋ณด๊ธฐ ํ์
URL
args
CorpNum : ํ๋นํ์ ์ฌ์
์๋ฒํธ
NTSConfirmNum : ๊ตญ์ธ์ฒญ ์น์ธ ๋ฒํธ
UserID : ํ๋นํ์ ์์ด๋
return
์ ์์ธ๊ธ๊ณ์ฐ์ ๋ณด๊ธฐ ํ์
URL ๋ฐํ
raise
Popbil... |
python | def set_orthogonal_selection(self, selection, value, fields=None):
"""Modify data via a selection for each dimension of the array.
Parameters
----------
selection : tuple
A selection for each dimension of the array. May be any combination of int,
slice, integer a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.