language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def difference(self, boolean_switches):
"""
[COMPATIBILITY]
Make a copy of the current instance, and then discard all options that are in boolean_switches.
:param set boolean_switches: A collection of Boolean switches to disable.
:return: A new SimState... |
java | public byte[] toLogData() throws javax.transaction.SystemException
{
if (tc.isEntryEnabled())
Tr.entry(tc, "toLogData", this);
byte[] logData = null;
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
final ObjectOutputStream oos = new Obj... |
java | public Iterable<UNode> getMemberList() {
assert m_type == NodeType.MAP || m_type == NodeType.ARRAY;
if (m_children == null) {
m_children = new ArrayList<UNode>();
}
return m_children;
} |
python | def setup(app):
"""When used for sphinx extension."""
global _is_sphinx
_is_sphinx = True
app.add_config_value('no_underscore_emphasis', False, 'env')
app.add_config_value('m2r_parse_relative_links', False, 'env')
app.add_config_value('m2r_anonymous_references', False, 'env')
app.add_config_... |
java | public boolean select(String date, String format, Locale locale) {
SimpleDateFormat inDateFormat = new SimpleDateFormat(format, locale);
SimpleDateFormat outDateForm = new SimpleDateFormat("dd/MMM/yyyy", locale);
try {
Date fromDate = inDateFormat.parse(date);
date =... |
java | @Override
public TestSet parseTapStream(Readable tapStream) {
state = new StreamStatus();
baseIndentation = Integer.MAX_VALUE;
try (Scanner scanner = new Scanner(tapStream)) {
while (scanner.hasNextLine()) {
String line = scanner.nextLine();
if (li... |
java | public void setTextureAtlasInfo(String key, float[] offset, float[] scale) {
setTextureOffset(key, offset);
setTextureScale(key, scale);
} |
java | public List<Long> fetchIncoming() { // TODO: replace with primitive specialization
if (incoming == null || incoming.isEmpty()) {
//return EMPTY_LONG_LIST;
return Collections.emptyList(); // TODO: replace with primitive specialization
}
//TLongList result = incoming;
... |
python | def reaction_formula(reaction, compound_formula):
"""Calculate formula compositions for both sides of the specified reaction.
If the compounds in the reaction all have formula, then calculate and
return the chemical compositions for both sides, otherwise return `None`.
Args:
reaction: :class:`... |
python | def convert(self, *args, **kwargs):
"""
Yes it is, thanks captain.
"""
self.strings()
self.metadata()
# save file
self.result.save(self.output()) |
python | def _error(self, exc_info):
""" Retrieves the error info """
if self.exc_info:
if self.traceback:
return exc_info
return exc_info[:2]
return exc_info[1] |
java | public static synchronized void asyncSampleSystemNow(final boolean medium, final boolean large) {
// slow mode starts an async thread
if (mode == GetRSSMode.PS) {
if (thread != null) {
if (thread.isAlive()) return;
else thread = null;
}
... |
python | def get_bios_settings_result(self):
"""Gets the result of the bios settings applied
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedError, if the command is
not supported on the server.
"""
headers, bios_uri, bios_settings = self._check_b... |
java | public static double block_zero(GrayF64 integral , int x0 , int y0 , int x1 , int y1 )
{
return ImplIntegralImageOps.block_zero(integral,x0,y0,x1,y1);
} |
python | def bounding_box(self):
"""Bounding box (`~regions.BoundingBox`)."""
xmin = self.center.x - self.radius
xmax = self.center.x + self.radius
ymin = self.center.y - self.radius
ymax = self.center.y + self.radius
return BoundingBox.from_float(xmin, xmax, ymin, ymax) |
java | public void mergeNE(double x, double y) {
if (xmin > x)
xmin = x;
else if (xmax < x)
xmax = x;
if (ymin > y)
ymin = y;
else if (ymax < y)
ymax = y;
} |
python | def reset_state(self):
""" Will reset state of each augmentor """
super(AugmentorList, self).reset_state()
for a in self.augmentors:
a.reset_state() |
java | public static <T> T getPasswordlessAuthenticationAccount(final Event event, final Class<T> clazz) {
return event.getAttributes().get("passwordlessAccount", clazz);
} |
python | def export_xml_file(directory, filename, bpmn_diagram):
"""
Exports diagram inner graph to BPMN 2.0 XML file (with Diagram Interchange data).
:param directory: string representing output directory,
:param filename: string representing output file name,
:param bpmn_diagram: BPMND... |
java | public CmsSitemapClipboardData copy() {
LinkedHashMap<CmsUUID, CmsClientSitemapEntry> deletions = new LinkedHashMap<CmsUUID, CmsClientSitemapEntry>();
deletions.putAll(m_deletions);
LinkedHashMap<CmsUUID, CmsClientSitemapEntry> modifications = new LinkedHashMap<CmsUUID, CmsClientSitemapEntry>()... |
python | async def call_with_fd_list(proxy, method_name, signature, args, fds,
flags=0, timeout_msec=-1):
"""
Asynchronously call the specified method on a DBus proxy object.
:param Gio.DBusProxy proxy:
:param str method_name:
:param str signature:
:param tuple args:
:par... |
java | private void readHeader(java.io.RandomAccessFile logFile)
throws ObjectManagerException
{
if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
trace.entry(this,
cclass,
"readHeader",
new Object[] ... |
java | public Object invoke(Object[] arguments) {
try {
return new MethodInterceptorIterator(arguments).proceed();
} catch (Throwable e) {
throw new TransfuseInjectionException("Error while invoking Method Interceptor", e);
}
} |
java | public void setElements(
final Collection<? extends T> elements
)
{
clear();
if (elements == null || elements.size() == 0) {
return;
}
for (T obj : elements) {
addElement( obj );
}
} |
java | public synchronized Pool getPool(String name) {
Pool pool = pools.get(name);
if (pool == null) {
boolean isConfiguredPool = poolNamesInAllocFile.contains(name);
pool = new Pool(name, isConfiguredPool);
pools.put(name, pool);
}
return pool;
} |
java | public static CuratorFramework startCuratorFramework(Configuration configuration) {
Preconditions.checkNotNull(configuration, "configuration");
String zkQuorum = configuration.getValue(HighAvailabilityOptions.HA_ZOOKEEPER_QUORUM);
if (zkQuorum == null || StringUtils.isBlank(zkQuorum)) {
throw new RuntimeExcep... |
java | public DDF load(DataSourceDescriptor dataSourceDescriptor,
Boolean persist) throws DDFException {
Class sourceClass = dataSourceDescriptor.getClass();
DDF ddf = null;
if (sourceClass.equals(S3DataSourceDescriptor.class)) {
ddf = loadFromS3((S3DataSourceDescriptor)dataSourceDescripto... |
java | public static boolean isNext(final Buffer buffer, final byte b) throws IOException {
if (buffer.hasReadableBytes()) {
final byte actual = buffer.peekByte();
return actual == b;
}
return false;
} |
java | @Override
public List<String> listHosts() {
try {
// TODO (dano): only return hosts whose agents completed registration (i.e. has id nodes)
return provider.get("listHosts").getChildren(Paths.configHosts());
} catch (KeeperException.NoNodeException e) {
return emptyList();
} catch (Keeper... |
python | def matchlist_by_account(
self,
region,
encrypted_account_id,
queue=None,
begin_time=None,
end_time=None,
begin_index=None,
end_index=None,
season=None,
champion=None,
):
"""
Get matchlist for ranked games played on give... |
java | @Override
public GetTransitGatewayRouteTableAssociationsResult getTransitGatewayRouteTableAssociations(GetTransitGatewayRouteTableAssociationsRequest request) {
request = beforeClientExecution(request);
return executeGetTransitGatewayRouteTableAssociations(request);
} |
java | public void setErrorMessage(String message) {
m_messageText.setInnerHTML(message);
addStyleName(formCss().hasError());
m_hasError = true;
} |
java | public List<TileCoordinate> translateToZoomLevel(byte zoomlevelNew) {
List<TileCoordinate> tiles = null;
int zoomlevelDistance = zoomlevelNew - this.zoomlevel;
int factor = (int) Math.pow(2, Math.abs(zoomlevelDistance));
if (zoomlevelDistance > 0) {
tiles = new ArrayList<>((... |
python | def _update_inplace(self, new_query_compiler):
"""Updates the current DataFrame inplace.
Args:
new_query_compiler: The new QueryCompiler to use to manage the data
"""
old_query_compiler = self._query_compiler
self._query_compiler = new_query_compiler
... |
python | def source(uri, consts):
''' read gl code '''
with open(uri, 'r') as fp:
content = fp.read()
# feed constant values
for key, value in consts.items():
content = content.replace(f"%%{key}%%", str(value))
return content |
java | public void writeTag(RandomAccessFile raf) throws FileNotFoundException, IOException
{
if (headerExists)
raf.seek(raf.length() - TAG_SIZE);
else
raf.seek(raf.length());
raf.write(Helpers.getBytesFromString(TAG_START, TAG_START.length(), ENC_TYPE));
raf.write(Helpers.getBytesFromString(title, TITLE_SIZE... |
python | def to_message(self):
"""Collate all message elements to a single message."""
my_message = m.Message()
if self.static_message is not None:
my_message.add(self.static_message)
for myDynamic in self.dynamic_messages:
my_message.add(myDynamic)
return my_messa... |
python | def distATT(x1,y1,x2,y2):
"""Compute the ATT distance between two points (see TSPLIB documentation)"""
xd = x2 - x1
yd = y2 - y1
rij = math.sqrt((xd*xd + yd*yd) /10.)
tij = int(rij + .5)
if tij < rij:
return tij + 1
else:
return tij |
java | @NonNull
public Crossfade setResizeBehavior(int resizeBehavior) {
if (resizeBehavior >= RESIZE_BEHAVIOR_NONE && resizeBehavior <= RESIZE_BEHAVIOR_SCALE) {
mResizeBehavior = resizeBehavior;
}
return this;
} |
java | public ReduceOperator<T> reduce(ReduceFunction<T> reducer) {
if (reducer == null) {
throw new NullPointerException("Reduce function must not be null.");
}
return new ReduceOperator<T>(this, reducer);
} |
python | def second_derivative_5(var, key):
'''5 point 2nd derivative'''
global derivative_data
import mavutil
tnow = mavutil.mavfile_global.timestamp
if not key in derivative_data:
derivative_data[key] = (tnow, [var]*5)
return 0
(last_time, data) = derivative_data[key]
data.pop(0)
... |
java | LogFileHeader logFileHeader() throws InternalLogException
{
if (tc.isEntryEnabled())
Tr.entry(tc, "logFileHeader", this);
// Check that the file is actually open
if (_activeFile == null)
{
if (tc.isEntryEnabled())
Tr.exit(tc, "logFileHeader", ... |
java | public static void main(String[] args)
{
if (args.length != 2)
{
System.err.println("Usage: StyleImport <url> <output_file>");
System.exit(0);
}
try
{
StyleImport si = new StyleImport(args[0]);
FileOutputStream os = new... |
python | def get_ecs_cluster_for_queue(queue_name, batch_client=None):
"""Get the name of the ecs cluster using the batch client."""
if batch_client is None:
batch_client = boto3.client('batch')
queue_resp = batch_client.describe_job_queues(jobQueues=[queue_name])
if len(queue_resp['jobQueues']) == 1:
... |
java | @Override
public void write( final Object obj, final OutputElement xml ) throws XMLStreamException {
final Class<?> superclass = obj.getClass().getSuperclass();
xml.setAttribute( SUPERCLASS, superclass.getName() );
final String[] interfaceNames = getInterfaceNames( obj );
... |
python | def app(environ, start_response):
"""Simple WSGI application. Returns 200 OK response with 'Hellow world!' in
the body for GET requests. Returns 405 Method Not Allowed for all other
methods.
Returns 500 Internal Server Error if an exception is thrown. The response
body will not include the error or... |
java | @Override
protected void onLoad() {
mainAbsolutePanel.setSize(
String.valueOf(yuiSliderGwtWidget.getOffsetWidth()),
String.valueOf(yuiSliderGwtWidget.getOffsetHeight())
);
setupMarkerLabels();
} |
java | private boolean syncRead(int amountToRead) throws IOException{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()){
Tr.debug(tc, "syncRead, Executing a synchronous read");
}
// Allocate the buffer and set it on the TCP Channel
setAndAllocateBuffer(amountToRea... |
python | def _set_django_attributes(span, request):
"""Set the django related attributes."""
django_user = getattr(request, 'user', None)
if django_user is None:
return
user_id = django_user.pk
try:
user_name = django_user.get_username()
except AttributeError:
# AnonymousUser in... |
java | public static PageSnapshot shootPage(WebDriver driver, ScrollStrategy scroll, int scrollTimeout, boolean useDevicePixelRatio) {
Browser browser = new Browser(driver, useDevicePixelRatio);
browser.setScrollTimeout(scrollTimeout);
PageSnapshot pageScreenshot = new PageSnapshot(driver, browser.get... |
python | def fm_discriminator(Signal):
"""
Calculates the digital FM discriminator from a real-valued time signal.
Parameters
----------
Signal : array-like
A real-valued time signal
Returns
-------
fmDiscriminator : array-like
The digital FM discriminator of the argument signal... |
python | def _require_authenticate(func):
'''A decorator to add digest authorization checks to HTTP Request Handlers'''
def wrapped(self):
if not hasattr(self, 'authenticated'):
self.authenticated = None
if self.authenticated:
return func(self)
auth = self.headers.get(u'... |
java | public void setInterTriggerTimer(Parameter newInterTriggerTimer) {
if (newInterTriggerTimer != interTriggerTimer) {
NotificationChain msgs = null;
if (interTriggerTimer != null)
msgs = ((InternalEObject)interTriggerTimer).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.CONTROL_PARAMETERS__INTER_T... |
java | public URI rewriteURI(RequestContext rc) throws URISyntaxException {
Request request = rc.request();
String path = request.path();
if (!path.startsWith(prefix)) {
return null;
}
return computeDestinationURI(request, path, proxyTo, prefix);
} |
java | public void marshall(UpdateAppRequest updateAppRequest, ProtocolMarshaller protocolMarshaller) {
if (updateAppRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(updateAppRequest.getAppId(), AP... |
java | public SearchInAppResponse searchInApp(int appId, String query, Boolean counts,
Boolean highlights, Integer limit, Integer offset, ReferenceTypeSearchInApp refType,
String searchFields) {
WebResource resource = getResourceFactory().getApiResource("/search/app/" + appId +... |
python | def send_mass_mail(data_tuple, fail_silently=False, auth_user=None,
auth_password=None, connection=None):
"""
Given a data_tuple of (subject, message, from_email, recipient_list), send
each message to each recipient list. Return the number of emails sent.
If from_email is None, use th... |
python | def convert_consonantal_i(self, word) -> str:
"""Convert i to j when at the start of a word."""
match = list(self.consonantal_i_matcher.finditer(word))
if match:
if word[0].isupper():
return "J" + word[1:]
return "j" + word[1:]
return word |
python | def calc_z0_and_conv_factor_from_ratio_of_harmonics(z, z2, NA=0.999):
"""
Calculates the Conversion Factor and physical amplitude of motion in nms
by comparison of the ratio of the heights of the z signal and
second harmonic of z.
Parameters
----------
z : ndarray
array containing... |
java | public JobGraph compileJobGraph(OptimizedPlan program) {
this.jobGraph = new JobGraph(program.getJobName());
this.vertices = new HashMap<PlanNode, AbstractJobVertex>();
this.chainedTasks = new HashMap<PlanNode, TaskInChain>();
this.chainedTasksInSequence = new ArrayList<TaskInChain>();
this.auxVertices = new ... |
java | public boolean back() {
Fragment top = peek();
if (top instanceof OnBackPressedHandlingFragment) {
if (((OnBackPressedHandlingFragment)top).onBackPressed())
return true;
}
return pop();
} |
java | public static <T, K, V> Func1<Iterable<T>, SolidMap<K, V>> toSolidMap(final Func1<T, K> keyExtractor, final Func1<T, V> valueExtractor) {
return new Func1<Iterable<T>, SolidMap<K, V>>() {
@Override
public SolidMap<K, V> call(final Iterable<T> iterable) {
return new SolidM... |
java | private void addField(int fieldIndex, XmlSchemaObjectBase xsdSchemaObject,
Map < String, Object > fields, RootCompositeType compositeTypes) {
if (xsdSchemaObject instanceof XmlSchemaElement) {
XmlSchemaElement xsdElement = (XmlSchemaElement) xsdSchemaObject;
fields.put(getFie... |
python | def truncate_seq_pair(tokens_a, tokens_b, max_num_tokens, rng):
"""Truncates a pair of sequences to a maximum sequence length."""
while True:
total_length = len(tokens_a) + len(tokens_b)
if total_length <= max_num_tokens:
break
trunc_tokens = tokens_a if len(tokens_a) > len(... |
java | @Override
public V get(Object key)
{
if (key == null)
return _nullValue;
int hash = key.hashCode() & _mask;
int count = _size + 1;
K []keys = _keys;
for (; count > 0; count--) {
K mapKey = keys[hash];
if (mapKey == null)
return null;
if (key.equals(_keys[hash... |
python | def set_config(self, config, and_restart=False):
""" Post the full contents of the configuration, in the same format as
returned by :func:`.config`. The configuration will be saved to disk
and the ``configInSync`` flag set to ``False``. Restart Syncthing to
activate."""
assert is... |
python | def cursor_to_data_header(cursor):
"""Fetches all rows from query ("cursor") and returns a pair (data, header)
Returns: (data, header), where
- data is a [num_rows]x[num_cols] sequence of sequences;
- header is a [num_cols] list containing the field names
"""
n = 0
data, hea... |
java | public OrderingList<S> concat(OrderingList<S> other) {
if (size() == 0) {
return other;
}
OrderingList<S> newList = this;
if (other.size() > 0) {
for (OrderedProperty<S> property : other) {
newList = newList.concat(property);
}
... |
java | private void updateAgentDetailsIfNeeded(HttpServletRequest pReq) {
// Lookup the Agent URL if needed
AgentDetails details = backendManager.getAgentDetails();
if (details.isInitRequired()) {
synchronized (details) {
if (details.isInitRequired()) {
i... |
java | public long getEndToEndDuration() {
SubtaskStateStats subtask = getLatestAcknowledgedSubtaskStats();
if (subtask != null) {
return Math.max(0, subtask.getAckTimestamp() - triggerTimestamp);
} else {
return -1;
}
} |
python | def prune_overridden(ansi_string):
"""Remove color codes that are rendered ineffective by subsequent codes in one escape sequence then sort codes.
:param str ansi_string: Incoming ansi_string with ANSI color codes.
:return: Color string with pruned color sequences.
:rtype: str
"""
multi_seqs =... |
java | public final static StringBuilder buildLine(Level level, StringBuilder sb, Object[] elements) {
sb.append(level.name());
return buildLine(sb,elements);
} |
java | public static String getPackageName(String className, boolean resource)
{
String packageName = null;
if (className != null)
{
if (resource)
if (className.endsWith(PROPERTIES))
className = className.substring(0, className.length() - PROPERTIES.length());
if (... |
java | public static Constructor getProtectedConstructor(Class klass, Class... paramTypes) {
Constructor c;
try {
c = klass.getDeclaredConstructor(paramTypes);
c.setAccessible(true);
return c;
} catch (Exception e) {
return null;
}
} |
python | def delete_date(self, date):
"""
Remove the date line from the textual representation. This doesn't
remove any entry line.
"""
self.lines = [
line for line in self.lines
if not isinstance(line, DateLine) or line.date != date
]
self.lines =... |
java | private void _processMetadata(HashMap<String, Object> result) {
// the collections in the result can be either an object[] or a HashSet<object>, depending on the serializer that is used
Object methods = result.get("methods");
Object attrs = result.get("attrs");
Object oneways = result.get("oneways");
if(meth... |
python | def _get_args(op, name):
"""Hack to get relevant arguments for lineage computation.
We need a better way to determine the relevant arguments of an expression.
"""
# Could use multipledispatch here to avoid the pasta
if isinstance(op, ops.Selection):
assert name is not None, 'name is None'
... |
python | def hdf5(self):
"""Path of output hdf5 folder if relevant, None otherwise."""
if self._rundir['hdf5'] is UNDETERMINED:
h5_folder = self.path / self.par['ioin']['hdf5_output_folder']
if (h5_folder / 'Data.xmf').is_file():
self._rundir['hdf5'] = h5_folder
... |
python | def soaproot(self, node):
"""
Get whether the specified I{node} is a soap encoded root.
This is determined by examining @soapenc:root='1'.
The node is considered to be a root when the attribute
is not specified.
@param node: A node to evaluate.
@type node: L{Eleme... |
java | public KeyStoreCredentialResolverBuilder addKeyPasswords(Map<String, String> keyPasswords) {
requireNonNull(keyPasswords, "keyPasswords");
keyPasswords.forEach(this::addKeyPassword);
return this;
} |
java | public double getSumOfSquare() {
final double tmp = sumOfSquare + sumOfSquareCompensation;
if (Double.isNaN(tmp) && Double.isInfinite(simpleSumOfSquare)) {
return simpleSumOfSquare;
}
return tmp;
} |
java | public void handleContextVector(String focusKey,
String secondaryKey,
SparseDoubleVector context) {
// Find the most similar existing word sense.
int senseNumber = 0;
int bestSense = 0;
double bestSimilarity = -1;
... |
python | def widgetForName(self, name):
"""Gets a widget with *name*
:param name: the widgets in this container should all have
a name() method. This is the string to match to that result
:type name: str
"""
for iwidget in range(len(self)):
if self.widget(iwidget).na... |
java | public Collection<Locale> getCountries() {
Collection<Locale> result = get(KEY_QUERY_COUNTRIES, Collection.class);
if (result == null) {
return Collections.emptySet();
}
return result;
} |
java | @Override
public void init(final Configuration c)
{
// check if we have a current model which emits change notifications
if (model instanceof ChangeNotifier) {
final ChangeNotifier notifier = (ChangeNotifier) model;
notifier.removeChangeListener(cl);
}
final DatapointModel<?> m = c.getDatapointModel();
... |
python | def group(self):
"""
| Comment: The id of a group
"""
if self.api and self.group_id:
return self.api._get_group(self.group_id) |
python | def file_get_details(object_id, input_params={}, always_retry=True, **kwargs):
"""
Invokes the /file-xxxx/getDetails API method.
For more info, see: https://wiki.dnanexus.com/API-Specification-v1.0.0/Details-and-Links#API-method%3A-%2Fclass-xxxx%2FgetDetails
"""
return DXHTTPRequest('/%s/getDetails... |
python | def streamweigths_get(self, session):
'''taobao.wangwang.eservice.streamweigths.get 获取分流权重接口
获取当前登录用户自己的店铺内的分流权重设置'''
request = TOPRequest('taobao.wangwang.eservice.streamweigths.get')
self.create(self.execute(request, session))
return self.staff_stream_weights |
python | def encrypt_message(self, reply, timestamp=None, nonce=None):
"""
加密微信回复
:param reply: 加密前的回复
:type reply: WeChatReply 或 XML 文本
:return: 加密后的回复文本
"""
if hasattr(reply, "render"):
reply = reply.render()
timestamp = timestamp or to_text(int(time... |
python | def bqm_index_labels(f):
"""Decorator to convert a bqm to index-labels and relabel the sample set
output.
Designed to be applied to :meth:`.Sampler.sample`. Expects the wrapped
function or method to accept a :obj:`.BinaryQuadraticModel` as the second
input and to return a :obj:`.SampleSet`.
""... |
java | public static void pressText(Image srcImage, File destFile, String pressText, Color color, Font font, int x, int y, float alpha) throws IORuntimeException {
write(pressText(srcImage, pressText, color, font, x, y, alpha), destFile);
} |
python | def get_rich_text_content(primary_text=None, secondary_text=None, tertiary_text=None):
# type: (str, str, str) -> TextContent
"""Responsible for building plain text content object using
ask-sdk-model in Alexa skills kit display interface.
https://developer.amazon.com/docs/custom-skills/display-interface... |
java | public static Point3d get3DCenter(IAtomContainer ac) {
double centerX = 0;
double centerY = 0;
double centerZ = 0;
double counter = 0;
for (IAtom atom : ac.atoms()) {
if (atom.getPoint3d() != null) {
centerX += atom.getPoint3d().x;
cent... |
java | public R scan(Tree node, P p) {
return (node == null) ? null : node.accept(this, p);
} |
java | public void deleteFromComputeNode(String poolId, String nodeId, String filePath) {
deleteFromComputeNodeWithServiceResponseAsync(poolId, nodeId, filePath).toBlocking().single().body();
} |
python | def get_resource_attribute(collection, key, attribute):
"""Return the appropriate *Response* for retrieving an attribute of
a single resource.
:param string collection: a :class:`sandman.model.Model` endpoint
:param string key: the primary key for the :class:`sandman.model.Model`
:rtype: :class:`fl... |
java | public void marshall(PutMethodResponseRequest putMethodResponseRequest, ProtocolMarshaller protocolMarshaller) {
if (putMethodResponseRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(putMeth... |
python | def get_child_value(parent, name, allow_missing=0):
""" return the value of the child element with name in the parent Element """
if not parent.hasElement(name):
if allow_missing:
return np.nan
else:
raise Exception('failed to find child element %s... |
java | public T waitForAny(List<Future<T>> futures, @SuppressWarnings("unchecked") TaskObserver<T>... observers) throws InterruptedException, ExecutionException {
int count = futures.size();
while(count-- > 0) {
int id = queue.take();
logger.debug("task '{}' complete (count: {}, queue: {})", id, count, queue.size())... |
java | private Authentication getAuthentication(SecurityContext securityContext) {
// 用户未登录
Authentication authentication = securityContext.getAuthentication();
if (authentication == null) {
authentication = new AnonymousAuthenticationToken(UUID.randomUUID().toString(), "anonymous",
Collections.<GrantedAuth... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.