language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | public void setTimeout(int pTimeout) {
if (pTimeout < 0) { // Must be positive
throw new IllegalArgumentException("Timeout must be positive.");
}
timeout = pTimeout;
if (socket != null) {
try {
socket.setSoTimeout(pTimeout);
}
... |
java | @javax.annotation.CheckForNull
public static IResource getResource(Object element) {
if (element instanceof IJavaElement) {
return ((IJavaElement) element).getResource();
}
return Util.getAdapter(IResource.class, element);
} |
java | public static Dictionary buildDictionary(final ObjectStream<Parse> data,
final HeadRules rules, final int cutoff) throws IOException {
final TrainingParameters params = new TrainingParameters();
params.put("dict", TrainingParameters.CUTOFF_PARAM,
Integer.toString(cutoff));
return buildDictio... |
python | def validate_authentication(self, username, password, handler):
"""authenticate user with password
"""
user = authenticate(
**{self.username_field: username, 'password': password}
)
account = self.get_account(username)
if not (user and account):
ra... |
java | static BasicTag convert(Tag t) {
return (t instanceof BasicTag) ? (BasicTag) t : new BasicTag(t.key(), t.value());
} |
java | Table TABLE_CONSTRAINTS() {
Table t = sysTables[TABLE_CONSTRAINTS];
if (t == null) {
t = createBlankTable(sysTableHsqlNames[TABLE_CONSTRAINTS]);
addColumn(t, "CONSTRAINT_CATALOG", SQL_IDENTIFIER);
addColumn(t, "CONSTRAINT_SCHEMA", SQL_IDENTIFIER);
addCo... |
java | public void close() {
if (tc.isEntryEnabled())
SibTr.entry(this, tc, "close");
// begin F177053
ChannelFramework framework = ChannelFrameworkFactory.getChannelFramework(); // F196678.10
try {
framework.stopChain(chainInbound, CHAIN_STOP_TIME);
} catch (Ch... |
java | public boolean containsBetaSettings(
java.lang.String key) {
if (key == null) { throw new java.lang.NullPointerException(); }
return internalGetBetaSettings().getMap().containsKey(key);
} |
python | def checksum1(data, stringlength):
""" Calculate Checksum 1
Calculate the ckecksum 1 required for the herkulex data packet
Args:
data (list): the data of which checksum is to be calculated
stringlength (int): the length of the data
Returns:
int: The calculated checksum 1
... |
java | public void set(String name, String value) {
if (deprecatedKeyMap.isEmpty()) {
getProps();
}
getOverlay().setProperty(name, value);
getProps().setProperty(name, value);
updatingResource.put(name, UNKNOWN_RESOURCE);
String[] altNames = getAlternateNames(name);
if (altNames != null && al... |
java | public java.util.List<String> getFilter() {
if (filter == null) {
filter = new com.amazonaws.internal.SdkInternalList<String>();
}
return filter;
} |
python | def _get_group(conn=None, name=None, vpc_id=None, vpc_name=None, group_id=None,
region=None, key=None, keyid=None, profile=None): # pylint: disable=W0613
'''
Get a group object given a name, name and vpc_id/vpc_name or group_id. Return
a boto.ec2.securitygroup.SecurityGroup object if the gro... |
java | public static void replaceUnit(/*String group, String unitName, */ Unit newUnit) {
String group = newUnit.getGroup().getName(), unitName = newUnit.getName();
readWriteLock.writeLock().lock();
try {
//unitMap
List<Unit> unitList = unitMap.get(group);
unitList.r... |
java | private String extractFileName(Part part) {
String disposition = part.getHeader("Content-Disposition");
if (disposition == null)
return null;
Matcher matcher = FILENAME_PATTERN.matcher(disposition);
if (!matcher.find())
return null;
return matcher.group(1);
} |
python | def _CheckPythonModule(self, dependency):
"""Checks the availability of a Python module.
Args:
dependency (DependencyDefinition): dependency definition.
Returns:
tuple: consists:
bool: True if the Python module is available and conforms to
the minimum required version, Fal... |
java | @Override public Object getCachedValue(FieldType field)
{
return (field == null ? null : m_array[field.getValue()]);
} |
python | def pan_cb(self, setting, value):
"""Handle callback related to changes in pan."""
pan_x, pan_y = value[:2]
self.logger.debug("pan set to %.2f,%.2f" % (pan_x, pan_y))
self.redraw(whence=0) |
python | def post(self, resource_endpoint, data={}, files=None):
"""Don't use it."""
url = self._create_request_url(resource_endpoint)
if files:
data = self._prepare_params_for_file_upload(data)
return req.post(url, headers=self.auth_header, files=files, data=data)
else:
... |
java | public Title getTitle(int pageId) throws WikiApiException {
Session session = this.__getHibernateSession();
session.beginTransaction();
Object returnValue = session.createNativeQuery(
"select p.name from PageMapLine as p where p.pageId= :pId").setParameter("pId", pageId, IntegerType.INS... |
java | public final IntResultListener asIntResultListener ()
{
return new IntResultListener() {
public void requestCompleted (int result) {
// call the invocation method and it will do the unsafe cast for us.
Resulting.this.requestProcessed((Object)result);
}... |
java | private String sanitizePrincipal(final String input) {
String s = "";
for (int i = 0; i < input.length(); i++) {
char c = input.charAt(i);
if (c == '*') {
// escape asterisk
s += "\\2a";
} else if (c == '(') {
// escap... |
java | protected void disconnect() {
// Stop broadcaster
if (locator != null) {
locator.disconnect();
locator = null;
}
// Stop gossiper's timer
if (gossiperTimer != null) {
gossiperTimer.cancel(false);
gossiperTimer = null;
}
// Close socket reader
if (reader != null) {
reader.disconnect();
... |
python | def module(self):
"""The module in which the Class is defined.
Python equivalent of the CLIPS defglobal-module command.
"""
modname = ffi.string(lib.EnvDefclassModule(self._env, self._cls))
defmodule = lib.EnvFindDefmodule(self._env, modname)
return Module(self._env, d... |
python | def add_word(self, word, freq=None, tag=None):
"""
Add a word to dictionary.
freq and tag can be omitted, freq defaults to be a calculated value
that ensures the word can be cut out.
"""
self.check_initialized()
word = strdecode(word)
freq = int(freq) if ... |
java | public boolean isOnAtCurrentZoom(GoogleMap map, LatLng latLng) {
float zoom = MapUtils.getCurrentZoom(map);
boolean on = isOnAtCurrentZoom(zoom, latLng);
return on;
} |
python | def add_user(self, group, username):
"""
Add a user to the specified LDAP group.
Args:
group: Name of group to update
username: Username of user to add
Raises:
ldap_tools.exceptions.InvalidResult:
Results of the query were invalid. T... |
python | def write(self, file, text, subvars={}, trim_leading_lf=True):
'''write to a file with variable substitution'''
file.write(self.substitute(text, subvars=subvars, trim_leading_lf=trim_leading_lf)) |
python | def copy_s3_bucket(src_bucket_name, src_bucket_secret_key, src_bucket_access_key,
dst_bucket_name, dst_bucket_secret_key, dst_bucket_access_key):
""" Copy S3 bucket directory with CMS data between environments. Operations are done on server. """
with cd(env.remote_path):
tmp_dir = "s3... |
python | def setzscale(self, z1="auto", z2="auto", nsig=3, samplesizelimit = 10000, border=300):
"""
We set z1 and z2, according to different algorithms or arguments.
For both z1 and z2, give either :
- "auto" (default automatic, different between z1 and z2)
- "e... |
java | public java.util.List<PrefixList> getPrefixLists() {
if (prefixLists == null) {
prefixLists = new com.amazonaws.internal.SdkInternalList<PrefixList>();
}
return prefixLists;
} |
python | def _apply_fit(self, font_family, font_size, is_bold, is_italic):
"""
Arrange all the text in this text frame to fit inside its extents by
setting auto size off, wrap on, and setting the font of all its text
to *font_family*, *font_size*, *is_bold*, and *is_italic*.
"""
s... |
java | public static Resource optimizeNestedResourceChain(final SecurityContext securityContext, final HttpServletRequest request, final Map<Pattern, Class<? extends Resource>> resourceMap, final Value<String> propertyView) throws FrameworkException {
final List<Resource> resourceChain = ResourceHelper.parsePath(securityCo... |
python | def predict(self, X):
"""Predict values using the model
Parameters
----------
X : {array-like, sparse matrix} of shape [n_samples, n_features]
Returns
-------
C : numpy array of shape [n_samples, n_outputs]
Predicted values.
"""
raw_p... |
python | def add_to_group(self, group_path):
"""Add a device to a group, if the group doesn't exist it is created
:param group_path: Path or "name" of the group
"""
if self.get_group_path() != group_path:
post_data = ADD_GROUP_TEMPLATE.format(connectware_id=self.get_connectware_id()... |
java | public static MozuUrl createOrderItemUrl(String orderId, String responseFields, Boolean skipInventoryCheck, String updateMode, String version)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/orders/{orderId}/items?updatemode={updateMode}&version={version}&skipInventoryCheck={skipInventoryCheck}&response... |
java | public void setTraceSegmentDocuments(java.util.Collection<String> traceSegmentDocuments) {
if (traceSegmentDocuments == null) {
this.traceSegmentDocuments = null;
return;
}
this.traceSegmentDocuments = new java.util.ArrayList<String>(traceSegmentDocuments);
} |
java | public com.google.api.ads.admanager.axis.v201808.SslScanResult getSslScanResult() {
return sslScanResult;
} |
java | public EditableResourceBundle getResourceBundle(Locale locale) {
EditableResourceBundle localeBundle = bundles.get(locale);
if(localeBundle==null) {
ResourceBundle resourceBundle = ResourceBundle.getBundle(baseName, locale);
if(!resourceBundle.getLocale().equals(locale)) throw new AssertionError("ResourceBund... |
python | def from_rdd_of_dataframes(self, rdd, column_idxs=None):
"""Take an RDD of Panda's DataFrames and return a Dataframe.
If the columns and indexes are already known (e.g. applyMap)
then supplying them with columnsIndexes will skip eveluating
the first partition to determine index info."""
... |
python | def anchor_and_curate_genV_and_genJ(self, V_anchor_pos_file, J_anchor_pos_file):
"""Trim V and J germline sequences to the CDR3 region.
Unproductive sequences have an empty string '' for the CDR3 region
sequence.
Edits the attributes genV and genJ
Param... |
java | public static String encodeCookie(String string) {
if (string == null) {
return null;
}
string = string.replaceAll("%", "%25");
string = string.replaceAll(";", "%3B");
string = string.replaceAll(",", "%2C");
return string;
} |
python | def get(self, key, **kwargs):
"""
Get the value of a key from etcd.
example usage:
.. code-block:: python
>>> import etcd3
>>> etcd = etcd3.client()
>>> etcd.get('/thing/key')
'hello world'
:param key: key in etcd to get
... |
java | public void close() throws IOException {
value = null;
token = null;
stack.clear();
stack.add(JsonScope.CLOSED);
in.close();
} |
java | protected void learnAmbiguousNegative(Rectangle2D_F64 targetRegion) {
TldHelperFunctions.convertRegion(targetRegion, targetRegion_I32);
if( detection.isSuccess() ) {
TldRegion best = detection.getBest();
// see if it found the correct solution
double overlap = helper.computeOverlap(best.rect,targetRegio... |
java | @Override
protected void removeConstraintsSub(Constraint[] con) {
logger.finest("Trying to remove constraints " + Arrays.toString(con) + "...");
if (con != null && con.length != 0) {
Bounds[] tot = new Bounds[con.length];
int[] from = new int[con.length];
int[] to = new int[con.length];
for (i... |
java | @Override
public <B> State<S, B> flatMap(Function<? super A, ? extends Monad<B, State<S, ?>>> f) {
return state(s -> run(s).into((a, s2) -> f.apply(a).<State<S, B>>coerce().run(s2)));
} |
java | protected boolean projectOntoFundamentalSpace( DMatrixRMaj F ) {
if( !svdConstraints.decompose(F) ) {
return false;
}
svdV = svdConstraints.getV(svdV,false);
svdU = svdConstraints.getU(svdU,false);
svdS = svdConstraints.getW(svdS);
SingularOps_DDRM.descendingOrder(svdU, false, svdS, svdV, false);
// ... |
python | def load(cls, pipeline_name, frequency, subject_id, visit_id, from_study,
path):
"""
Loads a saved provenance object from a JSON file
Parameters
----------
path : str
Path to the provenance file
frequency : str
The frequency of the re... |
java | @NotNull
public static DoubleStream of(@NotNull PrimitiveIterator.OfDouble iterator) {
Objects.requireNonNull(iterator);
return new DoubleStream(iterator);
} |
python | def make_class_postinject_decorator(classkey, modname=None):
"""
Args:
classkey : the class to be injected into
modname : the global __name__ of the module youa re injecting from
Returns:
closure_decorate_postinject (func): decorator for injectable methods
SeeAlso:
make... |
python | def _pad_nochord(target, axis=-1):
'''Pad a chord annotation with no-chord flags.
Parameters
----------
target : np.ndarray
the input data
axis : int
the axis along which to pad
Returns
-------
target_pad
`target` expanded by 1 along the specified `axis`.
... |
python | def delete(self, client=None):
"""API call: delete a sink via a DELETE request
See
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks/delete
:type client: :class:`~google.cloud.logging.client.Client` or
``NoneType``
:param client: t... |
python | def Parser(grammar, **actions):
r"""Make a parsing function from a peglet grammar, defining the
grammar's semantic actions with keyword arguments.
The parsing function maps a string to a results tuple or raises
Unparsable. (It can optionally take a rule name to start from, by
default the first in t... |
python | def set(key, value, timeout = -1, adapter = MemoryAdapter):
'''
set cache by code, must set timeout length
'''
if adapter(timeout = timeout).set(key, pickle.dumps(value)):
return value
else:
return None |
java | public static String findDefaultImageVersion( String rawVersion ) {
String rbcfVersion = rawVersion;
if( rbcfVersion == null
|| rbcfVersion.toLowerCase().endsWith( "snapshot" ))
rbcfVersion = LATEST;
return rbcfVersion;
} |
java | public String getPOIs(String id, double minX, double minY, double maxX, double maxY, List<Param> optionalParams)
throws Exception {
DescribeService describeService = getDescribeServiceByID(id);
POIProxyEvent beforeEvent = new POIProxyEvent(POIProxyEventEnum.BeforeBrowseExtent, describeService,
new Extent(mi... |
python | def _ping(self, uid, addr, port):
"""
Just say hello so that pymlgame knows that your controller is still alive. Unused controllers will be deleted
after a while. This function is also used to update the address and port of the controller if it has changed.
:param uid: Unique id of the ... |
python | def set_resize_parameters(
self,
degrad=6,
labels=None,
resize_mm=None,
resize_voxel_number=None,
):
"""
set_input_data() should be called before
:param degrad:
:param labels:
:param resize_mm:
:param resize... |
python | def enqueue(self, item, queue=None):
"""
Enqueue items.
If you define "self.filter" (sequence),
this method put the item to queue after filtering.
"self.filter" operates as blacklist.
This method expects that
"item" argument has dict type "data" attribute.
... |
java | public static INDArrayIndex[] fillIn(int[] shape, INDArrayIndex... indexes) {
if (shape.length == indexes.length)
return indexes;
INDArrayIndex[] newIndexes = new INDArrayIndex[shape.length];
System.arraycopy(indexes, 0, newIndexes, 0, indexes.length);
for (int i = indexes.... |
python | def do_page_truncate(self, args: List[str]):
"""Read in a text file and display its output in a pager, truncating long lines if they don't fit.
Truncated lines can still be accessed by scrolling to the right using the arrow keys.
Usage: page_chop <file_path>
"""
if not args:
... |
python | def fix_module(job):
"""
Fix for tasks without a module. Provides backwards compatibility with < 0.1.5
"""
modules = settings.RQ_JOBS_MODULE
if not type(modules) == tuple:
modules = [modules]
for module in modules:
try:
module_match = importlib.import_module(module)
... |
java | private TypeSpec enumAdapter(NameAllocator nameAllocator, EnumType type, ClassName javaType,
ClassName adapterJavaType) {
String value = nameAllocator.get("value");
String i = nameAllocator.get("i");
String reader = nameAllocator.get("reader");
String writer = nameAllocator.get("writer");
Typ... |
java | public Object execute(Context context) {
for (Map.Entry<String, Integer> entry : ruleNameToExpectedFireCountMap.entrySet()) {
String ruleName = entry.getKey();
int expectedFireCount = entry.getValue();
int actualFireCount = firedRuleCounter.getRuleNameFireCount(ruleName);
... |
python | def get_netapp_data(self):
""" Retrieve netapp volume information
returns ElementTree of netapp volume information
"""
netapp_data = self.server.invoke('volume-list-info')
if netapp_data.results_status() == 'failed':
self.log.error(
'While usin... |
python | def nvrtcCreateProgram(self, src, name, headers, include_names):
"""
Creates and returns a new NVRTC program object.
"""
res = c_void_p()
headers_array = (c_char_p * len(headers))()
headers_array[:] = encode_str_list(headers)
include_names_array = (c_char_p * len(... |
python | def is_prime(number):
"""
Function to test primality of a number. Function lifted from online
resource:
http://www.codeproject.com/Articles/691200/Primality-test-algorithms-Prime-test-The-fastest-w
This function is distributed under a separate licence:
This article, along with any assoc... |
python | def _should_fetch_reason(self) -> Tuple[bool, str]:
'''Return info about whether the URL should be fetched.
Returns:
tuple: A two item tuple:
1. bool: If True, the URL should be fetched.
2. str: A short reason string explaining the verdict.
'''
is_re... |
java | @SuppressWarnings({ "unchecked", "rawtypes" })
public static Object convert(Object value, Class<?> type) {
if (value == null || type == null || type.isAssignableFrom(value.getClass())) {
return value;
}
if (value instanceof String) {
String string = (String) value;
... |
java | public static boolean registerVIVOPush(Application application, String profile) {
vivoDeviceProfile = profile;
com.vivo.push.PushClient client = com.vivo.push.PushClient.getInstance(application.getApplicationContext());
try {
client.checkManifest();
client.initialize();
return true;
} ... |
python | def NewFromLab(l, a, b, alpha=1.0, wref=_DEFAULT_WREF):
'''Create a new instance based on the specifed CIE-LAB values.
Parameters:
:l:
The L component [0...100]
:a:
The a component [-1...1]
:b:
The a component [-1...1]
:alpha:
The color transparency [0...... |
python | def _get_web_session(self):
"""
:return: authenticated web session
:rtype: :class:`requests.Session`
:raises: :class:`RuntimeError` when session is unavailable
"""
if isinstance(self.backend, MobileWebAuth):
return self.backend.session
else:
... |
java | public byte[] getEncodedValue()
{
final String characterEncoding = this.chaiConfiguration.getSetting( ChaiSetting.LDAP_CHARACTER_ENCODING );
final byte[] password = modifyPassword.getBytes( Charset.forName( characterEncoding ) );
final byte[] dn = modifyDn.getBytes( Charset.forName( characte... |
java | public Variable[] intersect(Scope scope) {
Collection<Variable> intersection = new ArrayList<Variable>();
// A set of variable names that have been moved into the intersection.
Set<String> matchedNames = new HashSet<String>(7);
intersectFrom(this, scope, matchedNames, intersect... |
java | protected void applyWcmMarkup(@Nullable HtmlElement<?> mediaElement, @NotNull Media media) {
// further processing in edit or preview mode
Resource resource = media.getMediaRequest().getResource();
if (mediaElement != null && resource != null && wcmMode != null) {
switch (wcmMode) {
case EDIT... |
java | private int countOverlap(CharSequence c1, int start1,
CharSequence c2, int start2) {
// The maxium overlap is the number of characters in the sequences
int maxOverlap = Math.min(c1.length() - start1, c2.length() - start2);
int overlap = 0;
for (; overlap < maxOverlap; ++overlap)... |
java | public static Method find(TypeDef clazz, Property property) {
return find(clazz, property, false);
} |
python | def output_data_ports(self, output_data_ports):
""" Setter for _output_data_ports field
See property
:param dict output_data_ports: Dictionary that maps :class:`int` data_port_ids onto values of type
:class:`rafcon.core.state_elements.data_port.OutputDataP... |
java | public void setPagerTransformer(boolean reverseDrawingOrder,BaseTransformer transformer){
mViewPagerTransformer = transformer;
mViewPagerTransformer.setCustomAnimationInterface(mCustomAnimation);
mViewPager.setPageTransformer(reverseDrawingOrder,mViewPagerTransformer);
} |
python | def _register(self):
"""Register wrapper."""
logger.debug('register on %s', "ws://{}:{}".format(self.ip, self.port));
try:
websocket = yield from websockets.connect(
"ws://{}:{}".format(self.ip, self.port), timeout=self.timeout_connect)
except:
lo... |
java | @Override
public DataSet vectorize(InputStream is, String label) {
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(is, "UTF-8"));
String line = "";
StringBuilder builder = new StringBuilder();
while ((line = reader.readLine()) != null) {... |
java | public final void mIDENT_LIST() throws RecognitionException {
try {
int _type = IDENT_LIST;
int _channel = DEFAULT_TOKEN_CHANNEL;
// BELScript.g:269:11: ( '{' OBJECT_IDENT ( COMMA OBJECT_IDENT )* '}' )
// BELScript.g:270:5: '{' OBJECT_IDENT ( COMMA OBJECT_IDENT )*... |
python | def compare(self, remotedir = None, localdir = None, skip_remote_only_dirs = False):
''' Usage: compare [remotedir] [localdir] - \
compare the remote directory with the local directory
remotedir - the remote directory at Baidu Yun (after app's directory). \
if not specified, it defaults to the root directory.
loc... |
java | public List<Duplet<String, ArrayList<WComponent>>> getTerms() {
Map<String, Duplet<String, ArrayList<WComponent>>> componentsByTerm = new HashMap<>();
List<Duplet<String, ArrayList<WComponent>>> result = new ArrayList<>();
List<WComponent> childList = content.getComponentModel().getChildren();
if (childList !... |
python | def notify(self, instance, old, new):
"""
Call all callback functions with the current value
Each callback will either be called using
callback(new) or callback(old, new) depending
on whether ``echo_old`` was set to `True` when calling
:func:`~echo.add_callback`
... |
python | def convex_conj(self):
r"""The convex conjugate functional of the quadratic form.
Notes
-----
The convex conjugate of the quadratic form :math:`<x, Ax> + <b, x> + c`
is given by
.. math::
(<x, Ax> + <b, x> + c)^* (x) =
<(x - b), A^-1 (x - b)> - c... |
python | def _count_by_date(self, fname, all_dates):
"""
reads a logfile and returns a dictionary by date
showing the count of log entries
"""
if not os.path.isfile(fname):
return {}
d_log_sum = {}
with open(fname, "r") as raw_log:
for line in raw_l... |
java | public DocumentRepository asDocumentRepository(EnvironmentType env, String user, String pwd) throws Exception
{
return (DocumentRepository)new FactoryConverter().convert(type.asFactoryArguments(this, env, true, user, pwd));
} |
python | def _parse_option(option):
"""
Parse a 'key=val' option string into a python (key, val) pair
:param option: str
:return: tuple
"""
try:
key, val = option.split("=", 1)
except ValueError:
return option, True
try:
val = json.loads(val)
except json.JSONDecodeEr... |
java | public ServiceSimpleType createServiceSimpleTypeFromString(EDataType eDataType, String initialValue) {
ServiceSimpleType result = ServiceSimpleType.get(initialValue);
if (result == null)
throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() ... |
java | public static String join(Collection<String> toJoin, String separator) {
if (isNullOrEmpty(toJoin)) {
return "";
}
StringBuilder joinedString = new StringBuilder();
int currentIndex = 0;
for (String s : toJoin) {
if(s != null) {
joinedStri... |
python | def get_random_password():
"""Get a random password that complies with most of the requirements.
Note:
This random password is not strong and not "really" random, and should only be
used for testing purposes.
Returns:
str: The random password.
"""
... |
python | def _windows_virtual(osdata):
'''
Returns what type of virtual hardware is under the hood, kvm or physical
'''
# Provides:
# virtual
# virtual_subtype
grains = dict()
if osdata['kernel'] != 'Windows':
return grains
grains['virtual'] = 'physical'
# It is possible tha... |
java | void chooseUpsertPlugin(Context context) {
DatabaseType type = detectDB(context);
PluginConfiguration pluginConfiguration = new PluginConfiguration();
switch (type){
case MYSQL:
pluginConfiguration.setConfigurationType(MySqlUpsertPlugin.class.getTypeName());
context.addPluginConfigurat... |
java | public static ns_ssl_certkey_policy[] get_filtered(nitro_service service, String filter) throws Exception
{
ns_ssl_certkey_policy obj = new ns_ssl_certkey_policy();
options option = new options();
option.set_filter(filter);
ns_ssl_certkey_policy[] response = (ns_ssl_certkey_policy[]) obj.getfiltered(servi... |
python | def add(self, type, orig, replace):
"""Add an entry in the catalog, it may overwrite existing but
different entries. """
ret = libxml2mod.xmlACatalogAdd(self._o, type, orig, replace)
return ret |
java | @Pure
public static String getString(ClassLoader classLoader, String key, Object... params) {
return getString(classLoader, detectResourceClass(null), key, params);
} |
python | def getLogger(name):
"""This is used by gcdt plugins to get a logger with the right level."""
logger = logging.getLogger(name)
# note: the level might be adjusted via '-v' option
logger.setLevel(logging_config['loggers']['gcdt']['level'])
return logger |
java | public void setGramRole(String v) {
if (PTBConstituent_Type.featOkTst && ((PTBConstituent_Type)jcasType).casFeat_gramRole == null)
jcasType.jcas.throwFeatMissing("gramRole", "de.julielab.jules.types.PTBConstituent");
jcasType.ll_cas.ll_setStringValue(addr, ((PTBConstituent_Type)jcasType).casFeatCode_gramR... |
java | protected void pushDecodingInstanceVar(CodeAssembler a, int ordinal,
LocalVariable instanceVar) {
if (instanceVar == null) {
// Push this to stack in preparation for storing a property.
a.loadThis();
} else if (instanceVar.getType()... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.