language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def _init_modules_stub(self, **_):
"""Initializes the modules stub based off of your current yaml files
Implements solution from
http://stackoverflow.com/questions/28166558/invalidmoduleerror-when-using-testbed-to-unit-test-google-app-engine
"""
from google.appengine.api import ... |
java | public static vlan_channel_binding[] get(nitro_service service, Long id) throws Exception{
vlan_channel_binding obj = new vlan_channel_binding();
obj.set_id(id);
vlan_channel_binding response[] = (vlan_channel_binding[]) obj.get_resources(service);
return response;
} |
python | async def traverse_settings(dev, module, settings, depth=0):
"""Print all available settings."""
for setting in settings:
if setting.is_directory:
print("%s%s (%s)" % (depth * " ", setting.title, module))
return await traverse_settings(dev, module, setting.settings, depth + 2)
... |
java | public void setRolePolicyList(java.util.Collection<PolicyDetail> rolePolicyList) {
if (rolePolicyList == null) {
this.rolePolicyList = null;
return;
}
this.rolePolicyList = new com.amazonaws.internal.SdkInternalList<PolicyDetail>(rolePolicyList);
} |
java | public static Number numberFromSql(Connection connection, String sql, Object... args) throws SQLException
{
return OrmReader.numberFromSql(connection, sql, args);
} |
python | def start_span(self, request, headers, peer_host, peer_port):
"""
Start a new server-side span. If the span has already been started
by `start_basic_span`, this method only adds baggage from the headers.
:param request: inbound tchannel.tornado.request.Request
:param headers: di... |
java | protected final void completedReceived(AIStreamKey key, boolean reissueGet)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "completedReceived", new Object[] {key, Boolean.valueOf(reissueGet)});
completedReceivedNoPrefetch(key, reissueGet);
try
{
i... |
java | public static View create(String name, String map, String reduce) {
return new DefaultView(name, map, reduce);
} |
java | protected void updateText()
{
this.text.setLength(0);
this.text.append(password.toString().replaceAll("(?s).", String.valueOf(passwordChar)));
guiText.setText(text.toString());
} |
python | def get(self):
"""Returns existing value, or None if deadline has expired."""
if self.timer() > self.deadline:
self.value = None
return self.value |
java | protected Throwable composeErrors(Throwable... errors) {
if (errors == null) {
return new NullPointerException("errors");
} else if (errors.length == 1) {
return errors[0];
} else {
return new ComposedException(errors);
}
} |
python | def sample_discrete_from_log(p_log,axis=0,dtype=np.int32):
'samples log probability array along specified axis'
cumvals = np.exp(p_log - np.expand_dims(p_log.max(axis),axis)).cumsum(axis) # cumlogaddexp
thesize = np.array(p_log.shape)
thesize[axis] = 1
randvals = random(size=thesize) * \
... |
python | def build_table(self):
"""Build table."""
headers = ['Title', 'Seeders', 'Leechers', 'Age', 'Size']
titles = []
seeders = []
leechers = []
ages = []
sizes = []
if self.page == 'torrent_project':
titles = [list(span.find('a').stripped_strings)[... |
java | @Nullable
public Bitmap updateBitmap(String id, @Nullable Bitmap bitmap) {
return lottieDrawable.updateBitmap(id, bitmap);
} |
python | def download(self,
task,
default_ext,
timeout=5,
max_retry=3,
overwrite=False,
**kwargs):
"""Download the image and save it to the corresponding path.
Args:
task (dict): The task dict got f... |
python | def filter_by_rand(self, p:float, seed:int=None):
"Keep random sample of `items` with probability `p` and an optional `seed`."
if seed is not None: np.random.seed(seed)
return self.filter_by_func(lambda o: rand_bool(p)) |
python | def get_traceback(f):
"""
Multiprocessing doesn't forward exception traceback information. This does.
From: http://pragmaticpython.com/2017/02/19/
"""
@functools.wraps(f)
def wrapper(*args, **kwargs):
try:
return f(*args, **kwargs)
except Exception, ex:
ret = '#' * 60
ret += "\nExc... |
python | def settings_to_cmd_args(settings_dict):
"""
Copied from django 1.8 MySQL backend DatabaseClient - where the runshell
commandline creation has been extracted and made callable like so.
"""
args = ['mysql']
db = settings_dict['OPTIONS'].get('db', settings_dict['NAME'])
user = settings_dict['O... |
python | def applicationinsights_mgmt_plane_client(cli_ctx, _, subscription=None):
"""Initialize Log Analytics mgmt client for use with CLI."""
from .vendored_sdks.mgmt_applicationinsights import ApplicationInsightsManagementClient
from azure.cli.core._profile import Profile
profile = Profile(cli_ctx=cli_ctx)
... |
java | public Mono<String> getUaaUrl() {
this.uaaUrl = this.webClient.get().uri(this.cloudControllerUrl + "/info")
.retrieve().bodyToMono(Map.class)
.map((response) -> (String) response.get("token_endpoint")).cache()
.onErrorMap((ex) -> new CloudFoundryAuthorizationException(
Reason.SERVICE_UNAVAILABLE,
... |
python | def Cache(fn):
""" Function cache decorator """
def fnCache(*args, **kwargs):
""" Cache function """
key = (args and tuple(args) or None,
kwargs and frozenset(kwargs.items()) or None)
if key not in fn.__cached__:
fn.__cached__[key] = cache = fn(*args, **kwargs)
else:
... |
java | private static boolean javaTimeTypes(ExpressionTree tree, VisitorState state) {
if (packageStartsWith("java.time").matches(tree, state)) {
return false;
}
Symbol symbol = ASTHelpers.getSymbol(tree);
if (symbol instanceof MethodSymbol) {
MethodSymbol methodSymbol = (MethodSymbol) symbol;
... |
java | @Override
public void register( YogaEntityConfiguration<?>... entityConfigurations )
{
for ( YogaEntityConfiguration<?> entityConfiguration : entityConfigurations )
{
Class<?> type = entityConfiguration.getEntityClass();
if ( type == null )
{
... |
java | protected Map<String,String> buildRoot(HttpServletRequest request,
XMLOutputter doc) {
final String path = request.getPathInfo() != null
? request.getPathInfo() : "/";
final String exclude = request.getParameter("exclude") != null
? request.getParameter("exclude") : "\\..*\\.crc";
final St... |
python | def ExtractEvents(self, parser_mediator, registry_key, **kwargs):
"""Extracts events from a Windows Registry key.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
registry_key (dfwinreg.WinRegistryKey): Windows ... |
python | def perform_get_or_create(self, request, *args, **kwargs):
"""Perform "get_or_create" - return existing object if found."""
serializer = self.get_serializer(data=request.data)
serializer.is_valid(raise_exception=True)
process = serializer.validated_data.get('process')
process_inp... |
python | def process(argv, scope, interface=None):
"""
Processes any commands within the scope that matches the inputted arguments.
If a subcommand is found, then it is run, and the system exists with the
return value from the command.
:param argv | [<str>, ..]
scope | <dict>
... |
python | def purge_all(user=None, fast=False):
"""
Remove all calculations of the given user
"""
user = user or getpass.getuser()
if os.path.exists(datadir):
if fast:
shutil.rmtree(datadir)
print('Removed %s' % datadir)
else:
for fname in os.listdir(datadir... |
python | def read_h5ad(filename, backed: Optional[str] = None, chunk_size: int = 6000):
"""Read ``.h5ad``-formatted hdf5 file.
Parameters
----------
filename
File name of data file.
backed : {``None``, ``'r'``, ``'r+'``}
If ``'r'``, load :class:`~anndata.AnnData` in ``backed`` mode instead
... |
python | def _fit_diagV_noGP(
self, XTY, XTDY, XTFY, YTY_diag, YTDY_diag, YTFY_diag,
XTX, XTDX, XTFX, X, Y, X_base, X_res, D, F, run_TRs,
current_vec_U_chlsk_l,
current_a1, current_logSNR2,
idx_param_fitU, idx_param_fitV,
l_idx, n_C, n_T, n_V, n_l, n_run, n... |
python | def string_to_config(s):
"""s is a comma-separated list of stores."""
from .machines import Configuration
s = lexer(s)
x = parse_multiple(s, parse_store)
parse_end(s)
return Configuration(x) |
python | def ping(self):
"""Ping a device."""
msg = StandardSend(self._address, COMMAND_PING_0X0F_0X00)
self._send_msg(msg) |
python | def has_user(self, user, role=None, timestamp=False):
"""
Checks whether user has role in entity.
`timestamp` can have following values:
- False - check whether user has role in entity at the moment.
- None - check whether user has permanent role in entity.
- ... |
python | def add_rup_params(self, rupture):
"""
Add .REQUIRES_RUPTURE_PARAMETERS to the rupture
"""
for param in self.REQUIRES_RUPTURE_PARAMETERS:
if param == 'mag':
value = rupture.mag
elif param == 'strike':
value = rupture.surface.get_str... |
python | def configure_createfor(self, ns, definition):
"""
Register a create-for relation endpoint.
The definition's func should be a create function, which must:
- accept kwargs for the new instance creation parameters
- return the created instance
:param ns: the namespace
... |
python | def merge_files(service, skip_on_user_group_error=False):
"""
Given a prefix, find all templates below; merge with parameters; write to "dest"
Args:
service: "<service>", "all", or "ssh"
skip_on_user_group_error: True or False
For S3, full path becomes:
s3://ellation-cx-global-configs/<service>/tem... |
java | public static int distance (int a, int b, int N)
{
return (a > b) ? Math.min(a-b, b+N-a) : Math.min(b-a, a+N-b);
} |
java | @Nullable
@ReturnsMutableCopy
public static Object [] getAsObjectArray (@Nullable final Collection <?> aCollection)
{
if (CollectionHelper.isEmpty (aCollection))
return null;
final Object [] ret = new Object [aCollection.size ()];
return aCollection.toArray (ret);
} |
python | def widen(self, other):
""" Widen current range. """
if self.low < other.low:
low = -float("inf")
else:
low = self.low
if self.high > other.high:
high = float("inf")
else:
high = self.high
return Interval(low, high) |
java | private Object[] findInBundle(Spec specToOpen,
Spec specToFind,
String variant,
int direction) {
// assert(specToOpen.isLocale());
ResourceBundle res = specToOpen.getBundle();
if (res == null) ... |
python | def resolve_requirements(self, interpreter, req_libs):
"""Requirements resolution for PEX files.
:param interpreter: Resolve against this :class:`PythonInterpreter`.
:param req_libs: A list of :class:`PythonRequirementLibrary` targets to resolve.
:returns: a PEX containing target requirements and any s... |
java | public ArrayList<Integer> getAllIndices() {
ArrayList<Integer> res = new ArrayList<Integer>(this.realTSindex.size());
res.addAll(this.realTSindex.keySet());
Collections.sort(res);
return res;
} |
java | public void write(Writer out)
throws XmlModelWriterException, IOException
{
try
{
DOMSource domSource = new DOMSource(_doc);
StreamResult streamResult = new StreamResult(out);
TransformerFactory tf = TransformerFactory.newInstance();
tf.set... |
python | def qteKeyPress(self, msgObj):
"""
Record the key presses reported by the key handler.
"""
# Unpack the data structure.
(srcObj, keysequence, macroName) = msgObj.data
# Append the last QKeyEvent object to the so far recorded
# sequence. Note that both ``keysequen... |
java | protected void newBondData() {
bondCounter = 0;
bondid = new ArrayList<String>();
bondARef1 = new ArrayList<String>();
bondARef2 = new ArrayList<String>();
order = new ArrayList<String>();
bondStereo = new ArrayList<String>();
bondCustomProperty = new Hashtable<St... |
python | def teardown(self):
"""
Teardown the link.
Removes endpoints from properties I{links} collection.
@return: self
@rtype: L{Link}
"""
pA, pB = self.endpoints
if pA in pB.links:
pB.links.remove(pA)
if pB in pA.links:
pA.links.r... |
java | public Path resolveConflictsIfNecessary(Path ciphertextPath, String dirId) throws IOException {
String ciphertextFileName = ciphertextPath.getFileName().toString();
String basename = StringUtils.removeEnd(ciphertextFileName, LONG_NAME_FILE_EXT);
Matcher m = CIPHERTEXT_FILENAME_PATTERN.matcher(basename);
if (!m.... |
java | @NonNull
public RequestCreator transform(@NonNull List<? extends Transformation> transformations) {
data.transform(transformations);
return this;
} |
java | public final void addTriangle(double x1, double y1, double x2, double y2, double x3, double y3) {
addEdge(x1, y1, x2, y2);
addEdge(x2, y2, x3, y3);
addEdge(x1, y1, x3, y3);
} |
python | def xpath(self, selector: str, *, clean: bool = False, first: bool = False, _encoding: str = None) -> _XPath:
"""Given an XPath selector, returns a list of
:class:`Element <Element>` objects or a single one.
:param selector: XPath Selector to use.
:param clean: Whether or not to sanitiz... |
python | def raw_command(netfn, command, bridge_request=None, data=(), retry=True, delay_xmit=None, **kwargs):
'''
Send raw ipmi command
This allows arbitrary IPMI bytes to be issued. This is commonly used
for certain vendor specific commands.
:param netfn: Net function number
:param command: Command ... |
python | def get_edit_url(self):
"""Get model object edit url"""
return reverse('trionyx:model-edit', kwargs={
'app': self.get_app_label(),
'model': self.get_model_name(),
'pk': self.object.id
}) |
java | private void listJobs() throws IOException {
JobStatus[] jobs = jobsToComplete();
if (jobs == null)
jobs = new JobStatus[0];
System.out.printf("%d jobs currently running\n", jobs.length);
displayJobList(jobs);
} |
python | def _create_if_necessary(directory):
"""Create the specified directory, if necessary.
:param str directory: The directory to use.
:rtype: bool
:returns: True if no errors occurred and the directory was created or
existed beforehand, False otherwise.
"""
if not os.path.isabs(direc... |
java | public Map<String, String> getUriVariablesForSearchWithPost(BullhornEntityInfo entityInfo, Set<String> fieldSet, SearchParams params) {
Map<String, String> uriVariables = params.getParameterMap();
this.addCommonUriVariables(fieldSet, entityInfo, uriVariables);
return uriVariables;
} |
python | def _submit(ctx, parent_id, name, url, func, *args, **kwargs):
"""Submit a function to a cluster
Parameters
----------
parent_id : str
The ID of the group that the job is a part of.
name : str
The name of the job
url : str
The handler that can take the results (e.g., /be... |
java | public <T> Key<T> manualRefToKey(final Class<T> type, final Object id) {
return id == null ? null : new Key<T>(type, getCollectionName(type), id);
} |
java | public static base_response add(nitro_service client, location resource) throws Exception {
location addresource = new location();
addresource.ipfrom = resource.ipfrom;
addresource.ipto = resource.ipto;
addresource.preferredlocation = resource.preferredlocation;
addresource.longitude = resource.longitude;
a... |
java | public static void generateWhereCondition(final MethodSpec.Builder methodBuilder, final SQLiteModelMethod method, boolean sqlWhereParamsAlreadyDefined) {
final JQL jql = method.jql;
final JQLChecker jqlChecker = JQLChecker.getInstance();
if (jql.isWhereConditions()) {
// parameters extracted from query
fin... |
python | def comments(recid):
"""Display comments."""
from invenio_access.local_config import VIEWRESTRCOLL
from invenio_access.mailcookie import \
mail_cookie_create_authorize_action
from .api import check_user_can_view_comments
auth_code, auth_msg = check_user_can_view_comments(current_user, recid)... |
java | private void resetIdentifierType()
{
Expression expression = getExpression();
if( expression == null )
{
return;
}
Identifier identifier = getIdentifier();
if( identifier == null )
{
return;
}
ISymbol symbol = identifier.getSymbol();
if( symbol.getType() == GosuPa... |
java | public static void runExample(
AdWordsServicesInterface adWordsServices, AdWordsSession session, long serviceLinkId)
throws RemoteException {
// Get the CustomerService.
CustomerServiceInterface customerService =
adWordsServices.get(session, CustomerServiceInterface.class);
// Create th... |
python | def cli(execute, region, aws_access_key_id, aws_secret_access_key,
s3_staging_dir, athenaclirc, profile, database):
'''A Athena terminal client with auto-completion and syntax highlighting.
\b
Examples:
- athenacli
- athenacli my_database
'''
if (athenaclirc == ATHENACLIRC) and ... |
java | public static double getDouble(String pStr) {
if (isEmpty(pStr)) {
return 0.0;
}
double value = 0.0;
pStr = pStr.substring(0, pStr.length() - 2) + "." + pStr.substring(pStr.length() - 2);
try {
value = Double.parseDouble(pStr);
} catch (NumberForma... |
python | def get_namespace(self, uri):
"""Return a :class:`.Namespace` corresponding to the given ``uri``.
If the given ``uri`` is a relative URI (i.e. it does not
contain a leading slash ``/``), the ``uri`` is adjusted to
be relative to the ``uri`` of the namespace itself. This
method i... |
python | def _parse_response(xml):
"""
Attempt to parse the SOAP response and return a python object
Raise a WSManException if a Fault is found
"""
try:
soap_response = xmltodict.parse(xml, process_namespaces=True, namespaces=Service.Namespaces)
except Exception:
... |
python | def _lock(self):
'''
Locks, or returns False if already locked
'''
if not self._is_locked():
with open(self._lck,'w') as fh:
if self._devel: self.logger.debug("Locking")
fh.write(str(os.getpid()))
return True
else:
... |
java | public static Crouton make(Activity activity, View customView, ViewGroup viewGroup) {
return new Crouton(activity, customView, viewGroup);
} |
python | def get_formatted_output(self, format_type=FormatType.JSON):
"""
:param format_type: The format need to output.
:return: formatted output.
:raise ConversionError: data can't be converted to the specified format_type.
"""
if format_type not in [FormatType.JSON, FormatType.... |
java | public static byte[] insert (byte[] values, byte value, int index)
{
byte[] nvalues = new byte[values.length+1];
if (index > 0) {
System.arraycopy(values, 0, nvalues, 0, index);
}
nvalues[index] = value;
if (index < values.length) {
System.arraycopy(va... |
python | def hours_estimate(self, branch='master', grouping_window=0.5, single_commit_hours=0.5, limit=None, days=None, committer=True, by=None, ignore_globs=None, include_globs=None):
"""
inspired by: https://github.com/kimmobrunfeldt/git-hours/blob/8aaeee237cb9d9028e7a2592a25ad8468b1f45e4/index.js#L114-L143
... |
java | @SuppressWarnings("unchecked")
public Duration<U> plus(TimeSpan<? extends U> timespan) {
Duration<U> result = merge(this, timespan);
if (result == null) {
long[] sums = new long[4];
sums[0] = 0;
sums[1] = 0;
sums[2] = 0;
sums[3] = 0;
... |
java | private boolean drawPoint(BoundingBox boundingBox,
ProjectionTransform transform, FeatureTileGraphics graphics,
Point point, FeatureStyle featureStyle) {
boolean drawn = false;
Point projectedPoint = transform.transform(point);
float x = TileBoundingBoxUtils.getXPixel(tileWidth, boundingBox,
projecte... |
python | def print_alignment(mapping, instance1, instance2):
"""
print the alignment based on a node mapping
Args:
mapping: current node mapping list
instance1: nodes of AMR 1
instance2: nodes of AMR 2
"""
result = []
for instance1_item, m in zip(instance1, mapping):
r = ... |
java | public void fatal( String messagePattern, Object arg1, Object arg2 )
{
if( m_delegate.isFatalEnabled() )
{
String msgStr = MessageFormatter.format( messagePattern, arg1, arg2 );
m_delegate.fatal( msgStr, null );
}
} |
python | def strip_prompt(self, a_string):
"""Strip the trailing router prompt from the output."""
expect_string = r"^(OK|ERROR|Command not recognized\.)$"
response_list = a_string.split(self.RESPONSE_RETURN)
last_line = response_list[-1]
if re.search(expect_string, last_line):
... |
java | private void renameColumn(CmsSetupDb dbCon, String tablename, String oldname, String newname) throws SQLException {
System.out.println(new Exception().getStackTrace()[0].toString());
if (dbCon.hasTableOrColumn(tablename, oldname)) {
String query = readQuery(QUERY_RENAME_COLUMN);
... |
java | @Nonnull
public ETriState isValidPostalCode (@Nullable final Locale aCountry, @Nullable final String sPostalCode)
{
final IPostalCodeCountry aPostalCountry = getPostalCountryOfCountry (aCountry);
if (aPostalCountry == null)
return ETriState.UNDEFINED;
return ETriState.valueOf (aPostalCountry.isVal... |
python | def createFieldDescription(self):
"""
Provides a field description dict for swarm description.
:return: (dict)
"""
return {
"fieldName": self.getName(),
"fieldType": self._dataType,
"minValue": self._min,
"maxValue": self._max
} |
java | @Override
public CreatePlatformEndpointResult createPlatformEndpoint(CreatePlatformEndpointRequest request) {
request = beforeClientExecution(request);
return executeCreatePlatformEndpoint(request);
} |
python | def extractFromURL(url,
cache=False,
cacheDir='_cache',
verbose=False,
encoding=None,
filters=None,
userAgent=None,
timeout=5,
blur=5,
ignore_robotstxt=False,
only_mime_types=None,
raw=False):
"""
Extracts text from a URL.
Parameters:
url := string
Re... |
python | def record_sets_list_by_dns_zone(zone_name, resource_group, top=None, recordsetnamesuffix=None, **kwargs):
'''
.. versionadded:: Fluorine
Lists all record sets in a DNS zone.
:param zone_name: The name of the DNS zone (without a terminating dot).
:param resource_group: The name of the resource gr... |
java | private void merge(FieldNumberTree other) {
for (Key key : other.children.keySet()) {
FieldNumberTree value = other.children.get(key);
if (!this.children.containsKey(key)) {
this.children.put(key, value);
} else {
this.children.get(key).merge(value);
}
}
} |
java | private String getNextLineOrVirtualBlankLineAtEndOfStream(String nextLine) {
if ((nextLine == null) && !isEndOfStream) {
isEndOfStream = true;
return "";
}
return nextLine;
} |
python | def get_state_tuple(state, state_m=None):
""" Generates a tuple that holds the state as yaml-strings and its meta data in a dictionary.
The tuple consists of:
[0] json_str for state,
[1] dict of child_state tuples,
[2] dict of model_meta-data of self and elements
[3] path of state in state machi... |
java | public MethodDescriptor[] getMethodDescriptors() {
BeanInfo info = getBeanInfo();
if (info == null) {
return null;
}
MethodDescriptor[] mds = info.getMethodDescriptors();
getTeaToolsUtils().sortMethodDescriptors(mds);
return mds;
} |
java | private boolean isToBeCastedAnyType(LightweightTypeReference actualType, XExpression obj, ITreeAppendable appendable) {
if (actualType instanceof AnyTypeReference) {
if (getReferenceName(obj, appendable) != null)
return true;
else if (obj instanceof XBlockExpression) {
XBlockExpression blockExpression =... |
python | def smooth_mesh(mesh, n_iter=4, lam=0.6307, mu=-0.6347,
weights=None, bconstr=True,
volume_corr=False):
"""
FE mesh smoothing.
Based on:
[1] Steven K. Boyd, Ralph Muller, Smooth surface meshing for automated
finite element model generation from 3D image data, Journa... |
python | def tracker():
"""start a tracker to register running models"""
application = mmi.tracker.app()
application.listen(22222)
logger.info('serving at port 22222')
tornado.ioloop.IOLoop.instance().start() |
python | def create_tag(tag_name, kind='z'):
'''
Create tag record by tag_name
'''
cur_recs = TabTag.select().where(
(TabTag.name == tag_name) &
(TabTag.kind == kind)
)
if cur_recs.count():
uid = cur_recs.get().uid
# TabTag.delete()... |
python | def get_log_hierarchy_session(self, proxy):
"""Gets the ``OsidSession`` associated with the log hierarchy service.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.logging.LogHierarchySession) - a
``LogHierarchySession`` for logs
raise: NullArgument - ``proxy`` i... |
java | public WebSocket flush()
{
synchronized (mStateManager)
{
WebSocketState state = mStateManager.getState();
if (state != OPEN && state != CLOSING)
{
return this;
}
}
// Get the reference to the instance of WritingThread... |
python | def vrelg(v1, v2, ndim):
"""
Return the relative difference between two vectors of general dimension.
http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vrelg_c.html
:param v1: First vector
:type v1: Array of floats
:param v2: Second vector
:type v2: Array of floats
:param ndim:... |
java | public GetStatUvResponse getStatUv(GetStatUvRequest request) {
InternalRequest internalRequest = this.createRequest(request, HttpMethodName.GET, STAT, "uv");
if (request.getStartTime() != null) {
internalRequest.addParameter("startTime", DateUtils.formatAlternateIso8601Date(request.... |
java | protected ClientResponse deleteResponse(final WebResource webResource, final boolean checkResponse) {
final ClientResponse response = webResource.accept(MediaType.APPLICATION_JSON).delete(ClientResponse.class);
if(checkResponse) {
this.checkResponse(response);
}
return response;
} |
python | def get_plugins(modules, classobj):
"""Find all class objects in all modules.
@param modules: the modules to search
@ptype modules: iterator of modules
@return: found classes
@rytpe: iterator of class objects
"""
for module in modules:
for plugin in get_module_plugins(module, classob... |
java | private void setupJDK() throws AbortException, IOException, InterruptedException {
String jdkInstallationName = step.getJdk();
if (StringUtils.isEmpty(jdkInstallationName)) {
console.println("[withMaven] using JDK installation provided by the build agent");
return;
}... |
python | def read_field_h5(xdmf_file, fieldname, snapshot, header=None):
"""Extract field data from hdf5 files.
Args:
xdmf_file (:class:`pathlib.Path`): path of the xdmf file.
fieldname (str): name of field to extract.
snapshot (int): snapshot number.
header (dict): geometry information.... |
java | public static base_responses update(nitro_service client, vpnvserver resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
vpnvserver updateresources[] = new vpnvserver[resources.length];
for (int i=0;i<resources.length;i++){
updateresources[i] = ne... |
java | @Override
public final void setSymbolTable(SymbolTable symbols)
throws IOException
{
if (symbols == null || _Private_Utils.symtabIsSharedNotSystem(symbols)) {
throw new IllegalArgumentException("symbol table must be local or system to be set, or reset");
}
if (getDept... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.