language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def attention_lm_decoder(decoder_input,
decoder_self_attention_bias,
hparams,
name="decoder"):
"""A stack of attention_lm layers.
Args:
decoder_input: a Tensor
decoder_self_attention_bias: bias Tensor for self-attention
(see c... |
java | public static float getFloat(final float value, final float minValue, final float maxValue) {
return Math.min(maxValue, Math.max(minValue, value));
} |
python | def is_address_guard(self, address):
"""
Determines if an address belongs to a guard page.
@note: Returns always C{False} for kernel mode addresses.
@type address: int
@param address: Memory address to query.
@rtype: bool
@return: C{True} if the address belon... |
python | def _make_meridional_diffusion_matrix(K, lataxis):
"""Calls :func:`_make_diffusion_matrix` with appropriate weights for
the meridional diffusion case.
:param array K: dimensionless diffusivities at cell boundaries
of diffusion axis ``lataxis``
:param axis lataxis: ... |
java | public FSArray getPointerList() {
if (MMAXAnnotation_Type.featOkTst && ((MMAXAnnotation_Type)jcasType).casFeat_pointerList == null)
jcasType.jcas.throwFeatMissing("pointerList", "de.julielab.jules.types.mmax.MMAXAnnotation");
return (FSArray)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(a... |
java | @Override
public void toXML(final StringBuilder builder,
final ConfigVerification errors)
{
if (!controller.isEnableSQLDatabaseOutput()) {
boolean zipComp = controller.isZipCompressionEnabled();
boolean multiFile = controller.isMultipleOutputFiles();
builder.append("\t<output>\r\n");
builder.appen... |
java | public void addFilterBefore(IRuleFilter filter, Class<? extends IRuleFilter> beforeFilter) {
int index = getIndexOfClass(filters, beforeFilter);
if (index == -1) {
throw new FilterAddException("filter " + beforeFilter.getSimpleName() + " has not been added");
}
filters.add(in... |
python | def _create_file_racefree(self, file):
"""
Creates a file, but fails if the file already exists.
This function will thus only succeed if this process actually creates
the file; if the file already exists, it will cause an OSError,
solving race conditions.
:par... |
java | public boolean commitAsync(KafkaMessage msg) {
KafkaConsumer<String, byte[]> consumer = _getConsumer(msg.topic());
synchronized (consumer) {
Set<String> subscription = consumer.subscription();
if (subscription == null || !subscription.contains(msg.topic())) {
// t... |
python | def QA_indicator_PBX(DataFrame, N1=3, N2=5, N3=8, N4=13, N5=18, N6=24):
'瀑布线'
C = DataFrame['close']
PBX1 = (EMA(C, N1) + EMA(C, 2 * N1) + EMA(C, 4 * N1)) / 3
PBX2 = (EMA(C, N2) + EMA(C, 2 * N2) + EMA(C, 4 * N2)) / 3
PBX3 = (EMA(C, N3) + EMA(C, 2 * N3) + EMA(C, 4 * N3)) / 3
PBX4 = (EMA(C, N4) + ... |
python | def _handle_unknown_method(self, method, remainder, request=None):
'''
Routes undefined actions (like RESET) to the appropriate controller.
'''
if request is None:
self._raise_method_deprecation_warning(self._handle_unknown_method)
# try finding a post_{custom} or {c... |
java | public static PaxDate now(Clock clock) {
LocalDate now = LocalDate.now(clock);
return PaxDate.ofEpochDay(now.toEpochDay());
} |
java | public Predicate<T> and( final Predicate<T> other ) {
if (other == null || other == this) return this;
return new Predicate<T>() {
@Override
public boolean test( T input ) {
return Predicate.this.test(input) && other.test(input);
}
};
} |
python | def __insert(self, key, value):
'''
Insert a new key to database
'''
if key in self:
getLogger().warning("Cache entry exists, cannot insert a new entry with key='{key}'".format(key=key))
return False
with self.get_conn() as conn:
try:
... |
java | public void protectDisplayedTilesForCache(final Canvas pCanvas, final Projection pProjection) {
if (!setViewPort(pCanvas, pProjection)) {
return;
}
TileSystem.getTileFromMercator(mViewPort, TileSystem.getTileSize(mProjection.getZoomLevel()), mProtectedTiles);
final int tileZoomLevel = TileSystem.getInputTile... |
java | public JsonWriter key(CharSequence key) {
startKey();
if (key == null) {
throw new IllegalArgumentException("Expected map key, but got null.");
}
writeQuotedAndEscaped(key);
writer.write(':');
return this;
} |
java | @Override
public Object apply(Object value, Object... params) {
return super.asString(super.get(0, params)) + super.asString(value);
} |
python | def find_by(self, column=None, value=None, order_by=None, limit=0):
"""
Find all items that matches your a column/value.
:param column: column to search.
:param value: value to look for in `column`.
:param limit: How many rows to fetch.
:param order_b... |
python | def listdir(dir_name, get_dirs=None, get_files=None, hide_ignored=False):
"""
Return list of all dirs and files inside given dir.
Also can filter contents to return only dirs or files.
Args:
- dir_name: Which directory we need to scan (relative)
- get_dirs: Return dirs list
- get_files: Re... |
java | public Xid getRemoteTransactionXid(Long internalId) {
for (RemoteTransaction rTx : getRemoteTransactions()) {
RecoverableTransactionIdentifier gtx = (RecoverableTransactionIdentifier) rTx.getGlobalTransaction();
if (gtx.getInternalId() == internalId) {
if (trace) log.tracef("Found xi... |
java | @SuppressWarnings("unchecked")
public EList<String> getDirectionRatiosAsString() {
return (EList<String>) eGet(Ifc2x3tc1Package.Literals.IFC_DIRECTION__DIRECTION_RATIOS_AS_STRING, true);
} |
python | def cyvcf2(context, vcf, include, exclude, chrom, start, end, loglevel, silent,
individual, no_inds):
"""fast vcf parsing with cython + htslib"""
coloredlogs.install(log_level=loglevel)
start_parsing = datetime.now()
log.info("Running cyvcf2 version %s", __version__)
if include and exclu... |
python | def _wait_for_request(self, uuid, connection_adapter=None):
"""Wait for RPC request to arrive.
:param str uuid: Rpc Identifier.
:param obj connection_adapter: Provide custom connection adapter.
:return:
"""
start_time = time.time()
while not self._response[uuid]:... |
java | @Override
public CommerceTaxFixedRateAddressRel[] findByCPTaxCategoryId_PrevAndNext(
long commerceTaxFixedRateAddressRelId, long CPTaxCategoryId,
OrderByComparator<CommerceTaxFixedRateAddressRel> orderByComparator)
throws NoSuchTaxFixedRateAddressRelException {
CommerceTaxFixedRateAddressRel commerceTaxFixedRa... |
java | @Override
public LaxImmutableMapBuilder<K, V> orderEntriesByValue(Comparator<? super V> valueComparator) {
this.immutableMapEntryOrdering = checkNotNull(valueComparator);
return this;
} |
java | TimeVal compute_new_date(final TimeVal time, final long upd) {
final double ori_d = time.tv_sec + (double) time.tv_usec / 1000000;
final double new_d = ori_d + (double) upd / 1000;
final TimeVal ret = new TimeVal();
ret.tv_sec = (int) new_d;
ret.tv_usec = (int) ((new_d - ret.tv_sec) * 1000000);
return ret;
} |
python | def _setup_packages(self, sc):
"""
This method compresses and uploads packages to the cluster
"""
packages = self.py_packages
if not packages:
return
for package in packages:
mod = importlib.import_module(package)
try:
... |
java | public List<String> getTemplateNamesFromPage(int pageId) throws WikiApiException{
if(pageId<1){
throw new WikiApiException("Page ID must be > 0");
}
try {
PreparedStatement statement = null;
ResultSet result = null;
List<String> templateNames = new LinkedList<String>();
try {
... |
java | public final synchronized Date evalDateBalanceStoreStart(
final Map<String, Object> pAddParam) throws Exception {
Date dateBalanceStoreStart = lazyGetBalanceAtAllDirtyCheck(pAddParam)
.getDateBalanceStoreStart();
Date leastAccountingEntryDate = this.balanceAtAllDirtyCheck
.getLeastAccountingEntr... |
java | public static <E, F> PropertySelector<E, F> newPropertySelector(boolean orMode, Attribute<?, ?>... fields) {
PropertySelector<E, F> ps = new PropertySelector<E, F>(checkNotNull(fields));
return ps.orMode(orMode);
} |
python | def _create_ring(self, nodes):
"""Generate a ketama compatible continuum/ring.
"""
for node_name, node_conf in nodes:
for w in range(0, node_conf['vnodes'] * node_conf['weight']):
self._distribution[node_name] += 1
self._ring[self.hashi('%s-%s' % (node... |
java | public static Set<? extends BioPAXElement> getObjectBiopaxPropertyValues(BioPAXElement bpe, String property) {
Set<BioPAXElement> values = new HashSet<BioPAXElement>();
// get the BioPAX L3 property editors map
EditorMap em = SimpleEditorMap.L3;
// get the 'organism' biopax property editor,
// if exists fo... |
java | public static CommerceUserSegmentEntry fetchByGroupId_First(long groupId,
OrderByComparator<CommerceUserSegmentEntry> orderByComparator) {
return getPersistence().fetchByGroupId_First(groupId, orderByComparator);
} |
python | def extract_numerics_alert(event):
"""Determines whether a health pill event contains bad values.
A bad value is one of NaN, -Inf, or +Inf.
Args:
event: (`Event`) A `tensorflow.Event` proto from `DebugNumericSummary`
ops.
Returns:
An instance of `NumericsAlert`, if bad values are found.
`No... |
java | public List<XCalElement> children(ICalDataType dataType) {
String localName = dataType.getName().toLowerCase();
List<XCalElement> children = new ArrayList<XCalElement>();
for (Element child : children()) {
if (localName.equals(child.getLocalName()) && XCAL_NS.equals(child.getNamespaceURI())) {
children.add... |
java | public static void rollbackQuietly(EntityManager entityManager) {
if (entityManager.getTransaction().isActive()/* && entityManager.getTransaction().getRollbackOnly()*/) {
try {
entityManager.getTransaction().rollback();
} catch (Exception e) {
logger.error... |
java | void setAttr(String name, int flags)
{
if (null == m_attrs)
m_attrs = new StringToIntTable();
m_attrs.put(name, flags);
} |
python | def delete_device(self, rid):
"""
Deletes device object with given rid
http://docs.exosite.com/portals/#delete-device
"""
headers = {
'User-Agent': self.user_agent(),
'Content-Type': self.content_type()
}
headers.update... |
java | private void executeHistoryAction() {
CmsHistoryState state = getState();
if (state.isHistoryBack()) {
History.back();
} else if (state.isHistoryForward()) {
History.forward();
}
} |
java | @Override
public final void setLongProperty(String name, long value) throws JMSException
{
setProperty(name,Long.valueOf(value));
} |
java | public byte[] buildByteCode(Class<?> parentClass, String className) {
ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
cw.visit(version, // Java version
ACC_PUBLIC, // public class
convert(className), // package and name
null, // signature (null means not... |
java | static String getSimpleFormat(boolean useProxy) {
String format =
AccessController.doPrivileged(
new PrivilegedAction<String>() {
public String run() {
return System.getProperty(FORMAT_PROP_KEY);
}
});
... |
java | public static <K, V> Map<K, V> subMap(Map<K, V> map, K[] keys) {
Map<K, V> answer = new LinkedHashMap<K, V>(keys.length);
for (K key : keys) {
if (map.containsKey(key)) {
answer.put(key, map.get(key));
}
}
return answer;
} |
java | public EClass getIfcSoundValue() {
if (ifcSoundValueEClass == null) {
ifcSoundValueEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(521);
}
return ifcSoundValueEClass;
} |
python | def process_text(text, out_file='sofia_output.json', auth=None):
"""Return processor by processing text given as a string.
Parameters
----------
text : str
A string containing the text to be processed with Sofia.
out_file : Optional[str]
The path to a file to save the reader's outpu... |
java | @Override
public VType indexGet(int index) {
assert index >= 0 : "The index must point at an existing key.";
assert index <= mask ||
(index == mask + 1 && hasEmptyKey);
return Intrinsics.<VType> cast(values[index]);
} |
python | def create_gce_image(zone,
project,
instance_name,
name,
description):
"""
Shuts down the instance and creates and image from the disk.
Assumes that the disk name is the same as the instance_name (this is the
default be... |
python | def from_other(cls, item):
"""Factory function to return instances of `item` converted into a new
instance of ``cls``. Because this is a class method, it may be called
from any bitmath class object without the need to explicitly
instantiate the class ahead of time.
*Implicit Parameter:*
* ``cls`` A bitmath cl... |
python | def getIds(self, query='*:*', fq=None, start=0, rows=1000):
"""Returns a dictionary of: matches: number of matches failed: if true, then an
exception was thrown start: starting index ids: [id, id, ...]
See also the SOLRSearchResponseIterator class
"""
params = {'q': query, 'sta... |
java | private void nextSegment() {
assert(checkDir > 0 && seq == rawSeq && pos != limit);
// The input text [segmentStart..pos[ passes the FCD check.
int p = pos;
int prevCC = 0;
for(;;) {
// Fetch the next character's fcd16 value.
int q = p;
int c =... |
python | def _resample(self, arrays, ji_windows):
"""Resample all arrays with potentially different resolutions to a common resolution."""
# get a destination array template
win_dst = ji_windows[self.dst_res]
aff_dst = self._layer_meta[self._res_indices[self.dst_res][0]]["transform"]
arra... |
python | def _handler(self, sender, setting, value, **kwargs):
"""
handler for ``setting_changed`` signal.
@see :ref:`django:setting-changed`_
"""
if setting.startswith(self.prefix):
self._set_attr(setting, value) |
java | public static void stateNotNull(final Object obj, final String message) throws IllegalStateException {
if (obj == null) {
throw new IllegalStateException(message);
}
} |
java | public java.util.List<PricingDetail> getPricingDetails() {
if (pricingDetails == null) {
pricingDetails = new com.amazonaws.internal.SdkInternalList<PricingDetail>();
}
return pricingDetails;
} |
python | def _check_range(range_):
"""Check that a range is in the format we expect [min, max] and return"""
try:
if not isinstance(range_, list):
range_ = list(range_)
min_, max_ = range_
except (ValueError, TypeError):
raise TypeError("each range in i... |
python | def dir_import_table(self):
"""
import table is terminated by a all-null entry, so we have to
check for that
"""
import_header = list(self.optional_data_directories)[1]
import_offset = self.resolve_rva(import_header.VirtualAddress)
i = 0
while Tru... |
python | def urlopen(self, url, **kwargs):
"""GET a file-like object for a URL using HTTP.
This is a thin wrapper around :meth:`requests.Session.get` that returns a file-like
object wrapped around the resulting content.
Parameters
----------
url : str
The URL to requ... |
python | def send_request(self, *args, **kwargs):
"""Wrapper for session.request
Handle connection reset error even from pyopenssl
"""
try:
return self.session.request(*args, **kwargs)
except ConnectionError:
self.session.close()
return self.session.req... |
java | public static List<String> get(String name, @Nullable Integer value) {
return Args.integer(name, value);
} |
python | def is_py2_stdlib_module(m):
"""
Tries to infer whether the module m is from the Python 2 standard library.
This may not be reliable on all systems.
"""
if PY3:
return False
if not 'stdlib_path' in is_py2_stdlib_module.__dict__:
stdlib_files = [contextlib.__file__, os.__file__, c... |
java | public RemoveMethodType<SessionBeanType<T>> getOrCreateRemoveMethod()
{
List<Node> nodeList = childNode.get("remove-method");
if (nodeList != null && nodeList.size() > 0)
{
return new RemoveMethodTypeImpl<SessionBeanType<T>>(this, "remove-method", childNode, nodeList.get(0));
}
... |
java | @SuppressWarnings({ "unchecked" })
@SequentialOnly
public <VV> EntryStream<K, VV> selectByValue(Class<VV> clazz) {
if (isParallel()) {
return (EntryStream<K, VV>) sequential().filterByValue(Fn.instanceOf(clazz)).parallel(maxThreadNum(), splitor());
} else {
return (... |
python | def get_filename(self, filename, filesystem=False, convert=False, subpath=''):
"""
Get the filename according to self.to_path, and if filesystem is False
then return unicode filename, otherwise return filesystem encoded filename
@param filename: relative filename, it'll be comb... |
java | public static Collection<ByteBuffer> split(final ByteBuffer buffer,
final int chunkSize) {
final Collection<ByteBuffer> buffers = new LinkedList<ByteBuffer>();
final int limit = buffer.limit();
int totalSent = 0;
while ((totalSent + chunkSize) < limit) {
L... |
java | protected void destroyRequest(AsyncResourceRequest<V> resourceRequest) {
if(resourceRequest != null) {
try {
// To hand control back to the owner of the
// AsyncResourceRequest, treat "destroy" as an exception since
// there is no resource to pass into... |
python | def check_correct_audience(self, audience):
"Assert that Dataporten sends back our own client id as audience"
client_id, _ = self.get_key_and_secret()
if audience != client_id:
raise AuthException('Wrong audience') |
java | static int mergeInhibitAnyPolicy(int inhibitAnyPolicy,
X509CertImpl currCert) throws CertPathValidatorException
{
if ((inhibitAnyPolicy > 0) && !X509CertImpl.isSelfIssued(currCert)) {
inhibitAnyPolicy--;
}
try {
InhibitAnyPolicyExtension inhAnyPolExt = (Inhib... |
python | def utime(self, times):
"""
Set the access and modified times of this file. If
C{times} is C{None}, then the file's access and modified times are set
to the current time. Otherwise, C{times} must be a 2-tuple of numbers,
of the form C{(atime, mtime)}, which is used to set the a... |
python | def cublasStrsm(handle, side, uplo, trans, diag, m, n, alpha, A, lda, B, ldb):
"""
Solve a real triangular system with multiple right-hand sides.
"""
status = _libcublas.cublasStrsm_v2(handle,
_CUBLAS_SIDE_MODE[side],
... |
python | def smart_convert(original, colorkey, pixelalpha):
"""
this method does several tests on a surface to determine the optimal
flags and pixel format for each tile surface.
this is done for the best rendering speeds and removes the need to
convert() the images on your own
"""
tile_size = origi... |
python | def list_projects(self, max_results=None, page_token=None, retry=DEFAULT_RETRY):
"""List projects for the project associated with this client.
See
https://cloud.google.com/bigquery/docs/reference/rest/v2/projects/list
:type max_results: int
:param max_results: (Optional) maximu... |
python | def factory(cfg, login, pswd, request_type):
"""
Instantiate ImportRequest
:param cfg: request configuration, should consist of request description (url and parameters) and response for parsing result
:param login:
:param pswd:
:param request_type: TYPE_GET_SINGLE_OBJECT ... |
java | public java.util.List<String> getLaunchConfigurationNames() {
if (launchConfigurationNames == null) {
launchConfigurationNames = new com.amazonaws.internal.SdkInternalList<String>();
}
return launchConfigurationNames;
} |
java | @SuppressWarnings("deprecation")
private int getSubsitemapType() throws CmsRpcException {
try {
return OpenCms.getResourceManager().getResourceType(
CmsResourceTypeFolderSubSitemap.TYPE_SUBSITEMAP).getTypeId();
} catch (CmsLoaderException e) {
error(e);
... |
python | def get_action(self, action=None):
""" Returns action to take after call """
if action:
self.action = action
if self.action not in AjaxResponseAction.choices:
raise ValueError(
"Invalid action selected: '{}'".format(self.action))
return self.acti... |
python | def download_stories(self,
userids: Optional[List[Union[int, Profile]]] = None,
fast_update: bool = False,
filename_target: Optional[str] = ':stories',
storyitem_filter: Optional[Callable[[StoryItem], bool]] = None) -> N... |
python | def file_open_ex(self, path, access_mode, open_action, sharing_mode, creation_mode, flags):
"""Opens a file and creates a :py:class:`IGuestFile` object that
can be used for further operations, extended version.
in path of type str
Path to file to open. Guest path style.
i... |
python | def _ensure_data(values, dtype=None):
"""
routine to ensure that our data is of the correct
input dtype for lower-level routines
This will coerce:
- ints -> int64
- uint -> uint64
- bool -> uint64 (TODO this should be uint8)
- datetimelike -> i8
- datetime64tz -> i8 (in local tz)
... |
python | def temporal_louvain(tnet, resolution=1, intersliceweight=1, n_iter=100, negativeedge='ignore', randomseed=None, consensus_threshold=0.5, temporal_consensus=True, njobs=1):
r"""
Louvain clustering for a temporal network.
Parameters
-----------
tnet : array, dict, TemporalNetwork
Input netwo... |
java | public Observable<ServiceResponse<DetectorResponseInner>> getSiteDetectorResponseSlotWithServiceResponseAsync(String resourceGroupName, String siteName, String detectorName, String slot, DateTime startTime, DateTime endTime, String timeGrain) {
if (resourceGroupName == null) {
throw new IllegalArgum... |
java | public Template load(String path) throws IOException, ParseException {
try(TemplateSource source = sourceLoader.find(path)) {
if (source != null) {
return load(path, source);
}
}
return null;
} |
java | @Override
protected Icon getIcon(JTable table, int column) {
SortKey sortKey = getSortKey(table, column);
if (sortKey != null && table.convertColumnIndexToView(sortKey.getColumn()) == column) {
SortOrder sortOrder = sortKey.getSortOrder();
switch (sortOrder) {
case ASCENDING:
return VerticalSortIcon.A... |
python | def prepare_image_question_encoder(image_feat, question, hparams):
"""Prepare encoder.
Args:
image_feat: a Tensor.
question: a Tensor.
hparams: run hyperparameters
Returns:
encoder_input: a Tensor, bottom of encoder stack
encoder_self_attention_bias: a bias tensor for use in encoder self-att... |
python | def get_app_template_dir(app_name):
"""
Get the template directory for an application
We do not use django.db.models.get_app, because this will fail if an
app does not have any models.
Returns a full path, or None if the app was not found.
"""
if app_name in _cache:
return _cache[a... |
python | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'score') and self.score is not None:
_dict['score'] = self.score
return _dict |
python | def write(self, offset, value):
"""
.. _write:
Writes the memory word at ``offset`` to ``value``.
Might raise ReadOnlyError_, if the device is read-only.
Might raise AddressError_, if the offset exceeds the size of the device.
"""
if(not self.mode & 0b10):
raise ReadOnlyError("Device is Read-Only")
... |
python | def value_dp_matrix(self):
"""
:return: DataProperty for table data.
:rtype: list
"""
if self.__value_dp_matrix is None:
self.__value_dp_matrix = self.__dp_extractor.to_dp_matrix(
to_value_matrix(self.headers, self.rows)
)
return ... |
java | @Override
public double[] projectDataToScaledSpace(double[] data) {
final int dim = data.length;
double[] dst = new double[dim];
for(int d = 0; d < dim; d++) {
dst[d] = scales[d].getScaled(data[d]);
}
return dst;
} |
python | def setModel(self, model):
"""
Reimplements the **umbra.ui.views.Abstract_QTreeView.setModel** method.
:param model: Model to set.
:type model: QObject
"""
LOGGER.debug("> Setting '{0}' model.".format(model))
if not model:
return
umbra.ui.v... |
java | @Override
public Subject authenticate(@Sensitive X509Certificate[] certificateChain) throws AuthenticationException {
AuthenticationData authenticationData = createAuthenticationData(certificateChain);
return authenticationService.authenticate(jaasEntryName, authenticationData, null);
} |
java | private void removeBuffers() {
IntBuffer buffer = BufferUtils.createIntBuffer(1);
int queued = AL10.alGetSourcei(source, AL10.AL_BUFFERS_QUEUED);
while (queued > 0)
{
AL10.alSourceUnqueueBuffers(source, buffer);
queued--;
}
} |
java | public static int countOccurrences(byte[] buff, int len, String word) {
int wordlen=word.length();
int end=len-wordlen;
int count=0;
Loop:
for(int c=0;c<=end;c++) {
for(int d=0;d<wordlen;d++) {
char ch1=(char)buff[c+d];
if(ch1<='Z' && ch1>='A') ch1+='a'-'A';
char ch2=word.charAt(d);
if(ch2<... |
java | public static Date parseCompressedISO8601Date(String dateString) {
try {
return new Date(compressedIso8601DateFormat.parseMillis(dateString));
} catch (RuntimeException ex) {
throw handleException(ex);
}
} |
python | def unblock_events(self):
"""
Allows the widget to send signals.
"""
self._widget.blockSignals(False)
self._widget.setUpdatesEnabled(True) |
java | @Override
public UpdateCertificateResult updateCertificate(UpdateCertificateRequest request) {
request = beforeClientExecution(request);
return executeUpdateCertificate(request);
} |
python | def process_mav(self, mlog, flightmode_selections):
'''process one file'''
self.vars = {}
idx = 0
all_false = True
for s in flightmode_selections:
if s:
all_false = False
# pre-calc right/left axes
self.num_fields = len(self.fields)
... |
java | private boolean checkDimensions(CLIQUEUnit other, int e) {
for(int i = 0, j = 0; i < e; i++, j += 2) {
if(dims[i] != other.dims[i] || bounds[j] != other.bounds[j] || bounds[j + 1] != bounds[j + 1]) {
return false;
}
}
return true;
} |
java | public static double[] normalize(final double[] values) {
final double sum = 1.0/DoubleAdder.sum(values);
for (int i = values.length; --i >= 0;) {
values[i] = values[i]*sum;
}
return values;
} |
python | def markInputline( self, markerString = ">!<" ):
"""Extracts the exception line from the input string, and marks
the location of the exception with a special symbol.
"""
line_str = self.line
line_column = self.column - 1
if markerString:
line_str = "".join(... |
python | def build_album_art_full_uri(self, url):
"""Ensure an Album Art URI is an absolute URI.
Args:
url (str): the album art URI.
Returns:
str: An absolute URI.
"""
# Add on the full album art link, as the URI version
# does not include the ipaddress
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.