language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def jac(x,a):
""" Jacobian matrix given Christophe's suggestion of f """
return (x-a) / np.sqrt(((x-a)**2).sum(1))[:,np.newaxis] |
java | @NonNull
public static DeleteSelection deleteFrom(
@Nullable CqlIdentifier keyspace, @NonNull CqlIdentifier table) {
return new DefaultDelete(keyspace, table);
} |
python | def add(self):
""" Add a new VRF.
"""
c.action = 'add'
if 'action' in request.params:
if request.params['action'] == 'add':
v = VRF()
if request.params['rt'].strip() != '':
v.rt = request.params['rt']
if re... |
java | public static String[] getParameterNames(CtMethod ctMethod) throws NotFoundException {
MethodInfo methodInfo = ctMethod.getMethodInfo();
CodeAttribute codeAttribute = methodInfo.getCodeAttribute();
// logger.info("methodInfo.getConstPool().getSize():");
LocalVariableAttribute attribute = (LocalVariableAttri... |
python | def assert_200(response, max_len=500):
""" Check that a HTTP response returned 200. """
if response.status_code == 200:
return
raise ValueError(
"Response was {}, not 200:\n{}\n{}".format(
response.status_code,
json.dumps(dict(response.headers), indent=2),
response.content... |
java | boolean connectionFailed(IOException e) {
// Any future attempt to connect using this strategy will be a fallback attempt.
isFallback = true;
if (!isFallbackPossible) {
return false;
}
// If there was a protocol problem, don't recover.
if (e instanceof ProtocolException) {
return f... |
java | public static int execute(String[] commandArray, String[] alternativeEnvVars, File workingDir, Receiver outputReceiver) throws IOException {
Runtime rt = Runtime.getRuntime();
//command + arguments, environment parameters, workingdir
Process proc = null;
try {
proc = rt.exec(commandArray, alte... |
java | public void add(double datum) {
dbuf[nd++] = datum;
if (datum < q0) {
q0 = datum;
}
if (datum > qm) {
qm = datum;
}
if (nd == nbuf) {
update();
}
} |
python | def get_cookies(self):
'''
Retreive the cookies from the remote browser.
Return value is a list of http.cookiejar.Cookie() instances.
These can be directly used with the various http.cookiejar.XXXCookieJar
cookie management classes.
'''
ret = self.Network_getAllCookies()
assert 'result' in ret, "No re... |
java | public void done() {
final int processing_time = processingTimeMillis();
final String url = request.getUri();
final String msg = String.format("HTTP %s done in %d ms", url, processing_time);
if (url.startsWith("/api/put") && LOG.isDebugEnabled()) {
// NOTE: Suppresses too many log lines from /api/put.... |
python | def generate(self,
x,
y=None,
y_target=None,
eps=None,
clip_min=None,
clip_max=None,
nb_iter=None,
is_targeted=None,
early_stop_loss_threshold=None,
learning_rate=DEFAULT... |
python | def get_project_name_from_path(path, append_mx=False):
"""Get the project name from a path.
For a path "/home/peter/hans/HLC12398/online/M1_13.tdms" or
For a path "/home/peter/hans/HLC12398/online/data/M1_13.tdms" or
without the ".tdms" file, this will return always "HLC12398".
Parameters
----... |
java | public static boolean isPrimitive(Field field )
{
if(field == null)
return false;
String fieldName = field.getName();
if("serialVersionUID".equals(fieldName))
return false;
return isPrimitive(field.getType());
} |
java | protected void renderXML(String xml, String xslt, HttpServletResponse response)
throws FOPException, TransformerException, IOException {
//Setup sources
Source xmlSrc = convertString2Source(xml);
Source xsltSrc = convertString2Source(xslt);
//Setup the XSL transformatio... |
java | public JKTableColumn getTableColumn(final int col, final boolean visibleIndex) {
int actualIndex;
if (visibleIndex) {
actualIndex = this.visibilityManager.getActualIndexFromVisibleIndex(col);
} else {
actualIndex = col;
}
return this.tableColumns.get(actualIndex);
} |
java | public static <T>
Collector<T, ?, DoubleSummaryStatistics> summarizingDouble(ToDoubleFunction<? super T> mapper) {
return new CollectorImpl<T, DoubleSummaryStatistics, DoubleSummaryStatistics>(
DoubleSummaryStatistics::new,
(r, t) -> r.accept(mapper.applyAsDouble(t)),
... |
java | public BasicDependencyContainer add(Dependency dependency)
{
if (dependency == this)
throw new IllegalArgumentException("Can't add self as a dependency.");
if (! _dependencyList.contains(dependency))
_dependencyList.add(dependency);
// server/1d0w
// XXX: _lastCheckTime = 0;
return ... |
python | def reflect_right(self, value):
"""Only reflects the value if is < self."""
if value < self:
value = self.reflect(value)
return value |
java | public static double convertToDouble (@Nonnull final Object aSrcValue)
{
if (aSrcValue == null)
throw new TypeConverterException (double.class, EReason.NULL_SOURCE_NOT_ALLOWED);
final Double aValue = convert (aSrcValue, Double.class);
return aValue.doubleValue ();
} |
python | def skip_redundant(iterable, skipset=None):
"""
Redundant items are repeated items or items in the original skipset.
"""
if skipset is None:
skipset = set()
for item in iterable:
if item not in skipset:
skipset.add(item)
yield item |
java | public static SourceFile scanSingleFileConfig(CxxLanguage language, InputFile file, CxxConfiguration cxxConfig,
SquidAstVisitor<Grammar>... visitors) {
if (!file.isFile()) {
throw new IllegalArgumentException("File '" + file + "' not found.");
}
AstScanner<Grammar> scanner = create(language, cxxCo... |
java | @Override
protected UUID doDeserialize( String key, JsonDeserializationContext ctx ) {
return UUID.fromString( key );
} |
java | public Matrix4f billboardCylindrical(Vector3fc objPos, Vector3fc targetPos, Vector3fc up) {
float dirX = targetPos.x() - objPos.x();
float dirY = targetPos.y() - objPos.y();
float dirZ = targetPos.z() - objPos.z();
// left = up x dir
float leftX = up.y() * dirZ - up.z() * dirY;
... |
java | public RouteMatcher connectWithRegEx(String regex, Handler<HttpServerRequest> handler) {
addRegEx(regex, handler, connectBindings);
return this;
} |
java | public void add(final Class<?> clazz) {
if (this.clazzes.contains(clazz)) {
throw new IllegalArgumentException(
"Only one class-instance per benchmark allowed");
} else {
this.clazzes.add(clazz);
}
} |
java | public void setRemoteMessageTask(RemoteTask messageTaskPeer) throws RemoteException
{
BaseTransport transport = this.createProxyTransport(SET_REMOTE_MESSAGE_TASK);
String strTaskID = null;
if (messageTaskPeer instanceof BaseProxy)
{ // Always a TaskProxy
strTaskID = ((B... |
python | def remove(self, name_or_klass):
"""
Removes the specified panel.
:param name_or_klass: Name or class of the panel to remove.
:return: The removed panel
"""
logger.debug('removing panel %s' % name_or_klass)
panel = self.get(name_or_klass)
panel.on_uninsta... |
java | @Override
protected void unserializeFrom(RawDataBuffer in)
{
super.unserializeFrom(in);
message = MessageSerializer.unserializeFrom(in, true);
} |
python | def validate(config):
'''
Validate the beacon configuration
'''
_config = {}
list(map(_config.update, config))
if not isinstance(config, list):
return False, ('Configuration for avahi_announce '
'beacon must be a list.')
elif not all(x in _config for x in ('s... |
python | def intersect(self, other):
"""Calculate the intersection of this rectangle and another rectangle.
Args:
other (Rect): The other rectangle.
Returns:
Rect: The intersection of this rectangle and the given other rectangle, or None if there is no such
inter... |
java | private void applyPatchForFeatures() {
for (int i = 0; i < totalFeatures.length; i++) {
int total = totalFeatures[i];
int failures = getFailedFeatures()[i];
if (total < failures) {
// this data must be changed since it was generated by invalid code
... |
python | def levels_for(self, time_op, groups, df):
"""
Compute the partition at each `level` from the dataframe.
"""
levels = {}
for i in range(0, len(groups) + 1):
agg_df = df.groupby(groups[:i]) if i else df
levels[i] = (
agg_df.mean() if time_op... |
java | private static String internalBind(String message, Object[] args, String argZero, String argOne) {
if (message == null)
return "No message available."; //$NON-NLS-1$
if (args == null || args.length == 0)
args = EMPTY_ARGS;
int length = message.length();
//estimate correct size of string buffer to avoid g... |
python | def launch_minecraft(port, installdir="MalmoPlatform", replaceable=False):
"""Launch Minecraft listening for malmoenv connections.
Args:
port: the TCP port to listen on.
installdir: the install dir name. Defaults to MalmoPlatform.
Must be same as given (or defaulted) in download call if... |
java | @Override
public final void error(String error) throws IOException {
add(false);
setError(newCurrentPosition, error, newCurrentExisting);
} |
java | public void marshall(ProtectedResource protectedResource, ProtocolMarshaller protocolMarshaller) {
if (protectedResource == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(protectedResource.getResourc... |
python | def close(self):
"""Close connection to this room"""
if hasattr(self, "conn"):
self.conn.close()
del self.conn
if hasattr(self, "user"):
del self.user |
java | public void init(ServletConfig servletConfig) throws ServletException {
// Save our ServletConfig instance
this.servletConfig = servletConfig;
// Acquire our FacesContextFactory instance
try {
facesContextFactory = (FacesContextFactory)
FactoryFinder.getFact... |
python | def to_internal_value(self, value):
"""Basically, each tag dict must include a full dict with id,
name and slug--or else you need to pass in a dict with just a name,
which indicated that the Tag doesn't exist, and should be added."""
if "id" in value:
tag = Tag.objects.get(i... |
python | def ca_id(self, ca_id):
"""
Sets the ca_id of this DeviceData.
The certificate issuer's ID.
:param ca_id: The ca_id of this DeviceData.
:type: str
"""
if ca_id is not None and len(ca_id) > 500:
raise ValueError("Invalid value for `ca_id`, length must ... |
java | protected void paintCustomItem(final WTree tree, final WTree.ExpandMode mode, final TreeItemModel model, final TreeItemIdNode node,
final XmlStringBuilder xml, final Set<String> selectedRows, final Set<String> expandedRows) {
String itemId = node.getItemId();
List<Integer> rowIndex = tree.getRowIndexForCustomIt... |
java | public void billingAccount_ovhPabx_serviceName_menu_menuId_PUT(String billingAccount, String serviceName, Long menuId, OvhOvhPabxMenu body) throws IOException {
String qPath = "/telephony/{billingAccount}/ovhPabx/{serviceName}/menu/{menuId}";
StringBuilder sb = path(qPath, billingAccount, serviceName, menuId);
ex... |
java | public MoneyAmountStyle withZeroCharacter(Character zeroCharacter) {
int zeroVal = (zeroCharacter == null ? -1 : zeroCharacter);
if (zeroVal == this.zeroCharacter) {
return this;
}
return new MoneyAmountStyle(
zeroVal,
positiveCharacter,... |
java | public static HtmlTree META(String httpEquiv, String content, String charSet) {
HtmlTree htmltree = new HtmlTree(HtmlTag.META);
String contentCharset = content + "; charset=" + charSet;
htmltree.addAttr(HtmlAttr.HTTP_EQUIV, nullCheck(httpEquiv));
htmltree.addAttr(HtmlAttr.CONTENT, conten... |
java | public static void checkArgument(boolean condition,
@Nullable String errorMessageTemplate,
@Nullable Object... errorMessageArgs) {
if (!condition) {
throw new IllegalArgumentException(format(errorMessageTemplate, errorMessageArgs));
}
} |
java | private FormValidation checkSpecificSignature(JSONObject json, JSONObject signatureJson, MessageDigest digest, String digestEntry, Signature signature, String signatureEntry, String digestName) throws IOException {
// this is for computing a digest to check sanity
DigestOutputStream dos = new DigestOutp... |
java | @Override
public DeleteLabelsResult deleteLabels(DeleteLabelsRequest request) {
request = beforeClientExecution(request);
return executeDeleteLabels(request);
} |
python | def is_vowel(char):
"""
Check whether the character is a vowel letter.
"""
if is_letter(char, strict=True):
return char in chart.vowels
return False |
java | private static String getDeploymentClassNameFromXml(ArquillianDescriptor descriptor) {
ExtensionDef extension = descriptor.extension("suite");
if (extension != null) {
return extension.getExtensionProperties().get("deploymentClass");
}
return null;
} |
python | def release_lock(self, verbose=VERBOSE, raiseError=RAISE_ERROR):
"""
Release the lock when set and close file descriptor if opened.
:Parameters:
#. verbose (bool): Whether to be verbose about errors when encountered
#. raiseError (bool): Whether to raise error exception ... |
java | @Override
public void setValue(final int index, final E value)
{
setParsed(true);
getValues().set(index, value);
} |
java | public ComponentMetadata getComponentMetadata(Class<?> componentClass) {
ComponentMetadata md = componentMetadataMap.get(componentClass.getName());
if (md == null) {
if (componentClass.getSuperclass() != null) {
return getComponentMetadata(componentClass.getSuperclass());
} els... |
java | public static String asHexWithAlpha( Color color ) {
int r = color.getRed();
int g = color.getGreen();
int b = color.getBlue();
int a = color.getAlpha();
String hex = String.format("#%02x%02x%02x%02x", r, g, b, a);
return hex;
} |
python | def http(self):
"""A thread local instance of httplib2.Http.
Returns:
httplib2.Http: An Http instance authorized by the credentials.
"""
if self._use_cached_http and hasattr(self._local, 'http'):
return self._local.http
if self._http_replay is not None:
... |
python | def config(client, event, channel, nick, rest):
"Change the running config, something like a=b or a+=b or a-=b"
pattern = re.compile(r'(?P<key>\w+)\s*(?P<op>[+-]?=)\s*(?P<value>.*)$')
match = pattern.match(rest)
if not match:
return "Command not recognized"
res = match.groupdict()
key = res['key']
op = res['op... |
java | public void setCVAL3(Integer newCVAL3) {
Integer oldCVAL3 = cval3;
cval3 = newCVAL3;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.TILE_SET_COLOR__CVAL3, oldCVAL3, cval3));
} |
java | public static int cufftExecZ2D(cufftHandle plan, double cIdata[], double rOdata[])
{
int cudaResult = 0;
boolean inPlace = (cIdata == rOdata);
// Allocate space for the input data on the device
Pointer hostCIdata = Pointer.to(cIdata);
Pointer deviceCIdata = new Poin... |
python | def bban(value, country=None, validate=False):
'''
Printable Basic Bank Account Number (BBAN) for the given country code. The
``country`` must be a valid ISO 3166-2 country code.
:param value: string or int
:param country: string
>>> bban('068-9999995-01', 'BE')
'068999999501'
>>> bban... |
java | protected void recursivelyCompareJSONArray(String key, JSONArray expected, JSONArray actual,
JSONCompareResult result) throws JSONException {
Set<Integer> matched = new HashSet<Integer>();
for (int i = 0; i < expected.length(); ++i) {
Object exp... |
java | public SourceAlgorithmSpecification withSourceAlgorithms(SourceAlgorithm... sourceAlgorithms) {
if (this.sourceAlgorithms == null) {
setSourceAlgorithms(new java.util.ArrayList<SourceAlgorithm>(sourceAlgorithms.length));
}
for (SourceAlgorithm ele : sourceAlgorithms) {
th... |
java | public NetworkWatcherInner createOrUpdate(String resourceGroupName, String networkWatcherName, NetworkWatcherInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().single().body();
} |
python | def _piped_input_cl(data, region, tmp_dir, out_base_file, prep_params):
"""Retrieve the commandline for streaming input into preparation step.
"""
return data["work_bam"], _gatk_extract_reads_cl(data, region, prep_params, tmp_dir) |
java | public static void bindToProperty (
String property, PrefsConfig config, AbstractButton button, boolean defval)
{
// create a config binding which will take care of everything
new ButtonConfigBinding(property, config, button, defval);
} |
java | public PactDslJsonArray stringMatcher(String regex, String value) {
if (!value.matches(regex)) {
throw new InvalidMatcherException(EXAMPLE + value + "\" does not match regular expression \"" +
regex + "\"");
}
body.put(value);
matchers.addRule(rootPath + appen... |
python | def setExpanded(self, index, expanded):
""" Expands the model item specified by the index.
Overridden from QTreeView to make it persistent (between inspector changes).
"""
if index.isValid():
item = self.getItem(index)
item.expanded = expanded |
python | def chats_search(self, q=None, **kwargs):
"https://developer.zendesk.com/rest_api/docs/chat/chats#search-chats"
api_path = "/api/v2/chats/search"
api_query = {}
if "query" in kwargs.keys():
api_query.update(kwargs["query"])
del kwargs["query"]
if q:
... |
python | def delete(self, conn, key):
"""Deletes a key/value pair from the server.
:param key: is the key to delete.
:return: True if case values was deleted or False to indicate
that the item with this key was not found.
"""
assert self._validate_key(key)
command = b'de... |
python | def next_power_of_2(n):
""" Return next power of 2 greater than or equal to n """
n -= 1 # greater than OR EQUAL TO n
shift = 1
while (n + 1) & n: # n+1 is not a power of 2 yet
n |= n >> shift
shift *= 2
return max(4, n + 1) |
python | def track_exists(self, localdir):
""" Check if track exists in local directory. """
path = glob.glob(self.gen_localdir(localdir) +
self.gen_filename() + "*")
if len(path) > 0 and os.path.getsize(path[0]) > 0:
return True
return False |
python | def force_slash(fn):
"""
Force Slash
-----------
Wrap a bottle route with this decorator to force a trailing slash. This is useful for the root of your application or places where TrailingSlash doesn't work
"""
@wraps(fn)
def wrapped(*args, **kwargs):
if request.environ['PATH_INFO']... |
python | def imdct(y, L):
"""Inverse Modified Discrete Cosine Transform (MDCT)
Returns the Inverse Modified Discrete Cosine Transform
with fixed window size L of the vector of coefficients y.
The window is based on a sine window.
Parameters
----------
y : ndarray, shape (L/2, 2 * N / L)
Th... |
java | private long addFilesInDir(Path path, List<FileStatus> files, boolean logExcludedFiles)
throws IOException {
final FileSystem fs = path.getFileSystem();
long length = 0;
for(FileStatus dir: fs.listStatus(path)) {
if (dir.isDir()) {
if (acceptFile(dir) && enumerateNestedFiles) {
length += addFiles... |
java | public synchronized void recordCommit(int commitLength) {
Preconditions.checkArgument(commitLength >= 0, "commitLength must be a non-negative number.");
// Update counters.
this.commitCount++;
this.accumulatedLength += commitLength;
int minCount = this.config.getCheckpointMinCo... |
java | @Override
public void updateComponent(final Object data) {
MyDataBean myBean = (MyDataBean) data;
StringBuffer out = new StringBuffer();
out.append("Name: ").append(myBean.getName()).append("\n\n");
for (SomeDataBean bean : myBean.getMyBeans()) {
out.append("Field1: ").append(bean.getField1());
out.appe... |
java | public ImageBuilder withImageBuilderErrors(ResourceError... imageBuilderErrors) {
if (this.imageBuilderErrors == null) {
setImageBuilderErrors(new java.util.ArrayList<ResourceError>(imageBuilderErrors.length));
}
for (ResourceError ele : imageBuilderErrors) {
this.imageBu... |
python | def touch_tip(self,
location: Well = None,
radius: float = 1.0,
v_offset: float = -1.0,
speed: float = 60.0) -> 'InstrumentContext':
"""
Touch the pipette tip to the sides of a well, with the intent of
removing left-over dro... |
python | def debug_query_result(rows: Sequence[Any]) -> None:
"""Writes a query result to the log."""
log.info("Retrieved {} rows", len(rows))
for i in range(len(rows)):
log.info("Row {}: {}", i, rows[i]) |
python | def get_time_variables(ds):
'''
Returns a list of variables describing the time coordinate
:param netCDF4.Dataset ds: An open netCDF4 Dataset
'''
time_variables = set()
for variable in ds.get_variables_by_attributes(standard_name='time'):
time_variables.add(variable.name)
for varia... |
python | def added(self) -> int:
"""
Return the total number of added lines in the file.
:return: int lines_added
"""
added = 0
for line in self.diff.replace('\r', '').split("\n"):
if line.startswith('+') and not line.startswith('+++'):
added += 1
... |
java | public void removeProject(Project project, boolean cascade) throws GreenPepperServerException {
try {
sessionService.startSession();
sessionService.beginTransaction();
if (cascade) {
List<Repository> repositories = repositoryDao.getAll(project.getName());
... |
java | private void setCredential(Subject subject, WSPrincipal principal) throws CredentialException {
String securityName = principal.getName();
Hashtable<String, ?> customProperties = getUniqueIdHashtableFromSubject(subject);
if (customProperties == null || customProperties.isEmpty()) {
U... |
python | def execute_deploy_clone_from_vm(self, si, logger, vcenter_data_model, reservation_id, deployment_params, cancellation_context, folder_manager):
"""
Calls the deployer to deploy vm from another vm
:param cancellation_context:
:param str reservation_id:
:param si:
:param l... |
python | def replace(self, space, t, *, timeout=-1.0) -> _MethodRet:
"""
Replace request coroutine. Same as insert, but replace.
:param space: space id or space name.
:param t: tuple to insert (list object)
:param timeout: Request timeout
:returns: :class:`as... |
python | def mpoint_(self, col, x=None, y=None, rsum=None, rmean=None):
"""
Splits a column into multiple series based on the column's
unique values. Then visualize theses series in a chart.
Parameters: column to split, x axis column, y axis column
Optional: rsum="1D" to resample and sum data an rmean="1D"
to mean t... |
python | def _automaticallyDeriveSpatialReferenceId(self, directory):
"""
This method is used to automatically lookup the spatial reference ID of the GSSHA project. This method is a
wrapper for the ProjectionFile class method lookupSpatialReferenceID(). It requires an internet connection
(the loo... |
python | def update_window_size(self):
"""
Update the current window object with its current
height and width and clear the screen if they've changed.
"""
height, width = self.window.getmaxyx()
if self.height != height or self.width != width:
self.height, self.width = ... |
java | @Override
public List<CPInstance> findByCPDefinitionId(long CPDefinitionId) {
return findByCPDefinitionId(CPDefinitionId, QueryUtil.ALL_POS,
QueryUtil.ALL_POS, null);
} |
python | def raise_for_missing_namespace(self, line: str, position: int, namespace: str, name: str) -> None:
"""Raise an exception if the namespace is not defined."""
if not self.has_namespace(namespace):
raise UndefinedNamespaceWarning(self.get_line_number(), line, position, namespace, name) |
python | def generate():
################################################################################
### Build new network
net = Network(id='Example7_Brunel2000')
net.notes = 'Example 7: based on network of Brunel 2000'
net.parameters = { 'g': 4,
'eta': 1,
... |
python | def parse_sort_string(sort):
"""
Parse a sort string for use with elasticsearch
:param: sort: the sort string
"""
if sort is None:
return ['_score']
l = sort.rsplit(',')
sortlist = []
for se in l:
se = se.strip()
order = 'desc' if se[0:1] == '-' else 'asc'
... |
java | public boolean hasRequiredClientProps() {
boolean valid = true;
valid &= verifyStringPropSet(CONNECTION_APPLICATION_NAME_PROP, CLIENT_APPLICATION_NAME_PROP);
valid &= verifyStringPropSet(ACCUMULO_USER_PROP, CLIENT_ACCUMULO_USER_PROP);
valid &= verifyStringPropSet(ACCUMULO_PASSWORD_PROP, CLIENT_ACCUMULO_... |
python | def make_dict(cls, table):
"""Build a dictionary map int to `JobDetails` from an `astropy.table.Table`"""
ret_dict = {}
for row in table:
job_details = cls.create_from_row(row)
ret_dict[job_details.dbkey] = job_details
return ret_dict |
java | public String translate(Update u) {
final List<Expression> columns = u.getColumns();
final Expression table = u.getTable();
final Expression where = u.getWhere();
inject(table, where);
final List<String> temp = new ArrayList<>();
temp.add("UPDATE");
temp.add(ta... |
java | public static Map<String, String> pairsToMap(List<CmsPair<String, String>> pairs) {
LinkedHashMap<String, String> result = new LinkedHashMap<String, String>();
for (CmsPair<String, String> pair : pairs) {
result.put(pair.getFirst(), pair.getSecond());
}
return result;
} |
python | def delete_namespaced_lease(self, name, namespace, **kwargs): # noqa: E501
"""delete_namespaced_lease # noqa: E501
delete a Lease # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread ... |
java | public void marshall(DescribeBuildRequest describeBuildRequest, ProtocolMarshaller protocolMarshaller) {
if (describeBuildRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(describeBuildReques... |
python | def persist(self, storageLevel):
"""
Persists the underlying RDD with the specified storage level.
"""
if not isinstance(storageLevel, StorageLevel):
raise TypeError("`storageLevel` should be a StorageLevel, got %s" % type(storageLevel))
javaStorageLevel = self._java_... |
java | private void traverseResources(Resource resource, int counter) throws XMLStreamException, RepositoryException,
IllegalResourceTypeException, URISyntaxException, UnsupportedEncodingException
{
xmlStreamWriter.writeStartElement("DAV:", "response");
xmlStreamWriter.writeStartElement("DAV:", "h... |
python | def installed(name, # pylint: disable=C0103
ruby=None,
gem_bin=None,
user=None,
version=None,
rdoc=False,
ri=False,
pre_releases=False,
proxy=None,
source=None): # pylint: disable=C... |
java | public void encodeBuffer(ByteBuffer aBuffer, OutputStream aStream)
throws IOException {
byte [] buf = getBytes(aBuffer);
encodeBuffer(buf, aStream);
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.