language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def poisson_se_multiclust(data, k, n_runs=10, **se_params):
"""
Initializes state estimation using a consensus of several
fast clustering/dimensionality reduction algorithms.
It does a consensus of 8 truncated SVD - k-means rounds, and uses the
basic nmf_init to create starting points.
"""
... |
python | def asm(code, addr=0, syntax=None, target=None, gnu_binutils_prefix=None):
"""
Assemble statements into machine readable code.
Args:
code(str): The statements to assemble.
addr(int): The memory address where the code will run.
syntax(AsmSyntax): The input assembler syntax for x86. D... |
java | public SAMLEndpointResponse getSAMLAssertion(String usernameOrEmail, String password, String appId, String subdomain) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
return getSAMLAssertion(usernameOrEmail, password, appId, subdomain, null);
} |
python | def calcMomentsMatlabEmpirical(params):
"""Top 3 alternatives 20 empirical moment conditions"""
alpha = params[0]
a = params[1:5]
b = params[5:]
p1 = alpha*a+(1-alpha)*b
p21 = alpha*a[0]*a[1:]/(1-a[0])+(1-alpha)*b[0]*b[1:]/(1-b[0])
p22 = alpha*a[1]*np.hstack((a[0],a[2:]))/(1-a[1])+(1-alpha)*... |
python | def patch_botocore_session_send(context, http_filter):
"""
Monkey patches botocore's vendored requests, if available. Overloads the
Session class' send method to add tracing and metric collection.
"""
if BotocoreSession is None:
return
def send(self, *args, **kwargs):
id = str(u... |
java | @Override
public void propagate(int evtmask) throws ContradictionException {
for (int i = 0; i < n; i++) {
color[i].set(i);
size[i].set(1);
mate[i] = -1;
}
ISet nei;
for (int i = 0; i < n; i++) {
nei = g.getMandNeighOf(i);
for (int j : nei) {
if (i < j) {
enforce(i, j);
}
}
}
... |
python | def to_json_path(graph: BELGraph, path: str, **kwargs) -> None:
"""Write this graph to the given path as a Node-Link JSON."""
with open(os.path.expanduser(path), 'w') as f:
to_json_file(graph, file=f, **kwargs) |
python | def matrix_undirected_unweighted(user):
"""
Returns an undirected, unweighted matrix where an edge exists if the
relationship is reciprocated.
"""
matrix = matrix_undirected_weighted(user, interaction=None)
for a, b in combinations(range(len(matrix)), 2):
if matrix[a][b] is None or matri... |
python | def _unassembled_reads1_out_file_name(self):
"""Checks file name is set for reads1 output.
Returns absolute path."""
if self.Parameters['-1'].isOn():
unassembled_reads1 = self._absolute(
str(self.Parameters['-1'].Value))
else:
raise ValueError("... |
java | public static <T> int getIndex(List<T> l, T o, int fromIndex) {
int i = -1;
for (T o1 : l) {
i++;
if (i < fromIndex) {
continue;
}
if (o.equals(o1)) {
return i;
}
}
return -1;
} |
java | public ContactService getContactService() {
if (_contactService == null) {
synchronized (CCApi2.class) {
if (_contactService == null) {
_contactService = _retrofit.create(ContactService.class);
}
}
}
return _contactServ... |
java | public String handleAddException(SQLException e, ItemData item) throws RepositoryException,
InvalidItemStateException
{
if (e instanceof BatchUpdateException)
{
// gets original exception
if (e.getNextException() != null)
{
e = e.getNextException();
}... |
python | def perform(self, command, params=None, **kwargs):
"""Execute a command.
Arguments can be supplied either as a dictionary or as keyword
arguments. Examples:
stc.perform('LoadFromXml', {'filename':'config.xml'})
stc.perform('LoadFromXml', filename='config.xml')
... |
java | protected Bbox getTotalBounds(List<Feature> features) {
Bbox total = null;
for (Feature featureDto : features) {
org.geomajas.geometry.Geometry geom = featureDto.getGeometry();
if (geom != null) {
Bbox b = GeometryService.getBounds(geom);
if (total == null) {
total = b;
} else {
total = ... |
python | def update_snapshots(self):
"""Update list of EBS Snapshots for the account / region
Returns:
`None`
"""
self.log.debug('Updating EBSSnapshots for {}/{}'.format(self.account.account_name, self.region))
ec2 = self.session.resource('ec2', region_name=self.region)
... |
python | def set_autoreload_params(self, scan_interval=None, ignore_modules=None):
"""Sets autoreload related parameters.
:param int scan_interval: Seconds. Monitor Python modules' modification times to trigger reload.
.. warning:: Use only in development.
:param list|st|unicode ignore_mod... |
java | private double nextRadicalInverse() {
counter++;
// Do at most MAXFAST appromate steps
if(counter >= MAXFAST) {
counter = 0;
inverse += MAXFAST;
current = radicalInverse(inverse);
return current;
}
// Fast approximation:
double nextInverse = current + invbase;
if(next... |
python | def start_pan(self, x, y, button):
"""
Called when a pan operation has started.
*x*, *y* are the mouse coordinates in display coords.
button is the mouse button number:
* 1: LEFT
* 2: MIDDLE
* 3: RIGHT
.. note::
Intended to be overridden by... |
java | public String gaAccessor(final EObject ele) {
String _switchResult = null;
boolean _matched = false;
if (ele instanceof AbstractElement) {
_matched=true;
_switchResult = this.gaRuleElementAccessor(((AbstractElement)ele));
}
if (!_matched) {
if (ele instanceof AbstractRule) {
... |
java | public static JsonParser createJsonParser(CoronaConf conf)
throws IOException {
InputStream inputStream = new FileInputStream(conf.getCMStateFile());
if (conf.getCMCompressStateFlag()) {
inputStream = new GZIPInputStream(inputStream);
}
ObjectMapper mapper = new ObjectMapper();
mapper.conf... |
java | public Boolean challenge()
{
if( (this.hub_mode.equals("subscribe")) && (this.hub_verify_token.equals(this.configs.get("verify_token", ""))) ){
Logger.info("Verify token validated successfully.");
return true;
}
Logger.error("Error validating verify token.");
... |
python | def _client_send(self, msg):
"""Sends an Rpc message through the connection.
Args:
msg: string, the message to send.
Raises:
Error: a socket error occurred during the send.
"""
try:
self._client.write(msg.encode("utf8") + b'\n')
s... |
python | def show(self, view: View, request: Request):
"""Show the welcome page.
Arguments:
view {masonite.view.View} -- The Masonite view class.
Application {config.application} -- The application config module.
Returns:
masonite.view.View -- The Masonite view class... |
java | public T create(final Class<T> klass) {
T obj;
try {
obj = (T) klass.newInstance();
}
catch (IllegalAccessException e) {
throw new DocrepException(e);
}
catch (InstantiationException e) {
throw new DocrepException(e);
}
add(obj);
return obj;
} |
java | public void centerOnTile (int tx, int ty)
{
Rectangle trect = MisoUtil.getTilePolygon(_metrics, tx, ty).getBounds();
int nx = trect.x + trect.width/2 - _vbounds.width/2;
int ny = trect.y + trect.height/2 - _vbounds.height/2;
// Log.info("Centering on t:" + StringUtil.coordsToString(t... |
java | public static <E extends Enum<E>> EnumSet<E> processBitVectors(final Class<E> enumClass, final long... values) {
final EnumSet<E> results = EnumSet.noneOf(asEnum(enumClass));
final long[] lvalues = ArrayUtils.clone(Validate.notNull(values));
ArrayUtils.reverse(lvalues);
for (final E cons... |
java | protected Object lookupWalkForVar(String var) {
JsonNode current = node;
while (current!=null) {
Object result = lookupVar(current, var);
if (result!=null) return result;
if (current.hasAttribute("inheritProperties")) {
current = current.getParent();
} else {
current = null;
}
}
r... |
java | private static PatternData getPatternData(ULocale locale, String calType) {
ICUResourceBundle rb =
(ICUResourceBundle) UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME, locale);
ICUResourceBundle dtPatternsRb = rb.findWithFallback("calendar/" + calType + "/DateTimePatterns");
... |
python | def submit(self, task):
"""
:type task: Task
"""
if self.api_url == 'http://STUB_URL':
logging.info(u'STARTER CLIENT DEV MODE Задача условно поставлена')
return
url = self.api_url + '/services/' + task.serviceId + '/tasks'
last_e = None
fo... |
python | def scale(data, zero_center=True, max_value=None, copy=False) -> Optional[AnnData]:
"""Scale data to unit variance and zero mean.
.. note::
Variables (genes) that do not display any variation (are constant across
all observations) are retained and set to 0 during this operation. In
the ... |
java | public static boolean canUseAsDelayedQueue(final Jedis jedis, final String key) {
final String type = jedis.type(key);
return (ZSET.equalsIgnoreCase(type) || NONE.equalsIgnoreCase(type));
} |
java | @XmlElementDecl(namespace = "http://docs.oasis-open.org/ns/cmis/messaging/200908/", name = "maxItems", scope = Query.class)
public JAXBElement<BigInteger> createQueryMaxItems(BigInteger value) {
return new JAXBElement<BigInteger>(_GetTypeChildrenMaxItems_QNAME,
BigInteger.class, Query.class, value);
} |
java | private void deployNetwork(final NetworkContext context, final Handler<AsyncResult<NetworkContext>> doneHandler) {
log.debug(String.format("%s - Deploying network", NetworkManager.this));
final CountingCompletionHandler<Void> complete = new CountingCompletionHandler<Void>(context.components().size());
compl... |
java | public static void mergeDependencies(final Dependency dependency,
final Dependency relatedDependency, final Set<Dependency> dependenciesToRemove) {
dependency.addRelatedDependency(relatedDependency);
for (Dependency d : relatedDependency.getRelatedDependencies()) {
dependency.add... |
python | def discrete_gaussian_curvature_measure(mesh, points, radius):
"""
Return the discrete gaussian curvature measure of a sphere centered
at a point as detailed in 'Restricted Delaunay triangulations and normal
cycle', Cohen-Steiner and Morvan.
Parameters
----------
points : (n,3) float, list ... |
java | public Observable<PersistedFace> addPersonFaceFromStreamAsync(String personGroupId, UUID personId, byte[] image, AddPersonFaceFromStreamOptionalParameter addPersonFaceFromStreamOptionalParameter) {
return addPersonFaceFromStreamWithServiceResponseAsync(personGroupId, personId, image, addPersonFaceFromStreamOpti... |
python | def get_notes(ref_key, ref_id, **kwargs):
"""
Get all the notes for a resource, identifed by ref_key and ref_ido.
Returns [] if no notes are found or if the resource doesn't exist.
"""
notes = db.DBSession.query(Note).filter(Note.ref_key==ref_key)
if ref_key == 'NETWORK':
notes =... |
python | def _attach_endpoints(self):
"""Dynamically attaches endpoint callables to this client"""
for name, value in inspect.getmembers(self):
if inspect.isclass(value) and issubclass(value, self._Endpoint) and (value is not self._Endpoint):
endpoint_instance = value(self.requester)
... |
python | def list_installed_files(self):
"""
Iterates over the ``installed-files.txt`` entries and returns a tuple
``(path, hash, size)`` for each line.
:returns: a list of (path, hash, size)
"""
def _md5(path):
f = open(path, 'rb')
try:
c... |
python | def configure_logger(simple_name, log_dest=None,
detail_level=DEFAULT_LOG_DETAIL_LEVEL,
log_filename=DEFAULT_LOG_FILENAME,
connection=None, propagate=False):
# pylint: disable=line-too-long
"""
Configure the pywbem loggers and optionally activat... |
java | Object getValue(Object obj, String attributePath, Object metadata) throws Exception {
return getValue(obj, attributePath);
} |
java | public static Symmetry454Date now(Clock clock) {
LocalDate now = LocalDate.now(clock);
return Symmetry454Date.ofEpochDay(now.toEpochDay());
} |
python | def Normalize(self, fraction=1.0):
"""Normalizes this PMF so the sum of all probs is fraction.
Args:
fraction: what the total should be after normalization
Returns: the total probability before normalizing
"""
if self.log:
raise ValueError("Pmf is under ... |
java | public static String checkAndNormalizeRootPath(String path) throws IllegalArgumentException {
path = PathUtils.normalizeUnixStylePath(path);
//check the path is not trying to go upwards.
if (!PathUtils.isNormalizedPathAbsolute(path)) {
throw new IllegalArgumentException();
}... |
python | def rst_to_html(in_rst, stderr):
"""Renders HTML from an RST fragment.
:param string in_rst: An rst formatted string.
:param stderr: An open stream to use for docutils stderr output.
:returns: A tuple of (html rendered rst, return code)
"""
if not in_rst:
return '', 0
# Unfortunately, docutils is re... |
java | public int compareMethods(BugCollection lhsCollection, BugCollection rhsCollection, MethodAnnotation lhsMethod,
MethodAnnotation rhsMethod) {
if (lhsMethod == null || rhsMethod == null) {
return compareNullElements(lhsMethod, rhsMethod);
}
// Compare for exact match
... |
python | def onestep(self, *, direction=FORWARD, style=SINGLE):
"""Performs one step of a particular style. The actual rotation amount will vary by style.
`SINGLE` and `DOUBLE` will normal cause a full step rotation. `INTERLEAVE` will normally
do a half step rotation. `MICROSTEP` will perform the s... |
java | public boolean putMulti(MultiItem<T> items, int maxWait, TimeUnit unit) throws Exception
{
checkState();
String path = makeItemPath();
return internalPut(null, items, path, maxWait, unit);
} |
java | private CreateSubnetResponseType createSubnet(final String vpcId, final String cidrBlock) {
CreateSubnetResponseType ret = new CreateSubnetResponseType();
ret.setRequestId(UUID.randomUUID().toString());
MockSubnet mockSubnet = mockSubnetController.createSubnet(cidrBlock, vpcId);
SubnetT... |
java | @Nonnull
public static NetLegacyOptions none(@Nonnull NetdevNoneOptions none) {
NetLegacyOptions self = new NetLegacyOptions();
self.type = NetLegacyOptionsType.none;
self.none = none;
return self;
} |
java | @Override
public void registerListener(LifecycleListener listener)
{
if(listener == null)
throw new NullPointerException("listener is null");
synchronized(_lock)
{
if(_listeners == null || !_listeners.contains(listener))
{
Set<LifecycleListener> listeners = new HashSet<Lifecyc... |
java | @Override
public CPRuleUserSegmentRel fetchByCPRuleId_Last(long CPRuleId,
OrderByComparator<CPRuleUserSegmentRel> orderByComparator) {
int count = countByCPRuleId(CPRuleId);
if (count == 0) {
return null;
}
List<CPRuleUserSegmentRel> list = findByCPRuleId(CPRuleId, count - 1,
count, orderByComparato... |
java | public Optional<ExternalServiceAlertCondition> show(long policyId, long conditionId)
{
Optional<ExternalServiceAlertCondition> ret = Optional.absent();
Collection<ExternalServiceAlertCondition> conditions = list(policyId);
for(ExternalServiceAlertCondition condition : conditions)
{
... |
java | @SuppressWarnings("deprecation")
public org.opensaml.saml2.core.Response authenticate(String username, String password)
throws IOException, AuthenticationException, SOAPClientException {
// -- Connecting to SP, defer processing to parent class ------------------------------
HttpResponse res = super.execute(new... |
java | @Override
public Tuple createTuple(EntityKeyMetadata entityKeyMetadata, OperationContext operationContext) {
return identityColumnAwareGridDialect.createTuple( entityKeyMetadata, operationContext );
} |
python | def match_ref(self, ref):
""" Check if the ref matches one the concept's aliases.
If so, mark the matched ref so that we use it as the column label.
"""
if ref in self.refs:
self._matched_ref = ref
return True
return False |
python | def breakLines(self, width):
"""
Returns a broken line structure. There are two cases
A) For the simple case of a single formatting input fragment the output is
A fragment specifier with
- kind = 0
- fontName, fontSize, leading, textColor
... |
java | public static Execution newInstance(Specification specification, SystemUnderTest systemUnderTest, XmlReport xmlReport, String sections)
{
Execution execution = Execution.newInstance(specification, systemUnderTest, xmlReport );
execution.setSections(sections);
return execution;
} |
python | def _add_metadata_as_attrs_da(data, units, description, dtype_out_vert):
"""Add metadata attributes to DataArray"""
if dtype_out_vert == 'vert_int':
if units != '':
units = '(vertical integral of {0}): {0} kg m^-2)'.format(units)
else:
units = '(vertical integral of quant... |
java | private static boolean isNotSREEntry(IRuntimeClasspathEntry entry) {
try {
final File file = new File(entry.getLocation());
if (file.isDirectory()) {
return !SARLRuntime.isUnpackedSRE(file);
} else if (file.canRead()) {
return !SARLRuntime.isPackedSRE(file);
}
} catch (Throwable e) {
SARLEcli... |
python | def stop_instance(self, fast=False):
"""
I attempt to stop a running VM.
I make sure any connection to the worker is removed.
If the VM was using a cloned image, I remove the clone
When everything is tidied up, I ask that bbot looks for work to do
"""
log.msg("Att... |
python | def get_configurations(self, project, repository_type=None, repository_id=None, branch=None, service_connection_id=None):
"""GetConfigurations.
[Preview API] Gets a list of existing configuration files for the given repository.
:param str project: Project ID or project name
:param str re... |
python | def callback(self, msg):
"""Accept a message that was published, process and forward
Parameters
----------
msg : tuple, (str, str, str)
The message sent over the line. The `tuple` is of the form:
(message_type, channel, payload).
Notes
-----
... |
java | public void hideFloatWindow(Activity activity) {
HMSAgentLog.i("hideFloatWindow");
isShowFloatWindowCalled = false;
showFinal(false, activity, ApiClientMgr.INST.getApiClient());
} |
java | public static String buildKey(final RegisteredService service) {
return service.getId() + ";" + service.getName() + ';' + service.getServiceId();
} |
java | private AjaxFormComponentUpdatingBehavior createAjax(final QueryParameter parameter, final IModel model, final Component component, final String time) {
return new AjaxFormComponentUpdatingBehavior("onchange") {
@SuppressWarnings("unchecked")
@Override
protected void onUpdate(AjaxReq... |
python | def get_capability_report(self, raw=True, cb=None):
"""
This method retrieves the Firmata capability report
:param raw: If True, it either stores or provides the callback
with a report as list.
If False, prints a formatted report to the console
:... |
python | def get_export_configuration(self, config_id):
"""
Retrieve the ExportConfiguration with the given ID
:param string config_id:
ID for which to search
:return:
a :class:`meteorpi_model.ExportConfiguration` or None, or no match was found.
"""
sql = ... |
java | protected synchronized void removeShapeGeometryChangeListener(ShapeGeometryChangeListener listener) {
assert listener != null : AssertMessages.notNullParameter();
if (this.geometryListeners != null) {
this.geometryListeners.remove(listener);
if (this.geometryListeners.isEmpty()) {
this.geometryListeners =... |
python | def calculateAxis(self, axis, size, minDelta):
"""
Calculates the rendering information for the given axis based on
the current size and the minimum required delta.
:param axis | <XChartAxis>
size | <int>
minDelta | <in... |
java | public static Long getLong(Map<?, ?> map, Object key) {
return get(map, key, Long.class);
} |
java | public boolean rowContainsKey(String key) {
String resolvedKey = resolveRowKey(key);
return rowMap.containsKey(resolvedKey)
|| parent != null && parent.rowContainsKey(resolvedKey);
} |
python | def ast_from_value(value: Any, type_: GraphQLInputType) -> Optional[ValueNode]:
"""Produce a GraphQL Value AST given a Python value.
A GraphQL type must be provided, which will be used to interpret different Python
values.
| JSON Value | GraphQL Value |
| ------------- | ----------------... |
python | def to_kaf(self):
"""
Converts the element to NAF
"""
if self.type == 'NAF':
##convert all the properties
for node in self.node.findall('properties/property'):
node.set('pid',node.get('id'))
del node.attrib['id'] |
java | public static synchronized PeriodType forFields(DurationFieldType[] types) {
if (types == null || types.length == 0) {
throw new IllegalArgumentException("Types array must not be null or empty");
}
for (int i = 0; i < types.length; i++) {
if (types[i] == null) {
... |
java | public void run()
{
m_strFileName = this.getProperty("fileName");
if (m_strFileName == null)
m_strFileName = Constants.BLANK;
m_strPackage = this.getProperty("package");
if (m_strPackage == null)
m_strPackage = Constants.BLANK;
m_strProjectID = this.ge... |
java | public void setupProxy() throws InvalidProxyException {
// are we running through a proxy
if (Property.isProxySet()) {
// set the proxy information
Proxy proxy = new Proxy();
proxy.setHttpProxy(Property.getProxy());
desiredCapabilities.setCapability(Capabi... |
java | public BuildStepInner get(String resourceGroupName, String registryName, String buildTaskName, String stepName) {
return getWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, stepName).toBlocking().single().body();
} |
python | def ping(hostname: str, timeout_s: int = 5) -> bool:
"""
Pings a host, using OS tools.
Args:
hostname: host name or IP address
timeout_s: timeout in seconds
Returns:
was the ping successful?
"""
if sys.platform == "win32":
timeout_ms = timeout_s * 1000
... |
java | @Override
public Connection getOrCreate() throws SQLException {
Connection con = DriverManager.getConnection(this.url, this.user, this.password);
con.setAutoCommit(isAutoCommitEnabled());
return con;
} |
java | private static <T> void acceptResult(CompletableCompletionStage<T> s, Supplier<? extends T> supplier) {
try {
// exception can be thrown only by supplier. All callbacks are generated by us and they do not throw any exceptions
s.complete(supplier.get());
} catch (Throwable e) {
... |
java | public FastAdapterBottomSheetDialog<Item> withOnPreClickListener(com.mikepenz.fastadapter.listeners.OnClickListener<Item> onPreClickListener) {
this.mFastAdapter.withOnPreClickListener(onPreClickListener);
return this;
} |
python | def run(self):
"""Called when the process has started
:param int port: The HTTP Server port
"""
LOGGER.debug('Initializing process')
# Setup logging
self.logging_config = self.setup_logging()
# Register the signal handlers
self.setup_signal_handlers()
... |
java | private JsonObject lookForRelation(String oid, String field,
JsonSimple config, JsonSimple baseNode) {
JsonObject newRelation = new JsonObject();
newRelation.put("field", field);
newRelation.put("authority", true);
// ** -1- ** EXCLUSIONS
List<String> exPath = config.getStringList("excludeCondition", "pat... |
java | public List<Link> connect(int bandwidth, Switch sw, Node... nodes) {
List<Link> l = new ArrayList<>();
for (Node n : nodes) {
l.add(connect(bandwidth, sw, n));
}
return l;
} |
java | public void setYear(int year){
if(mAdapter.getYear() == year)
return;
mAdapter.setYear(year);
goTo(year);
} |
java | public Observable<ServiceResponse<Page<RemoteLoginInformationInner>>> listRemoteLoginInformationSinglePageAsync(final String resourceGroupName, final String workspaceName, final String clusterName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is ... |
java | public static policypatset[] get_filtered(nitro_service service, filtervalue[] filter) throws Exception{
policypatset obj = new policypatset();
options option = new options();
option.set_filter(filter);
policypatset[] response = (policypatset[]) obj.getfiltered(service, option);
return response;
} |
java | @SuppressWarnings("unchecked")
@Override
public T lessThan(final String col, final Object value) {
context().param(CaseFormat.CAMEL_CASE.convert(col), new LessThan(col, value));
this.useOperator = true;
return (T) this;
} |
python | def groupby(self, keyexpr, **outexprs):
"""simple prototype of group by, with support for expressions in the group-by clause
and outputs
@param keyexpr: grouping field and optional expression for computing the key value;
if a string is passed
@type keyexpr: stri... |
python | def json_encoder_default(obj):
"""Handle more data types than the default JSON encoder.
Specifically, it treats a `set` and a `numpy.array` like a `list`.
Example usage: ``json.dumps(obj, default=json_encoder_default)``
"""
if np is not None and hasattr(obj, 'size') and hasattr(obj, 'dtype'):
... |
java | private static String join(double[] seriesData, String separator) {
// two or more elements
StringBuilder sb = new StringBuilder(256); // Java default is 16, probably too small
sb.append(seriesData[0]);
for (int i = 1; i < seriesData.length; i++) {
if (separator != null) {
sb.append(sepa... |
java | @Override
public IEntity getEntity(String key, Class type) throws GroupsException {
return getEntity(key, type, null);
} |
java | public static String valueParameters(String value, Map parameters)
{
if (value==null)
return null;
int i = value.indexOf(';');
if (i<0)
return value;
if (parameters==null)
return value.substring(0,i).trim();
StringTokenizer tok1 =... |
java | public void writeFree()
{
Record recClassInfo = this.getMainRecord();
ClassFields recClassFields = new ClassFields(this);
try {
String strFieldName;
String strFieldClass;
// Now, zero out all the class fields
recClassFields.setKeyArea(C... |
python | def getOutputDevice(self, textureType):
"""
* Returns platform- and texture-type specific adapter identification so that applications and the
compositor are creating textures and swap chains on the same GPU. If an error occurs the device
will be set to 0.
pInstance is an optional... |
python | def exclude_args(parser, args, excluded_args, target):
"""Delete options that are not appropriate for a following code path; exit
with an error if excluded options were passed in by the user.
argparse generates a namespace with all options it knows, but not every
attribute should be passed to all code ... |
java | protected ArchiveReader getArchiveReader(final String f,
final InputStream is, final boolean atFirstRecord)
throws IOException {
// Check if it's compressed, based on file extension.
if( f.endsWith(".gz") ) {
return new CompressedWARCReader(f, is, atFirstRecord);
} else {
return new Unc... |
java | protected String decode(String html) throws Exception {
String result=StringEscapeUtils.unescapeHtml4(html);
return result;
} |
python | def compose(scripts, name='main', description=None, prog=None,
version=None):
"""
Collects together different scripts and builds a single
script dispatching to the subparsers depending on
the first argument, i.e. the name of the subparser to invoke.
:param scripts: a list of script inst... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.