language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | public int getSpaces(char[] array, int currentIndex, StringBuffer velocityBlock,
VelocityParserContext context)
{
int i = currentIndex;
while (i < array.length && Character.isWhitespace(array[i])) {
++i;
}
if (velocityBlock != null) {
velocityBlock.a... |
java | public void copyStructure( DMatrixSparseCSC orig ) {
reshape(orig.numRows, orig.numCols, orig.nz_length);
this.nz_length = orig.nz_length;
System.arraycopy(orig.col_idx,0,col_idx,0,orig.numCols+1);
System.arraycopy(orig.nz_rows,0,nz_rows,0,orig.nz_length);
} |
java | public void updateTargetCellule(SIBUuid8 targetMEUuid) throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "updateTargetCellule", targetMEUuid);
this.targetMEUuid = targetMEUuid;
sourceStreamManager.updateTargetCellule(targetMEUui... |
python | async def set_volume(self, volume: int):
"""
Sets the volume of Lavalink.
Parameters
----------
volume : int
Between 0 and 150
"""
self._volume = max(min(volume, 150), 0)
await self.node.volume(self.channel.guild.id, self.volume) |
python | def weighted_hamming(b1, b2):
"""
Hamming distance that emphasizes differences earlier in strings.
"""
assert(len(b1) == len(b2))
hamming = 0
for i in range(len(b1)):
if b1[i] != b2[i]:
# differences at more significant (leftward) bits
# are more important
... |
python | def _display(port=None, height=None, print_message=False, display_handle=None):
"""Internal version of `display`.
Args:
port: As with `display`.
height: As with `display`.
print_message: True to print which TensorBoard instance was selected
for display (if applicable), or False otherwise.
dis... |
python | def refresh(
self):
"""*Refreshs this project's attributes if, for example, the parent document's projects or tasks has been sorted*
**Usage:**
To refresh the project:
.. code-block:: python
myProject.refresh
"""
if self.parent:
... |
java | public boolean render(RootDoc rootDoc, DocletRenderer renderer) {
if (!processOverview(rootDoc, renderer)) {
return false;
}
Set<PackageDoc> packages = new HashSet<PackageDoc>();
for (ClassDoc doc : rootDoc.classes()) {
packages.add(doc.containingPackage());
... |
python | def fetch(self, is_dl_forced=False):
"""
For the MGI resource, we connect to the remote database,
and pull the tables into local files.
We'll check the local table versions against the remote version
:return:
"""
# check if config exists; if it doesn't, error out ... |
python | def card_names_and_ids(self):
"""Returns [(name, id), ...] pairs of cards from current board"""
b = Board(self.client, self.board_id)
cards = b.getCards()
card_names_and_ids = [(unidecode(c.name), c.id) for c in cards]
return card_names_and_ids |
python | def fetch_contributing_projects(self, **kwargs):
"""
List projects as contributor
Fetch projects that the currently authenticated user has access to because he or she is a contributor.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, ... |
python | def show_observee(self, user_id, observee_id):
"""
Show an observee.
Gets information about an observed user.
*Note:* all users are allowed to view their own observees.
"""
path = {}
data = {}
params = {}
# REQUIRED - PATH - ... |
python | def get_urls(self, controllers=None, prefix_path=''):
"""
Return a list of all valid urls (minus args and kwargs, just the program paths)
for this manifest. If a single program has two urls, both will be returned.
"""
tag_match = lambda program: set(program.controllers) & set(con... |
python | def main():
""" Read the options given on the command line and do the required actions.
This method is used in the entry_point `cast`.
"""
opts = docopt(__doc__, version="cast 0.1")
cast = pychromecast.PyChromecast(CHROMECAST_HOST)
ramp = cast.get_protocol(pychromecast.PROTOCOL_RAMP)
# Wa... |
python | def graph(self, node_source, edge_source, layout_provider, **kwargs):
''' Creates a network graph using the given node, edge and layout provider.
Args:
node_source (:class:`~bokeh.models.sources.ColumnDataSource`) : a user-supplied data source
for the graph nodes. An attempt... |
python | def read_snapshots(path, comments="#", directed=False, delimiter=None,
nodetype=None, timestamptype=None, encoding='utf-8', keys=False):
"""Read a DyNetx graph from snapshot graph list format.
Parameters
----------
path : basestring
The desired output filena... |
java | @Override
public ListOperationsResult listOperations(ListOperationsRequest request) {
request = beforeClientExecution(request);
return executeListOperations(request);
} |
python | def subscribe(config, accounts, region, merge, debug):
"""subscribe accounts log groups to target account log group destination"""
config = validate.callback(config)
subscription = config.get('subscription')
if subscription is None:
log.error("config file: logs subscription missing")
sy... |
python | def _parse_create_args(client, args):
"""Converts CLI arguments to args for VSManager.create_instance.
:param dict args: CLI arguments
"""
data = {
"hourly": args.get('billing', 'hourly') == 'hourly',
"cpus": args.get('cpu', None),
"ipv6": args.get('ipv6', None),
"disks"... |
java | public void logp(Level level,
String sourceClass,
String sourceMethod,
String msg,
Object params1,
Object params2,
Object params3
)
{
logp(level,sourceClass, sourceMethod, msg, new Object[] {params1, params2, params3});
... |
python | def deactivate(self, asset_manager_id):
"""
Is is only possible to deactivate an asset manager if your client_id is also the client_id that was used
to originally create the asset manager.
:param asset_manager_id:
:return:
"""
self.logger.info('Deactivate Asset M... |
python | def create_class(self, method):
"""
Build the estimator class.
Returns
-------
:return : string
The built class as string.
"""
temp_type = self.temp('type')
temp_arr = self.temp('arr')
temp_arr_ = self.temp('arr[]')
temp_arr__ ... |
java | @Override
public void deleteByColumn(String schemaName, String tableName, String columnName, Object columnValue)
{
Object connection = null;
Pipeline pipeLine = null;
try
{
connection = getConnection();
if (isBoundTransaction())
{
... |
java | @Override
public String incomingClearText(String st) {
StringBuffer sb = new StringBuffer(st);
int idx = sb.indexOf("'IIDIA:");
if (idx != -1) {
int idx2 = sb.indexOf("'", idx + 1);
log.warn("removing invalid segment '" + sb.substring(idx + 1, idx2 + 1) + "'");
... |
python | def close(scope):
"""
Closes the existing connection with the remote host. This function is
rarely used, as normally Exscript closes the connection automatically
when the script has completed.
"""
conn = scope.get('__connection__')
conn.close(1)
scope.define(__response__=conn.response)
... |
java | public ResponseInfo syncPut(File file, String key, String token, UploadOptions options) {
final UpToken decodedToken = UpToken.parse(token);
ResponseInfo info = areInvalidArg(key, null, file, token, decodedToken);
if (info != null) {
return info;
}
return FormUploader... |
java | public boolean authenticate(String pUser, PublicKey pKey, ServerSession pSession) {
return user != null && user.equals(pUser) && allowedKey.equals(pKey);
} |
java | public void marshall(ListFileSharesRequest listFileSharesRequest, ProtocolMarshaller protocolMarshaller) {
if (listFileSharesRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(listFileSharesRe... |
java | @SuppressWarnings("unused") // called through reflection by RequestServer
public ModelsV3 delete(int version, ModelsV3 s) {
Model model = getFromDKV("key", s.model_id.key());
model.delete(); // lock & remove
return s;
} |
python | async def crunch(image_data, format, silent=False):
""" Crunch image data, and return the processed data, or orignal data if operation failed. """
if (((format is CoverImageFormat.PNG) and (not HAS_OPTIPNG)) or
((format is CoverImageFormat.JPEG) and (not HAS_JPEGOPTIM))):
return image_data
... |
java | public static <K, V> RedisTemplate<K, V> newRedisTemplate(final RedisConnectionFactory connectionFactory) {
val template = new RedisTemplate<K, V>();
val string = new StringRedisSerializer();
val jdk = new JdkSerializationRedisSerializer();
template.setKeySerializer(string);
temp... |
java | public D plus(CalendarDays days) {
long result = Math.addExact(this.getDaysSinceEpochUTC(), days.getAmount());
try {
return this.getChronology().getCalendarSystem().transform(result);
} catch (IllegalArgumentException iae) {
ArithmeticException ex = new ArithmeticExcept... |
python | def mag_rotation(RAW_IMU, inclination, declination):
'''return an attitude rotation matrix that is consistent with the current mag
vector'''
m_body = Vector3(RAW_IMU.xmag, RAW_IMU.ymag, RAW_IMU.zmag)
m_earth = Vector3(m_body.length(), 0, 0)
r = Matrix3()
r.from_euler(0, -radians(inclination)... |
python | def _parse_migrations(self):
"""Build a :class:`Migration` instance."""
migration = self.parsed['migration']
options = self._parse_options(migration)
versions = self._parse_versions(migration, options)
return Migration(versions, options) |
python | def sys_call(cmd):
"""Execute cmd and capture stdout and stderr
:param cmd: command to be executed
:return: (stdout, stderr)
"""
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True)
return p.stdout.readlines(), p.stderr.readlines() |
java | public void endpointDeactivation(MessageEndpointFactory mef, ActivationSpec as) throws Exception
{
if (mef == null)
throw new Exception("MessageEndpointFactory is null");
if (as == null)
throw new Exception("ActivationSpec is null");
Endpoint e = new Endpoint(mef, as);
Inf... |
java | public static List<? extends Object> getObjectList(Config config, String path) {
try {
return config.getAnyRefList(path);
} catch (ConfigException.Missing | ConfigException.WrongType e) {
if (e instanceof ConfigException.WrongType) {
LOGGER.warn(e.getMessage(), e)... |
python | def repmc(instr, marker, value, lenout=None):
"""
Replace a marker with a character string.
http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/repmc_c.html
:param instr: Input string.
:type instr: str
:param marker: Marker to be replaced.
:type marker: str
:param value: Replacemen... |
java | @Indexable(type = IndexableType.DELETE)
@Override
public CommerceNotificationTemplate deleteCommerceNotificationTemplate(
long commerceNotificationTemplateId) throws PortalException {
return commerceNotificationTemplatePersistence.remove(commerceNotificationTemplateId);
} |
python | def prepare_headers(self, headers):
"""Prepares the given HTTP headers."""
if headers:
self.headers = CaseInsensitiveDict((to_native_string(name), value) for name, value in headers.items())
else:
self.headers = CaseInsensitiveDict() |
python | def raw(self):
"""
An eager version of Trace
Returns
-------
raw : RawTrace
"""
return RawTrace(self.filehandle,
self.dtype,
len(self),
self.shape,
self.readonly,
... |
python | def add_xtalographic_info(data_api, struct_inflator):
""" Add the crystallographic data to the structure.
:param data_api the interface to the decoded data
:param struct_inflator the interface to put the data into the client object"""
if data_api.unit_cell == None and data_api.space_group is not None:
... |
python | def override_environment(settings, **kwargs):
# type: (Settings, **str) -> Generator
"""
Override env vars and reload the Settings object
NOTE:
Obviously this context has to be in place before you import any
module which reads env values at import time.
NOTE:
The values in `kwargs` mus... |
java | public Configuration createConfiguration(KNXNetworkLink link)
{
final ConfigImpl c = new ConfigImpl(link);
configs.add(c);
logger.info("created configuration for " + link.getName());
return c;
} |
java | public static long genSeed(final String ident) {
try {
MessageDigest instance = MessageDigest.getInstance("SHA-1");
byte[] strbytes = ident.getBytes("UTF-8");
byte[] digest = instance.digest(strbytes);
//use first 8 bytes as a long
return ByteBuffer.w... |
java | private void processCustomValueLists() throws IOException
{
CustomFieldValueReader9 reader = new CustomFieldValueReader9(m_projectDir, m_file.getProjectProperties(), m_projectProps, m_file.getCustomFields());
reader.process();
} |
java | public static void cancelAll(Context context,
Class<? extends GroundyService> groundyServiceClass) {
new GroundyServiceConnection(context, groundyServiceClass) {
@Override
protected void onGroundyServiceBound(GroundyService.GroundyServiceBinder binder) {
binder.cancelAllTasks();
}
... |
java | public static ExtractionFn fromQueryGranularity(final Granularity queryGranularity)
{
if (queryGranularity == null) {
return null;
} else {
return new TimeFormatExtractionFn(null, null, null, queryGranularity, true);
}
} |
java | static String[] toArray(JsArrayString values) {
if (GWT.isScript()) {
return reinterpretCast(values);
} else {
int length = values.length();
String[] ret = new String[length];
for (int i = 0, l = length; i < l; i++) {
ret[i] = values.get(i)... |
python | def __delete_directory(self, directory):
"""
Deletes given directory.
:param directory: Directory to delete.
:type directory: unicode
"""
for node in itertools.chain(self.__script_editor.model.get_project_nodes(directory),
self.__scri... |
java | @Pure
@Inline(value="($1 != $2)", constantExpression=true)
public static boolean operator_notEquals(char a, int b) {
return a != b;
} |
java | private void generateBuilderClass() {
if (data.isSkipBuilderGeneration()) {
return;
}
List<PropertyGen> nonDerived = nonDerivedProperties();
generateSeparator();
String finalType = data.isTypeFinal() ? "final " : "";
addLine(1, "/**");
addLine(1, " * T... |
python | def plot(figsize=None, formats=None, limit=100, titlelen=10, **kwargs):
"""Display an image [in a Jupyter Notebook] from a Quilt fragment path.
Intended for use with `%matplotlib inline`.
Convenience method that loops over supblots that call
`plt.imshow(image.imread(FRAG_PATH))`.
Keyword arguments... |
java | public void marshall(GetApplicationPolicyRequest getApplicationPolicyRequest, ProtocolMarshaller protocolMarshaller) {
if (getApplicationPolicyRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshal... |
python | def disaggregate_radiation(data_daily,
sun_times=None,
pot_rad=None,
method='pot_rad',
angstr_a=0.25,
angstr_b=0.5,
bristcamp_a=0.75,
... |
java | public static MetricRequest fromProtobuf(TopologyMaster.MetricRequest request) {
String componentName = request.getComponentName();
Map<String, Set<String>> componentNameInstanceId = new HashMap<>();
if (request.getInstanceIdCount() == 0) {
// empty list means all instances
// 'null' means all ... |
java | public Observable<BackupLongTermRetentionVaultInner> getAsync(String resourceGroupName, String serverName) {
return getWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1<ServiceResponse<BackupLongTermRetentionVaultInner>, BackupLongTermRetentionVaultInner>() {
@Override
... |
python | def GetDisplayNameForPathSpec(
cls, path_spec, mount_path=None, text_prepend=None):
"""Retrieves the display name of a path specification.
Args:
path_spec (dfvfs.PathSpec): path specification.
mount_path (Optional[str]): path where the file system that is used
by the path specificat... |
java | public DateFormat getDateTimeFormat(int dateStyle, int timeStyle, ULocale loc) {
return formatHelper(this, loc, dateStyle, timeStyle);
} |
java | public final AbstractItem removeIfMatches(final Filter filter, PersistentTransaction transaction) throws ProtocolException, TransactionException, SevereMessageStoreException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "removeIfMatches", new Object[] {... |
java | public LocalDate getInternalLocalDate(ColumnInformation columnInfo, TimeZone timeZone)
throws SQLException {
if (lastValueWasNull()) {
return null;
}
if (length == 0) {
lastValueNull |= BIT_LAST_FIELD_NULL;
return null;
}
String raw = new String(buf, pos, length, StandardCha... |
python | def get_cover_image(self, output_file_path=None, scope='profile/public'):
"""
Retrieve the Mxit user's cover image
No user authentication required
"""
data = _get(
token=self.oauth.get_user_token(scope),
uri='/user/cover'
)
if output_file_... |
python | def walk(self, listener):
"""Walk the parse tree, using the given listener. The listener
should be a
stix2patterns.grammars.STIXPatternListener.STIXPatternListener (or
subclass) instance."""
antlr4.ParseTreeWalker.DEFAULT.walk(listener, self.__parse_tree) |
python | def parse_fragment(lexer: Lexer) -> Union[FragmentSpreadNode, InlineFragmentNode]:
"""Corresponds to both FragmentSpread and InlineFragment in the spec.
FragmentSpread: ... FragmentName Directives?
InlineFragment: ... TypeCondition? Directives? SelectionSet
"""
start = lexer.token
expect_token(... |
java | public CmsUser readOwner(CmsDbContext dbc, CmsProject project) throws CmsException {
return readUser(dbc, project.getOwnerId());
} |
java | public void ip_mitigationProfiles_ipMitigationProfile_PUT(String ip, String ipMitigationProfile, OvhMitigationProfile body) throws IOException {
String qPath = "/ip/{ip}/mitigationProfiles/{ipMitigationProfile}";
StringBuilder sb = path(qPath, ip, ipMitigationProfile);
exec(qPath, "PUT", sb.toString(), body);
} |
java | public Selector getSelector(String selector)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
tc.entry(cclass,
"getSelector",
"selector: " + selector);
// Start by parsing the selector expression (in-line for the moment)
selOperands = new ArrayList()... |
python | def res_1to1(pst,logger=None,filename=None,plot_hexbin=False,histogram=False,**kwargs):
""" make 1-to-1 plots and also observed vs residual by observation group
Parameters
----------
pst : pyemu.Pst
logger : Logger
if None, a generic one is created. Default is None
filename : str
... |
python | def comparebed(args):
"""
%prog comparebed AP.chr.bed infer.bed
Compare the scaffold links indicated in two bed files.
"""
p = OptionParser(comparebed.__doc__)
opts, args = p.parse_args(args)
if len(args) != 2:
sys.exit(not p.print_help())
abed, bbed = args
abed = Bed(abed... |
java | public static <T> Iterator<T> concat(final Iterator<? extends T>... iterators) {
return new ImmutableIterator<T>() {
int current = 0;
@Override
public boolean hasNext() {
advance();
return current < iterators.length;
}
... |
python | def RemoveEventHandler(self, wb):
""" Removes an event handler. """
from UcsBase import WriteUcsWarning
if wb in self._wbs:
self._remove_watch_block(wb)
else:
WriteUcsWarning("Event handler not found") |
java | public static JInternalFrame newInternalFrame(final String title, final boolean resizable,
final boolean closable, final boolean maximizable, final boolean iconifiable)
{
final JInternalFrame internalFrame = new JInternalFrame(title, resizable, closable,
maximizable, iconifiable);
return internalFrame;
} |
java | public void marshall(DeleteUserRequest deleteUserRequest, ProtocolMarshaller protocolMarshaller) {
if (deleteUserRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(deleteUserRequest.getUserNam... |
python | def call_hook(message,
attachment=None,
color='good',
short=False,
identifier=None,
channel=None,
username=None,
icon_emoji=None):
'''
Send message to Slack incoming webhook.
:param message: The topic of m... |
python | def _get_xy_scaling_parameters(self):
"""Get the X/Y coordinate limits for the full resulting image"""
return self.mx, self.bx, self.my, self.by |
python | def set_active_current(self, settings):
'''
Sets the amperage of each motor for when it is activated by driver.
Values are initialized from the `robot_config.high_current` values,
and can then be changed through this method by other parts of the API.
For example, `Pipette` setti... |
java | public List<Point3D_F64> getLandmark3D( int version ) {
int N = QrCode.totalModules(version);
set3D( 0,0,N,point3D.get(0));
set3D( 0,7,N,point3D.get(1));
set3D( 7,7,N,point3D.get(2));
set3D( 7,0,N,point3D.get(3));
set3D( 0,N-7,N,point3D.get(4));
set3D( 0,N,N,point3D.get(5));
set3D( 7,N,N,point3D.get(6... |
java | public static void setXwpfDocument(String path) throws IOException {
InputStream is = new FileInputStream(path);
xwpfDocument = new XWPFDocument(is);
is.close();
} |
python | def parse_file(cls, filename, encoding='utf-8', required=True, resolve=True, unresolved_value=DEFAULT_SUBSTITUTION):
"""Parse file
:param filename: filename
:type filename: basestring
:param encoding: file encoding
:type encoding: basestring
:param required: If true, rai... |
python | def local_list(timestamps=True):
"""
Return a list of the locally available dictionnaries. Each element is a
tuple of the dictionnary name and its last modification date as a
timestamp.
"""
init_storage()
lst = []
for d in glob(os.path.join(DICTS_PATH, '*.txt')):
name = d.split('... |
python | def is_valid_scalar(self, node: ValueNode) -> None:
"""Check whether this is a valid scalar.
Any value literal may be a valid representation of a Scalar, depending on that
scalar type.
"""
# Report any error at the full type expected by the location.
location_type = self... |
python | def rev_comp(dna):
"""
Parameters
----------
dna : bytearray
dna sequence to be reverse complemented
"""
i2 = len(dna) - 1
l = len(dna) // 2
for i in range(0, l):
b = DNA_COMP_DICT[dna[i]]
dna[... |
python | def write_changelog(debug=False):
"""Write a changelog based on the git changelog."""
changelog = _iter_log_oneline(debug)
if changelog:
changelog = _iter_changelog(changelog)
if not changelog:
return
if debug:
print('Writing ChangeLog')
new_changelog = os.path.join(os.pa... |
java | public void setDescription(CmsObject cms, String description) {
if (CmsStringUtil.isEmptyOrWhitespaceOnly(description)) {
m_description = "";
if (m_element.element(PARAM_DESCRIPTION) != null) {
m_element.remove(m_element.element(PARAM_DESCRIPTION));
}
... |
java | public static byte[] longToBytesNoLeadZeroes(long val) {
// todo: improve performance by while strip numbers until (long >> 8 == 0)
if (val == 0)
return EMPTY_BYTE_ARRAY;
byte[] data = ByteBuffer.allocate(8).putLong(val).array();
return stripLeadingZeroes(data);
} |
python | def get_usage(self, loadbalancer=None, start=None, end=None):
"""
Return the load balancer usage records for this account. If 'loadbalancer'
is None, records for all load balancers are returned. You may optionally
include a start datetime or an end datetime, or both, which will limit
... |
java | public static Key JOIN_PROMPT(String value, Voice voice) {
Map<String, String> map = new HashMap<String, String>();
map.put("value", value);
if (voice != null) {
map.put("voice", voice.toString());
}
return createKey("joinPrompt", map);
} |
java | public void senSegment(String text, List senList){
senList.clear();
String resultStr = senSegment(text);
StringTokenizer senTknr = new StringTokenizer(resultStr, "\n");
while(senTknr.hasMoreTokens()){
senList.add(senTknr.nextToken());
}
} |
java | public static <T> BufferedIterator<T> buffered(Iterator<T> self) {
if (self instanceof BufferedIterator) {
return (BufferedIterator<T>) self;
} else {
return new IteratorBufferedIterator<T>(self);
}
} |
java | @Override
public Number getNumber(int index) {
check(index);
return CBLConverter.asNumber(fleeceValueToObject(index));
} |
python | def error_handler(_, event):
# type: (Any, Any) -> int
""" Specifies the program's supplied error handler. """
evt = event.contents
ERROR.details = {
"type": evt.type,
"serial": evt.serial,
"error_code": evt.error_code,
"request_code": evt.request_code,
"minor_co... |
python | def main(argv=None):
"""
September 18, 2014: if an arg is passed, we visualize it
Otherwise a simple shell gets opened.
"""
print("Ontospy " + ontospy.VERSION)
ontospy.get_or_create_home_repo()
if argv:
print("Argument passing not implemented yet")
if False:
onto = Model(argv[0])
for x in onto.get_c... |
java | public final static String getDefaultType() {
String cpvtype =
AccessController.doPrivileged(new PrivilegedAction<String>() {
public String run() {
return Security.getProperty(CPV_TYPE);
}
});
return (cpvtype == null) ? "PKIX" :... |
java | @Nonnull
public final XMLWriterSettings setIncorrectCharacterHandling (@Nonnull final EXMLIncorrectCharacterHandling eIncorrectCharacterHandling)
{
m_eIncorrectCharacterHandling = ValueEnforcer.notNull (eIncorrectCharacterHandling, "IncorrectCharacterHandling");
return this;
} |
java | private void type(String type) throws IOException {
if (this.packagePrefix == null) {
throw new IllegalStateException();
}
Matcher m = TYPE_PATTERN.matcher(type);
int pos = 0;
while (true) {
boolean found = m.find(pos);
// copy non-matching characters like "<"
int typeStart... |
python | def call(func, max_attempts=None, exceptions=Exception, wait=0.0,
cleanup_hook=None, pre_retry_hook=None):
""" :param func (callable):
The function to retry. No arguments are passed to this function.
If your function requires arguments, consider defining a separate
funct... |
python | def ConvCnstrMOD(*args, **kwargs):
"""A wrapper function that dynamically defines a class derived from
one of the implementations of the Convolutional Constrained MOD
problems, and returns an object instantiated with the provided
parameters. The wrapper is designed to allow the appropriate
object to... |
java | public static JSONObject getWidgetConfigurationAsJSON(String widgetConfiguration) {
JSONObject result = new JSONObject();
if (CmsStringUtil.isEmptyOrWhitespaceOnly(widgetConfiguration)) {
return result;
}
Map<String, String> confEntries = CmsStringUtil.splitAsMap(
... |
java | public Object sqlToJava(Object source)
{
try
{
ByteArrayInputStream stringIn =
new ByteArrayInputStream(((String) source).getBytes());
Base64.InputStream uuIn =
new Base64.InputStream(stringIn, Base64.DECODE, false);
GZIPInp... |
java | public static <T> List<T> toposort(List<T> inputs,
T root, final Deps<T> deps, boolean isFullCut) {
// Get inputs as a set.
final HashSet<T> inputSet = new HashSet<T>(inputs);
if (inputSet.size() != inputs.size()) {
throw new IllegalStateException("Multiple copies of modu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.