language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def serverless(self):
"""
Access the Serverless Twilio Domain
:returns: Serverless Twilio Domain
:rtype: twilio.rest.serverless.Serverless
"""
if self._serverless is None:
from twilio.rest.serverless import Serverless
self._serverless = Serverless... |
java | public void marshall(FaultRootCauseEntity faultRootCauseEntity, ProtocolMarshaller protocolMarshaller) {
if (faultRootCauseEntity == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(faultRootCauseEntit... |
python | def query_starts_with(query, prefixes):
"""Check if the query starts with any item from *prefixes*."""
prefixes = [prefix.lower() for prefix in prefixes]
formatted_sql = sqlparse.format(query.lower(), strip_comments=True)
return bool(formatted_sql) and formatted_sql.split()[0] in prefixes |
java | public void marshall(DescribeFileSystemsRequest describeFileSystemsRequest, ProtocolMarshaller protocolMarshaller) {
if (describeFileSystemsRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(d... |
java | private void createIndex() {
indexLen = MIN_LEN;
TreeMap<String, TreeSet<Integer>> indexT = new TreeMap<String, TreeSet<Integer>>();
for(String s: dp.keySet()) {
if(s.length() < indexLen)
continue;
String temp = s.substring(0, indexLen);
//System.out.println(temp);
if(indexT.containsKey(te... |
python | def write(self, format_p, options, path):
"""Writes the contents of the appliance exports into a new OVF file.
Calling this method is the final step of exporting an appliance from VirtualBox;
see :py:class:`IAppliance` for an overview.
Since exporting the appliance wil... |
python | def version():
"""
Returns a human-readable version string.
For official releases, it will follow a semver style (e.g. ``1.2.7``).
For dev versions, it will have the semver style first, followed by
hyphenated qualifiers (e.g. ``1.2.7-dev``).
Returns a string.
"""
short = '.'.join([str(... |
java | private void getHeadersFromFrame() {
byte[] hbf = null;
if (currentFrame.getFrameType() == FrameTypes.HEADERS || currentFrame.getFrameType() == FrameTypes.PUSHPROMISEHEADERS) {
hbf = ((FrameHeaders) currentFrame).getHeaderBlockFragment();
} else if (currentFrame.getFrameType() == Fra... |
java | @Beta
public static void addDelayedShutdownHook(
ExecutorService service, long terminationTimeout, TimeUnit timeUnit) {
new Application()
.addDelayedShutdownHook(service, terminationTimeout, timeUnit);
} |
java | private static void generateToCManagedConnection(Map<String, TraceEvent> events, FileWriter fw)
throws Exception
{
writeString(fw, "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"");
writeEOL(fw);
writeString(fw, " \"http://www.w3.org/TR/html4/loose.dtd\"... |
java | private static List<InputSplit> cleanSplits(List<InputSplit> splits) throws IOException {
if (VersionInfo.getVersion().compareTo("2.3.0") >= 0) {
// This issue was fixed in 2.3.0, if newer version, no need to clean up splits
return splits;
}
List<InputSplit> cleanedSplits = Lists.newArrayList()... |
java | public EventServiceLog updateEventServiceLog(EventServiceLog eventServiceLog) {
if (eventServiceLog != null) {
final EventServiceLog log = getObjectById(EventServiceLog.class, eventServiceLog.getId());
if (log != null) {
pm.currentTransaction().begin();
lo... |
java | public DTMIterator createDTMIterator(String xpathString,
PrefixResolver presolver)
{
return m_dtmManager.createDTMIterator(xpathString, presolver);
} |
java | @SuppressWarnings("unchecked")
public EList<String> getTelephoneNumbers() {
return (EList<String>) eGet(Ifc2x3tc1Package.Literals.IFC_TELECOM_ADDRESS__TELEPHONE_NUMBERS, true);
} |
python | def early_create_objects(self, raw_objects):
"""Create the objects needed for the post configuration file initialization
:param raw_objects: dict with all object with str values
:type raw_objects: dict
:return: None
"""
types_creations = self.__class__.types_creations
... |
java | @Override
public EClass getIfcWorkControl() {
if (ifcWorkControlEClass == null) {
ifcWorkControlEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI)
.getEClassifiers().get(771);
}
return ifcWorkControlEClass;
} |
java | public void insertChild(CmsTreeItem item, int position) {
m_children.insert(item, position);
adopt(item);
} |
java | @Override
public boolean checkCredentials(final String uid, final String password) {
StringBuilder sb = new StringBuilder(userIdentifyer + "=").append(uid).append(",");
sb.append(Configuration.getProperty(instanceName + LdapKeys.ATTR_OU_PEOPLE)).append(",");
sb.append(baseDn);
if (ui... |
java | public static boolean hasPrefix(String principalName) {
return CmsStringUtil.isNotEmptyOrWhitespaceOnly(principalName)
&& (principalName.trim().toUpperCase().startsWith(PRINCIPAL_ROLE + "."));
} |
java | public String digest(String message) {
final byte[] messageAsByteArray;
try {
messageAsByteArray = message.getBytes(charsetName);
} catch (UnsupportedEncodingException e) {
throw new DigestException("error converting message to byte array: charsetName=" + charsetName, e);
}
final byte[] digest = diges... |
java | public static <T> T forkJoinExecution(Callable<T> callable, ConcurrencyConfiguration concurrencyConfiguration, boolean parallelStream) {
if(parallelStream && concurrencyConfiguration.isParallelized()) {
try {
ForkJoinPool pool = new ForkJoinPool(concurrencyConfiguration.getMaxNumberO... |
python | def print_sentence(self, sent_index):
"""
returns the string representation of a sentence.
:param sent_index: the index of a sentence (from ``self.sentences``)
:type sent_index: int
:return: the sentence string
:rtype: str
"""
tokens = [self.print_token(t... |
java | public final void entryRuleValidID() throws RecognitionException {
try {
// InternalXbase.g:1867:1: ( ruleValidID EOF )
// InternalXbase.g:1868:1: ruleValidID EOF
{
if ( state.backtracking==0 ) {
before(grammarAccess.getValidIDRule());
... |
java | public String next() throws java.io.IOException {
int zzInput;
int zzAction;
// cached fields:
int zzCurrentPosL;
int zzMarkedPosL;
int zzEndReadL = zzEndRead;
char [] zzBufferL = zzBuffer;
char [] zzCMapL = ZZ_CMAP;
int [] zzTransL = ZZ_TRANS;
int [] zzRowMapL = ZZ... |
python | def yaml_tag_constructor(loader, tag, node):
"""convert shorthand intrinsic function to full name
"""
def _f(loader, tag, node):
if tag == '!GetAtt':
return node.value.split('.')
elif type(node) == yaml.SequenceNode:
return loader.construct_sequence(node)
else... |
java | public void initialize(UimaContext aContext) {
annotate_tokens = (Boolean) aContext.getConfigParameterValue(PARAM_ANNOTATE_TOKENS);
annotate_sentences = (Boolean) aContext.getConfigParameterValue(PARAM_ANNOTATE_SENTENCES);
annotate_pos = (Boolean) aContext.getConfigParameterValue(PARAM_ANNOTATE_POS);
this.langu... |
java | @Override
public boolean readBoolean() throws JMSException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "readBoolean");
// Check that we are in read mode
checkBodyReadable("readBoolean");
if (requiresInit)
lazyInitF... |
python | def collect_filepaths(self, directories):
"""
Collects and returns every filepath from each directory in
`directories` that is filtered through the `file_filters`.
If no `file_filters` are present, passes every file in directory
as a result.
Always returns a `set` object
... |
python | def fromOpenIDRequest(cls, openid_request):
"""Extract a FetchRequest from an OpenID message
@param openid_request: The OpenID authentication request
containing the attribute fetch request
@type openid_request: C{L{openid.server.server.CheckIDRequest}}
@rtype: C{L{FetchRequ... |
python | def associate(self, model):
"""
Associate the model instance to the given parent.
:type model: eloquent.Model
:rtype: eloquent.Model
"""
self._parent.set_attribute(self._foreign_key, model.get_key())
self._parent.set_attribute(self._morph_type, model.get_morph_c... |
python | def iterfd(fd):
'''
Generator which unpacks a file object of msgpacked content.
Args:
fd: File object to consume data from.
Notes:
String objects are decoded using utf8 encoding. In order to handle
potentially malformed input, ``unicode_errors='surrogatepass'`` is set
... |
java | public static X500Principal getSubjectX500Principal(X509Certificate cert) {
try {
return getX500Principal(cert, false);
} catch (Exception e) {
throw new RuntimeException("Could not parse subject", e);
}
} |
java | public Descriptor withTopics(TopicCall<?>... topicCalls) {
return new Descriptor(name, calls, pathParamSerializers, messageSerializers, serializerFactory, exceptionSerializer, autoAcl, acls, headerFilter, locatableService, circuitBreaker,
this.topicCalls.plusAll(Arrays.asList(topicCalls)));
... |
python | def create_monitoring_request(
self,
balance_proof: BalanceProofSignedState,
reward_amount: TokenAmount,
) -> Optional[RequestMonitoring]:
""" This method can be used to create a `RequestMonitoring` message.
It will contain all data necessary for an external monit... |
java | public void redirect(String url) throws IOException {
endChangesIfNecessary();
ResponseWriter writer = getWrapped();
writer.startElement("redirect", null);
writer.writeAttribute("url", url, null);
writer.endElement("redirect");
} |
python | def make_cache(self, backend=None):
"""Make a cache to reduce the time of run. Some backends may implemented it.
This is temporary API. It may changed or deprecated."""
if backend is None:
if self._default_backend is None:
backend = DEFAULT_BACKEND_NAME
e... |
java | public static String toStringUTF8(byte[] bytes)
{
if (bytes == null)
{
return null;
}
return toStringUTF8(bytes, 0, bytes.length);
} |
java | private void doListGet(final Message<JsonObject> message) {
final String name = message.body().getString("name");
if (name == null) {
message.reply(new JsonObject().putString("status", "error").putString("message", "No name specified."));
return;
}
final Integer index = message.body().getIn... |
python | def geolocate(self, ip: str):
"""Return geolocate information from ip address (Geolocate doesn't need apikey !!)
"""
url_path = "/api/geoloc/{ip}".format(ip=ip)
return self._request_without_api(path=url_path) |
python | def isASLREnabled(self):
"""
Determines if the current L{PE} instance has the DYNAMICBASE (Use address space layout randomization) flag enabled.
@see: U{http://msdn.microsoft.com/en-us/library/bb384887.aspx}
@rtype: bool
@return: Returns C{True} if the current L{PE} instance has... |
python | def zlib_decompress_all_frames(data):
"""Decompress all frames of zlib-compressed bytes.
Repeatedly tries to decompress `data` until all data are decompressed, or decompression
fails. This will skip over bytes that are not compressed with zlib.
Parameters
----------
data : bytearray or bytes
... |
java | @Override
public View getView(int position, View convertView, ViewGroup parent) {
View view;
if (convertView == null) {
view = inflater.inflate(itemResource, parent, false);
} else {
view = convertView;
}
if(temporarySelection != null && position == ge... |
java | @Override
public CreateDatabaseResult createDatabase(CreateDatabaseRequest request) {
request = beforeClientExecution(request);
return executeCreateDatabase(request);
} |
python | def __find_handler_factories(self):
"""
Finds all registered handler factories and stores them
"""
# Get the references
svc_refs = self.__context.get_all_service_references(
handlers_const.SERVICE_IPOPO_HANDLER_FACTORY
)
if svc_refs:
for sv... |
java | public void add_logging_target (String[] dvsa) throws DevFailed
{
//- Fight against "zombie appender" synfrom
kill_zombie_appenders();
//- N x [device-name, ttype::tname] expected
if ((dvsa.length % 2) != 0) {
String desc = "Incorrect number of arguments";
Except.throw_exception("API_Method... |
python | def plot_element_profile(self, element, comp, show_label_index=None,
xlim=5):
"""
Draw the element profile plot for a composition varying different
chemical potential of an element.
X value is the negative value of the chemical potential reference to
... |
java | private boolean decode_PlayColParm() throws ParserException {
boolean decoded = false;
if (index < totalChars) {
if (chars[index] == 'i' && chars[index + 1] == 'p') {
index = index + 3;
AnnouncementParmValue annPaVa = new AnnouncementParmValue(ParameterEnum.ip);
value.put(ParameterEnum.ip, annPaVa);
... |
java | public static void setLookAndFeel() {
try {
if(PREFER_GTK) {
LookAndFeelInfo[] lfs = UIManager.getInstalledLookAndFeels();
for(LookAndFeelInfo lf : lfs) {
if(lf.getClassName().contains("GTK")) {
UIManager.setLookAndFeel(lf.getClassName());
return;
}
... |
java | @Override
public void focusOn() throws WidgetException {
WebDriver driver = SessionManager.getInstance().getCurrentSession().getWrappedDriver();
JavascriptExecutor jse = (JavascriptExecutor) driver;
jse.executeScript("arguments[0].focus();", findElement());
} |
python | def append_path(self, path):
"""Append :obj:`path` onto the current path.
The path may be either the return value from one of :meth:`copy_path`
or :meth:`copy_path_flat` or it may be constructed manually.
:param path:
An iterable of tuples
in the same format as r... |
python | def get(self, name):
""" creates connection to the MQ with process-specific settings
:return :mq::flopsy::Publisher instance"""
if name not in self.pools:
self.pools[name] = _Pool(logger=self.logger, name=name)
return self.pools[name].get() |
python | def md5_checker(self, md5sum, local_file=None, file_object=None):
"""Return True if the local file and the provided `md5sum` are equal.
If the processed file and the provided md5sum do not match an exception
is raised indicating the failure.
:param md5sum: ``str``
:param local_... |
java | public static int[] getInt2DColumnSum(int[][] apsp) {
int[] colSum = new int[apsp.length];
int sum;
for (int i = 0; i < apsp.length; i++) {
sum = 0;
for (int j = 0; j < apsp.length; j++) {
sum += apsp[i][j];
}
colSum[i] = sum;
... |
java | public void setClassNameResolver(final Object classNameResolver) {
if (classNameResolver instanceof ClassNameResolver) {
this.classNameResolver = (ClassNameResolver) classNameResolver;
} else if (classNameResolver instanceof String) {
this.classNameResolver = new ClassNameResolve... |
python | def SendTextMessage(self, Text):
"""Sends a text message over channel.
:Parameters:
Text : unicode
Text to send.
"""
if self.Type == cctReliable:
self.Stream.Write(Text)
elif self.Type == cctDatagram:
self.Stream.SendDatagram(Text)
... |
java | private String encode() {
byte[] pack = new byte[4 + m_bits.length];
pack[0] = (byte) ((FP_SIZE & 0xffffffff) >> 24);
pack[1] = (byte) ((FP_SIZE & 0x00ffffff) >> 16);
pack[2] = (byte) ((FP_SIZE & 0x0000ffff) >> 8);
pack[3] = (byte) (FP_SIZE & 0x000000ff);
for (int i = 0;... |
java | private void remainChangesBack(PlainChangesLog cLog)
{
changesLog.addAll(cLog.getAllStates());
if (LOG.isDebugEnabled())
{
LOG.debug(" ----- rollback ----- \n" + cLog.dump());
}
} |
java | @Override
public void handleTransportError(final WebSocketSession webSocketSession, final Throwable exception) throws Exception {
if (exception != null) {
logger.error("[handleTransportError]", exception);
}
} |
python | def search_with_additional_terms(self, term_dict, escape=True):
"""
Returns a new search object with additional search terms and-ed to the
filter string. term_dict maps attribute names to assertion values. If
you don't want the values escaped, pass escape=False.
"""
term_... |
java | public ServiceFuture<Void> beginFailoverAsync(String resourceGroupName, String accountName, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(beginFailoverWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback);
} |
python | def get_formatted_as_type(self, value, default=None, out_type=str):
"""Return formatted value for input value, returns as out_type.
Caveat emptor: if out_type is bool and value a string,
return will be True if str is 'True'. It will be False for all other
cases.
Args:
... |
java | public EClass getIfcFeatureElementSubtraction() {
if (ifcFeatureElementSubtractionEClass == null) {
ifcFeatureElementSubtractionEClass = (EClass) EPackage.Registry.INSTANCE
.getEPackage(Ifc2x3tc1Package.eNS_URI).getEClassifiers().get(233);
}
return ifcFeatureElementSubtractionEClass;
} |
java | private LocatedBlock recoverBlock(int namespaceId, Block block, boolean keepLength,
DatanodeID[] datanodeids, boolean closeFile, long deadline) throws IOException {
InjectionHandler.processEvent(InjectionEvent.DATANODE_BEFORE_RECOVERBLOCK,
this);
// If the block is already being recovered, then s... |
java | public static List<String> readColumnFromDelimitedFile(String filename,
int columnNumber, String delimiter) {
List<String> columnValues = Lists.newArrayList();
try {
BufferedReader in = new BufferedReader(new FileReader(filename));
String line;
while ((line = in.readLine()) != null) {
... |
python | def uninstall(self):
"""
Called when uninstalled from the user store. Uninstalls all my
powerups.
"""
for item in self.items:
uninstallFrom(item, self.store)
self._items = [] |
python | def start_output (self):
"""
Write start of checking info as xml comment.
"""
super(CustomXMLLogger, self).start_output()
self.xml_start_output()
attrs = {"created": strformat.strtime(self.starttime)}
self.xml_starttag(u'linkchecker', attrs)
self.flush() |
python | def close_open_fds(keep_files=[]):
"""Close all open file descriptors except those in a given set.
@param keep_files: an iterable of file descriptors or file-like objects.
"""
keep_fds = set()
for file in keep_files:
if isinstance(file, int):
keep_fds.add(file)
else:
... |
python | def _add_group_remover(self):
"""
Add a ``_remove_eg_x()`` method to the element class for this choice
group.
"""
def _remove_choice_group(obj):
for tagname in self._member_nsptagnames:
obj.remove_all(tagname)
_remove_choice_group.__doc__ = (
... |
java | public static Object getValue(Field field, Object object) {
String fieldName = field.getName();
String setMethodName = "get" + firstLetterUpperCase(fieldName);
Method method = null;
try {
method = object.getClass().getMethod(setMethodName);
} catch (Exception e) {
}
if(method != null) {
try {
... |
python | def segment_similarity(A, B, T=CLOSE_DISTANCE_THRESHOLD):
"""Computes the similarity between two segments
Args:
A (:obj:`Segment`)
B (:obj:`Segment`)
Returns:
float: between 0 and 1. Where 1 is very similar and 0 is completely different
"""
l_a = len(A.points)
l_b = len(... |
python | def initialize(self):
"""
Initialize instance attributes. You can override this method in
the subclasses.
"""
self.main_pid = os.getpid()
self.processes.extend(self.init_service_processes())
self.processes.extend(self.init_tornado_workers()) |
python | def rerecord(ctx, rest):
"""Rerecord tests."""
run('tox -e py27 -- --cassette-mode all --record --credentials {0} -s'
.format(rest), pty=True)
run('tox -e py27 -- --resave --scrub --credentials test_credentials {0} -s'
.format(rest), pty=True) |
java | public static void transfer(InputStream in, byte[] bytes) throws IOException
{
// Read in the bytes
int offset = 0;
int numRead;
while (offset < bytes.length && (numRead = in.read(bytes, offset, bytes.length - offset)) >= 0)
{
offset += numRead;
}
... |
python | def roll(self):
""" Calculates the Roll of the Quaternion. """
x, y, z, w = self.x, self.y, self.z, self.w
return math.atan2(2*y*w - 2*x*z, 1 - 2*y*y - 2*z*z) |
python | def _branch_flow_dc(self, branches, Bf, Pfinj, base_mva):
""" Returns the branch flow limit constraint. The real power flows
at the from end the lines are related to the bus voltage angles by
Pf = Bf * Va + Pfinj.
"""
# Indexes of constrained lines.
il = array([i for i,l... |
python | def MakeDeployableBinary(self, template_path, output_path):
"""This will add the config to the client template and create a .deb."""
buildpackage_binary = "/usr/bin/dpkg-buildpackage"
if not os.path.exists(buildpackage_binary):
logging.error("dpkg-buildpackage not found, unable to repack client.")
... |
java | @Activate
protected synchronized void activate(ComponentContext ctx, Map<String, Object> properties) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(tc, "Activated: " + properties);
}
Set<String> installedFeatures = provisionerService.getInstalledFe... |
python | def changeDefaultMessageConst(self, header_segment, segment_len, separator_count):
"""
Provide a way to change default HL7 parameter if you want to subclass
:param header_segment: Expected segment, for HL7, it's MSH
:param segment_len: Expected length of segment, for HL7, it's 3
... |
java | public E peek() {
lock.lock();
try {
if (open) {
if (elements.size() > 0) {
return elements.getFirst();
} else {
return null;
}
} else {
throw new IllegalStateException("queue is closed");
}
} finally {
lock.unlock();
}
} |
python | def detect_language(
self,
parent=None,
model=None,
content=None,
mime_type=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Detects the language of text within ... |
java | static void register() {
Transliterator.registerFactory(_ID, new Transliterator.Factory() {
@Override
public Transliterator getInstance(String ID) {
return new LowercaseTransliterator(ULocale.US);
}
});
Transliterator.registerSpecialInverse("L... |
python | def _merge_wheres_to_has(self, has_query, relation):
"""
Merge the "wheres" from the relation query to a has query.
:param has_query: The has query
:type has_query: Builder
:param relation: The relation to count
:type relation: eloquent.orm.relations.Relation
""... |
python | def atanh(x, context=None):
"""
Return the inverse hyperbolic tangent of x.
"""
return _apply_function_in_current_context(
BigFloat,
mpfr.mpfr_atanh,
(BigFloat._implicit_convert(x),),
context,
) |
java | public static <T> Iterable<T> simpleIterable(final Iterable<T> iterable) {
requireNonNull(iterable);
return () -> iterable.iterator();
} |
java | public void process( GrayF32 input ) {
scaleSpace.initialize(input);
detections.reset();
do {
// scale from octave to input image
pixelScaleToInput = scaleSpace.pixelScaleCurrentToInput();
// detect features in the image
for (int j = 1; j < scaleSpace.getNumScales()+1; j++) {
// not really sur... |
python | def __execute_sext(self, instr):
"""Execute SEXT instruction.
"""
op0_size = instr.operands[0].size
op2_size = instr.operands[2].size
op0_val = self.read_operand(instr.operands[0])
op0_msb = extract_sign_bit(op0_val, op0_size)
op2_mask = (2**op2_size-1) & ~(2**o... |
python | def text(self, path, compression=None, lineSep=None):
"""Saves the content of the DataFrame in a text file at the specified path.
The text files will be encoded as UTF-8.
:param path: the path in any Hadoop supported file system
:param compression: compression codec to use when saving t... |
java | private void populateDistSetTypeNameCombo() {
distsetTypeNameComboBox.setContainerDataSource(getDistSetTypeLazyQueryContainer());
distsetTypeNameComboBox.setItemCaptionPropertyId(SPUILabelDefinitions.VAR_NAME);
distsetTypeNameComboBox.setValue(getDefaultDistributionSetType().getId());
} |
java | public @CheckForNull User getUser(String name) {
return User.get(name, User.ALLOW_USER_CREATION_VIA_URL && hasPermission(ADMINISTER));
} |
java | private HttpEntity<?> createHttpEntity(HttpHeaders httpHeaders, Object payload, HttpMethod method) {
if (httpMethodSupportsBody(method)) {
return new HttpEntity<>(payload, httpHeaders);
} else {
return new HttpEntity<>(httpHeaders);
}
} |
python | def fit(self, X, y=None, init=None):
"""
Computes the position of the points in the embedding space
Parameters
----------
X : array, shape=[n_samples, n_features], or [n_samples, n_samples] \
if dissimilarity='precomputed'
Input data.
... |
java | OrderedHashSet getDependentConstraints(int colIndex) {
OrderedHashSet set = new OrderedHashSet();
for (int i = 0, size = constraintList.length; i < size; i++) {
Constraint c = constraintList[i];
if (c.hasColumnOnly(colIndex)) {
set.add(c);
}
... |
java | private static ConjunctionImpl organizeConjunction(Operator andOper) {
Selector left = andOper.getOperands()[0];
ConjunctionImpl conjunction;
if (left instanceof Operator) {
Operator oper = (Operator) left;
if (oper.getOp() == Selector.AND)
conjunction = organizeConjunction(oper);
... |
java | protected final void updateCapabilities(TriggerType[] triggerTypes) {
AgentCapabilities agentCapabilities = new AgentCapabilities();
agentCapabilities.setId(this.getId());
agentCapabilities.setType(this.getType());
agentCapabilities.setSupportedTriggerTypes(triggerTypes);
this.... |
python | def compute_prior(name, z, latent, hparams, condition=False, state=None,
temperature=1.0):
"""Distribution on z_t conditioned on z_{t-1} and latent.
Args:
name: variable scope.
z: 4-D Tensor.
latent: optional,
if hparams.latent_dist_encoder == "pointwise", this is a list
... |
java | protected static StringBuilder appendResourcePathPrefixFor(StringBuilder sb, String pkgName)
{
if(pkgName == null)
throw new NullPointerException("pkgName is null");
if(sb == null)
sb = new StringBuilder(pkgName.length() + 2);
sb.append('/');
if(pkgName.length() == 0)
return sb;
sb.append(pkgName.re... |
python | def solar_azimuth(self, dateandtime=None):
"""Calculates the solar azimuth angle for a specific date/time.
:param dateandtime: The date and time for which to calculate the angle.
:type dateandtime: :class:`~datetime.datetime`
:returns: The azimuth angle in degrees clockwise from North.... |
java | @Override
public String getDescription() {
String ucExt = extension.substring(1).toUpperCase();
return (ucExt + " Files (*" + extension + ')');
} |
java | public void remove(String identifier, ItemData item)
{
writeLock.lock();
try
{
ItemData data= getItem(identifier);
if (data != null && data.equals(item))
{
cache.remove(new CacheId(identifier));
}
}
catch (Exception e)
{
LOG... |
java | public void marshall(BotAliasMetadata botAliasMetadata, ProtocolMarshaller protocolMarshaller) {
if (botAliasMetadata == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(botAliasMetadata.getName(), NAM... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.