language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def get_nic_capacity(driver_info, ilo_fw):
"""Gets the FRU data to see if it is NIC data
Gets the FRU data in loop from 0-255 FRU Ids
and check if the returned data is NIC data. Couldn't
find any easy way to detect if it is NIC data. We should't be
hardcoding the FRU Id.
:param driver_info: Co... |
python | def _send_segment(self):
"""
Send the current segment to X-Ray daemon if it is present and
sampled, then clean up context storage.
The emitter will handle failures.
"""
segment = self.current_segment()
if not segment:
return
if segment.sample... |
java | public static PrioritizationStrategy getPrioritizationStrategy(String attributeValue, Long processInstanceId) throws StrategyException {
Package packageVO = processInstanceId == null ? null : getPackage(processInstanceId);
TaskInstanceStrategyFactory factory = getInstance();
String className = f... |
java | private Set<String> searchForIds(Context context, BooleanQuery query, ConsistencyLevel readConsistency) {
Set<String> ids = Sets.newTreeSet();
for (BooleanClause clause : query.getClauses()) {
Set<String> subQueryIds;
Query subQuery = clause.getQuery();
if (subQuery... |
python | def by_group(self): # pragma: no cover
"""
Display group membership sorted by group.
Returns:
Array with a dictionary of group membership.
For example: {'testgroup': ['test.user', 'test.user2']}
"""
group_membership = {}
for record in self._... |
java | public EventServiceLog createEventServiceLog(Class<? extends Subscriber> clazz) {
if (LoggableSubscriber.class.isAssignableFrom(clazz)) {
pm.currentTransaction().begin();
final EventServiceLog log = new EventServiceLog();
log.setSubscriberClass(clazz.getCanonicalName());
... |
python | def hex_to_rgb(hex_value):
"""
expects: hex value, ex: #ffffff
returns: rgb value, ex: ff00/ff00/ff00
"""
if '#' in hex_value:
hex_value = hex_value.replace('#', '')
if len(hex_value) < 6:
return '0000/0000/0000'
r = hex_value[:2]
g = hex_value[2:4]
b = hex_value[4:]
... |
java | @GwtIncompatible("NavigableMap")
public static <K, V> NavigableMap<K, V> filterKeys(
NavigableMap<K, V> unfiltered, final Predicate<? super K> keyPredicate) {
// TODO(user): Return a subclass of Maps.FilteredKeyMap for slightly better
// performance.
return filterEntries(unfiltered, Maps.<K>keyPredi... |
python | def single_send(self, param, must=[APIKEY, MOBILE, TEXT]):
'''单条发送
参数名 类型 是否必须 描述 示例
apikey String 是 用户唯一标识 9b11127a9701975c734b8aee81ee3526
mobile String 是
接收的手机号;仅支持单号码发送;国际号码需包含国际地区前缀号码,格式必须是"+"号开头("+"号需要urlencode处理,否则会出现格式错误),国际号码不以"+"开头将被认为是中国地区的号码
(针对国际短信,m... |
java | private ExprKraken parseMulExpr()
{
ExprKraken left = parseSimpleTerm();
while (true) {
Token token = scanToken();
switch (token) {
case STAR:
left = new BinaryExpr(BinaryOp.MUL, left, parseSimpleTerm());
break;
case DIV:
left = new BinaryExpr(BinaryOp.DIV, le... |
java | @SuppressWarnings("unchecked")
public List<T> toList() {
return new ArrayList<>((Collection<T>) new ArrayCollection(toArray(Object[]::new)));
} |
python | def close(self):
""" Closes the connection by removing the user from all rooms """
logging.debug('Closing for user {user}'.format(user=self.id.name))
self.id.release_name()
for room in self._rooms.values():
room.disconnect(self) |
java | public ProtocolDataUnit receiveFromWire () throws DigestException , InternetSCSIException , IOException {
final ProtocolDataUnit protocolDataUnit = protocolDataUnitFactory.create(connection.getSetting(OperationalTextKey.HEADER_DIGEST), connection.getSetting(OperationalTextKey.DATA_DIGEST));
try {
... |
python | def __get_dbms_version(self, make_connection=True):
"""
Returns the 'DBMS Version' string
"""
major, minor, _, _ = self.get_server_version(make_connection=make_connection)
return '{}.{}'.format(major, minor) |
java | private static <V> TreeEntry<V> successor(TreeEntry<V> t) {
if (t == null) {
return null;
} else if (t.right != null) {
TreeEntry<V> p = t.right;
while (p.left != null) {
p = p.left;
}
return p;
} else {
Tree... |
python | def floating_ip_associate(self, server_name, floating_ip):
'''
Associate floating IP address to server
.. versionadded:: 2016.3.0
'''
nt_ks = self.compute_conn
server_ = self.server_by_name(server_name)
server = nt_ks.servers.get(server_.__dict__['id'])
s... |
java | private static void generateToCConnectionListener(Map<String, List<TraceEvent>> events, FileWriter fw)
throws Exception
{
writeString(fw, "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"");
writeEOL(fw);
writeString(fw, " \"http://www.w3.org/TR/html4/loos... |
python | def cast(cls, value, cast=str, subcast=None):
"""
Parse and cast provided value.
:param value: Stringed value.
:param cast: Type or callable to cast return value as.
:param subcast: Subtype or callable to cast return values as (used for
nested structures)... |
python | def category(self):
"""
| Comment: The id of the category to which this section belongs
"""
if self.api and self.category_id:
return self.api._get_category(self.category_id) |
python | def dicttotext(d, sort=False, max = 0):
"""Function for converting dictionary to plaintext output, optionally with some (reverse) sorting"""
if sort:
f = lambda x: sorted(x, key=lambda y: -1 * y[1])
else:
f = lambda x: x
output = ""
for i, (key, value) in enumerate(f(d.items())):
... |
python | def get(self, path, **kwargs):
"""Perform an HTTP GET request of the specified path in Device Cloud
Make an HTTP GET request against Device Cloud with this accounts
credentials and base url. This method uses the
`requests <http://docs.python-requests.org/en/latest/>`_ library
`... |
java | static Collection<File> getCheckpointDirs(Configuration conf,
String defaultName) {
Collection<String> dirNames = conf.getStringCollection("fs.checkpoint.dir");
if (dirNames.size() == 0 && defaultName != null) {
dirNames.add(defaultName);
}
Collection<File> dirs = new ArrayList<File>(dirName... |
python | def get_renew_burn_info( outputs ):
"""
There are four poutputs: the OP_RETURN, the registration (owner)
address, the change address (i.e. from the preorderer), and the
burn address with the renewal fee.
Get the burn address and value
"""
if len(outputs) < 4:
raise Exception("Malfor... |
java | public void marshall(Document document, ProtocolMarshaller protocolMarshaller) {
if (document == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(document.getBytes(), BYTES_BINDING);
protoc... |
java | public int getSrcSetMaxWidth() {
int result = 0;
if ((m_srcSet != null) && (m_srcSet.size() > 0)) {
result = m_srcSet.lastKey().intValue();
}
return result;
} |
java | public static BasicTagList of(String... tags) {
Preconditions.checkArgument(tags.length % 2 == 0,
"tags must be a sequence of key,value pairs");
final SmallTagMap.Builder builder = SmallTagMap.builder();
for (int i = 0; i < tags.length; i += 2) {
Tag t = Tags.newTag(tags[i], tags[i + 1]);
... |
python | def focusInEvent(self, event):
""" The default 'focusInEvent' implementation.
"""
widget = self.widget
type(widget).focusInEvent(widget, event)
self.declaration.focus_gained() |
java | public Point3d[] calculate3DCoordinates1(Point3d aPoint, Point3d bPoint, Point3d cPoint, int nwanted,
double length, double angle) {
Point3d points[] = new Point3d[nwanted];
// BA vector
Vector3d ba = new Vector3d(aPoint);
ba.sub(bPoint);
ba.normalize();
// if... |
python | def get_exit_code(self):
"""
@rtype: int
@return: Process exit code, or C{STILL_ACTIVE} if it's still alive.
@warning: If a process returns C{STILL_ACTIVE} as it's exit code,
you may not be able to determine if it's active or not with this
method. Use L{is_alive... |
java | @Override
public Byte convert(final String valueStr, final boolean _caseSensitive, final Object target)
{
if (valueStr.length() == 1)
{
if (_caseSensitive)
return new Byte((byte) valueStr.charAt(0));
return new Byte((byte) valueStr.toLowerCase().charAt(0))... |
python | def clause_indices(self):
"""The list of clause indices in ``words`` layer.
The indices are unique only in the boundary of a single sentence.
"""
if not self.is_tagged(CLAUSE_ANNOTATION):
self.tag_clause_annotations()
return [word.get(CLAUSE_IDX, None) for word in sel... |
java | private static List<Tree<Node>> getNewTree(Tree<Node> inst){
delDefault(inst);
List<Tree<Node>> newTreeList = new ArrayList<Tree<Node>>();
List<Tree<Node>> children = new ArrayList<Tree<Node>>();
if(!inst.isLeaf()&&!inst.getFirstChild().isLeaf()){
boolean hasPu = false;
Tree<Node> newInst=null;
... |
java | @Override
public void handleRequest(ServletRequest req, ServletResponse res) throws Exception {
String methodName = "handleRequest";
// set the MappingMatch here as when the CacheServletWrapper is being used we will not go
// through the path of URIMatcher.
//reqData.setMappingMatch... |
java | private void configureSecurity(List<com.ibm.ws.javaee.dd.web.common.SecurityConstraint> securityConstraints,
LoginConfig loginConfig,
List<SecurityRole> securityRoles,
List<ServletMapping> servletMappings,
... |
python | def challenge(self,
task_desc,
expect=None,
hints=None,
congratulations='OK',
failed='FAILED',
expect_type='exact',
challenge_type='command',
shutit_pexpect_child=None,
timeout=None,
... |
python | def command(task: Task, command: str) -> Result:
"""
Executes a command locally
Arguments:
command: command to execute
Returns:
Result object with the following attributes set:
* result (``str``): stderr or stdout
* stdout (``str``): stdout
* stderr (``str... |
java | public static Vec numericToStringVec(Vec src) {
if (src.isCategorical() || src.isUUID())
throw new H2OIllegalValueException("Cannot convert a non-numeric column"
+ " using numericToStringVec() ",src);
Vec res = new MRTask() {
@Override
public void map(Chunk chk, NewChunk newChk) {
... |
java | public void addLocalTypeVariable(VariableElement ve, String signature, int index)
{
localTypeVariables.add(new LocalTypeVariable(ve, signature, index));
} |
python | def load_states(self, fname):
"""Loads trainer states (e.g. optimizer, momentum) from a file.
Parameters
----------
fname : str
Path to input states file.
Note
----
`optimizer.param_dict`, which contains Parameter information (such as
`lr_mul... |
python | def get_oauth_access_token(url, client_id, client_secret, token_type='jwt', grant_type='client_credentials',
refresh_token=None):
""" Retrieves OAuth 2.0 access token using the given grant type.
Args:
url (str): Oauth2 access token endpoint
client_id (str): client ID
... |
python | def list_preferences_type(self, type, user_id, address):
"""
List preferences.
Fetch all preferences for the given communication channel
"""
path = {}
data = {}
params = {}
# REQUIRED - PATH - user_id
"""ID"""
path["user_id"] ... |
python | def IsFleetspeakEnabledClient(grr_id, token=None):
"""Returns whether the provided GRR id is a Fleetspeak client."""
if grr_id is None:
return False
if data_store.RelationalDBEnabled():
md = data_store.REL_DB.ReadClientMetadata(grr_id)
if not md:
return False
return md.fleetspeak_enabled
... |
python | def mutate_unsampled_call_args(self, module, method, wrapped, instance, args, kwargs, transaction):
"""
Method called for unsampled wrapped calls. This can e.g. be used to add traceparent headers to the
underlying http call for HTTP instrumentations.
:param module:
:param method... |
java | public Operation setMachineType(MachineTypeId machineType, OperationOption... options) {
return compute.setMachineType(getInstanceId(), machineType, options);
} |
java | public static byte[] pBKDF2ObfuscatePassword(String password, byte[] salt)
throws NoSuchAlgorithmException, InvalidKeySpecException {
String algorithm = "PBKDF2WithHmacSHA1";
int derivedKeyLength = 160;
int iterations = 20000;
KeySpec spec = new PBEKeySpec(password.toCharArra... |
python | def alt_names(names: str) -> Callable[..., Any]:
"""Add alternative names to you custom commands.
`names` is a single string with a space separated list of aliases for the
decorated command.
"""
names_split = names.split()
def decorator(func: Callable[..., Any]) -> Callable[..., Any]:
... |
java | private String filterAndExecuteLaunchScriptAndReturnExecLine(String containerWorkDir) {
BufferedReader reader = null;
BufferedWriter writer = null;
String execLine = null;
File inJvmlaunchScript = null;
try {
File launchScript = new File(containerWorkDir, "launch_cont... |
java | private Object parse(String text, ParsePosition parsePosition, Currency[] currency) {
int backup;
int i = backup = parsePosition.getIndex();
// Handle NaN as a special case:
// Skip padding characters, if around prefix
if (formatWidth > 0 &&
(padPosition == PAD_BEFO... |
python | def receive(self):
"""
Receives incoming websocket messages, and puts them on the Client queue
for processing.
:return:
"""
while self.running:
if self._receiver_lock.acquire(blocking=False):
try:
raw = self.conn.recv()
... |
python | def generate_ctrlpts2d_weights(ctrlpts2d):
""" Generates unweighted control points from weighted ones in 2-D.
This function
#. Takes in 2-D control points list whose coordinates are organized like (x*w, y*w, z*w, w)
#. Converts the input control points list into (x, y, z, w) format
#. Returns the ... |
java | public void removeExtension() {
try {
if (extensionsDao.isTableExists()) {
extensionsDao.deleteByExtension(EXTENSION_NAME);
}
} catch (SQLException e) {
throw new GeoPackageException(
"Failed to delete CRS WKT extension. GeoPackage: "
+ geoPackage.getName(), e);
}
} |
java | public final void deleteOccurrence(String name) {
DeleteOccurrenceRequest request = DeleteOccurrenceRequest.newBuilder().setName(name).build();
deleteOccurrence(request);
} |
python | def add_object(self, request):
"""
Adds an object.
"""
try:
# backbone sends data in the body in json format
# Conditional statement is for backwards compatibility with Django <= 1.3
data = json.loads(request.body if hasattr(request, 'body') else reque... |
java | public static String decompressString(byte[] compressed) throws IOException {
ByteArrayInputStream is = new ByteArrayInputStream(compressed);
try (InputStream gis = new GZIPInputStream(is)) {
return new String(Base64.decode(IOUtils.toByteArray(gis)), StandardCharsets.UTF_8);
}
} |
java | @Override
public List<String> getFeatureAndTileTables() {
List<String> tables = new ArrayList<String>();
tables.addAll(getFeatureTables());
tables.addAll(getTileTables());
return tables;
} |
java | public void setLearningRate(double learningRate)
{
if(Double.isInfinite(learningRate) || Double.isNaN(learningRate) || learningRate <= 0)
throw new IllegalArgumentException("Learning rate must be positive, not " + learningRate);
this.learningRate = learningRate;
} |
python | def _redraw_labels(self):
"""Redraw axis labels, typically after draw or resize events."""
ax = self.get_axes()
# Remove any previous labels
for mpl_object in self._to_remove:
mpl_object.remove()
self._to_remove = []
# Redraw the labels with the appropriate an... |
java | public void setSTSHeaderValue() {
String STSHeader = null;
if (this.contextParams != null){
STSHeader = (String) this.contextParams.get("com.ibm.ws.webcontainer.ADD_STS_HEADER_WEBAPP");
if (STSHeader != null ){
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabl... |
python | def _get_one_pending_job(self):
"""
Retrieve a pending job.
:return: A CFGJob instance or None
"""
pending_job_key, pending_job = self._pending_jobs.popitem()
pending_job_state = pending_job.state
pending_job_call_stack = pending_job.call_stack
pending_j... |
python | def _parse_text(self, page_text):
"""Extract the s2config and the content from the raw page text."""
# 1 sanitize: remove leading blank lines
# 2 separate "config text" from content, store content
# 3 convert config text + \n to obtain Meta, this is the config.
lines = page_tex... |
java | @Nullable
@ReturnsMutableCopy
public static ICommonsList <String> readStreamLines (@Nullable final IHasInputStream aISP,
@Nonnull final Charset aCharset)
{
return readStreamLines (aISP, aCharset, 0, CGlobal.ILLEGAL_UINT);
} |
java | public static TimeZone getTimeZoneById(String id)
{
TimeZone ret = null;
if(timezones != null)
{
for(int i = 0; i < timezones.length && ret == null; i++)
{
if(timezones[i].getId().equals(id))
ret = timezones[i].getTimeZone();
... |
java | public ModelAnnotation getAnnotation(Class<? extends Annotation> value) {
for (ModelAnnotation item : annotations) {
if (item.getName().equals(value.getCanonicalName())) {
return item;
}
}
return null;
} |
java | public Observable<Page<RecordSetInner>> listAsync(final String resourceGroupName, final String privateZoneName) {
return listWithServiceResponseAsync(resourceGroupName, privateZoneName)
.map(new Func1<ServiceResponse<Page<RecordSetInner>>, Page<RecordSetInner>>() {
@Override
... |
python | def write_chunk(self, x, z, nbt_file):
"""
Pack the NBT file as binary data, and write to file in a compressed format.
"""
data = BytesIO()
nbt_file.write_file(buffer=data) # render to buffer; uncompressed
self.write_blockdata(x, z, data.getvalue()) |
java | private void visitRestParam(NodeTraversal t, Node restParam, Node paramList) {
Node functionBody = paramList.getNext();
int restIndex = paramList.getIndexOfChild(restParam);
Node nameNode = restParam.getOnlyChild();
String paramName = nameNode.getString();
// Swap the existing param into the list, ... |
java | <T extends ListValue> void setListRelation(String attributeName,
String value, Class<T> valuesClass) {
instance.setListRelation(this, attributeName, value, valuesClass);
} |
java | public static boolean ringAlreadyInSet(IRing newRing, IRingSet ringSet) {
IRing ring;
// IBond[] bonds;
// IBond[] newBonds;
// IBond bond;
int equalCount;
boolean equals;
for (int f = 0; f < ringSet.getAtomContainerCount(); f++) {
equals = fa... |
python | def parse(self, response):
"""
Checks any given response on being an article and if positiv,
passes the response to the pipeline.
:param obj response: The scrapy response
"""
if not self.helper.parse_crawler.content_type(response):
return
yield self.... |
java | public double getYield(double bondPrice, AnalyticModel model) {
GoldenSectionSearch search = new GoldenSectionSearch(-2.0, 2.0);
while(search.getAccuracy() > 1E-11 && !search.isDone()) {
double x = search.getNextPoint();
double fx=getValueWithGivenYield(0.0,x,model);
double y = (bondPrice-fx)*(bondPrice-fx... |
python | def write(self, document, obj, *args, **kwargs):
"""
Returns a Deferred that fire the factory result
that should be the document.
"""
try:
document = IWritableDocument(document)
mime_type = document.mime_type
writer = self.lookup_writer(mime_ty... |
python | def update(self, identifier, new_instance):
"""
Update an encryptable field, make sure that:
* We won't change the encryption context key
* The new value is going to be encrypted
* The return instance.plaintext is the updated one
Note: Will expunge the returned instance
... |
python | def get_suffix(id, regex="-[A-Z]{1}[0-9]{1,2}$"):
"""Get the suffix of the ID, e.g. '-R01' or '-P05'
The current regex determines a pattern of a single uppercase character with
at most 2 numbers following at the end of the ID as the suffix.
"""
parts = re.findall(regex, id)
if not parts:
... |
python | def add_interface(self, interface):
"""
Add interface is a lower level option to adding interfaces directly
to the engine. The interface is expected to be an instance of
Layer3PhysicalInterface, Layer2PhysicalInterface, TunnelInterface,
or ClusterInterface. The engines instance c... |
java | protected int doWriteSingle(ChannelOutboundBuffer in) throws Exception {
// The outbound buffer contains only one message or it contains a file region.
Object msg = in.current();
if (msg instanceof ByteBuf) {
return writeBytes(in, (ByteBuf) msg);
} else if (msg instanceof Def... |
java | public ApiResponse<ApiSuccessResponse> releaseWithHttpInfo(String id, ReleaseData releaseData) throws ApiException {
com.squareup.okhttp.Call call = releaseValidateBeforeCall(id, releaseData, null, null);
Type localVarReturnType = new TypeToken<ApiSuccessResponse>(){}.getType();
return apiClient... |
python | def should_execute(self, workload):
"""
If we have been suspended by i3bar, only execute those modules that set the keep_alive flag to a truthy
value. See the docs on the suspend_signal_handler method of the io module for more information.
"""
if not self._suspended.is_set():
... |
python | def _wait_for_lock(self, lock_file):
"""
Just sleep until the lock_file does not exist or a lock_file-related dynamic recovery flag is spotted
:param str lock_file: Lock file to wait upon.
"""
sleeptime = .5
first_message_flag = False
dot_count = 0
recove... |
java | @Override
public final String getFor(final Class<?> pClass, final String pThingName) {
if ("entityEdit".equals(pThingName) && pClass == Cart.class) {
return null;
} else if (pClass == CustOrder.class) {
if ("entitySave".equals(pThingName)) {
return PrCuOrSv.class.getSimpleName();
} e... |
java | public void addModifier(String modifier) {
if (!Strings.isEmpty(modifier)) {
getSarlAction().getModifiers().add(modifier);
}
} |
python | def generate_hexagonal_lattice(maxv1, minv1, maxv2, minv2, mindist):
"""
This function generates a 2-dimensional lattice of points using a hexagonal
lattice.
Parameters
-----------
maxv1 : float
Largest value in the 1st dimension to cover
minv1 : float
Smallest value in the ... |
java | protected Socket openSocket(String host, int port)
throws IOException {
return SocketFactory.getDefault().createSocket(host, port);
} |
python | def create(graph, reset_probability=0.15,
threshold=1e-2,
max_iterations=20,
_single_precision=False,
_distributed='auto',
verbose=True):
"""
Compute the PageRank for each vertex in the graph. Return a model object
with total PageRank as well as the Pag... |
java | public boolean isTopologyActive(StormClusterState stormClusterState, String topologyName) throws Exception {
boolean rtn = false;
if (Cluster.get_topology_id(stormClusterState, topologyName) != null) {
rtn = true;
}
return rtn;
} |
java | public static Map<String, ReadHandler<?, ?>> readHandlerMap(Map<String, ReadHandler<?, ?>> customHandlers) {
return new ReadHandlerMap(customHandlers);
} |
python | def pfadd(self, key, value, *values):
"""Adds the specified elements to the specified HyperLogLog."""
return self.execute(b'PFADD', key, value, *values) |
java | private Response addContent(String spaceID, String contentID, String storeID) {
StringBuilder msg = new StringBuilder("adding content(");
msg.append(spaceID);
msg.append(", ");
msg.append(contentID);
msg.append(", ");
msg.append(storeID);
msg.append(")");
... |
java | public static String wordWrapToTwoLines(String text, int minLength) {
String wordWrapText = text != null ? text.trim() : null;
if ((wordWrapText != null) && (wordWrapText.length() > minLength)) {
int middle = wordWrapText.length() / 2;
int leftSpaceIndex = wordWrapText.substring(... |
java | void generateSerializeOnJacksonInternal(BindTypeContext context, MethodSpec.Builder methodBuilder, String serializerName, TypeName beanClass, String beanName, BindProperty property, boolean onString) {
// define key and value type
ParameterizedTypeName mapTypeName=(ParameterizedTypeName) property.getPropertyType().... |
java | public java.util.List<InventoryAggregator> getAggregators() {
if (aggregators == null) {
aggregators = new com.amazonaws.internal.SdkInternalList<InventoryAggregator>();
}
return aggregators;
} |
python | def get_program_duration(program):
'''
Get a program's duration in seconds
'''
program_start = program.get('start_time')
program_end = program.get('end_time')
if not program_start or not program_end:
_LOGGER.error('Could not determine program start and/or end times.')
_LOGGER.deb... |
java | public static String adjustToRelativeDirectoryContext(final String path) {
// Return nulls
if (path == null) {
return path;
}
// Strip absolute form
final String removedPrefix = optionallyRemovePrecedingSlash(path);
// Add end of context slash
final S... |
java | @Override
public BatchDeleteAttributesResult batchDeleteAttributes(BatchDeleteAttributesRequest request) {
request = beforeClientExecution(request);
return executeBatchDeleteAttributes(request);
} |
java | public final <C extends CalendarComponent> ComponentList<C> getComponents(final String name) {
return getComponents().getComponents(name);
} |
java | protected static void constructM(List<Point2D_F64> obsPts,
DMatrixRMaj alphas, DMatrixRMaj M)
{
int N = obsPts.size();
M.reshape(3*alphas.numCols,2*N,false);
for( int i = 0; i < N; i++ ) {
Point2D_F64 p2 = obsPts.get(i);
int row = i*2;
for( int j = 0; j < alphas.numCols; j++ ) {
int col... |
python | def getreference(self, validate=True):
"""Return and validate the Phonetic Content's reference. Raises UnresolvableTextContent when invalid"""
if self.offset is None: return None #nothing to test
if self.ref:
ref = self.doc[self.ref]
else:
ref = self.finddefaultr... |
python | def get_items(self):
"""This is out of spec, but required for adaptive assessment parts?"""
ils = get_item_lookup_session(runtime=self._runtime, proxy=self._proxy)
ils.use_federated_bank_view()
items = []
if self.has_items():
for idstr in self._my_map['itemIds']:
... |
python | def success(self):
"""Return boolean indicating whether a solution was found"""
self._check_valid()
return self._problem._cp.solution.get_status() in (
self._problem._cp.solution.status.optimal,
self._problem._cp.solution.status.optimal_tolerance,
self._proble... |
python | def _assemble_linux_cmdline(kv):
"""
Given a dictionary, assemble a Linux boot command line.
"""
# try to be compatible with Py2.4
parts = []
for k, v in kv.items():
if v is None:
parts.append(str(k))
else:
parts.append('%s=%s' % (k, v))
return ' '.joi... |
java | @Pure
public static boolean intersectsTriangleOrientedBox(
double tx1, double ty1, double tz1,
double tx2, double ty2, double tz2,
double tx3, double ty3, double tz3,
double cx, double cy, double cz,
double ax1, double ay1, double az1,
double ax2, double ay2, double az2,
double ax3, double ay3, d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.