language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | private int getValueAccordingBoundaries(final int value) {
// check boundaries
final int newValue;
if (value < 0) {
newValue = 0;
}
else if (value > getMaxValue()) {
newValue = getMaxValue();
}
else {
newValue = value;
}
return newValue;
} |
python | def _find_unpurge_targets(desired, **kwargs):
'''
Find packages which are marked to be purged but can't yet be removed
because they are dependencies for other installed packages. These are the
packages which will need to be 'unpurged' because they are part of
pkg.installed states. This really just a... |
python | def cells(self):
"""The number of cells in the MOC.
This gives the total number of cells at all orders,
with cells from every order counted equally.
>>> m = MOC(0, (1, 2))
>>> m.cells
2
"""
n = 0
for (order, cells) in self:
n += len... |
python | def _get_users_of_group(config, group):
""" Utility to query fas for users of a group. """
if not group:
return set()
fas = fmn.rules.utils.get_fas(config)
return fmn.rules.utils.get_user_of_group(config, fas, group) |
java | public void processResetRequestAck(long dmeVersion, SendDispatcher sendDispatcher)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "processResetRequestAck", Long.valueOf(dmeVersion));
// Only consider non-stale request acks
if (dmeVersion >= _latestDMEVersion)
... |
java | public static Component createDropDown(FontIcon icon, Component content, String title) {
return createDropDown(getDropDownButtonHtml(icon), content, title);
} |
java | public static void appendPath(StringBuilder buffer, String... segments) {
for (int i = 0; i < segments.length; i++) {
String s = segments[i];
if (i > 0) {
buffer.append(SEPARATOR);
}
buffer.append(s);
}
} |
java | synchronized boolean processHeartbeat(
TaskTrackerStatus trackerStatus,
boolean initialContact) {
String trackerName = trackerStatus.getTrackerName();
synchronized (taskTrackers) {
synchronized (trackerExpiryQueue) {
boolean seenBe... |
java | public static PluginManager getInstance() {
if (_instance == null) {
_instance = new PluginManager();
_instance.classInformation = new HashMap<String, ClassInformation>();
_instance.methodInformation = new HashMap<String, com.groupon.odo.proxylib.models.Method>();
... |
java | public String[] getPinyinFromChar(char c) {
String s = Integer.toHexString(c).toUpperCase();
return tables.get(s);
} |
java | public void setTrackLocation( RectangleLength2D_I32 location ) {
this.location.set(location);
// massage the rectangle so that it has an odd width and height
// otherwise it could experience a bias when localizing
this.location.width += 1- this.location.width%2;
this.location.height += 1- this.location.heigh... |
python | def diff_to_new_interesting_lines(unified_diff_lines: List[str]
) -> Dict[int, str]:
"""
Extracts a set of 'interesting' lines out of a GNU unified diff format.
Format:
gnu.org/software/diffutils/manual/html_node/Detailed-Unified.html
@@ from-line-numbers to-l... |
java | public static FigShareClient to(String endpoint, int version, String clientKey, String clientSecret,
String tokenKey, String tokenSecret) {
return new FigShareClient(endpoint, version, clientKey, clientSecret, tokenKey, tokenSecret);
} |
java | public final void mJavaLetter() throws RecognitionException {
try {
// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1379:2: ( ( 'a' .. 'z' | 'A' .. 'Z' | '$' | '_' ) |{...}?~ ( '\\u0000' .. '\\u007F' | '\\uD800' .. '\\uDBFF' ) |{...}? ( '\\uD800' .. '\\uDBFF' ) ( '\\uDC00' .. '\\uDFFF' ) )
... |
python | def from_arrays(cls, arrays, name=None, **kwargs):
"""Creates a new instance of self from the given (list of) array(s).
This is done by calling numpy.rec.fromarrays on the given arrays with
the given kwargs. The type of the returned array is cast to this
class, and the name (if provided)... |
java | public Element appendToXml(Element parentNode, List<String> parametersToIgnore) {
for (Map.Entry<String, Serializable> entry : m_configurationObjects.entrySet()) {
String name = entry.getKey();
// check if the parameter should be ignored
if ((parametersToIgnore == null)... |
java | public void unsubscribeOrderbook(final BitfinexOrderBookSymbol symbol) {
final UnsubscribeChannelCommand command = new UnsubscribeChannelCommand(symbol);
client.sendCommand(command);
} |
python | def rgb(color,default=(0,0,0)):
""" return rgb tuple for named color in rgb.txt or a hex color """
c = color.lower()
if c[0:1] == '#' and len(c)==7:
r,g,b = c[1:3], c[3:5], c[5:]
r,g,b = [int(n, 16) for n in (r, g, b)]
return (r,g,b)
if c.find(' ')>-1: c = c.replace(' ','')
... |
java | @Override
public boolean add(E e) {
if (capacity <= linkedBlockingDeque.size())
linkedBlockingDeque.removeFirst();
return linkedBlockingDeque.add(e);
} |
java | public DynamoDBDeleteExpression withExpressionAttributeNames(
java.util.Map<String, String> expressionAttributeNames) {
setExpressionAttributeNames(expressionAttributeNames);
return this;
} |
python | def get_current_executions(self):
"""Get all current running executions.
:return: Returns a set of running Executions or empty list.
:rtype: list
raises ValueError in case of protocol issues
:Seealso:
- apply_actions
- launch_action_group
- get_history... |
java | public void clickInList(int line, int index, int id) {
if(config.commandLogging){
Log.d(config.commandLoggingTag, "clickInList("+line+", "+index+", " + id +")");
}
clicker.clickInList(line, index, id, false, 0);
} |
python | def _delete_partition(self, tenant_id, tenant_name):
"""Function to delete a service partition. """
self.dcnm_obj.delete_partition(tenant_name, fw_const.SERV_PART_NAME) |
python | def load(self, value):
"""Load the value of the DigitWord from a JSON representation of a list. The representation is
validated to be a string and the encoded data a list. The list is then validated to ensure each
digit is a valid digit"""
if not isinstance(value, str):
rais... |
python | def complete_block(self):
"""Return code lines **with** bootstrap"""
return "".join(line[SOURCE] for line in self._boot_lines + self._source_lines) |
java | public int getScale(int column) throws SQLException
{
sourceResultSet.checkColumnBounds(column);
VoltType type = sourceResultSet.table.getColumnType(column - 1);
Integer result = type.getMaximumScale();
if (result == null) {
result = 0;
}
return result;
... |
python | def _Close(self):
"""Closes the file-like object."""
super(VHDIFile, self)._Close()
for vhdi_file in self._parent_vhdi_files:
vhdi_file.close()
for file_object in self._sub_file_objects:
file_object.close()
self._parent_vhdi_files = []
self._sub_file_objects = [] |
java | private static boolean nodeListsAreEqual(final NodeList a, final NodeList b) {
if (a == b) {
return true;
}
if ((a == null) || (b == null)) {
return false;
}
if (a.getLength() != b.getLength()) {
return false;
}
for (int i = 0; ... |
java | @Override
public final void endElement(final String ns, final String lName,
final String qName) throws SAXException {
// the actual element name is either in lName or qName, depending
// on whether the parser is namespace aware
String name = lName == null || lName.length() == 0 ?... |
python | def to_latex(self):
""" Returns an interval representation """
if self.low == self.high:
if self.low * 10 % 10 == 0:
return "{0:d}".format(int(self.low))
else:
return "{0:0.2f}".format(self.low)
else:
t = ""
if self.... |
java | private static CSLName[] toAuthors(List<Map<String, Object>> authors) {
CSLName[] result = new CSLName[authors.size()];
int i = 0;
for (Map<String, Object> a : authors) {
CSLNameBuilder builder = new CSLNameBuilder();
if (a.containsKey(FIELD_FIRSTNAME)) {
builder.given(strOrNull(a.get(FIELD_FIRSTNAME)))... |
python | def d2logpdf_dlink2(self, inv_link_f, y, Y_metadata=None):
"""
Hessian at y, given link(f), w.r.t link(f)
i.e. second derivative logpdf at y given link(f_i) and link(f_j) w.r.t link(f_i) and link(f_j)
The hessian will be 0 unless i == j
.. math::
\\frac{d^{2} \\ln p... |
python | def _resume_with_session_id(
self,
server_info: ServerConnectivityInfo,
ssl_version_to_use: OpenSslVersionEnum
) -> bool:
"""Perform one session resumption using Session IDs.
"""
session1 = self._resume_ssl_session(server_info, ssl_version_to_use)
... |
java | public static long readUnsignedIntegerLittleEndian(byte[] buffer, int offset) {
long value;
value = (buffer[offset] & 0xFF);
value |= (buffer[offset + 1] & 0xFF) << 8;
value |= (buffer[offset + 2] & 0xFF) << 16;
value |= ((long)(buffer[offset + 3] & 0xFF)) << 24;
return value;
} |
java | public static void writeOutSilent(Expression value, BytecodeContext bc, int mode) throws TransformerException {
Position start = value.getStart();
Position end = value.getEnd();
value.setStart(null);
value.setEnd(null);
value.writeOut(bc, mode);
value.setStart(start);
value.setEnd(end);
} |
python | def parse_command_line_parameters():
""" Parses command line arguments """
usage = 'usage: %prog [options] fasta_filepath'
version = 'Version: %prog 0.1'
parser = OptionParser(usage=usage, version=version)
# A binary 'verbose' flag
parser.add_option('-p', '--is_protein', action='store_true',
... |
python | def add_catalogue_cluster(self, catalogue, vcl, flagvector,
cluster_id=None, overlay=True):
"""
Creates a plot of a catalogue showing where particular clusters exist
"""
# Create simple magnitude scaled point basemap
self.add_size_scaled_points(catal... |
python | def parse_JSON(self, JSON_string):
"""
Parses a list of *UVIndex* instances out of raw JSON data. Only certain
properties of the data are used: if these properties are not found or
cannot be parsed, an error is issued.
:param JSON_string: a raw JSON string
:type JSON_str... |
java | @Override
public EClass getIfcTextureVertexList() {
if (ifcTextureVertexListEClass == null) {
ifcTextureVertexListEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI)
.getEClassifiers().get(721);
}
return ifcTextureVertexListEClass;
} |
java | public void setItem(java.util.Collection<EndpointBatchItem> item) {
if (item == null) {
this.item = null;
return;
}
this.item = new java.util.ArrayList<EndpointBatchItem>(item);
} |
python | def delete(uuid):
'''
Remove an installed image
uuid : string
Specifies uuid to import
CLI Example:
.. code-block:: bash
salt '*' imgadm.delete e42f8c84-bbea-11e2-b920-078fab2aab1f
'''
ret = {}
cmd = 'imgadm delete {0}'.format(uuid)
res = __salt__['cmd.run_all'](c... |
python | def keyPressEvent(self, event):
"""
Qt override.
"""
if event.key() in [Qt.Key_Enter, Qt.Key_Return]:
QTableWidget.keyPressEvent(self, event)
# To avoid having to enter one final tab
self.setDisabled(True)
self.setDisabled(False)
... |
java | public static String[] getByJNDI() {
try {
Class<?> dirContext =
Class.forName("javax.naming.directory.DirContext");
Hashtable<String, String> env = new Hashtable<String, String>();
env.put("java.naming.factory.initial", "com.sun.jndi.dns.DnsContextFactory... |
java | byte[] decodeLikeAnEngineer(final byte[] input) {
if (input == null) {
throw new NullPointerException("input");
}
if ((input.length & 0x01) == 0x01) {
throw new IllegalArgumentException(
"input.length(" + input.length + ") is not even");
}
... |
java | private static HyphenationPattern[] sortPatterns(HyphenationPattern[] patternArray) {
Comparator<HyphenationPattern> comparator = new Comparator<HyphenationPattern>() {
@Override
public int compare(HyphenationPattern p1, HyphenationPattern p2) {
return (p2.getWordPart().length() - p1.g... |
java | public static String get(final String key, String def) {
if (key == null) {
throw new NullPointerException("key");
}
if (key.isEmpty()) {
throw new IllegalArgumentException("key must not be empty.");
}
String value = null;
try {
if (Sy... |
java | @Override
public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) throws InterruptedException {
threadPoolController.resumeIfPaused();
return threadPool.invokeAll(interceptorsActive ? wrap(tasks) : tasks);
} |
java | public static ParameterizedAnalyticsQuery parameterized(final String statement,
final JsonObject namedParams) {
return new ParameterizedAnalyticsQuery(statement, null, namedParams, null);
} |
python | def generateImplicitParameters(cls, obj):
"""
Create PRODID, VERSION, and VTIMEZONEs if needed.
VTIMEZONEs will need to exist whenever TZID parameters exist or when
datetimes with tzinfo exist.
"""
for comp in obj.components():
if comp.behavior is not None:
... |
java | public void setDefaultTransactionIsolation(final int transactionIsolation) {
if (Connection.TRANSACTION_READ_UNCOMMITTED == transactionIsolation
|| Connection.TRANSACTION_READ_COMMITTED == transactionIsolation
|| Connection.TRANSACTION_REPEATABLE_READ == transactionIsolation
|| Connection.TRANSACTION_SERI... |
java | public String rtmpPublishUrl(String streamKey, int expireAfterSeconds) {
long expire = System.currentTimeMillis() / 1000 + expireAfterSeconds;
String path = String.format("/%s/%s?e=%d", hub, streamKey, expire);
String token;
try {
token = auth.sign(path);
} catch (Exc... |
python | def ep(self, exc: Exception) -> bool:
"""Return False if the exception had not been handled gracefully"""
if not isinstance(exc, ConnectionAbortedError):
return False
if len(exc.args) != 2:
return False
origin, reason = exc.args
logging.getLogger(__name... |
python | def set_text(self, x, y, text):
"""Set text to the given coords.
:param x: x coordinate of the text start position
:param y: y coordinate of the text start position
"""
col, row = get_pos(x, y)
for i,c in enumerate(text):
self.chars[row][col+i] = c |
python | def add_bounding_box(self, color=None, corner_factor=0.5, line_width=None,
opacity=1.0, render_lines_as_tubes=False, lighting=None,
reset_camera=None, loc=None):
"""
Adds an unlabeled and unticked box at the boundaries of
plot. Useful for when w... |
java | protected static List<String> listDeliveryStreams() {
ListDeliveryStreamsRequest listDeliveryStreamsRequest = new ListDeliveryStreamsRequest();
ListDeliveryStreamsResult listDeliveryStreamsResult =
firehoseClient.listDeliveryStreams(listDeliveryStreamsRequest);
List<String> deliv... |
java | public static void main(String[] args) throws Exception {
AdPerformanceConfig config = new AdPerformanceConfig();
config.parse(AdTrackingBenchmark.class.getName(), args);
AdTrackingBenchmark benchmark = new AdTrackingBenchmark(config);
benchmark.runBenchmark();
} |
java | @Override
public void write(ITuple key, NullWritable value) throws IOException {
if(isClosing()) {
throw new IOException("Index is already closing");
}
heartBeater.needHeartBeat();
try {
try {
batch.add(converter.convert(key, value));
if(batch.size() > batchSize) {
batchWriter.queueBatch(bat... |
python | def split(mesh,
only_watertight=True,
adjacency=None,
engine=None):
"""
Split a mesh into multiple meshes from face connectivity.
If only_watertight is true, it will only return watertight meshes
and will attempt single triangle/quad repairs.
Parameters
----------... |
python | def _check_value(self, tag, value):
"""Ensure that the element matching C{tag} can have the given C{value}.
@param tag: The tag to consider.
@param value: The value to check
@return: The unchanged L{value}, if valid.
@raises L{WSDLParseError}: If the value is invalid.
""... |
python | def child(self, name):
"""
Create a new instance of this class derived from the current instance
such that:
(new.trace_id == current.trace_id and
new.parent_span_id == current.span_id)
The new L{Trace} instance will have a new unique span_id and if set the
... |
java | double getMarginValue(final double defaultMargin) {
double margin = model.get(BasicSceneGenerator.Margin.class);
if (margin == AUTOMATIC)
margin = defaultMargin;
return margin;
} |
python | def partial_transform(self, traj):
"""Featurize an MD trajectory into a vector space via calculation
of soft-bins over dihdral angle space.
Parameters
----------
traj : mdtraj.Trajectory
A molecular dynamics trajectory to featurize.
Returns
-------
... |
java | public void printInputControl(PrintWriter out, String strFieldDesc, String strFieldName, String strSize, String strMaxSize, String strValue, String strControlType, String strFieldType)
{
out.println(" <xfm:" + strControlType + " xform=\"form1\" ref=\"" + strFieldName + "\" cols=\"" + strSize + "\" type=\"" ... |
java | @Override
public void login(LoginCredential credential, LoginOpCall opLambda) throws LoginFailureException {
doLogin(credential, createLoginOption(opLambda)); // exception if login failure
} |
java | public Set<String> getIdsForTermWithAncestors(String s) {
if (!indexByName.containsKey(s))
return new HashSet<String>();
Stack<String> idsToConsider = new Stack<String>();
idsToConsider.addAll(getIdsForTerm(s));
Set<String> resultIds = new HashSet<String>();
while (!i... |
java | public void addModalButton(final ToolbarModalAction modalAction) {
final IButton button = new IButton();
button.setWidth(buttonSize);
button.setHeight(buttonSize);
button.setIconSize(buttonSize - WidgetLayout.toolbarStripHeight);
button.setIcon(modalAction.getIcon());
button.setActionType(SelectionType.CHEC... |
python | def connect_redis(redis_client, name=None, transaction=False):
"""
Connect your redis-py instance to redpipe.
Example:
.. code:: python
redpipe.connect_redis(redis.StrictRedis(), name='users')
Do this during your application bootstrapping.
You can also pass a redis-py-cluster insta... |
java | public long roundHalfEven(long instant) {
long floor = roundFloor(instant);
long ceiling = roundCeiling(instant);
long diffFromFloor = instant - floor;
long diffToCeiling = ceiling - instant;
if (diffFromFloor < diffToCeiling) {
// Closer to the floor - round floor
... |
python | def getAll(self, event_name):
"""Gets all the events of a certain name that have been received so
far. This is a non-blocking call.
Args:
callback_id: The id of the callback.
event_name: string, the name of the event to get.
Returns:
A list of Snippe... |
python | def __set_web_authentication_detail(self):
"""
Sets up the WebAuthenticationDetail node. This is required for all
requests.
"""
# Start of the authentication stuff.
web_authentication_credential = self.client.factory.create('WebAuthenticationCredential')
web_auth... |
python | def _add_getter(self):
"""
Add a read-only ``{prop_name}`` property to the element class for
this child element.
"""
property_ = property(self._getter, None, None)
# assign unconditionally to overwrite element name definition
setattr(self._element_cls, self._prop_... |
python | def getBitmapFromRect(self, x, y, w, h):
""" Capture the specified area of the (virtual) screen. """
min_x, min_y, screen_width, screen_height = self._getVirtualScreenRect()
img = self._getVirtualScreenBitmap() # TODO
# Limit the coordinates to the virtual screen
# Then offset so... |
python | def image(self, fname, group=None, scaled=None, dtype=None, idxexp=None,
zoom=None, gray=None):
"""Get named image.
Parameters
----------
fname : string
Filename of image
group : string or None, optional (default None)
Name of image group
... |
java | public static BoxResourceIterable<Info> getAllFileCollaborations(final BoxAPIConnection api, String fileID,
int pageSize, String... fields) {
QueryStringBuilder builder = new QueryStringBuilder();
if (fields.length > 0) {
... |
python | def user_session_show(self, user_id, id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/sessions#show-session"
api_path = "/api/v2/users/{user_id}/sessions/{id}.json"
api_path = api_path.format(user_id=user_id, id=id)
return self.call(api_path, **kwargs) |
python | def _on_error_page_write_error(self, status_code, **kwargs):
"""Replaces the default Tornado error page with a Django-styled one"""
if oz.settings.get('debug'):
exception_type, exception_value, tback = sys.exc_info()
is_breakpoint = isinstance(exception_value, oz.error_pages.Deb... |
python | def _new_type(cls, args):
"""Creates a new class similar to namedtuple.
Pass a list of field names or None for no field name.
>>> x = ResultTuple._new_type([None, "bar"])
>>> x((1, 3))
ResultTuple(1, bar=3)
"""
fformat = ["%r" if f is None else "%s=%%r" % f for... |
python | def get_table_list(self, cursor):
"""
Returns a list of table names in the current database and schema.
"""
cursor.execute("""
SELECT c.relname, c.relkind
FROM pg_catalog.pg_class c
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace... |
python | def GetHostMemPhysFreeMB(self):
'''Undocumented.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetHostMemPhysFreeMB(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
return counter.value |
python | def _CreateMethod(self, method_name):
"""Create a method wrapping an invocation to the SOAP service.
Args:
method_name: A string identifying the name of the SOAP method to call.
Returns:
A callable that can be used to make the desired SOAP request.
"""
soap_service_method = self.zeep_c... |
java | private void doSubstitutions(NodeTraversal t, Config config, Node n) {
if (n.isTaggedTemplateLit()) {
// This is currently not supported, since tagged template literals have a different calling
// convention than ordinary functions, so it's unclear which arguments are expected to be
// replaced. S... |
java | static void waitForPipelineToFinish(PipelineResult result) {
try {
// Check to see if we are creating a template.
// This should throw {@link UnsupportedOperationException} when creating a template.
result.getState();
State state = result.waitUntilFinish();
LOG.info("Job finished with... |
python | def load(filename, compressed=True, prealloc=None):
""" Loads a tensor from disk. """
# switch load based on file ext
_, file_ext = os.path.splitext(filename)
if compressed:
if file_ext != COMPRESSED_TENSOR_EXT:
raise ValueError('Can only load compressed tenso... |
python | def asDictionary(self):
""" returns the object as a python dictionary """
value = self._dict
if value is None:
template = {
"hasM" : self._hasM,
"hasZ" : self._hasZ,
"rings" : [],
"spatialReference" : self.spatialReferen... |
python | def groupby(self, dimensions, container_type=None, group_type=None, **kwargs):
"""Groups object by one or more dimensions
Applies groupby operation over the specified dimensions
returning an object of type container_type (expected to be
dictionary-like) containing the groups.
A... |
java | public static <T> Response call(RestUtils.RestCallable<T> callable,
AlluxioConfiguration alluxioConf) {
return call(callable, alluxioConf, null);
} |
python | def dict_encode(in_dict):
"""returns a new dictionary with encoded values useful for encoding http queries (python < 3)"""
if _IS_PY2:
out_dict = {}
for k, v in list(in_dict.items()):
if isinstance(v, unicode):
v = v.encode('utf8')
elif isinstance(v, str):... |
python | def _is_projection_updated_instance(self):
"""
This method tries to guess if instance was update since last time.
If return True, definitely Yes, if False, this means more unknown
:return: bool
"""
last = self._last_workflow_started_time
if not self._router.public... |
python | def create_toc(doctree, depth=9223372036854775807, writer_name='html',
exclude_first_section=True, href_prefix=None, id_prefix='toc-ref-'):
"""
Create a Table of Contents (TOC) from the given doctree
Returns: (docutils.core.Publisher instance, output string)
`writer_name`: represents a ... |
java | public static void fillUniform(GrayF32 img, Random rand , float min , float max) {
float range = max-min;
float[] data = img.data;
for (int y = 0; y < img.height; y++) {
int index = img.getStartIndex() + y * img.getStride();
for (int x = 0; x < img.width; x++) {
data[index++] = rand.nextFloat()*range+... |
java | Get generateContinueRequest(String cmcontinue) {
return newRequestBuilder() //
.param("cmcontinue", MediaWiki.urlEncode(cmcontinue)) //
.buildGet();
} |
java | public static int append(char[] target, int limit, int char32) {
// Check for irregular values
if (char32 < CODEPOINT_MIN_VALUE || char32 > CODEPOINT_MAX_VALUE) {
throw new IllegalArgumentException("Illegal codepoint");
}
// Write the UTF-16 values
if (char32 >= SUPPL... |
java | @Indexable(type = IndexableType.DELETE)
@Override
public CommerceCurrency deleteCommerceCurrency(long commerceCurrencyId)
throws PortalException {
return commerceCurrencyPersistence.remove(commerceCurrencyId);
} |
java | @Override
public Long zunionstore(final byte[] dstkey, final byte[]... sets) {
checkIsInMultiOrPipeline();
client.zunionstore(dstkey, sets);
return client.getIntegerReply();
} |
java | public static boolean isSARLAnnotation(Class<?> type) {
return (type != null && Annotation.class.isAssignableFrom(type))
&& isSARLAnnotation(type.getPackage().getName());
} |
python | def _attempt_YYYYMMDD(arg, errors):
"""
try to parse the YYYYMMDD/%Y%m%d format, try to deal with NaT-like,
arg is a passed in as an object dtype, but could really be ints/strings
with nan-like/or floats (e.g. with nan)
Parameters
----------
arg : passed value
errors : 'raise','ignore',... |
java | void setOrthoShadowMatrix(Matrix4f modelMtx, GVRLight light)
{
GVROrthogonalCamera camera = (GVROrthogonalCamera) getCamera();
if (camera == null)
{
return;
}
float w = camera.getRightClippingDistance() - camera.getLeftClippingDistance();
float h = camera... |
java | public void disconnect(final ComposableBody msg) throws BOSHException {
if (msg == null) {
throw(new IllegalArgumentException(
"Message body may not be null"));
}
Builder builder = msg.rebuild();
builder.setAttribute(Attributes.TYPE, TERMINATE);
s... |
python | def encode_ulid_base32(binary):
"""
Encode 16 binary bytes into a 26-character long base32 string.
:param binary: Bytestring or list of bytes
:return: ASCII string of 26 characters
:rtype: str
"""
assert len(binary) == 16
if not py3 and isinstance(binary, str):
binary = [ord(b) ... |
java | protected String getPath( final Bundle bundle )
{
if( m_pathManifestHeader != null )
{
final Object value = bundle.getHeaders().get( m_pathManifestHeader );
if( value instanceof String && ( (String) value ).trim().length() > 0 )
{
String path = (St... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.