language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | private void writeAssignments(Project project)
{
Project.Assignments assignments = m_factory.createProjectAssignments();
project.setAssignments(assignments);
List<Project.Assignments.Assignment> list = assignments.getAssignment();
for (ResourceAssignment assignment : m_projectFile.getResourc... |
java | public <T> Future<T> actAsync(final FileCallable<T> callable) throws IOException, InterruptedException {
try {
DelegatingCallable<T,IOException> wrapper = new FileCallableWrapper<>(callable);
for (FileCallableWrapperFactory factory : ExtensionList.lookup(FileCallableWrapperFactory.class)... |
python | def setWorkingStandingZeroPoseToRawTrackingPose(self):
"""Sets the preferred standing position in the working copy."""
fn = self.function_table.setWorkingStandingZeroPoseToRawTrackingPose
pMatStandingZeroPoseToRawTrackingPose = HmdMatrix34_t()
fn(byref(pMatStandingZeroPoseToRawTrackingP... |
python | def convert_case(name):
"""Converts name from CamelCase to snake_case"""
s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name)
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower() |
java | @Override
public String getIndexName() {
final NameableVisitor visitor = new NameableVisitor();
this.accept(visitor);
return visitor.getIndexName();
} |
java | public static BigDecimal div(String v1, String v2, int scale) {
return div(v1, v2, scale, RoundingMode.HALF_UP);
} |
python | def load_metadata_from_file(filename):
""" Load the plot related metadata saved in a file
Parameters
----------
filename: str
Name of file load metadata from.
Returns
-------
cp: ConfigParser
A configparser object containing the metadata
"""
try:
extension =... |
java | public T withConsistencyLevel(ConsistencyLevel consistencyLevel) {
getOptions().setCl(Optional.of(consistencyLevel));
return getThis();
} |
java | private boolean getAnchorMetadataFromData(ValueMap resourceProps, Element element) {
boolean foundAny = false;
List<Attribute> attributes = element.getAttributes();
for (Attribute attribute : attributes) {
if (DataPropertyUtil.isHtml5DataName(attribute.getName())) {
String value = attribute.g... |
python | def multidict(ordered_pairs):
"""Convert duplicate keys values to lists."""
# read all values into lists
d = defaultdict(list)
for k, v in ordered_pairs:
d[k].append(v)
# unpack lists that have only 1 item
dict_copy = deepcopy(d)
for k, v in iteritems(dict_copy):
if len(v) ==... |
python | def s_get(self, quant):
"""Return a number using the given quantity of signed bits."""
if quant < 2:
# special case, just return that unsigned value
# quant can also be 0
return self.u_get(quant)
sign = self.u_get(1)
raw_number = self.u_get(quant - 1)... |
python | def refresh_authorizer_token(
self, authorizer_appid, authorizer_refresh_token):
"""
获取(刷新)授权公众号的令牌
:params authorizer_appid: 授权方appid
:params authorizer_refresh_token: 授权方的刷新令牌
"""
return self.post(
'/component/api_authorizer_token',
... |
python | def ChunkedTransformerLM(vocab_size,
feature_depth=512,
feedforward_depth=2048,
num_layers=6,
num_heads=8,
dropout=0.1,
chunk_selector=None,
max_... |
python | def datacenters(self):
"""
::
GET /:login/datacenters
:Returns: all datacenters (mapping from short location key to
full URL) that this cloud is aware of
:rtype: :py:class:`dict`
This method also updates the local `known_locatio... |
java | public static Map<String, Object> decrypt(KeenClient client, String apiKey, String scopedKey)
throws ScopedKeyException {
try {
// convert the api key from hex string to byte array
final byte[] apiKeyBytes = KeenUtils.hexStringToByteArray(apiKey);
// grab first 1... |
python | def is_signature_equal(cls, sig_a, sig_b):
"""Compares two signatures using a constant time algorithm to avoid timing attacks."""
if len(sig_a) != len(sig_b):
return False
invalid_chars = 0
for char_a, char_b in zip(sig_a, sig_b):
if char_a != char_b:
... |
java | public void addPatientParticipantObject(String patientId)
{
addParticipantObjectIdentification(
new RFC3881ParticipantObjectCodes.RFC3881ParticipantObjectIDTypeCodes.PatientNumber(),
null,
null,
null,
patientId,
RFC3881ParticipantObjectTypeCodes.PERSON,
RFC3881ParticipantObjectTypeRo... |
java | @CheckReturnValue
private FlowScope traverseReturn(Node n, FlowScope scope) {
scope = traverseChildren(n, scope);
Node retValue = n.getFirstChild();
if (retValue != null) {
JSType type = functionScope.getRootNode().getJSType();
if (type != null) {
FunctionType fnType = type.toMaybeFun... |
python | def change_message_visibility(self, queue, receipt_handle,
visibility_timeout, callback=None):
"""
Extends the read lock timeout for the specified message from
the specified queue to the specified value.
:type queue: A :class:`boto.sqs.queue.Queue` obje... |
java | @Override
protected UIComponent createComponent(FacesContext context, String id)
{
String componentType = getComponentType();
if (componentType == null)
{
throw new NullPointerException("componentType");
}
if (_binding != null)
{
Applicati... |
java | @Nonnull
public static <T> T getDeserializedObject (@Nonnull final byte [] aData)
{
ValueEnforcer.notNull (aData, "Data");
// Read new object from byte array
try (final ObjectInputStream aOIS = new ObjectInputStream (new NonBlockingByteArrayInputStream (aData)))
{
return GenericReflection.unc... |
java | public String connect (String hostname, int port)
throws IOException, CDDBException
{
return connect(hostname, port, CLIENT_NAME, CLIENT_VERSION);
} |
python | def replace(oldstr, newstr, infile, dryrun=False):
"""
Sed-like Replace function..
Usage: pysed.replace(<Old string>, <Replacement String>, <Text File>)
Example: pysed.replace('xyz', 'XYZ', '/path/to/file.txt')
This will dump the output to STDOUT instead of changing the input file.
Example 'DRY... |
python | def max_knob_end_distance(self):
""" Maximum distance between knob_end and each of the hole side-chain centres. """
return max([distance(self.knob_end, h) for h in self.hole]) |
python | def parse_url(arg, extract, key=None):
"""
Returns the portion of a URL corresponding to a part specified
by 'extract'
Can optionally specify a key to retrieve an associated value
if extract parameter is 'QUERY'
Parameters
----------
extract : one of {'PROTOCOL', 'HOST', 'PATH', 'REF',
... |
python | def power_on(self, id): # pylint: disable=invalid-name,redefined-builtin
"""Power on a device using it's power on command.
:param id: Device ID as an int.
:return: :class:`devices.PowerCmd <devices.PowerCmd>` object
:rtype: devices.PowerCmd
"""
schema = PowerCmdSchema()
... |
java | final AbstractJcrProperty removeExistingProperty( Name name ) throws VersionException, LockException, RepositoryException {
AbstractJcrProperty existing = getProperty(name);
if (existing != null) {
existing.remove();
return existing;
}
// Return without throwing a... |
python | def load(self, filename):
"""Optimized load and return the parsed version of filename.
Uses the on-disk parse cache if the file is located in it.
"""
# Compute sha1 hash (key)
with open(filename) as fp:
key = sha1(fp.read()).hexdigest()
path = self.key_to_pa... |
java | public void register(FoxHttpInterceptorType interceptorType, FoxHttpInterceptor foxHttpInterceptor) throws FoxHttpException {
FoxHttpInterceptorType.verifyInterceptor(interceptorType, foxHttpInterceptor);
if (foxHttpInterceptors.containsKey(interceptorType)) {
foxHttpInterceptors.get(interce... |
java | @Override
public int compareTo(MachineTime<U> other) {
if (this.scale == other.scale) {
if (this.seconds < other.seconds) {
return -1;
} else if (this.seconds > other.seconds) {
return 1;
} else {
return (this.nanos - other... |
java | public JvmGenericType toClass(/* @Nullable */ EObject sourceElement, /* @Nullable */ QualifiedName name, /* @Nullable */ Procedure1<? super JvmGenericType> initializer) {
return toClass(sourceElement, name != null ? name.toString() : null, initializer);
} |
java | public static void installDomainConnectorServices(final OperationContext context,
final ServiceTarget serviceTarget,
final ServiceName endpointName,
final Ser... |
python | def rm_(key, recurse=False, profile=None, **kwargs):
'''
.. versionadded:: 2014.7.0
Delete a key from etcd. Returns True if the key was deleted, False if it was
not and None if there was a failure.
CLI Example:
.. code-block:: bash
salt myminion etcd.rm /path/to/key
salt my... |
python | def _high_dim_sim(self, v, w, normalize=False, X=None, idx=0):
"""Similarity measurement based on Gaussian Distribution"""
sim = np.exp((-np.linalg.norm(v - w) ** 2) / (2*self._sigma[idx] ** 2))
if normalize:
return sim / sum(map(lambda x: x[1], self._knn(idx, X, high_dim=True)))
... |
python | def to_array(self):
"""
Serializes this InlineQueryResultCachedSticker to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(InlineQueryResultCachedSticker, self).to_array()
array['type'] = u(self.type) # py2: type un... |
java | @Override
public ConnectionManager getConnectionManager(ResourceInfo refInfo, AbstractConnectionFactoryService svc) throws ResourceException {
final boolean trace = TraceComponent.isAnyTracingEnabled();
if (trace && tc.isEntryEnabled())
Tr.entry(this, tc, "getConnectionManager", refInfo... |
python | def bgp_normalize_table_data(bgp_table):
"""The 'show bgp all summary vrf all' table can have entries that wrap multiple lines.
2001:db8:4:701::2
4 65535 163664 163693 145 0 0 3w2d 3
2001:db8:e0:dd::1
4 10 327491 327278 145 0 0 3w1d 4
... |
java | public static ArrayNode getArrayAndRemove(ObjectNode obj, String fieldName) {
ArrayNode result = null;
if (obj != null) {
result = array(remove(obj, fieldName));
}
return result;
} |
python | def get_assistant(filename):
"""Imports a module from filename as a string, returns the contained Assistant object"""
agent_name = os.path.splitext(filename)[0]
try:
agent_module = import_with_3(
agent_name, os.path.join(os.getcwd(), filename))
except ImportError:
agent_mo... |
python | def __EncodedAttribute_encode_rgb24(self, rgb24, width=0, height=0):
"""Encode a 24 bit color image (no compression)
:param rgb24: an object containning image information
:type rgb24: :py:obj:`str` or :class:`numpy.ndarray` or seq< seq<element> >
:param width: image width. **MUST**... |
python | def run_hmmbuild(self):
'''
Generate hmm with hhbuild,
output to file. Also stores query names.
'''
for alignment in self.alignment_list:
print 'building Hmm for', alignment
alignment_full_path = self.alignment_dir + alignment
query_name = ... |
java | public void translate(Tuple2D<?> move) {
assert move != null : AssertMessages.notNullParameter();
this.curvilineTranslation += move.getX();
this.shiftTranslation += move.getY();
this.isIdentity = null;
} |
java | @XmlElementDecl(namespace = "http://www.w3.org/1998/Math/MathML", name = "arccsc")
public JAXBElement<ElementaryFunctionsType> createArccsc(ElementaryFunctionsType value) {
return new JAXBElement<ElementaryFunctionsType>(_Arccsc_QNAME, ElementaryFunctionsType.class, null, value);
} |
python | def _stream_annotation(file_name, pb_dir):
"""
Stream an entire remote annotation file from physiobank
Parameters
----------
file_name : str
The name of the annotation file to be read.
pb_dir : str
The physiobank directory where the annotation file is located.
"""
# Ful... |
python | def _create_sentence_objects(self):
'''Returns a list of Sentence objects from the raw text.
'''
sentence_objects = []
sent_tokenizer = SentenceTokenizer(locale=self.language.code)
seq = Sequence(self.raw)
seq = sent_tokenizer.transform(seq)
for start_index, end_index in zip(seq.idx[:-1], se... |
java | @Override
public void terminateAllConnections() {
this.terminationLock.lock();
try {
for (int i = 0; i < this.pool.thriftServerCount; i++) {
this.pool.partitions.get(i).setUnableToCreateMoreTransactions(false);
List<ThriftConnectionHandle<T>> clist = new LinkedList<>();
this.pool.partitions.get(i).g... |
python | def parse(cls, resource):
""" Parse a resource
:param resource: Element representing the text inventory
:param _cls_dict: Dictionary of classes to generate subclasses
"""
xml = xmlparser(resource)
o = cls(name=xml.xpath("//ti:TextInventory", namespaces=XPATH_NAMESPACES)[... |
java | @Override
public EClass getMetrics() {
if (metricsEClass == null) {
metricsEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(StorePackage.eNS_URI).getEClassifiers().get(100);
}
return metricsEClass;
} |
java | public Node previousNode() throws DOMException
{
if (!m_cacheNodes)
throw new RuntimeException(
XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_CANNOT_ITERATE, null)); //"This NodeSet can not iterate to a previous node!");
if ((m_next - 1) > 0)
{
m_next--;
return... |
python | def _find_key_cols(df):
"""Identify columns in a DataFrame that could be a unique key"""
keys = []
for col in df:
if len(df[col].unique()) == len(df[col]):
keys.append(col)
return keys |
java | @SuppressWarnings("unchecked")
public static void addJSFAttrbituteToAngularModel(Map<String, Object> model, String key, Object value,
boolean cacheable) {
Map<String, Object> sessionMap = FacesContext.getCurrentInstance().getExternalContext().getSessionMap();
Map<String, Object> cache = (Map<String, Object>) se... |
python | def attach_pipeline(self, pipeline, name, chunks=None, eager=True):
"""Register a pipeline to be computed at the start of each day.
Parameters
----------
pipeline : Pipeline
The pipeline to have computed.
name : str
The name of the pipeline.
chunk... |
python | def update(self, ipv6s):
"""
Method to update ipv6's
:param ipv6s: List containing ipv6's desired to updated
:return: None
"""
data = {'ips': ipv6s}
ipv6s_ids = [str(ipv6.get('id')) for ipv6 in ipv6s]
return super(ApiIPv6, self).put('api/v3/ipv6/%s/' %
... |
python | def link_page_filter(self, page, modelview_name):
"""
Arguments are passed like: page_<VIEW_NAME>=<PAGE_NUMBER>
"""
new_args = request.view_args.copy()
args = request.args.copy()
args["page_" + modelview_name] = page
return url_for(
request.endpoin... |
java | @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
public float getLineSpacingMultiplier (){
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)
return mInputView.getLineSpacingMultiplier();
return 0f;
} |
python | def get_type(data):
"""Retrieve the type of effects calculation to do.
"""
if data["analysis"].lower().startswith("var") or dd.get_variantcaller(data):
return tz.get_in(("config", "algorithm", "effects"), data, "snpeff") |
java | public OvhMigrationAccount domain_account_accountName_migrate_destinationServiceName_destinationEmailAddress_destinationEmailAddress_GET(String domain, String accountName, String destinationServiceName, String destinationEmailAddress) throws IOException {
String qPath = "/email/domain/{domain}/account/{accountName}/m... |
java | public double getAverageFiringTime() {
long fires = this.agendaStats.getConsolidatedStats().matchesFired.get();
long time = this.agendaStats.getConsolidatedStats().firingTime.get();
// calculating the average and converting it from nano secs to milli secs
return fires > 0 ? (((double) ti... |
java | private String getTaskField(int key)
{
String result = null;
if ((key > 0) && (key < m_taskNames.length))
{
result = m_taskNames[key];
}
return (result);
} |
java | private String getAdditionalDependencies(final TargetInfo linkTarget, final List<DependencyDef> projectDependencies,
final Map<String, TargetInfo> targets, final String basePath) {
String dependencies = null;
final File[] linkSources = linkTarget.getAllSources();
final StringBuffer buf = new StringBuf... |
python | def _first(self, **spec):
""" Get the earliest entry in this category, optionally including subcategories """
for record in self._entries(spec).order_by(model.Entry.local_date,
model.Entry.id)[:1]:
return entry.Entry(record)
return N... |
python | def clusterQueues(self):
""" Return a dict of queues in cluster and servers running them
"""
servers = yield self.getClusterServers()
queues = {}
for sname in servers:
qs = yield self.get('rhumba.server.%s.queues' % sname)
uuid = yield self.get('rhumba.s... |
java | public static GeoDistanceSortFieldBuilder geoDistance(String mapper, double latitude, double longitude) {
return new GeoDistanceSortFieldBuilder(mapper, latitude, longitude);
} |
python | def project_get(auth=None, **kwargs):
'''
Get a single project
CLI Example:
.. code-block:: bash
salt '*' keystoneng.project_get name=project1
salt '*' keystoneng.project_get name=project2 domain_id=b62e76fbeeff4e8fb77073f591cf211e
salt '*' keystoneng.project_get name=f315afcf... |
java | public BUILDER setDeprecated(ModelVersion since, boolean notificationUseful) {
//noinspection deprecation
this.deprecated = new DeprecationData(since, notificationUseful);
return (BUILDER) this;
} |
java | @Override
public SpatialReferenceSystem queryForSameId(SpatialReferenceSystem data)
throws SQLException {
SpatialReferenceSystem srs = super.queryForSameId(data);
setDefinition_12_063(srs);
return srs;
} |
java | public void set(Rec fieldList) throws DBException
{
this.syncCurrentToBase();
boolean[] rgbListenerState = this.getRecord().setEnableListeners(false);
this.getRecord().handleRecordChange(DBConstants.UPDATE_TYPE); // Fake the call for the grid table
this.getRecord().setEnableListene... |
python | def sgd_entropic_regularization(a, b, M, reg, batch_size, numItermax, lr):
'''
Compute the sgd algorithm to solve the regularized discrete measures
optimal transport dual problem
The function solves the following optimization problem:
.. math::
\gamma = arg\min_\gamma <\gamma,M>_F + re... |
java | public static <K> PoolKey<K> lookup(K key) {
if (key == null)
throw new IllegalStateException("Key must not be null");
return new PoolKey<K>(key);
} |
python | def _get_template(path, option_key):
'''
Get the contents of a template file and provide it as a module type
:param path: path to the template.yml file
:type path: ``str``
:param option_key: The unique key of this template
:type option_key: ``str``
:returns: Details about the template
... |
java | public static boolean isValidMapcodeFormat(@Nonnull final String mapcode) throws IllegalArgumentException {
checkNonnull("mapcode", mapcode);
try {
// Throws an exception if the format is incorrect.
getPrecisionFormat(mapcode.toUpperCase());
return true;
} cat... |
java | public void encodeListNullToNull(Writer writer, List<? extends T> list) throws IOException {
if (list == null) {
writer.write("null");
writer.flush();
return;
}
JsonUtil.startArray(writer);
int size = list.size();
for (int i = 0; i < size; i++) {
encodeNullToNull(writer, list.get(i));
if (i ... |
java | public void containsEntry(@NullableDecl Object key, @NullableDecl Object value) {
// TODO(kak): Can we share any of this logic w/ MapSubject.containsEntry()?
if (!actual().containsEntry(key, value)) {
Entry<Object, Object> entry = Maps.immutableEntry(key, value);
List<Entry<Object, Object>> entryLis... |
python | def getDimensionForImage(filename, maxsize):
"""Return scaled image size in (width, height) format.
The scaling preserves the aspect ratio.
If PIL is not found returns None."""
try:
from PIL import Image
except ImportError:
return None
img = Image.open(filename)
width, height... |
java | public ClientConnectionTimingsBuilder socketConnectEnd() {
checkState(socketConnectStartTimeMicros >= 0, "socketConnectStart() is not called yet.");
checkState(!socketConnectEndSet, "socketConnectEnd() is already called.");
socketConnectEndNanos = System.nanoTime();
socketConnectEndSet =... |
python | def _AddReprMethod(message_descriptor, cls):
"""Helper for _AddMessageMethods()."""
def __repr__(self):
return text_format.MessageToString(self)
cls.__repr__ = __repr__ |
java | public static LifecycleChaincodePackage fromFile(File policyFile) throws IOException, InvalidArgumentException {
if (null == policyFile) {
throw new InvalidArgumentException("The parameter policyFile may not be null.");
}
try (InputStream is = new FileInputStream(policyFile)) {
... |
python | def GET(self, courseid, taskid, path): # pylint: disable=arguments-differ
""" GET request """
try:
course = self.course_factory.get_course(courseid)
if not self.user_manager.course_is_open_to_user(course):
return self.template_helper.get_renderer().course_unavail... |
java | public Set getResourcePaths(String uriInContext)
{
try
{
uriInContext=URI.canonicalPath(uriInContext);
if (uriInContext==null)
return Collections.EMPTY_SET;
Resource resource=getHttpContext().getResource(uriInContext);
if (resource==nul... |
java | @Nonnull
@ReturnsMutableCopy
public ICommonsList <ICSSTopLevelRule> getAllRules (@Nonnull final Predicate <? super ICSSTopLevelRule> aFilter)
{
return m_aRules.getAll (aFilter);
} |
java | public static byte[] getBytes(String text) {
byte[] bytes = new byte[] {};
try {
bytes = text.getBytes("utf-8");
} catch (UnsupportedEncodingException e) {
}
return bytes;
} |
python | def revert(self):
"""
Revert any changes made to settings.
"""
for attr, value in self._changed.items():
setattr(django_settings, attr, value)
for attr in self._added:
delattr(django_settings, attr)
self._changed = {}
self._added = []
... |
java | final Table SYSTEM_TYPEINFO() {
Table t = sysTables[SYSTEM_TYPEINFO];
if (t == null) {
t = createBlankTable(sysTableHsqlNames[SYSTEM_TYPEINFO]);
//-------------------------------------------
// required by JDBC:
// --------------------------------------... |
java | @Override
public void setMessageType(char indicationType)
throws IllegalArgumentException {
/*
* old TURN DATA indication type is an indication despite 0x0115 &
* 0x0110 indicates STUN error response type
*/
if (!isIndicationType(indicationType)
&& indicationType != StunMessage.OLD_DATA_INDICATION)... |
python | def _set_intrinsics(self):
"""Read the intrinsics matrix from the stream.
"""
strm = self._profile.get_stream(rs.stream.color)
obj = strm.as_video_stream_profile().get_intrinsics()
self._intrinsics[0, 0] = obj.fx
self._intrinsics[1, 1] = obj.fy
self._intrinsics[0,... |
python | def create_role_policy(role_name, policy_name, policy, region=None, key=None,
keyid=None, profile=None):
'''
Create or modify a role policy.
CLI Example:
.. code-block:: bash
salt myminion boto_iam.create_role_policy myirole mypolicy '{"MyPolicy": "Statement": [{"Action... |
python | def start(self, subid, params=None):
''' /v1/server/start
POST - account
Start a virtual machine. If the machine is already
running, it will be restarted.
Link: https://www.vultr.com/api/#server_start
'''
params = update_params(params, {'SUBID': subid})
r... |
java | @Override
public KeywordLiteral setType(int nodeType) {
if (!(nodeType == Token.THIS
|| nodeType == Token.NULL
|| nodeType == Token.TRUE
|| nodeType == Token.FALSE
|| nodeType == Token.DEBUGGER))
throw new IllegalArgumentException("Invalid ... |
python | def diff(before, after, check_modified=False):
"""Diff two sequences of comparable objects.
The result of this function is a list of dictionaries containing
values in ``before`` or ``after`` with a ``state`` of either
'unchanged', 'added', 'deleted', or 'modified'.
>>> import pprint
>>> result... |
python | def _at_extend(self, calculator, rule, scope, block):
"""
Implements @extend
"""
from scss.selector import Selector
selectors = calculator.apply_vars(block.argument)
rule.extends_selectors.extend(Selector.parse_many(selectors)) |
python | def extract_cookies(self, response, request):
"""Extract cookies from response, where allowable given the request."""
_debug("extract_cookies: %s", response.info())
self._cookies_lock.acquire()
try:
self._policy._now = self._now = int(time.time())
for cookie in s... |
python | def start_browser_when_ready(host, port=None, cancel_event=None):
"""
Starts a thread that waits for the server then opens the specified
address in the browser. Set cancel_event to cancel the wait. The
started thread object is returned.
"""
browser_thread = Thread(
target=wait_and_start_... |
java | public static void validateMergedXML(ModuleInitData mid)
throws EJBConfigurationException
{
if (!validationEnabled()) {
return;
}
EJBJar mergedEJBJar = mid.getMergedEJBJar();
if (mergedEJBJar == null) { // managed beans only
return;
... |
python | def start(st_reg_number):
"""Checks the number valiaty for the Alagoas state"""
if len(st_reg_number) > 9:
return False
if len(st_reg_number) < 9:
return False
if st_reg_number[0:2] != "24":
return False
if st_reg_number[2] not in ['0', '3', '5', '7', '8']:
return... |
python | def smoothing(self, f, w, sm, smtol, gstol):
"""
Smooths a surface f by choosing nodal function values and gradients to
minimize the linearized curvature of F subject to a bound on the
deviation from the data values. This is more appropriate than interpolation
when significant er... |
python | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'text') and self.text is not None:
_dict['text'] = self.text
if hasattr(self, 'score') and self.score is not None:
_dict['score'] = self.score
return _d... |
python | def set_coords(self, names, inplace=None):
"""Given names of one or more variables, set them as coordinates
Parameters
----------
names : str or list of str
Name(s) of variables in this dataset to convert into coordinates.
inplace : bool, optional
If True... |
java | @Override
public void visitClassContext(ClassContext classContext) {
try {
clsContext = classContext;
JavaClass cls = classContext.getJavaClass();
if (cls.isInterface())
return;
superClasses = cls.getSuperClasses();
cls.accept(this)... |
java | public static boolean checkUri(String uri) {
QueryStringDecoder queryStringDecoder = new QueryStringDecoder(uri, true);
String path = queryStringDecoder.path();
int groupIndex = path.indexOf('/') + 1,
unitIndex = path.indexOf('/', groupIndex) + 1;
if (groupIndex == 0 || u... |
java | public void marshall(DescribeCollectionRequest describeCollectionRequest, ProtocolMarshaller protocolMarshaller) {
if (describeCollectionRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(desc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.