language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | private void sendVODInitCM(IPlayItem item) {
OOBControlMessage oobCtrlMsg = new OOBControlMessage();
oobCtrlMsg.setTarget(IPassive.KEY);
oobCtrlMsg.setServiceName("init");
Map<String, Object> paramMap = new HashMap<String, Object>(1);
paramMap.put("startTS", (int) item.getStart()... |
python | def begin(self, request, data):
""" Try to get Request Token from OAuth Provider and
redirect user to provider's site for approval.
"""
request = self.get_request(
http_url = self.REQUEST_TOKEN_URL,
parameters = dict(oauth_callback = self.get_callback(... |
python | def query_stock(self, stock_id, op_user_id=None, device_info=None):
"""
查询代金券批次
:param stock_id: 代金券批次 ID
:param op_user_id: 可选,操作员账号,默认为商户号
:param device_info: 可选,微信支付分配的终端设备号
:return: 返回的结果信息
"""
data = {
'appid': self.appid,
'co... |
java | @Override
public Object readValue(final Attribute _attribute,
final List<Object> _objectList)
throws EFapsException
{
// reads the Value from "Admin_Common_DataBaseTimeZone"
final String timezoneID = EFapsSystemConfiguration.get() == null ? DateTimeZone.getDef... |
java | public static AsteriskVersion getDetermineVersionFromString(String coreLine)
{
for (AsteriskVersion version : knownVersions)
{
for (Pattern pattern : version.patterns)
{
if (pattern.matcher(coreLine).matches())
{
return vers... |
python | def write_document(doc, fnm):
"""Write a Text document to file.
Parameters
----------
doc: Text
The document to save.
fnm: str
The filename to save the document
"""
with codecs.open(fnm, 'wb', 'ascii') as f:
f.write(json.dumps(doc, indent=2)) |
java | public static void foreach(String path, Consumer<? super String> block) {
Ruby.Enumerator.of(new EachLineIterable(new File(path))).each(block);
} |
java | public ServiceFuture<BuildStepInner> beginUpdateAsync(String resourceGroupName, String registryName, String buildTaskName, String stepName, BuildStepUpdateParameters buildStepUpdateParameters, final ServiceCallback<BuildStepInner> serviceCallback) {
return ServiceFuture.fromResponse(beginUpdateWithServiceRespon... |
java | public void init(
boolean forEncryption,
CipherParameters param)
{
if (core == null)
{
core = new NativeRSACoreEngine();
}
core.init(forEncryption, param);
} |
python | def point_cloud(df, columns=[0, 1, 2]):
"""3-D Point cloud for plotting things like mesh models of horses ;)"""
df = df if isinstance(df, pd.DataFrame) else pd.DataFrame(df)
if not all(c in df.columns for c in columns):
columns = list(df.columns)[:3]
fig = plt.figure()
ax = fig.add_subplot(... |
java | protected static <T> T callClosureForMapEntryAndCounter(Closure<T> closure, Map.Entry entry, int counter) {
if (closure.getMaximumNumberOfParameters() == 3) {
return closure.call(new Object[]{entry.getKey(), entry.getValue(), counter});
}
if (closure.getMaximumNumberOfParameters() ==... |
java | @Override
public EClass getIfcSchedulingTime() {
if (ifcSchedulingTimeEClass == null) {
ifcSchedulingTimeEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI)
.getEClassifiers().get(586);
}
return ifcSchedulingTimeEClass;
} |
java | @Beta
public Builder toBuilder() {
Builder builder = new GoogleCredential.Builder()
.setServiceAccountPrivateKey(serviceAccountPrivateKey)
.setServiceAccountPrivateKeyId(serviceAccountPrivateKeyId)
.setServiceAccountId(serviceAccountId)
.setServiceAccountProjectId(serviceAccountPro... |
python | def from_settings_product(cls, environments, babblings,
interest_models, sensorimotor_models,
evaluate_at,
testcases=None, same_testcases=False):
""" Creates a ExperimentPool with the product of all the given settings.
... |
java | public String drawAlmostCentreRectangle(long horizon, HashMap<String, Rectangle> rect){
String ret = "";
int j = 1;
ret = "set xrange [0:" + horizon +"]"+ "\n";
ret += "set yrange [0:" + horizon +"]" + "\n";
int i = 0;
for (String str : rect.keySet()) {
//rec
ret += "set obj " + j + " rect ... |
java | public OvhAsyncTaskArray<OvhBuilding> eligibility_search_buildings_POST(String streetCode, String streetNumber) throws IOException {
String qPath = "/connectivity/eligibility/search/buildings";
StringBuilder sb = path(qPath);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "streetCode", str... |
java | public static ns_clusternode[] remove_node(nitro_service client, ns_clusternode[] resources) throws Exception
{
if(resources == null)
throw new Exception("Null resource array");
if(resources.length == 1)
return ((ns_clusternode[]) resources[0].perform_operation(client, "remove_node"));
re... |
python | def _update_state(self, response):
"""Update the state of the browser. Create a new state object, and
append to or overwrite the browser's state history.
:param requests.MockResponse: New response object
"""
# Clear trailing states
self._states = self._states[:self._cur... |
java | private static long startOfYear(int year)
{
long day = cache.get(year);
if (day == CalendarCache.EMPTY) {
int months = (235 * year - 234) / 19; // # of months before year
long frac = months * MONTH_FRACT + BAHARAD; // Fractional part of day #
... |
java | public Object getRepeatedField(final FieldDescriptorType descriptor,
final int index) {
if (!descriptor.isRepeated()) {
throw new IllegalArgumentException(
"getRepeatedField() can only be called on repeated fields.");
}
final Object value = getField(descriptor... |
java | public static Header[] resize(final Header[] headers) {
int new_capacity=headers.length + RESIZE_INCR;
Header[] new_hdrs=new Header[new_capacity];
System.arraycopy(headers, 0, new_hdrs, 0, headers.length);
return new_hdrs;
} |
python | def p_preprocessor_line_line(p):
""" preproc_line : _LINE INTEGER
"""
p.lexer.lineno = int(p[2]) + p.lexer.lineno - p.lineno(2) |
python | def extent(self):
"""
Return the segment whose end-points denote the maximum and
minimum extent of the segmentlist. Does not require the
segmentlist to be coalesced.
"""
if not len(self):
raise ValueError("empty list")
min, max = self[0]
for lo, hi in self:
if min > lo:
min = lo
if max < h... |
java | @Override
public UpdateIdentityProviderConfigurationResult updateIdentityProviderConfiguration(UpdateIdentityProviderConfigurationRequest request) {
request = beforeClientExecution(request);
return executeUpdateIdentityProviderConfiguration(request);
} |
python | def gff3_parse_attributes(attributes_string):
"""
Parse a string of GFF3 attributes ('key=value' pairs delimited by ';')
and return a dictionary.
"""
attributes = dict()
fields = attributes_string.split(';')
for f in fields:
if '=' in f:
key, value = f.split('=')... |
python | def prompt(self):
"""Select file
"""
self.msg.template(78)
print("| Choose what to do file by file:")
print("| {0}K{1}{2}eep, {3}O{4}{5}verwrite, {6}R{7}{8}emove, "
"{9}D{10}{11}iff, {12}M{13}{14}erge, {15}Q{16}{17}uit".format(
self.red, self.endc,... |
java | private static void storeRecentConnectionSettings(Hashtable settings) {
try {
if (recentSettings == null) {
setHomeDir();
if (homedir == null) {
return;
}
recentSettings = new File(homedir, fileName);
... |
java | public RedisFirewallRuleInner createOrUpdate(String resourceGroupName, String cacheName, String ruleName, RedisFirewallRuleCreateParameters parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, cacheName, ruleName, parameters).toBlocking().single().body();
} |
java | private void initGraphics() {
// Set initial size
if (Double.compare(gauge.getPrefWidth(), 0.0) <= 0 || Double.compare(gauge.getPrefHeight(), 0.0) <= 0 ||
Double.compare(gauge.getWidth(), 0.0) <= 0 || Double.compare(gauge.getHeight(), 0.0) <= 0) {
if (gauge.getPrefWidth() > 0 && ... |
python | def _parse_join(self, tokens):
""" Parses a join.
Join ::= 'join' '(' SuperRange [',' SuperRange] ')'
"""
children = []
tokens.pop(0) # Pop 'join'
tokens.pop(0) # Pop '('
children.append(self._parse_nested_interval(tokens))
while tokens[0] == ',':
... |
java | @Override
protected List<String> getAncestors(String dataId)
{
List<String> result = new ArrayList<String>(depth);
String hash = hash(dataId);
int length = hash.length();
for (int i = 0; i < depth - 1 && i < length; i++)
{
result.add(hash.substring(i, i + 1));
}
... |
java | public CacheSimpleConfig getCacheConfig(String name) {
return ConfigUtils.getConfig(configPatternMatcher, cacheConfigs, name, CacheSimpleConfig.class);
} |
python | def _scan_block(self, cfg_job):
"""
Scan a basic block starting at a specific address
:param CFGJob cfg_job: The CFGJob instance.
:return: a list of successors
:rtype: list
"""
addr = cfg_job.addr
current_func_addr = cfg_job.func_addr
# Fix the ... |
java | public static <A> AnyGene<A> of(
final Supplier<? extends A> supplier,
final Predicate<? super A> validator
) {
return new AnyGene<>(supplier.get(), supplier, validator);
} |
python | def compamp_to_ac(compamp, window=np.hanning): # convert single or multi-subband compamps into autocorrelation waterfall
'''
Adapted from Gerry Harp at SETI.
'''
header = compamp.header()
cdata = compamp.complex_data()
#Apply Windowing and Padding
cdata = np.multiply(cdata, window(cdata.shape[2]))... |
python | def _ReadDefinition(self, definitions_registry, definition_values):
"""Reads a data type definition.
Args:
definitions_registry (DataTypeDefinitionsRegistry): data type definitions
registry.
definition_values (dict[str, object]): definition values.
Returns:
DataTypeDefinition: ... |
python | def __scanPlugins(self):
"""Scanning local plugin directories and third-party plugin packages.
:returns: No return, but self.__plugins will be updated
:raises: PluginError: raises an exception, maybe CSSLoadError, VersionError, based PluginError
"""
self.logger.info("Initializa... |
java | @Override
public DescribeScheduledInstancesResult describeScheduledInstances(DescribeScheduledInstancesRequest request) {
request = beforeClientExecution(request);
return executeDescribeScheduledInstances(request);
} |
python | def sentence_starts(self):
"""The list of start positions representing ``sentences`` layer elements."""
if not self.is_tagged(SENTENCES):
self.tokenize_sentences()
return self.starts(SENTENCES) |
java | protected int getPriorityFromTaintFrame(TaintFrame fact, int offset)
throws DataflowAnalysisException {
Taint parameterTaint = fact.getStackValue(offset);
return getPriority(parameterTaint);
} |
java | public StatusCode deleteList(String sessionId, String listId) throws MovieDbException {
return tmdbList.deleteList(sessionId, listId);
} |
java | public <D> D oneToManyWithoutControl(D destination,final T source) {
try{ return this.<D,T>getJMapper(relationalOneToManyMapper,destination.getClass()).getDestinationWithoutControl(destination,source); }
catch (Exception e) { return this.logAndReturnNull(e); }
} |
python | def _set_user_session_info(self, v, load=False):
"""
Setter method for user_session_info, mapped from YANG variable /brocade_aaa_ext_rpc/user_session_info (rpc)
If this variable is read-only (config: false) in the
source YANG file, then _set_user_session_info is considered as a private
method. Backe... |
java | static String getXmlProlog(final InputStream is, final String guessedEnc) throws IOException {
String encoding = null;
if (guessedEnc != null) {
final byte[] bytes = new byte[BUFFER_SIZE];
is.mark(BUFFER_SIZE);
int offset = 0;
int max = BUFFER_SIZE;
... |
java | @Override
public ResponseList<SavedSearch> getSavedSearches() throws TwitterException {
return factory.createSavedSearchList(get(conf.getRestBaseURL() + "saved_searches/list.json"));
} |
java | public PartialResponseUpdateType<PartialResponseChangesType<T>> getOrCreateUpdate()
{
List<Node> nodeList = childNode.get("update");
if (nodeList != null && nodeList.size() > 0)
{
return new PartialResponseUpdateTypeImpl<PartialResponseChangesType<T>>(this, "update", childNode, nodeList.g... |
python | def call(self, uri, *args, **kwargs ):
""" Sends a RPC request to the WAMP server
"""
if self._state == STATE_DISCONNECTED:
raise Exception("WAMP is currently disconnected!")
options = {
'disclose_me': True
}
uri = self.get_full_uri(uri)
me... |
java | public final String entryRuleFeatureCallID() throws RecognitionException {
String current = null;
AntlrDatatypeRuleToken iv_ruleFeatureCallID = null;
try {
// InternalSARL.g:9873:53: (iv_ruleFeatureCallID= ruleFeatureCallID EOF )
// InternalSARL.g:9874:2: iv_ruleFeatur... |
java | public void changeValue(String value, int valueIndex) {
m_attributeValueViews.get(valueIndex).getValueWidget().setValue(value, false);
changeEntityValue(value, valueIndex);
} |
java | @Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case XtextPackage.TYPE_REF__METAMODEL:
setMetamodel((AbstractMetamodelDeclaration)newValue);
return;
case XtextPackage.TYPE_REF__CLASSIFIER:
setClassifier((EClassifier)newValue);
return;
}
super.eSet(featureID... |
java | @Override public void writeTo(OutputStream os) {
ZipOutputStream zos = new ZipOutputStream(os);
try {
writeTo(zos);
zos.close();
} catch (IOException e) {
e.printStackTrace();
}
} |
python | def move_to(self, x, y, pre_dl=None, post_dl=None):
"""Move mouse to (x, y)
**中文文档**
移动鼠标到 (x, y) 的坐标处。
"""
self.delay(pre_dl)
self.m.move(x, y)
self.delay(post_dl) |
python | def scan(self, text):
"""Analyse some data
Analyse the passed content. Each time a token is recognized, a
2-uple containing its name and parsed value is raised (via
yield).
On error, a ParseError exception is raised.
:param text: a binary string containing the data to ... |
python | def _parse_args(self, args, known_only):
"""Helper function to do the main argument parsing.
This function goes through args and does the bulk of the flag parsing.
It will find the corresponding flag in our flag dictionary, and call its
.parse() method on the flag value.
Args:
args: [str], a... |
python | def bk_dark(cls):
"Make the current background color dark."
wAttributes = cls._get_text_attributes()
wAttributes &= ~win32.BACKGROUND_INTENSITY
cls._set_text_attributes(wAttributes) |
python | def copy(self):
'''Create a copy of the current instance.
:returns: A safely editable copy of the current sequence.
:rtype: coral.Peptide
'''
return type(self)(str(self._sequence), features=self.features,
run_checks=False) |
python | def get_vm_obj(self):
"""
Search for vm in vcenter, return the object if found
:return:
"""
uuid = VcenterInterfaces.get_vcenter_vm_uuid_by_name(self.host, self.user, self.password, self.name)
# connect to vc
# Getting VM data
vm_obj = self.vcenter_conn.c... |
python | def up(job, input_file_id_1, input_file_id_2):
"""Merges the two files and places them in the output.
"""
with job.fileStore.writeGlobalFileStream() as (fileHandle, output_id):
with job.fileStore.readGlobalFileStream(input_file_id_1) as inputFileHandle1:
with job.fileStore.readGlobalFile... |
python | def finalize(self, initial=True):
"""Call this after you've created all the PawnSpot you need and are ready to add them to the board."""
if getattr(self, '_finalized', False):
return
if (
self.proxy is None or
not hasattr(self.proxy, 'name')
):... |
java | public void setRemoveSubnetIds(java.util.Collection<String> removeSubnetIds) {
if (removeSubnetIds == null) {
this.removeSubnetIds = null;
return;
}
this.removeSubnetIds = new com.amazonaws.internal.SdkInternalList<String>(removeSubnetIds);
} |
java | public DescribeHsmClientCertificatesResult withHsmClientCertificates(HsmClientCertificate... hsmClientCertificates) {
if (this.hsmClientCertificates == null) {
setHsmClientCertificates(new com.amazonaws.internal.SdkInternalList<HsmClientCertificate>(hsmClientCertificates.length));
}
... |
python | def stop_sync(self):
"""Safely stop this BLED112 instance without leaving it in a weird state."""
# Disconnect connected device
if self.connected:
self.disconnect_sync(self._connection_handle)
# Disable advertising
self.set_advertising(False)
# Stop the baBL... |
python | def stat(filename, use_cache_only=False):
"""Return stat() info for *filename*. If *use_cache_only* is *False*,
we will try to fetch the file if it is not cached."""
filename = pyc2py(filename)
if filename not in file_cache:
if not use_cache_only: cache_file(filename)
if filename not in ... |
python | def undefinedImageType(self):
"""
Returns the name of undefined image type for the invalid image.
.. versionadded:: 2.3.0
"""
if self._undefinedImageType is None:
ctx = SparkContext._active_spark_context
self._undefinedImageType = \
ctx._... |
python | def compress(pub):
'''
Input must be hex string, and a valid uncompressed public key.
Check if it's a valid key first, using the validatepubkey()
function below, and then verify that the str len is 130.
'''
x = pub[2:66]
y = pub[66:]
if int(y,16) % 2:
o = str('03') + str(x)
... |
java | public void write(InputStream is, long length, boolean escape, boolean noBackslashEscapes)
throws IOException {
byte[] array = new byte[4096];
int len;
while (length > 0 && (len = is.read(array, 0, Math.min(4096, (int) length))) > 0) {
if (escape) {
writeBytesEscaped(array, len, noBacksl... |
java | public boolean createOrReplaceEntity(Entity entity) {
String entityName = entity.getName();
checkEntityIsEmpty(entityName);
QueryPart<Entity> queryPart = new Query<Entity>("entities")
.path(entityName, true);
return httpClientManager.updateMetaData(queryPart, put(entity))... |
java | public static ITextProcessor wrap(final ITextProcessor processor, final IProcessorDialect dialect) {
Validate.notNull(dialect, "Dialect cannot be null");
if (processor == null) {
return null;
}
return new TextProcessorWrapper(processor, dialect);
} |
python | def MakeMixture(metapmf, name='mix'):
"""Make a mixture distribution.
Args:
metapmf: Pmf that maps from Pmfs to probs.
name: string name for the new Pmf.
Returns: Pmf object.
"""
mix = Pmf(name=name)
for pmf, p1 in metapmf.Items():
for x, p2 in pmf.Items():
mix.... |
java | public Set<String> getIdsForIdWithDescendants(String s) {
buildIsTypeOf();
Stack<String> idsToConsider = new Stack<String>();
idsToConsider.add(s);
Set<String> resultIds = new HashSet<String>();
while (!idsToConsider.isEmpty()) {
String id = idsToConsider.pop();
... |
python | def is_modified(self):
"""
Returns whether list is modified or not
"""
if self.__modified_data__ is not None:
return True
for value in self.__original_data__:
try:
if value.is_modified():
return True
except A... |
python | def run(self, head_rows, tail_rows=None, n_rows=None):
"""
Run the intuition process
:param head_rows: A list of rows from the start of the file. Should have at least 30 rows
:param tail_rows: A list of rows from the end of the file. Optional, but should have at least 30 rows
:pa... |
java | double psfunc3(double x, double t1, double t2, int dim, int type) {
// type: the type of curve
// css: the class of index
double beta;
beta = 0.0;
dim++;
if (type == 31) {
double xy = 4 * (x - 0.5);
double rate = 1.0 * dim / nvar;
beta = xy - 4 * (t1 * t1 * rate + t2 * (1... |
python | def fileExists(fName, dire=pDir()):
"""
Check if a file exists
"""
if os.path.isfile(os.path.join(dire, fName)):
return True
return False |
python | def set_translation(self, lang, field, text):
"""
Store a translation string in the specified field for a Translatable
istance
@type lang: string
@param lang: a string with the name of the language
@type field: string
@param field: a string with the name that we... |
java | static synchronized Mutator mutatorFor(Class<?> type, Method method, Configuration configuration,
String name) {
PropertyInfoKey key = new PropertyInfoKey(type, name, configuration);
Mutator mutator = MUTATOR_CACHE.get(key);
if (mutator == null) {
mutator = new MethodMutator(type, method, n... |
python | def _map_arguments(self, args):
"""Map from the top-level arguments to the arguments provided to
the indiviudal links """
comp_file = args.get('comp', None)
datafile = args.get('data', None)
do_ltsum = args.get('do_ltsum', False)
NAME_FACTORY.update_base_dict(datafile)
... |
python | def _start_priority_containers(self, groups, group_orders, tool_d):
""" Select containers based on priorities to start """
vent_cfg = Template(self.path_dirs.cfg_file)
cfg_groups = vent_cfg.option('groups', 'start_order')
if cfg_groups[0]:
cfg_groups = cfg_groups[1].split(','... |
java | protected WsByteBuffer getBuffer() {
WsByteBuffer buffer = this.output[this.outputIndex];
if (null == buffer) {
buffer = HttpDispatcher.getBufferManager().allocate(this.bbSize);
buffer.clear();
this.output[this.outputIndex] = buffer;
if (TraceComponent.isA... |
java | @Bean
protected PersistenceManagerFactory persistenceManagerFactory() throws InitializationException
{
CacheManagerFactory cacheManagerFactory = new CacheManagerFactory();
cacheManagerFactory.initialize();
return cacheManagerFactory;
} |
java | public Query adding( Column... columns ) {
List<Column> newColumns = null;
if (this.columns != null) {
newColumns = new ArrayList<Column>(this.columns);
for (Column column : columns) {
newColumns.add(column);
}
} else {
newColumns =... |
java | @Override
public <B> State<S, B> pure(B b) {
return state(s -> tuple(b, s));
} |
python | def all_library_calls(self):
""" recursive version of library calls
"""
if self._all_library_calls is None:
self._all_library_calls = self._explore_functions(lambda x: x.library_calls)
return self._all_library_calls |
java | public void marshall(ListPipelinesRequest listPipelinesRequest, ProtocolMarshaller protocolMarshaller) {
if (listPipelinesRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(listPipelinesReques... |
java | @Override
public int compareTo(Duration otherDuration) {
int cmp = Jdk8Methods.compareLongs(seconds, otherDuration.seconds);
if (cmp != 0) {
return cmp;
}
return nanos - otherDuration.nanos;
} |
python | def eval(self, ebin, dtheta, scale_fn=None):
"""Evaluate the PSF at the given energy bin index.
Parameters
----------
ebin : int
Index of energy bin.
dtheta : array_like
Array of angular separations in degrees.
scale_fn : callable
... |
python | def remove_whitespace(self, html):
"""
Clean whitespace from html
@Params
html - html source to remove whitespace from
@Returns
String html without whitespace
"""
# Does python have a better way to do exactly this?
clean_html = html
for cha... |
python | def Rx(rads: Union[float, sympy.Basic]) -> XPowGate:
"""Returns a gate with the matrix e^{-i X rads / 2}."""
pi = sympy.pi if protocols.is_parameterized(rads) else np.pi
return XPowGate(exponent=rads / pi, global_shift=-0.5) |
java | public long getTotalCalls(IoEventType type) {
switch (type) {
case MESSAGE_RECEIVED :
if (profileMessageReceived) {
return messageReceivedTimerWorker.getCallsNumber();
}
break;
case MESS... |
java | public com.google.protobuf.Duration getLatency() {
return latency_ == null ? com.google.protobuf.Duration.getDefaultInstance() : latency_;
} |
python | def login(self, user, passwd):
"""login user passwd
Performs the login operation for Security Center, storing the token
that Security Center has generated for this login session for future
queries.
"""
data = self.raw_query('auth', 'login',
da... |
java | @NullSafe
public static byte[] toByteArray(InputStream in) throws IOException {
Assert.notNull(in, "The InputStream to read bytes from cannot be null");
ByteArrayOutputStream out = new ByteArrayOutputStream(in.available());
byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
int bytesRead;
while (... |
java | public ChronoFunction<CalendarDate, Moment> transitAtNoon() {
return date -> transitAtNoon(toLMT(date), this.longitude, this.calculator);
} |
java | @Override
public final void process(final Map<String, Object> pRqVs,
final IRequestData pRqDt) throws Exception {
Cart cart = this.srvCart.getShoppingCart(pRqVs, pRqDt, false,
false);
if (cart != null) {
String dlvStr = pRqDt.getParameter("deliv");
String payMethStr = pRqDt.getParameter(... |
java | private static String getHandlerID(int transferMode,
int transferType,
int type) {
String id = "";
switch (transferMode) {
case Session.MODE_STREAM:
id += "S-"; break;
case GridFTPSession.MODE_EBLOCK:
id += "E-"; break;
default:
throw new IllegalArgumentException("Mode not sup... |
java | public Analysis<SolutionType> setNumBurnIn(String searchID, int n){
if(!searches.containsKey(searchID)){
throw new UnknownIDException("No search with ID " + searchID + " has been added.");
}
if(n <= 0){
throw new IllegalArgumentException("Number of burn-in runs should be ... |
java | public void addMetric(final IMetric<?> metric) {
// metric null or already present
if (metric == null) {
throw new IllegalArgumentException("Cannot add a null metric");
}
if (getMetricFromName(metric.getName()) == null) {
logger.debug(String.format("Adding %s metric in Metric Manager", metr... |
python | def present(name, database, duration="7d",
replication=1, default=False,
**client_args):
'''
Ensure that given retention policy is present.
name
Name of the retention policy to create.
database
Database to create retention policy on.
'''
ret = {'name': n... |
java | public static File decodeToFile(String base64, File destFile) {
return FileUtil.writeBytes(Base64Decoder.decode(base64), destFile);
} |
java | @Override
protected void populateModel(ModelNode operation, ModelNode model) throws OperationFailedException {
model.get(ModelConstants.PROCESS_ENGINES);
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.