language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | @Deprecated
public void setPaddingChar(final char paddingChar) {
if (Character.isDigit(paddingChar)) {
throw new IllegalArgumentException("Padding character should not be a digit.");
}
getOrCreateComponentModel().paddingChar = paddingChar;
} |
java | public static String get(String url, Map<String, String> body) {
return get(url, JSONObject.toJSONString(body));
} |
java | public static TreeMap<String, String> getTemplates(CmsObject cms, String currWpPath) throws CmsException {
return getElements(cms, CmsWorkplace.VFS_DIR_TEMPLATES, currWpPath, true);
} |
python | def recognize(self,
audio,
model=None,
language_customization_id=None,
acoustic_customization_id=None,
base_model_version=None,
customization_weight=None,
inactivity_timeout=None,
... |
java | @SideOnly(Side.CLIENT)
public static void addHitEffects(World world, RayTraceResult target, ParticleManager particleManager, IBlockState... states)
{
BlockPos pos = target.getBlockPos();
if (ArrayUtils.isEmpty(states))
states = new IBlockState[] { world.getBlockState(pos) };
IBlockState baseState = world.ge... |
java | public static ContaineredTaskManagerParameters create(
Configuration config,
long containerMemoryMB,
int numSlots) {
// (1) try to compute how much memory used by container
final long cutoffMB = calculateCutoffMB(config, containerMemoryMB);
// (2) split the remaining Java memory between heap and off-hea... |
java | @Exported(visibility=2)
public List<Cause> getCauses() {
List<Cause> r = new ArrayList<>();
for (Map.Entry<Cause,Integer> entry : causeBag.entrySet()) {
r.addAll(Collections.nCopies(entry.getValue(), entry.getKey()));
}
return Collections.unmodifiableList(r);
} |
python | def get(self, path, default_value):
"""
Get value for config item into a string value; leading slash is optional
and ignored.
"""
return lib.zconfig_get(self._as_parameter_, path, default_value) |
python | def _parse_for_errors(self):
""" Look for an error tag and raise APIError for fatal errors or APIWarning for nonfatal ones. """
error = self._response.find('{www.clusterpoint.com}error')
if error is not None:
if error.find('level').text.lower() in ('rejected', 'failed', 'error', 'fat... |
java | public void exportResourcesAndUserdata(String exportFile, String pathList) throws Exception {
exportResourcesAndUserdata(exportFile, pathList, false);
} |
python | def scale_joint_sfs_folded(s, n1, n2):
"""Scale a folded joint site frequency spectrum.
Parameters
----------
s : array_like, int, shape (m_chromosomes//2, n_chromosomes//2)
Folded joint site frequency spectrum.
n1, n2 : int, optional
The total number of chromosomes called in each p... |
java | protected <T> T processTransactionError(Transaction t, TxCallable<T> callable, TxCallable<T> process) throws Exception {
try {
return callable.call(t);
} catch (Exception e) {
return processCheckRowCountError(t, e, e, process);
}
} |
python | def createPdf(htmlreport, outfile=None, css=None, images={}):
"""create a PDF from some HTML.
htmlreport: rendered html
outfile: pdf filename; if supplied, caller is responsible for creating
and removing it.
css: remote URL of css file to download
images: A dictionary containing possibl... |
java | public com.google.api.ads.admanager.axis.v201902.LineItemDiscountType getDiscountType() {
return discountType;
} |
python | def char_size(self, size):
'''Changes font size
Args:
size: change font size. Options are 24' '32' '48' for bitmap fonts
33, 38, 42, 46, 50, 58, 67, 75, 83, 92, 100, 117, 133, 150, 167, 200 233,
11, 44, 77, 111, 144 for outline fonts.
Returns:
... |
python | def mmGetCellActivityPlot(self, title=None, showReset=False,
resetShading=0.25):
""" Returns plot of the cell activity.
@param title an optional title for the figure
@param showReset if true, the first set of cell activities after a reset
will have a gray ... |
java | protected Label newButtonLabel(final String id, final String resourceKey,
final String defaultValue)
{
final IModel<String> labelModel = ResourceModelFactory.newResourceModel(resourceKey, this,
defaultValue);
final Label label = new Label(id, labelModel);
label.setOutputMarkupId(true);
return label;
} |
python | def build_synchronize_decorator():
"""Returns a decorator which prevents concurrent calls to functions.
Usage:
synchronized = build_synchronize_decorator()
@synchronized
def read_value():
...
@synchronized
def write_value(x):
...
Returns:
make_threadsafe (fct): The decorato... |
java | protected void offerAt(final int pos, O e) {
if(pos == NO_VALUE) {
// resize when needed
if(size + 1 > queue.length) {
resize(size + 1);
}
index.put(e, size);
size++;
heapifyUp(size - 1, e);
heapModified();
return;
}
assert (pos >= 0) : "Unexpected neg... |
java | public static StatsInstanceImpl createInstance(String name, String configXmlPath, ObjectName userProvidedMBeanObjectName, boolean bCreateDefaultMBean,
StatisticActions actionLsnr)
throws StatsFactoryException {
PmiModuleConfig cfg = PerfMod... |
python | def incoming_phone_numbers(self):
"""
Access the incoming_phone_numbers
:returns: twilio.rest.api.v2010.account.incoming_phone_number.IncomingPhoneNumberList
:rtype: twilio.rest.api.v2010.account.incoming_phone_number.IncomingPhoneNumberList
"""
if self._incoming_phone_n... |
java | protected MemberId next() {
// If a connection was already established then use that connection.
if (currentNode != null) {
return currentNode;
}
if (!selector.hasNext()) {
if (selector.leader() != null) {
selector.reset(null, selector.members());
this.currentNode = selector... |
python | def _prepare_memoization_key(args, kwargs):
"""
Make a tuple of arguments which can be used as a key
for a memoized function's lookup_table. If some object can't be hashed
then used its __repr__ instead.
"""
key_list = []
for arg in args:
try:
hash(arg)
key_li... |
python | def download(self, data, block_num=-1):
"""
Downloads a DB data into the AG.
A whole block (including header and footer) must be available into the
user buffer.
:param block_num: New Block number (or -1)
:param data: the user buffer
"""
type_ = c_byte
... |
java | public static Optional<Class> resolveSuperGenericTypeArgument(Class type) {
try {
Type genericSuperclass = type.getGenericSuperclass();
if (genericSuperclass instanceof ParameterizedType) {
return resolveSingleTypeArgument(genericSuperclass);
}
ret... |
java | @Before
public void setUp() {
defineApplicationLocales();
clearKeys();
List<Key> keys = new ArrayList<>();
keys.add(createKey(KEY_DEFAULT, false, false, false));
Key outdatedKey = createKey(KEY_OUTDATED, false, false, false);
outdatedKey.setOutdated();
keys... |
java | public EntryStream<K, V> filterValues(Predicate<? super V> valuePredicate) {
return filter(e -> valuePredicate.test(e.getValue()));
} |
python | def label_weight(base, label_name=None, children=[], parents=[],
dependencies=[]):
"""
Function that returns a Formatoption class for modifying the fontweight
This function returns a :class:`~psyplot.plotter.Formatoption` instance
that modifies the weight of the given `base` formatopti... |
java | private void shrink() {
/* If the size of the topmost array is at its minimum, don't do
* anything. This doesn't change the asymptotic memory usage because
* we only do this for small arrays.
*/
if (mArrays.length == kMinArraySize) return;
/* Otherwise, we cur... |
python | def get_field(field, slog, fl=False):
"""parse sample log for field
set fl=True to return a float
otherwise, returns int
"""
field += r'\:\s+([\d\.]+)'
match = re.search(field, slog)
if match:
if fl:
return float(match.group(1))
... |
python | def merge_sketches(outdir, sketch_paths):
"""Merge new Mash sketches with current Mash sketches
Args:
outdir (str): output directory to write merged Mash sketch file
sketch_paths (list of str): Mash sketch file paths for input fasta files
Returns:
str: output path for Mash sketch f... |
java | @Override
public <DATA> JsonObjectPersister<DATA> createInFileObjectPersister(Class<DATA> clazz, File cacheFolder)
throws CacheCreationException {
return new JsonObjectPersister<DATA>(getApplication(), jsonFactory, clazz, cacheFolder);
} |
java | public VpnSiteInner beginCreateOrUpdate(String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, vpnSiteName, vpnSiteParameters).toBlocking().single().body();
} |
python | def unfinished(finished_status,
update_interval,
status_key,
edit_at_key):
"""
Create dict query for pymongo that getting all unfinished task.
:param finished_status: int, status code that less than this
will be considered as unfinished.
:param updat... |
java | private Attribute parseAttribute(StreamTokenizer tokenizer) throws IOException, ParseException {
Attribute attribute = null;
// Get attribute name.
getNextToken(tokenizer);
String attributeName = tokenizer.sval;
getNextToken(tokenizer);
// Check if attribute is nominal.... |
python | def deprecated(func_or_text, environ=os.environ):
'''
Decorator used to mark functions as deprecated. It will result in a
warning being emmitted hen the function is called.
Usage:
>>> @deprecated
... def fnc():
... pass
Usage (custom message):
>>> @deprecated('This is depreca... |
python | def authenticate(self, name, password, mechanism="DEFAULT"):
"""
Send an authentication command for this database.
mostly stolen from pymongo
"""
if not isinstance(name, (bytes, unicode)):
raise TypeError("TxMongo: name must be an instance of basestring.")
if ... |
python | def form_group_classes(self):
"""
Full list of classes for the class attribute of the form group. Returned as a string
with spaces separating each class, ready for insertion into the class attribute.
This will generally look like the following:
'form-group has-error custom-clas... |
python | def draw(
self,
tree_style=None,
height=None,
width=None,
axes=None,
orient=None,
tip_labels=None,
tip_labels_colors=None,
tip_labels_style=None,
tip_labels_align=None,
node_labels=None,
node_labels_style=None,
... |
python | def step(self, step_size: Timedelta=None):
"""Advance the simulation one step.
Parameters
----------
step_size
An optional size of step to take. Must be the same type as the
simulation clock's step size (usually a pandas.Timedelta).
"""
old_step_s... |
python | def dt_comp(self, sampled_topics):
"""
Compute document-topic matrix from sampled_topics.
"""
samples = sampled_topics.shape[0]
dt = np.zeros((self.D, self.K, samples))
for s in range(samples):
dt[:, :, s] = \
samplers_ld... |
java | private Long findTransactionBeginPosition(ErosaConnection mysqlConnection, final EntryPosition entryPosition)
throws IOException {
// 针对开始的第一条为非Begin记录,需要从该binlog扫描
final java.util.concurrent... |
java | public static boolean isUnauthenticated(Subject subject) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
SibTr.entry(tc, CLASS_NAME + "isUnauthenticated", subject);
}
boolean result = subjectHelper.isUnauthenticated(subject);
if (TraceComponent.isAnyTraci... |
java | Map<String, ProvidedName> collectProvidedNames(Node externs, Node root) {
if (this.providedNames.isEmpty()) {
// goog is special-cased because it is provided in Closure's base library.
providedNames.put(GOOG, new ProvidedName(GOOG, null, null, false /* implicit */, false));
NodeTraversal.traverseR... |
java | public static <E> ProxyChannel<E> createMpscProxy(int capacity,
Class<E> iFace,
WaitStrategy waitStrategy) {
return createProxy(capacity,
iFace,
waitStrategy,
MpscOffHeapFixedSizeRingBuffer.class);
} |
java | public static ReturnType getReturnTypeDescriptor(String methodDescriptor) {
int index = methodDescriptor.indexOf(')') + 1;
if (methodDescriptor.charAt(index) == 'L') {
return new ReturnType(methodDescriptor.substring(index + 1, methodDescriptor.length() - 1), Kind.REFERENCE);
}
else {
return new ReturnTyp... |
java | public void setReceiveMessageAttributeNames(List<String> receiveMessageAttributeNames) {
if (receiveMessageAttributeNames == null) {
this.receiveMessageAttributeNames = Collections.emptyList();
} else {
this.receiveMessageAttributeNames = Collections.unmodifiableList(new ArrayLis... |
python | def resolve(self, cfg, addr, func_addr, block, jumpkind):
"""
Resolves the indirect jump in MIPS ELF binaries where all external function calls are indexed using gp.
:param cfg: A CFG instance.
:param int addr: IRSB address.
:param int func_addr: The function address.
:p... |
python | def chain(*layers):
"""Compose two models `f` and `g` such that they become layers of a single
feed-forward model that computes `g(f(x))`.
Raises exception if their dimensions don't match.
"""
if len(layers) == 0:
return FeedForward([])
elif len(layers) == 1:
return layers[0]
... |
java | public /*@Nullable*/Downloader startGetFile(final String path, /*@Nullable*/String rev)
throws DbxException
{
DbxPathV1.checkArgNonRoot("path", path);
String apiPath = "1/files/auto" + path;
/*@Nullable*/String[] params = {
"rev", rev
};
return startGe... |
python | def numeric(self, *args, **kwargs):
"""Compare attributes of pairs with numeric algorithm.
Shortcut of :class:`recordlinkage.compare.Numeric`::
from recordlinkage.compare import Numeric
indexer = recordlinkage.Compare()
indexer.add(Numeric())
"""
c... |
java | public void add(IntArrayList values) {
ensureCapacity(size + values.size);
for (int i=0; i<values.size; i++) {
this.add(values.elements[i]);
}
} |
python | def parse_policies(self, fetched_policy, params):
"""
Parse a single IAM policy and fetch additional information
"""
api_client = params['api_client']
policy = {}
policy['name'] = fetched_policy.pop('PolicyName')
policy['id'] = fetched_policy.pop('PolicyId')
... |
java | public void marshall(SegmentImportResource segmentImportResource, ProtocolMarshaller protocolMarshaller) {
if (segmentImportResource == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(segmentImportRes... |
python | def loadLibSVMFile(sc, path, numFeatures=-1, minPartitions=None):
"""
Loads labeled data in the LIBSVM format into an RDD of
LabeledPoint. The LIBSVM format is a text-based format used by
LIBSVM and LIBLINEAR. Each line represents a labeled sparse
feature vector using the followi... |
java | public int nextSetBit(final int i) {
int x = i >> 6;
long w = bitmap[x];
w >>>= i;
if (w != 0) {
return i + numberOfTrailingZeros(w);
}
for (++x; x < bitmap.length; ++x) {
if (bitmap[x] != 0) {
return x * 64 + numberOfTrailingZeros(bitmap[x]);
}
}
return -1;
} |
python | def linecol_to_pos(text, line, col):
"""Return the offset of this line and column in text.
Lines are one-based, columns zero-based.
This is how Jedi wants it. Don't ask me why.
"""
nth_newline_offset = 0
for i in range(line - 1):
new_offset = text.find("\n", nth_newline_offset)
... |
java | @BetaApi
public final Operation insertBackendService(
String project, BackendService backendServiceResource) {
InsertBackendServiceHttpRequest request =
InsertBackendServiceHttpRequest.newBuilder()
.setProject(project)
.setBackendServiceResource(backendServiceResource)
... |
java | @Override
public void commence(final HttpServletRequest request,
final HttpServletResponse response,
final AuthenticationException authException) throws IOException {
// This is invoked when user tries to access a secured REST resource
// without supplying any credentials. We... |
python | def dirint(ghi, altitudes, doys, pressures, use_delta_kt_prime=True,
temp_dew=None, min_sin_altitude=0.065, min_altitude=3):
"""
Determine DNI from GHI using the DIRINT modification of the DISC
model.
Implements the modified DISC model known as "DIRINT" introduced in
[1]. DIRINT predicts... |
python | def construct_parameter_pattern(parameter):
"""
Given a parameter definition returns a regex pattern that will match that
part of the path.
"""
name = parameter['name']
type = parameter['type']
repeated = '[^/]'
if type == 'integer':
repeated = '\d'
return "(?P<{name}>{rep... |
java | public static I_CmsVfsServiceAsync getVfsService() {
if (VFS_SERVICE == null) {
VFS_SERVICE = GWT.create(I_CmsVfsService.class);
String serviceUrl = CmsCoreProvider.get().link("org.opencms.gwt.CmsVfsService.gwt");
((ServiceDefTarget)VFS_SERVICE).setServiceEntryPoint(serviceU... |
java | public synchronized boolean addAll(int index, Collection<? extends E> c) {
modCount++;
if (index < 0 || index > elementCount)
throw new ArrayIndexOutOfBoundsException(index);
Object[] a = c.toArray();
int numNew = a.length;
ensureCapacityHelper(elementCount + numNew)... |
python | def handle_response(response):
"""
Given a requests.Response object, throw the appropriate exception, if applicable.
"""
# ignore valid responses
if response.status_code < 400:
return
cls = _status_to_exception_type.get(response.status_code, HttpError)
kwargs = {
'code': r... |
java | public LinePlot line(double[][] data, Line.Style style) {
return line(null, data, style);
} |
python | def until(condition, fns):
"""
Try a list of seeder functions until a condition is met.
:param condition:
a function that takes one argument - a seed - and returns ``True``
or ``False``
:param fns:
a list of seeder functions
:return:
a "composite" seeder function t... |
java | public static List<WriteFuture> broadcast(Object message, IoSession... sessions) {
if (sessions == null) {
sessions = EMPTY_SESSIONS;
}
List<WriteFuture> answer = new ArrayList<>(sessions.length);
if (message instanceof IoBuffer) {
for (IoSession s: sessi... |
java | public void markInitialState() {
if (!attachedObjects.isEmpty()) {
for (T t : attachedObjects) {
if (t instanceof PartialStateHolder) {
((PartialStateHolder) t).markInitialState();
}
}
}
initialState = true;
} |
java | public void sampleSequenceForward(SequenceModel model, int[] sequence, double temperature) {
// System.err.println("Sampling forward");
for (int pos=0; pos<sequence.length; pos++) {
samplePosition(model, sequence, pos, temperature);
}
} |
java | private Later<JsonNode> createFetcher() {
final RequestBuilder call = new GraphRequestBuilder(getGraphEndpoint(), HttpMethod.POST, this.timeout, this.retries);
// This actually creates the correct JSON structure as an array
String batchValue = JSONUtils.toJSON(this.graphRequests, this.mapper);
if (log.i... |
java | public void updateBackground(MotionModel homeToCurrent, T frame) {
worldToHome.concat(homeToCurrent, worldToCurrent);
worldToCurrent.invert(currentToWorld);
// find the distorted polygon of the current image in the "home" background reference frame
transform.setModel(currentToWorld);
transform.compute(0, 0, ... |
java | private static byte[] lmHash(String password) throws Exception {
byte[] oemPassword = password.toUpperCase().getBytes("US-ASCII");
int length = Math.min(oemPassword.length, 14);
byte[] keyBytes = new byte[14];
System.arraycopy(oemPassword, 0, keyBytes, 0, length);
Key lowKey = cr... |
java | public boolean process( List<AssociatedPair> points , DMatrixRMaj solution ) {
if( points.size() < 8 )
throw new IllegalArgumentException("Must be at least 8 points. Was only "+points.size());
// use normalized coordinates for pixel and calibrated
// TODO re-evaluate decision to normalize for calibrated case
... |
python | def desc(t=None, reg=True):
"""
Describe Class Dependency
:param reg: should we register this class as well
:param t: custom type as well
:return:
"""
def decorated_fn(cls):
if not inspect.isclass(cls):
return NotImplemented('For now we can only describe classes')
... |
java | @Override
public SqlContext inOutParam(final String parameterName, final Object value, final SQLType sqlType) {
if (value instanceof Optional) {
Optional<?> optionalValue = (Optional<?>) value;
if (optionalValue.isPresent()) {
param(new InOutParameter(parameterName, optionalValue.get(), sqlType));
} els... |
java | public static String cutBegin(String data, int maxLength) {
if (data.length() > maxLength) {
return "..." + data.substring(data.length() - maxLength, data.length());
} else {
return data;
}
} |
java | private static void matchScale(BigDecimal[] val) {
if (val[0].scale == val[1].scale) {
return;
} else if (val[0].scale < val[1].scale) {
val[0] = val[0].setScale(val[1].scale, ROUND_UNNECESSARY);
} else if (val[1].scale < val[0].scale) {
val[1] = val[1].setSca... |
java | public static byte[] bytes(String s) {
try {
return s.getBytes(ENCODING);
} catch (UnsupportedEncodingException e) {
log.error("UnsupportedEncodingException ", e);
throw new RuntimeException(e);
}
} |
java | public static <T> Iterator<T[]> combinationsIterator(final T[] elements, final int subsetSize) {
return new Iterator<T[]>() {
/**
* The index on the combination array.
*/
private int r = 0;
/**
* The index on the elements array.
... |
java | public java.util.List<ScheduledInstancesIpv6Address> getIpv6Addresses() {
if (ipv6Addresses == null) {
ipv6Addresses = new com.amazonaws.internal.SdkInternalList<ScheduledInstancesIpv6Address>();
}
return ipv6Addresses;
} |
java | public String createWorkflow(Workflow workflow) {
executionDAO.createWorkflow(workflow);
indexDAO.indexWorkflow(workflow);
return workflow.getWorkflowId();
} |
python | def apply_security_groups_to_lb(self, name, security_groups):
"""
Applies security groups to the load balancer.
Applying security groups that are already registered with the
Load Balancer has no effect.
:type name: string
:param name: The name of the Load Balancer
... |
python | def send_to_address(self, asset_id, to_addr, value, fee=None, change_addr=None, id=None, endpoint=None):
"""
Args:
asset_id: (str) asset identifier (for NEO: 'c56f33fc6ecfcd0c225c4ab356fee59390af8560be0e930faebe74a6daff7c9b', for GAS: '602c79718b16e442de58778e148d0b1084e3b2dffd5de6b7b16cee79... |
python | def get_neuroml_from_sonata(sonata_filename, id, generate_lems = True, format='xml'):
"""
Return a NeuroMLDocument with (most of) the contents of the Sonata model
"""
from neuroml.hdf5.NetworkBuilder import NetworkBuilder
neuroml_handler = NetworkBuilder()
sr = SonataReader(filename=s... |
java | @Support({SQLDialect.POSTGRES})
public static <T> Field<T[]> arrayAgg(Field<T> field) {
return DSL.field("array_agg({0})", field.getDataType().getArrayDataType(), field);
} |
java | public static Number multiply(Number left, Number right) {
return NumberMath.multiply(left, right);
} |
python | def event_listen(self, timeout=None, raise_on_disconnect=True):
'''Does not return until PulseLoopStop
gets raised in event callback or timeout passes.
timeout should be in seconds (float),
0 for non-blocking poll and None (default) for no timeout.
raise_on_disconnect causes PulseDisconnected exceptions... |
python | def retrieve_data_directory(self):
"""
Retrieve the data directory
Look first into config_filename_global
then into config_filename_user. The latter takes preeminence.
"""
args = self.args
try:
if args['datadirectory']:
aux.ensure_dir(a... |
java | @Override
public int compareTo(EigenPair o) {
if(this.eigenvalue < o.eigenvalue) {
return -1;
}
if(this.eigenvalue > o.eigenvalue) {
return +1;
}
return 0;
} |
python | def with_connection(func):
"""Decorate a function to open a new datafind connection if required
This method will inspect the ``connection`` keyword, and if `None`
(or missing), will use the ``host`` and ``port`` keywords to open
a new connection and pass it as ``connection=<new>`` to ``func``.
"""
... |
python | def generate (self, ps):
""" Generates all possible targets contained in this project.
"""
assert isinstance(ps, property_set.PropertySet)
self.manager_.targets().log(
"Building project '%s' with '%s'" % (self.name (), str(ps)))
self.manager_.targets().increase_indent... |
java | public Bucket updateBucket(String bucketName) {
// [START updateBucket]
BucketInfo bucketInfo = BucketInfo.newBuilder(bucketName).setVersioningEnabled(true).build();
Bucket bucket = storage.update(bucketInfo);
// [END updateBucket]
return bucket;
} |
python | def delete_on_computes(self):
"""
Delete the project on computes but not on controller
"""
for compute in list(self._project_created_on_compute):
if compute.id != "local":
yield from compute.delete("/projects/{}".format(self._id))
self._project... |
python | def get_hostmap(profile):
'''
We abuse the profile combination to also derive a pilot-host map, which
will tell us on what exact host each pilot has been running. To do so, we
check for the PMGR_ACTIVE advance event in agent_0.prof, and use the NTP
sync info to associate a hostname.
'''
# F... |
java | @SuppressWarnings("unchecked")
protected void processObject(/* String scope, */ Object tempelObject, Set<String> objectClassPath,
ITemplateRepository templateRepository, ITemplateSourceFactory templateSourceFactory) {
// Mapa parametrów pliku tempel.xml:
if(tempelObject instanceof Map) {
properties = new Tre... |
java | protected List<DisambiguationPatternRule> loadPatternRules(String filename) throws ParserConfigurationException, SAXException, IOException {
DisambiguationRuleLoader ruleLoader = new DisambiguationRuleLoader();
return ruleLoader.getRules(JLanguageTool.getDataBroker().getFromResourceDirAsStream(filename));
} |
python | def erange(start, end, steps):
"""
Returns a numpy array over the specified range taking geometric steps.
See also numpy.logspace()
"""
if start == 0:
print("Nothing you multiply zero by gives you anything but zero. Try picking something small.")
return None
if end == 0:
... |
java | @Override
public synchronized void addNotification(IntegerID consumerId, AbstractMessage prefetchedMessage)
{
NotificationPacket notifPacket = new NotificationPacket();
notifPacket.setSessionId(sessionId);
notifPacket.setConsumerId(consumerId);
notifPacket.setMessage(prefetchedMessage);
... |
python | def get_filename(key, message, default=None, history=None):
"""
Like :meth:`prompt`, but only accepts the name of an existing file
as an input.
:type key: str
:param key: The key under which to store the input in the :class:`InputHistory`.
:type message: str
:param message: The user promp... |
java | @Setup
public void setup() {
proxyInterceptor = MethodDelegation.to(ByteBuddyProxyInterceptor.class);
accessInterceptor = MethodDelegation.to(ByteBuddyAccessInterceptor.class);
prefixInterceptor = MethodDelegation.to(ByteBuddyPrefixInterceptor.class);
baseClassDescription = TypePool.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.