language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def get_title(brain_or_object):
"""Get the Title for this object
:param brain_or_object: A single catalog brain or content object
:type brain_or_object: ATContentType/DexterityContentType/CatalogBrain
:returns: Title
:rtype: string
"""
if is_brain(brain_or_object) and base_hasattr(brain_or_... |
java | int splitSegment(int origin_vertex, double[] split_scalars, int split_count) {
int actual_splits = 0;
int next_vertex = getNextVertex(origin_vertex);
if (next_vertex == -1)
throw GeometryException.GeometryInternalError();
int vindex = getVertexIndex(origin_vertex);
int vindex_next = getVertexIndex(next_ve... |
java | @Override
public boolean satisfies(Match match, int... ind)
{
int x = -1;
for (MappedConst mc : con)
{
if (mc.satisfies(match, ind)) x *= -1;
}
return x == 1;
} |
java | public EEnum getIfcSIPrefix() {
if (ifcSIPrefixEEnum == null) {
ifcSIPrefixEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(890);
}
return ifcSIPrefixEEnum;
} |
python | def attention_lm_moe_base_memeff():
"""Base model with attention expert."""
hparams = attention_lm_moe_base_long_seq()
hparams.use_sepconv = False
hparams.diet_experts = True
hparams.layer_preprocess_sequence = "n"
hparams.layer_postprocess_sequence = "da"
hparams.layer_prepostprocess_dropout = 0.0
hpa... |
python | def _prepare_imports(self, dicts):
""" an override for prepare imports that sorts the imports by parent_id dependencies """
# all pseudo parent ids we've seen
pseudo_ids = set()
# pseudo matches
pseudo_matches = {}
# get prepared imports from parent
prepared = di... |
java | @Nonnull
public static <ELEMENTTYPE> String getImplodedMappedNonEmpty (@Nonnull final String sSep,
@Nullable final ELEMENTTYPE [] aElements,
@Nonnegative final int nOfs,
... |
java | public static long cleartextSize(long ciphertextSize, Cryptor cryptor) {
checkArgument(ciphertextSize >= 0, "expected ciphertextSize to be positive, but was %s", ciphertextSize);
long cleartextChunkSize = cryptor.fileContentCryptor().cleartextChunkSize();
long ciphertextChunkSize = cryptor.fileContentCryptor().ci... |
java | public String getHelpText() {
@SuppressWarnings("unchecked")
ArrayList<Argument> arguments = (ArrayList<Argument>) this.args.clone();
String ret = programDescription + "\n";
ret += "Usage: " + executableName + " ";
for (Argument arg : this.args) {
if (arg.isParam) {
ret += !arg.isRequiredArg()
?... |
python | def read(self):
"""
Reads a single character from the device.
:returns: character read from the device
:raises: :py:class:`~alarmdecoder.util.CommError`
"""
ret = None
try:
ret = self._device.read_data(1)
except (usb.core.USBError, FtdiError... |
java | public static String writeShort(Short value) {
if (value==null) return null;
return Short.toString(value);
} |
java | protected void detectJournalManager() throws IOException {
int failures = 0;
do {
try {
Stat stat = new Stat();
String primaryAddr = zk.getPrimaryAvatarAddress(logicalName,
stat, true, true);
if (primaryAddr == null || primaryAd... |
python | def write_squonk_datasetmetadata(outputBase, thinOutput, valueClassMappings, datasetMetaProps, fieldMetaProps):
"""This is a temp hack to write the minimal metadata that Squonk needs.
Will needs to be replaced with something that allows something more complete to be written.
:param outputBase: Base name fo... |
java | public static PlaceDetailsRequest placeDetails(
GeoApiContext context, String placeId, PlaceAutocompleteRequest.SessionToken sessionToken) {
PlaceDetailsRequest request = new PlaceDetailsRequest(context);
request.placeId(placeId);
request.sessionToken(sessionToken);
return request;
} |
java | public CmsJspDateSeriesBean getParentSeries() {
if ((m_parentSeries == null) && getIsExtractedDate()) {
CmsObject cms = m_value.getCmsObject();
try {
CmsResource res = cms.readResource(m_seriesDefinition.getParentSeriesId());
CmsJspContentAccessBean conte... |
java | public static <T extends Vector> double getSimilarity(
SimType similarityType, T a, T b) {
switch (similarityType) {
case COSINE:
return cosineSimilarity(a, b);
case PEARSON_CORRELATION:
return correlation(a, b);
case EUCLIDEAN:
... |
java | private boolean hashesMatch(Dependency dependency1, Dependency dependency2) {
if (dependency1 == null || dependency2 == null || dependency1.getSha1sum() == null || dependency2.getSha1sum() == null) {
return false;
}
return dependency1.getSha1sum().equals(dependency2.getSha1sum());
... |
python | def ElementFactory(href, smcresult=None, raise_exc=None):
"""
Factory returns an object of type Element when only
the href is provided.
:param str href: string href to fetch
:param SMCResult smcresult: optional SMCResult. If provided,
the request fetch will be skipped
:param Excepti... |
java | private void initialize() {
this.setText(Constant.messages.getString("sites.resend.popup"));
this.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent evt) {
if (treeSite != null) {
... |
java | public boolean skipPreamble () throws IOException
{
// First delimiter may be not preceeded with a CRLF.
System.arraycopy (m_aBoundary, 2, m_aBoundary, 0, m_aBoundary.length - 2);
m_nBoundaryLength = m_aBoundary.length - 2;
try
{
// Discard all data up to the delimiter.
discardBodyData... |
java | public boolean recordThrowDescription(
JSTypeExpression type, String description) {
if (currentInfo.documentThrows(type, description)) {
populated = true;
return true;
} else {
return false;
}
} |
python | def checkPortAvailable(ha):
"""Checks whether the given port is available"""
# Not sure why OS would allow binding to one type and not other.
# Checking for port available for TCP and UDP.
sockTypes = (socket.SOCK_DGRAM, socket.SOCK_STREAM)
for typ in sockTypes:
sock = socket.socket(socket.A... |
python | def scale(cls, *scaling):
"""Create a scaling transform from a scalar or vector.
:param scaling: The scaling factor. A scalar value will
scale in both dimensions equally. A vector scaling
value scales the dimensions independently.
:type scaling: float or sequence
... |
python | def load_slice(self, state, start, end):
"""
Return the memory objects overlapping with the provided slice.
:param start: the start address
:param end: the end address (non-inclusive)
:returns: tuples of (starting_addr, memory_object)
"""
items = [ ]
if s... |
java | Chronology getEffectiveChronology() {
Chronology chrono = currentParsed().chrono;
if (chrono == null) {
chrono = overrideChronology;
if (chrono == null) {
chrono = IsoChronology.INSTANCE;
}
}
return chrono;
} |
python | def get_layer_heights(heights, depth, *args, **kwargs):
"""Return an atmospheric layer from upper air data with the requested bottom and depth.
This function will subset an upper air dataset to contain only the specified layer using
the heights only.
Parameters
----------
heights : array-like
... |
python | def similar_items(self, key, replaces):
"""
Returns a list of (key, value) tuples for all variants of ``key``
in this DAWG according to ``replaces``.
``replaces`` is an object obtained from
``DAWG.compile_replaces(mapping)`` where mapping is a dict
that maps single-char ... |
java | @Override
public AdminDeleteUserAttributesResult adminDeleteUserAttributes(AdminDeleteUserAttributesRequest request) {
request = beforeClientExecution(request);
return executeAdminDeleteUserAttributes(request);
} |
python | def apply_with(self, _, v, ctx):
""" constructor
:param v: things used to constrcut date
:type v: timestamp in float, datetime.date object, or ISO-8601 in str
"""
self.v = None
if isinstance(v, float):
self.v = datetime.date.fromtimestamp(v)
elif isin... |
python | def qurl(parser, token):
"""
Append, remove or replace query string parameters (preserve order)
{% qurl url [param]* [as <var_name>] %}
{% qurl 'reverse_name' [reverse_params] | [param]* [as <var_name>] %}
param:
name=value: replace all values of name by one value
... |
python | def page(self, actor_sid=values.unset, event_type=values.unset,
resource_sid=values.unset, source_ip_address=values.unset,
start_date=values.unset, end_date=values.unset,
page_token=values.unset, page_number=values.unset,
page_size=values.unset):
"""
R... |
python | def get_edge_ids_by_node_ids(self, node_a, node_b):
"""Returns a list of edge ids connecting node_a to node_b."""
# Check if the nodes are adjacent
if not self.adjacent(node_a, node_b):
return []
# They're adjacent, so pull the list of edges from node_a and determine which o... |
java | public <T> FluentIterable<T> toFluentIterable(Function<? super Cursor, T> singleRowTransform) {
try {
return Cursors.toFluentIterable(this, singleRowTransform);
} finally {
close();
}
} |
java | public Object jsonObject() {
if (json == null) {
return null;
}
if (cached == null) {
Object tmp = null;
if (json[0] == '{') {
tmp = new LazyJsonObject<String, Object>(json);
} else if (json[0] == '[') {
tmp = new... |
python | def scanmeta(f):
"""Scan file headers for @meta ... @endmeta information and store that into
a dictionary.
"""
print(f)
if isinstance(f, str):
f = io.open(f, mode='r', encoding='latin-1')
done = False
l = f.readline()
s = None
while l and s is None:
i = l.find('!... |
java | private InputStream getPrivateKeyStream(String privateKey) throws LRException
{
try
{
// If the private key matches the form of a private key string, treat it as such
if (privateKey.matches(pgpRegex))
{
return new ByteArrayInputStream(privateKey.ge... |
java | public int isCompliantWithRequestContentType(Request request) {
if (acceptedMediaTypes == null || acceptedMediaTypes.isEmpty() || request == null) {
return 2;
} else {
String content = request.contentMimeType();
if (content == null) {
return 2;
... |
java | public void downloadBlockChain() {
DownloadProgressTracker listener = new DownloadProgressTracker();
startBlockChainDownload(listener);
try {
listener.await();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
} |
python | def _get_repos(url):
"""Gets repos in url
:param url: Url
:return: List of repositories in given url
"""
current_page = 1
there_is_something_left = True
repos_list = []
while there_is_something_left:
api_driver = GithubRawApi(
... |
java | @Override
public boolean cancel(final String appName, final String id,
final boolean isReplication) {
if (super.cancel(appName, id, isReplication)) {
replicateToPeers(Action.Cancel, appName, id, null, null, isReplication);
synchronized (lock) {
... |
python | def count_called(self, axis=None):
"""Count called genotypes.
Parameters
----------
axis : int, optional
Axis over which to count, or None to perform overall count.
"""
b = self.is_called()
return np.sum(b, axis=axis) |
python | def format(self, record):
"""Override default format method."""
if record.levelno == logging.DEBUG:
string = Back.WHITE + Fore.BLACK + ' debug '
elif record.levelno == logging.INFO:
string = Back.BLUE + Fore.WHITE + ' info '
elif record.levelno == logging.WARNING:... |
python | def clear(self):
'''
Method which resets any variables held by this class, so that the parser can be used again
:return: Nothing
'''
self.tags = []
'''the current list of tags which have been opened in the XML file'''
self.chars = {}
'''the chars held by... |
python | def setEditable(self, state):
"""
Sets whether or not this label should be editable or not.
:param state | <bool>
"""
self._editable = state
if state and not self._lineEdit:
self.setLineEdit(XLineEdit(self))
e... |
python | def correction(sentence, pos):
"Most probable spelling correction for word."
word = sentence[pos]
cands = candidates(word)
if not cands:
cands = candidates(word, False)
if not cands:
return word
cands = sorted(cands, key=lambda w: P(w, sentence, pos), reverse=True)
cands = [c... |
java | @Override
public Path toAbsolutePath() {
// Already absolute?
if (this.isAbsolute()) {
return this;
}
// Else construct a new absolute path and normalize it
final Path absolutePath = new ShrinkWrapPath(ArchivePath.SEPARATOR + this.path, this.fileSystem);
... |
java | public int last(int node) {
while (true) {
final int right = right(node);
if (right == NIL) {
break;
}
node = right;
}
return node;
} |
python | def data(ctx, path):
"""List EDC data for [STUDY] [ENV] [SUBJECT]"""
_rws = partial(rws_call, ctx)
if len(path) == 0:
_rws(ClinicalStudiesRequest(), default_attr='oid')
elif len(path) == 1:
_rws(StudySubjectsRequest(path[0], 'Prod'), default_attr='subjectkey')
elif len(path) == 2:
... |
java | @Override
public void evaluate(DoubleSolution solution) {
int hi=0;
double [] fx = new double[getNumberOfObjectives()] ; // functions
EBEsElementsTopology(solution); // transforma geometria a caracterÃÂsticas mecánicas
EBEsCalculus(); // metodo matricial de la rigidez para estructuras espacia... |
python | def reset_coords(self, names=None, drop=False, inplace=None):
"""Given names of coordinates, reset them to become variables
Parameters
----------
names : str or list of str, optional
Name(s) of non-index coordinates in this dataset to reset into
variables. By def... |
python | def delete_multiple(self, ids=None, messages=None):
"""Execute an HTTP request to delete messages from queue.
Arguments:
ids -- A list of messages id to be deleted from the queue.
messages -- Response to message reserving.
"""
url = "queues/%s/messages" % self.name
... |
python | def _format_table(fmt, headers, rows, colwidths, colaligns):
"""Produce a plain-text representation of the table."""
lines = []
hidden = fmt.with_header_hide if (headers and fmt.with_header_hide) else []
pad = fmt.padding
headerrow = fmt.headerrow
padded_widths = [(w + 2*pad) for w in colwidths... |
java | @Override
public void applicationStopping(ApplicationInfo appInfo) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(this, tc, "application stopping, remove stored cookie name : " + appInfo.getName() + ", cookie name : " + this.cookieNames.get(appInfo.getName()));
... |
java | static AttrRequests createFromString(final String str)
throws BOSHException {
if (str == null) {
return null;
} else {
return new AttrRequests(str);
}
} |
java | @Override
public String generateId(Attribute attribute) {
String idPart = generateHashcode(attribute.getEntity().getId() + attribute.getIdentifier());
String namePart = truncateName(cleanName(attribute.getName()));
return namePart + SEPARATOR + idPart;
} |
java | public static ResourceRecordSet<AAAAData> aaaa(String name, Collection<String> addresses) {
return new AAAABuilder().name(name).addAll(addresses).build();
} |
java | public double Interpolation_I_Single_Y_func_Area_(double A)
{
// A (cm2) es el area necesaria para cubrir la tensión
// Y (mm) es la latura relacionada al eje y
double Y =0;
// se limita la interpolación
if( 5.0 < A && A < 1000.0)
{
Y = 0.000003*Math.pow(A,3) - 0.0063*Math.pow(A,2) + 4... |
python | def log_likelihood(z, x, P, H, R):
"""
Returns log-likelihood of the measurement z given the Gaussian
posterior (x, P) using measurement function H and measurement
covariance error R
"""
S = np.dot(H, np.dot(P, H.T)) + R
return logpdf(z, np.dot(H, x), S) |
python | def find_view_function(module_name, function_name, fallback_app=None, fallback_template=None, verify_decorator=True):
'''
Finds a view function, class-based view, or template view.
Raises ViewDoesNotExist if not found.
'''
dmp = apps.get_app_config('django_mako_plus')
# I'm first calling find_s... |
python | def heightmap_count_cells(hm: np.ndarray, mi: float, ma: float) -> int:
"""Return the number of map cells which value is between ``mi`` and ``ma``.
Args:
hm (numpy.ndarray): A numpy.ndarray formatted for heightmap functions.
mi (float): The lower bound.
ma (float): The upper bound.
... |
python | def removeAnnotation(self, specfiles=None):
"""Remove all annotation information from :class:`Fi` elements.
:param specfiles: the name of an ms-run file or a list of names. If None
all specfiles are selected.
:type specfiles: None, str, [str, str]
"""
if specfiles is... |
java | Map<Class<?>, List<InjectionTarget>> getDeclaredInjectionTargets
(List<InjectionBinding<?>> resolvedInjectionBindings)
{
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled())
Tr.entry(tc, "getDeclaredInjectionTargets");
... |
python | def minify_urls(filepath, ext='asc', url_regex=None, output_ext='.urls_minified', access_token=None):
""" Use bitly or similar minifier to shrink all URLs in text files within a folder structure.
Used for the NLPIA manuscript directory for Manning Publishing
bitly API: https://dev.bitly.com/links.html
... |
python | def delete_user_by_email(self, email):
"""
This call will delete a user from the Iterable database.
This call requires a path parameter to be passed in, 'email'
in this case, which is why we're just adding this to the 'call'
argument that goes into the 'api_call' request.
"""
call = "/api/users/"+ ... |
java | public static int computeEasternSundayNumber(final int year)
{
final int i = year % 19;
final int j = year / 100;
final int k = year % 100;
final int l = (19 * i + j - j / 4 - (j - (j + 8) / 25 + 1) / 3 + 15) % 30;
final int m = (32 + 2 * (j % 4) + 2 * (k / 4) - l - k % 4) % 7;
return (l + m - 7 * ((i + 11... |
python | def _acking(self, params=None):
"""
Packet acknowledge and retry loop
:param params: Ignore
:type params: None
:rtype: None
"""
while self._is_running:
try:
t, num_try, (ip, port), packet = self._to_ack.get(
timeout... |
java | public void setSchemaArns(java.util.Collection<String> schemaArns) {
if (schemaArns == null) {
this.schemaArns = null;
return;
}
this.schemaArns = new java.util.ArrayList<String>(schemaArns);
} |
java | public Constraint<SVar<T>,Set<T>> rewrite(UnionFind<SVar<T>> uf) {
SVar<T> vIn_p = uf.find(vIn);
SVar<T> vDest_p = uf.find(vDest);
return new CtDiffConstraint<T>(vIn_p, ctSet, vDest_p);
} |
python | def execute(self, env, args):
""" Prints task information.
`env`
Runtime ``Environment`` instance.
`args`
Arguments object from arg parser.
"""
task_name = args.task_name
if task_name is None:
if not env.task.acti... |
python | def block_splitter(self, sources, weight=get_weight, key=lambda src: 1):
"""
:param sources: a list of sources
:param weight: a weight function (default .weight)
:param key: None or 'src_group_id'
:returns: an iterator over blocks of sources
"""
ct = self.oqparam.... |
java | public String getAnswerPattern() {
if (InputElement_Type.featOkTst && ((InputElement_Type)jcasType).casFeat_answerPattern == null)
jcasType.jcas.throwFeatMissing("answerPattern", "edu.cmu.lti.oaqa.framework.types.InputElement");
return jcasType.ll_cas.ll_getStringValue(addr, ((InputElement_Type)jcasType).... |
python | def find_trees(self, query_dict=None, exact=False, verbose=False, wrap_response=False, **kwargs):
"""Query on tree properties. See documentation for _OTIWrapper class."""
if self.use_v1:
uri = '{p}/singlePropertySearchForTrees'.format(p=self.query_prefix)
else:
uri = '{p}... |
python | def startup_script(self, startup_script):
"""
Updates the startup script.
:param startup_script: content of the startup script
"""
try:
startup_script_path = os.path.join(self.working_dir, 'startup.vpc')
with open(startup_script_path, "w+", encoding='utf... |
java | public ReturnValue invoke(final CommandDefinition cd, final String[] argsAry) {
String pluginName = cd.getPluginName();
try {
String[] commandLine = cd.getCommandLine();
if (acceptParams) {
for (int j = 0; j < commandLine.length; j++) {
for (... |
python | def normalize(X):
""" equivalent to scipy.preprocessing.normalize on sparse matrices
, but lets avoid another depedency just for a small utility function """
X = coo_matrix(X)
X.data = X.data / sqrt(bincount(X.row, X.data ** 2))[X.row]
return X |
python | def _process_job_and_get_successors(self, job_info):
"""
Process a job, get all successors of this job, and call _handle_successor() to handle each successor.
:param JobInfo job_info: The JobInfo instance
:return: None
"""
job = job_info.job
successors = self._... |
python | def get_instances(self):
# type: () -> List[Tuple[str, str, int]]
"""
Retrieves the list of the currently registered component instances
:return: A list of (name, factory name, state) tuples.
"""
with self.__instances_lock:
return sorted(
(nam... |
python | def _query_near(*, session=None, **kwargs):
"""Query marine database with given query string values and keys"""
url_endpoint = 'http://calib.org/marine/index.html'
if session is not None:
resp = session.get(url_endpoint, params=kwargs)
else:
with requests.Session() as s:
# Ne... |
java | private static NetFlowV5Header parseHeader(ByteBuf bb) {
final int version = bb.readUnsignedShort();
if (version != 5) {
throw new InvalidFlowVersionException(version);
}
final int count = bb.readUnsignedShort();
final long sysUptime = bb.readUnsignedInt();
f... |
python | def cli(ctx, lsftdi, lsusb, lsserial, info):
"""System tools.\n
Install with `apio install system`"""
exit_code = 0
if lsftdi:
exit_code = System().lsftdi()
elif lsusb:
exit_code = System().lsusb()
elif lsserial:
exit_code = System().lsserial()
elif info:
... |
java | public static List<Match> searchPlain(Model model, Pattern pattern)
{
List<Match> list = new LinkedList<Match>();
Map<BioPAXElement, List<Match>> map = search(model, pattern);
for (List<Match> matches : map.values())
{
list.addAll(matches);
}
return list;
} |
python | def repeal_target(self):
"""The resolution this resolution has repealed, or is attempting
to repeal.
Returns
-------
:class:`ApiQuery` of :class:`Resolution`
Raises
------
TypeError:
If the resolution doesn't repeal anything.
"""
... |
java | @Override
public InputStream getInputStream( BinaryKey key ) throws BinaryStoreException {
Connection connection = newConnection();
try {
InputStream inputStream = database.readContent(key, connection);
if (inputStream == null) {
// if we didn't find anything,... |
python | def pop_key(self, arg, key, *args, **kwargs):
"""Delete a previously defined key for the `add_argument`
"""
return self.unfinished_arguments[arg].pop(key, *args, **kwargs) |
java | public java.util.List<CancelStepsInfo> getCancelStepsInfoList() {
if (cancelStepsInfoList == null) {
cancelStepsInfoList = new com.amazonaws.internal.SdkInternalList<CancelStepsInfo>();
}
return cancelStepsInfoList;
} |
java | public final void removePseudoDestination(SIBUuid12 destinationUuid)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "removePseudoDestination", destinationUuid);
destinationIndex.removePseudoUuid(destinationUuid);
if (TraceComponent.isAnyTracing... |
java | public static String getLibInfo() {
String info = libInfo.get();
if (info == null) {
info = String.format(Locale.ENGLISH, LIB_INFO, C4.getVersion());
libInfo.compareAndSet(null, info);
}
return info;
} |
python | def resolve_dict_keywords(keywords):
"""Replace dictionary content with html.
:param keywords: The keywords.
:type keywords: dict
:return: New keywords with updated content.
:rtype: dict
"""
for keyword in ['value_map', 'inasafe_fields', 'inasafe_default_values']:
value = keywords... |
java | public S getRepresentative(Block<S, L> block) {
return block.getStates().choose().getOriginalState();
} |
java | private int find(int key, int hash) {
int index = index(hash);
final int maxTry = capacity;
for (int i = 0; i < maxTry; i++) {
Object slot = values[index];
if (slot == null) return -1;
if (slot != GUARD) return keys[index] == key ? index : -1;
... |
python | def bake(self):
"""Find absolute times for all keys.
Absolute time is stored in the KeyFrame dictionary as the variable
__abs_time__.
"""
self.unbake()
for key in self.dct:
self.get_absolute_time(key)
self.is_baked = True |
java | private Optional<String> validateProctimeAttribute(Optional<String> proctimeAttribute) {
return proctimeAttribute.map((attribute) -> {
// validate that field exists and is of correct type
Optional<TypeInformation<?>> tpe = schema.getFieldType(attribute);
if (!tpe.isPresent()) {
throw new ValidationExcept... |
java | public Object invoke(InvocationContext ctx, VisitableCommand command) {
return asyncInterceptorChain.invoke(ctx, command);
} |
python | def verify_item_signature(signature_attribute, encrypted_item, verification_key, crypto_config):
# type: (dynamodb_types.BINARY_ATTRIBUTE, dynamodb_types.ITEM, DelegatedKey, CryptoConfig) -> None
"""Verify the item signature.
:param dict signature_attribute: Item signature DynamoDB attribute value
:par... |
java | public Paint getComboBoxButtonBorderPaint(Shape s, CommonControlState type) {
TwoColors colors = getCommonBorderColors(type);
return createVerticalGradient(s, colors);
} |
java | public static boolean isLess(BigDecimal bigNum1, BigDecimal bigNum2) {
Assert.notNull(bigNum1);
Assert.notNull(bigNum2);
return bigNum1.compareTo(bigNum2) < 0;
} |
python | def _format_property_values(self, previous, current):
"""
Format WMI Object's RAW data based on the previous sample.
Do not override the original WMI Object !
"""
formatted_wmi_object = CaseInsensitiveDict()
for property_name, property_raw_value in iteritems(current):
... |
python | def read_hdf5_segmentlist(h5f, path=None, gpstype=LIGOTimeGPS, **kwargs):
"""Read a `SegmentList` object from an HDF5 file or group.
"""
# find dataset
dataset = io_hdf5.find_dataset(h5f, path=path)
segtable = Table.read(dataset, format='hdf5', **kwargs)
out = SegmentList()
for row in segta... |
python | def get_one(self, cls=None, **kwargs):
"""Returns a one case."""
case = cls() if cls else self._CasesClass()
for attr, value in kwargs.iteritems():
setattr(case, attr, value)
return case |
python | def mute_modmail_author(self, _unmute=False):
"""Mute the sender of this modmail message.
:param _unmute: Unmute the user instead. Please use
:meth:`unmute_modmail_author` instead of setting this directly.
"""
path = 'unmute_sender' if _unmute else 'mute_sender'
ret... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.