language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def ListProfilers(self):
"""Lists information about the available profilers."""
table_view = views.ViewsFactory.GetTableView(
self._views_format_type, column_names=['Name', 'Description'],
title='Profilers')
profilers_information = sorted(
profiling.ProfilingArgumentsHelper.PROFILER... |
java | public void setIPRanges(java.util.Collection<IPRange> iPRanges) {
if (iPRanges == null) {
this.iPRanges = null;
return;
}
this.iPRanges = new com.amazonaws.internal.SdkInternalList<IPRange>(iPRanges);
} |
java | public Node getNamedItemNS(String namespaceURI, String localName)
{
Node retNode = null;
for (int n = dtm.getFirstAttribute(element); n != DTM.NULL;
n = dtm.getNextAttribute(n))
{
if (localName.equals(dtm.getLocalName(n)))
{
String nsURI = dtm.g... |
java | protected Statement methodBlock(final FrameworkMethod method) {
Object test;
try {
test = new ReflectiveCallable() {
@Override
protected Object runReflectiveCall() throws Throwable {
return createTest(method);
}
... |
python | def create_kubernetes_role(self, name, bound_service_account_names, bound_service_account_namespaces, ttl="",
max_ttl="", period="", policies=None, mount_point='kubernetes'):
"""POST /auth/<mount_point>/role/:name
:param name: Name of the role.
:type name: str.
... |
python | def get_obj_attrs(obj):
""" Return a dictionary built from the attributes of the given object.
"""
pr = {}
if obj is not None:
if isinstance(obj, numpy.core.records.record):
for name in obj.dtype.names:
pr[name] = getattr(obj, name)
elif hasattr(obj, '__dict__... |
java | public static ProviderInfo parseProviderInfo(String originUrl) {
String url = originUrl;
String host = null;
int port = 80;
String path = null;
String schema = null;
int i = url.indexOf("://"); // seperator between schema and body
if (i > 0) {
schema =... |
java | @Override
synchronized public void write(final byte data[], final int off,
final int len) throws IOException {
// TODO: Ideally we'd make sure to fill up each message as much as
// we can, but this will work for now!
final byte[] encoded = CommonUtils.encode(this.key, data,... |
python | def get_time_remaining_estimate(self):
"""
Looks through all power sources and returns total time remaining estimate
or TIME_REMAINING_UNLIMITED if ac power supply is online.
"""
all_energy_now = []
all_power_now = []
try:
type = self.power_source_type... |
python | def set_color(
fg=Color.normal,
bg=Color.normal,
fg_dark=False,
bg_dark=False,
underlined=False,
):
"""Set the console color.
>>> set_color(Color.red, Color.blue)
>>> set_color('red', 'blue')
>>> set_color() # returns back to normal
"""
_set_color(fg, bg, fg_dar... |
python | def work(self):
"""
A list of :class:`Employment` instances describing the user's work history.
Each structure has attributes ``employer``, ``position``, ``started_at`` and ``ended_at``.
``employer`` and ``position`` reference ``Page`` instances, while ``started_at`` and ``ended_at``
... |
python | def get_flash(self, format_ = "nl"):
"""
return a string representations of the flash
"""
flash = [self.flash.read(i) for i in range(self.flash.size)]
return self._format_mem(flash, format_) |
java | public JvmOperation getJvmOperation(IMethod method, XtendTypeDeclaration context)
throws JavaModelException {
if (!method.isConstructor() && !method.isLambdaMethod() && !method.isMainMethod()) {
final JvmType type = this.typeReferences.findDeclaredType(
method.getDeclaringType().getFullyQualifiedName(),
... |
java | public static ProgressLayout wrap(final View targetView){
if(targetView==null){
throw new IllegalArgumentException();
}
final ProgressLayout progressLayout = new ProgressLayout(targetView.getContext());
progressLayout.attachTo(targetView);
return progressLayout;
... |
python | def first(self):
"""
Return the first result of this Query or None if the result
doesn't contain any row.
"""
results = self.rpc_model.search_read(
self.domain, None, 1, self._order_by, self.fields,
context=self.context
)
return results and... |
java | public List<T> apply(List<T> selectedCandidates, Random rng)
{
return new ArrayList<T>(selectedCandidates);
} |
java | public ProviderGroup add(ProviderInfo providerInfo) {
if (providerInfo == null) {
return this;
}
ConcurrentHashSet<ProviderInfo> tmp = new ConcurrentHashSet<ProviderInfo>(providerInfos);
tmp.add(providerInfo); // 排重
this.providerInfos = new ArrayList<ProviderInfo>(tmp... |
python | def replace_template(self, template_content, team_context, template_id):
"""ReplaceTemplate.
[Preview API] Replace template contents
:param :class:`<WorkItemTemplate> <azure.devops.v5_1.work_item_tracking.models.WorkItemTemplate>` template_content: Template contents to replace with
:para... |
java | public ApiSuccessResponse stopMonitoring(StopMonitoringData stopMonitoringData) throws ApiException {
ApiResponse<ApiSuccessResponse> resp = stopMonitoringWithHttpInfo(stopMonitoringData);
return resp.getData();
} |
java | public void info(Object message) {
if (repository.isDisabled(Level.INFO_INT))
return;
if (Level.INFO.isGreaterOrEqual(this.getEffectiveLevel()))
forcedLog(FQCN, Level.INFO, message, null);
} |
python | def _get_reporoot():
"""Returns the absolute path to the repo root directory on the current
system.
"""
from os import path
import acorn
medpath = path.abspath(acorn.__file__)
return path.dirname(path.dirname(medpath)) |
java | public void onConfigurationChanged() {
final Collection<PropertyWidget<?>> widgets = getWidgets();
if (logger.isDebugEnabled()) {
final StringBuilder sb = new StringBuilder();
sb.append("id=");
sb.append(System.identityHashCode(this));
sb.append(" - onCon... |
java | protected <T, A> void handleRequest(final Channel channel, final DataInput message, final ManagementProtocolHeader header, ActiveRequest<T, A> activeRequest) {
handleMessage(channel, message, header, activeRequest.context, activeRequest.handler);
} |
java | public static String loadString(String file) throws IOException {
StringBuilder sb = new StringBuilder();
UnicodeReader reader = new UnicodeReader(new FileInputStream(file), "utf8");
int n;
char[] cs = new char[256];
while ((n = reader.read(cs)) != -1) {
sb.append(Arrays.copyOfRange(cs, 0, n)); ... |
java | public Object invoke(MethodInvocation invocation) throws Throwable {
ProxyMethodInvocation pmi = (ProxyMethodInvocation) invocation;
TargetMetaRequest targetMetaRequest = targetMetaRequestsHolder.getTargetMetaRequest();
TargetMetaDef targetMetaDef = targetMetaRequest.getTargetMetaDef();
if (targetMetaDef.is... |
python | def islice_extended(iterable, *args):
"""An extension of :func:`itertools.islice` that supports negative values
for *stop*, *start*, and *step*.
>>> iterable = iter('abcdefgh')
>>> list(islice_extended(iterable, -4, -1))
['e', 'f', 'g']
Slices with negative values require some cach... |
python | def _generate_examples(self, archive):
"""Yields examples."""
prefix_len = len("SUN397")
with tf.Graph().as_default():
with utils.nogpu_session() as sess:
for filepath, fobj in archive:
if (filepath.endswith(".jpg") and
filepath not in _SUN397_IGNORE_IMAGES):
... |
python | def initialize_request(self, request, *args, **kargs):
"""
Override DRF initialize_request() method to swap request.GET
(which is aliased by request.query_params) with a mutable instance
of QueryParams, and to convert request MergeDict to a subclass of dict
for consistency (Merge... |
python | def convertDict2Attrs(self, *args, **kwargs):
"""The trick for iterable Mambu Objects comes here:
You iterate over each element of the responded List from Mambu,
and create a Mambu Group object for each one, initializing them
one at a time, and changing the attrs attribute (which just
... |
python | def tracebacks(score_matrix, traceback_matrix, idx):
"""Calculate the tracebacks for `traceback_matrix` starting at index `idx`.
Returns: An iterable of tracebacks where each traceback is sequence of
(index, direction) tuples. Each `index` is an index into
`traceback_matrix`. `direction` indicates ... |
java | private void handleAsyncComplete(boolean forceQueue, TCPReadCompletedCallback inCallback) {
boolean fireHere = true;
if (forceQueue) {
// Complete must be returned on a separate thread.
// Reuse queuedWork object (performance), but reset the error parameters.
queuedWo... |
java | public static int getRelativeX(int x, Element target) {
return (x - target.getAbsoluteLeft()) + /* target.getScrollLeft() + */target.getOwnerDocument().getScrollLeft();
} |
java | public void initialize(Context context, String appGUID, String pushClientSecret,MFPPushNotificationOptions options) {
try {
if (MFPPushUtils.validateString(pushClientSecret) && MFPPushUtils.validateString(appGUID)) {
// Get the applicationId and backend route from core
clientSecret = pushClie... |
java | public void addTrace(final S state, final Word<I> input, final Word<O> output) {
this.addTrace(this.nodeToObservationMap.get(state), input, output);
} |
python | def __get_subscript(self, name, ctx=None):
"""
Returns `<data_var>["<name>"]`
"""
assert isinstance(name, string_types), name
return ast.Subscript(
value=ast.Name(id=self.data_var, ctx=ast.Load()),
slice=ast.Index(value=ast.Str(s=name)),
ctx=ctx) |
java | public static Record
newRecord(Name name, int type, int dclass, long ttl, int length, byte [] data) {
if (!name.isAbsolute())
throw new RelativeNameException(name);
Type.check(type);
DClass.check(dclass);
TTL.check(ttl);
DNSInput in;
if (data != null)
in = new DNSInput(data);
else
in = null;
try {
retu... |
java | public String getTypeGenericExtends(int typeParamIndex, String[] typeParamNames) {
String genericClause = typeGenericExtends[typeParamIndex];
genericClause = genericClause.replace("<" + typeGenericName[typeParamIndex] + ">", "<" + typeParamNames[typeParamIndex] + ">");
for (int i = 0; i < typeGe... |
python | def _update_port_status_cache(self, device, device_bound=True):
"""Update the ports status cache."""
with self._cache_lock:
if device_bound:
self._bound_ports.add(device)
self._unbound_ports.discard(device)
else:
self._bound_ports.d... |
python | def grad(self, x):
r"""Compute the gradient of a signal defined on the vertices.
The gradient :math:`y` of a signal :math:`x` is defined as
.. math:: y = \nabla_\mathcal{G} x = D^\top x,
where :math:`D` is the differential operator :attr:`D`.
The value of the gradient on the ... |
java | @Override
public DeregisterJobDefinitionResult deregisterJobDefinition(DeregisterJobDefinitionRequest request) {
request = beforeClientExecution(request);
return executeDeregisterJobDefinition(request);
} |
python | def build_base_parameters(request):
"""Build the list of parameters to forward from the post and get parameters"""
getParameters = {}
postParameters = {}
files = {}
# Copy GET parameters, excluding ebuio_*
for v in request.GET:
if v[:6] != 'ebuio_':
val = request.GET.getlis... |
python | def index(self, item, minindex=0, maxindex=None):
"""Provide an index of first occurence of item in the list. (or raise
a ValueError if item not present)
If item is not a string, will raise a TypeError.
minindex and maxindex are also optional arguments
s.index(x[, i[, j]]) return... |
java | public static ByteArrayEntity createExceptionByteArray(String name, byte[] byteArray, ResourceType type) {
ByteArrayEntity result = null;
if (byteArray != null) {
result = new ByteArrayEntity(name, byteArray, type);
Context.getCommandContext()
.getByteArrayManager()
.insertByteArray... |
java | private HashMap readFault()
throws IOException
{
HashMap map = new HashMap();
int code = read();
for (; code > 0 && code != 'z'; code = read()) {
_peek = code;
Object key = readObject();
Object value = readObject();
if (key != null &... |
python | def ver_dec_content(parts, sign_key=None, enc_key=None, sign_alg='SHA256'):
"""
Verifies the value of a cookie
:param parts: The parts of the payload
:param sign_key: A :py:class:`cryptojwt.jwk.hmac.SYMKey` instance
:param enc_key: A :py:class:`cryptojwt.jwk.hmac.SYMKey` instance
:param sign_al... |
python | def get_elem_type(elem):
""" Get elem type of soup selection
:param elem: a soup element
"""
elem_type = None
if isinstance(elem, list):
if elem[0].get("type") == "radio":
elem_type = "radio"
else:
raise ValueError(u"Unknown element type: {}".format(elem))... |
python | def save_as_png(self, filename, width=300, height=250, render_time=1):
"""Open saved html file in an virtual browser and save a screen shot to PNG format."""
self.driver.set_window_size(width, height)
self.driver.get('file://{path}/{filename}'.format(
path=os.getcwd(), filename=filen... |
python | def truthtable2expr(tt, conj=False):
"""Convert a truth table into an expression."""
if conj:
outer, inner = (And, Or)
nums = tt.pcdata.iter_zeros()
else:
outer, inner = (Or, And)
nums = tt.pcdata.iter_ones()
inputs = [exprvar(v.names, v.indices) for v in tt.inputs]
t... |
java | @Override
public void writePage(int pageID, P page) {
try {
countWrite();
byte[] array = pageToByteArray(page);
long offset = ((long) (header.getReservedPages() + pageID)) * (long) pageSize;
assert offset >= 0 : header.getReservedPages() + " " + pageID + " " + pageSize + " " + offset;
... |
java | @Override
public void saveDocument(IProject project, File projectRoot, String name, boolean modelOnly)
throws IOException
{
String document = readFile("latex/document.tex");
String documentFileName = name;// + ".tex";
File latexRoot = makeOutputFolder(project);
StringBuilder sb = new StringBuilder();
Str... |
java | public EnvVars getEnvironment() throws IOException, InterruptedException {
EnvVars cachedEnvironment = this.cachedEnvironment;
if (cachedEnvironment != null) {
return new EnvVars(cachedEnvironment);
}
cachedEnvironment = EnvVars.getRemote(getChannel());
this.cachedEn... |
python | def path(self, filename):
'''
This returns the absolute path of a file uploaded to this set. It
doesn't actually check whether said file exists.
:param filename: The filename to return the path for.
:param folder: The subfolder within the upload set previously used
... |
python | def create_index(self, cls_or_collection,
params=None, fields=None, ephemeral=False, unique=False):
"""Create new index on the given collection/class with given parameters.
:param cls_or_collection:
The name of the collection or the class for which to create an
... |
python | def receiveManagementEvent(self, action, varBind, **context):
"""Apply mass operation on extending table's row.
SNMP SMI provides a way to extend already existing SMI table with
another table. Whenever a mass operation on parent table's column
is performed (e.g. row creation or destruct... |
java | public void putCustomQueryParameter(String name, String value) {
if (customQueryParameters == null) {
customQueryParameters = new HashMap<String, List<String>>();
}
List<String> paramList = customQueryParameters.get(name);
if (paramList == null) {
paramList = new ... |
java | public ArrayList<String> directories_availableZipCodes_GET(OvhNumberCountryEnum country, String number) throws IOException {
String qPath = "/telephony/directories/availableZipCodes";
StringBuilder sb = path(qPath);
query(sb, "country", country);
query(sb, "number", number);
String resp = execN(qPath, "GET", ... |
python | def get_speakers(self, **kwargs):
"""
Gets the info of BGPSpeaker instance.
Usage:
======= ================
Method URI
======= ================
GET /vtep/speakers
======= ================
Example::
$ curl -X... |
python | def listPrimaryDsTypes(self, primary_ds_type="", dataset=""):
"""
API to list primary dataset types
:param primary_ds_type: List that primary dataset type (Optional)
:type primary_ds_type: str
:param dataset: List the primary dataset type for that dataset (Optional)
:typ... |
java | public static void openDialog(
String title,
String hookUri,
List<String> uploadedFiles,
final CloseHandler<PopupPanel> closeHandler) {
if (hookUri.startsWith("#")) {
List<CmsUUID> resourceIds = new ArrayList<CmsUUID>();
if (uploadedFiles != null)... |
python | def corr(self, col1, col2, method=None):
"""
Calculates the correlation of two columns of a DataFrame as a double value.
Currently only supports the Pearson Correlation Coefficient.
:func:`DataFrame.corr` and :func:`DataFrameStatFunctions.corr` are aliases of each other.
:param ... |
python | def _type_insert(self, handle, key, value):
'''
Insert the value into the series.
'''
if value!=0:
if isinstance(value,float):
handle.incrbyfloat(key, value)
else:
handle.incr(key,value) |
python | def flush(self):
"""Flush pool contents."""
# Write data to in-memory buffer first.
buf = cStringIO.StringIO()
with records.RecordsWriter(buf) as w:
for record in self._buffer:
w.write(record)
w._pad_block()
str_buf = buf.getvalue()
buf.close()
if not self._exclusive and... |
java | protected void generateNumericConstants(IStyleAppendable it) {
appendComment(it, "numerical constants"); //$NON-NLS-1$
appendMatch(it, "sarlNumber", "[0-9][0-9]*\\.[0-9]\\+([eE][0-9]\\+)\\?[fFdD]\\?"); //$NON-NLS-1$ //$NON-NLS-2$
appendMatch(it, "sarlNumber", "0[xX][0-9a-fA-F]\\+"); //$NON-NLS-1$ //$NON-NLS-2$
... |
java | public void setVpcAttachments(java.util.Collection<VpcAttachment> vpcAttachments) {
if (vpcAttachments == null) {
this.vpcAttachments = null;
return;
}
this.vpcAttachments = new com.amazonaws.internal.SdkInternalList<VpcAttachment>(vpcAttachments);
} |
java | public boolean isSameOrSubTypeOf(ClassDescriptorDef type, String baseType, boolean checkActualClasses) throws ClassNotFoundException
{
if (type.getQualifiedName().equals(baseType.replace('$', '.')))
{
return true;
}
else if (type.getOriginalClass() != null)
... |
java | public ByteBuffer getKey(int index) throws IOException {
if (index >= structure.keySizes.size()) {
throw new IOException("Index " + index + " is out of range.");
}
int length = structure.keySizes.get(index);
return ByteBuffer.wrap(key, structure.keyByteOffsets.get(index), len... |
java | public static IEntityGroup findGroup(String key) throws GroupsException {
LOGGER.trace("Invoking findGroup for key='{}'", key);
return instance().ifindGroup(key);
} |
java | protected Collection<Class<?>> discoverClasses(String... packageNames) {
log.debug("Discovering annotated controller in package(s) '{}'", Arrays.toString(packageNames));
Collection<Class<?>> classes = ClassUtil.getAnnotatedClasses(Path.class, packageNames);
return classes;
} |
java | public static FloatMatrix solvePositive(FloatMatrix A, FloatMatrix B) {
A.assertSquare();
FloatMatrix X = B.dup();
SimpleBlas.posv('U', A.dup(), X);
return X;
} |
java | @JmxOperation(description = "Retrieve operation status")
public String getStatus(int id) {
try {
return getOperationStatus(id).toString();
} catch(VoldemortException e) {
return "No operation with id " + id + " found";
}
} |
java | public DeviceSharingId deleteSharingForDevice(String deviceId, String shareId) throws ApiException {
ApiResponse<DeviceSharingId> resp = deleteSharingForDeviceWithHttpInfo(deviceId, shareId);
return resp.getData();
} |
python | def clear_validation(self, cert):
"""
Clears the record that a certificate has been validated
:param cert:
An ans1crypto.x509.Certificate object
"""
if cert.signature in self._validate_map:
del self._validate_map[cert.signature] |
java | public static IntSupplier topAlignedTo(IPositioned other, int offset)
{
checkNotNull(other);
return () -> {
return other.position().y() + offset;
};
} |
python | def plot_median_freq_evol(time_signal, signal, time_median_freq, median_freq, activations_begin,
activations_end, sample_rate, file_name=None):
"""
-----
Brief
-----
Graphical representation of the EMG median power frequency evolution time series.
-----------
Descr... |
python | def is_noncontinuable(self):
"""
@see: U{http://msdn.microsoft.com/en-us/library/aa363082(VS.85).aspx}
@rtype: bool
@return: C{True} if the exception is noncontinuable,
C{False} otherwise.
Attempting to continue a noncontinuable exception results in an
... |
python | def do_gate(self, gate: Gate):
"""
Perform a gate.
:return: ``self`` to support method chaining.
"""
unitary = lifted_gate(gate=gate, n_qubits=self.n_qubits)
self.wf = unitary.dot(self.wf)
return self |
python | def workflow_set_visibility(object_id, input_params={}, always_retry=True, **kwargs):
"""
Invokes the /workflow-xxxx/setVisibility API method.
For more info, see: https://wiki.dnanexus.com/API-Specification-v1.0.0/Visibility#API-method%3A-%2Fclass-xxxx%2FsetVisibility
"""
return DXHTTPRequest('/%s/... |
java | public boolean isMethodAllowed(String method) {
return HttpMethod.isValidMethod(method) && (allowedMethods.isEmpty() || allowedMethods.contains(method));
} |
python | def nodeid(self, iv, quantifier=False):
"""
Return the nodeid of the predication selected by *iv*.
Args:
iv: the intrinsic variable of the predication to select
quantifier: if `True`, treat *iv* as a bound variable and
find its quantifier; otherwise the n... |
java | public static String join(String joinChar, String... args) {
String next = ""; //$NON-NLS-1$
StringBuilder result = new StringBuilder(length(args) + (args.length - 1));
for (String arg : args) {
result.append(next);
result.append(arg);
next = joinChar;
... |
python | def execute_with_scope(expr, scope, aggcontext=None, clients=None, **kwargs):
"""Execute an expression `expr`, with data provided in `scope`.
Parameters
----------
expr : ibis.expr.types.Expr
The expression to execute.
scope : collections.Mapping
A dictionary mapping :class:`~ibis.e... |
python | def get(self, eid):
"""
Returns a dict with the complete record of the entity with the given eID
"""
data = self._http_req('connections/%u' % eid)
self.debug(0x01, data['decoded'])
return data['decoded'] |
java | public void execute() throws Exception {
String site1 = getSecureBaseUrl(sites.get(0));
String site2 = getSecureBaseUrl(sites.get(1));
if(site1.equalsIgnoreCase(site2)) {
System.err.println("Cannot clone a site into itself.");
System.exit(1);
}
try{
System.out.println("Getting... |
java | protected static CmsTreeItem getLastOpenedItem(CmsTreeItem item, int stopLevel, boolean requiresDropEnabled) {
if (stopLevel != -1) {
// stop level is set
int currentLevel = getPathLevel(item.getPath());
if (currentLevel > stopLevel) {
// we are past the stop... |
python | def swo_enable(self, cpu_speed, swo_speed=9600, port_mask=0x01):
"""Enables SWO output on the target device.
Configures the output protocol, the SWO output speed, and enables any
ITM & stimulus ports.
This is equivalent to calling ``.swo_start()``.
Note:
If SWO is al... |
python | def decompress(self, value: LocalizedValue) -> List[str]:
"""Decompresses the specified value so
it can be spread over the internal widgets.
Arguments:
value:
The :see:LocalizedValue to display in this
widget.
Returns:
All values ... |
java | public @NotNull OptionalInt findOptionalInt(@NotNull SqlQuery query) {
Optional<Integer> value = findOptional(Integer.class, query);
return value.isPresent() ? OptionalInt.of(value.get()) : OptionalInt.empty();
} |
java | static <T> void crossover(
final MSeq<T> that,
final MSeq<T> other,
final int index
) {
assert index >= 0 :
format(
"Crossover index must be within [0, %d) but was %d",
that.length(), index
);
that.swap(index, min(that.length(), other.length()), other, index);
} |
python | def _set_label(label, mark, dim, **kwargs):
"""Helper function to set labels for an axis
"""
if mark is None:
mark = _context['last_mark']
if mark is None:
return {}
fig = kwargs.get('figure', current_figure())
scales = mark.scales
scale_metadata = mark.scales_metadata.get(di... |
java | private boolean validate(CmsFavoriteEntry entry) {
try {
String siteRoot = entry.getSiteRoot();
if (!m_okSiteRoots.contains(siteRoot)) {
m_rootCms.readResource(siteRoot);
m_okSiteRoots.add(siteRoot);
}
CmsUUID project = entry.getPr... |
java | @Override
public void eUnset(int featureID) {
switch (featureID) {
case AfplibPackage.BEGIN_SEGMENT__SEGNAME:
setSEGNAME(SEGNAME_EDEFAULT);
return;
}
super.eUnset(featureID);
} |
python | def on_hazard_exposure_bookmark_toggled(self, enabled):
"""Update the UI when the user toggles the bookmarks radiobutton.
:param enabled: The status of the radiobutton.
:type enabled: bool
"""
if enabled:
self.bookmarks_index_changed()
else:
self.... |
python | def get_present_children(self, parent, locator, params=None, timeout=None, visible=False):
"""
Get child-elements both present in the DOM.
If timeout is 0 (zero) return WebElement instance or None, else we wait and retry for timeout and raise
TimeoutException should the element not be f... |
java | @Override
public com.liferay.commerce.product.model.CPDisplayLayout createCPDisplayLayout(
long CPDisplayLayoutId) {
return _cpDisplayLayoutLocalService.createCPDisplayLayout(CPDisplayLayoutId);
} |
python | def xpathNextDescendant(self, ctxt):
"""Traversal function for the "descendant" direction the
descendant axis contains the descendants of the context
node in document order; a descendant is a child or a child
of a child and so on. """
if ctxt is None: ctxt__o = None
... |
java | public Point fromTransferObject(PointTo input, CrsId crsId) {
if (input == null) { return null; }
crsId = getCrsId(input, crsId);
isValid(input);
return createPoint(input.getCoordinates(), crsId);
} |
python | async def create_object(model, **data):
"""Create object asynchronously.
:param model: mode class
:param data: data for initializing object
:return: new object saved to database
"""
# NOTE! Here are internals involved:
#
# - obj._data
# - obj._get_pk_value()
# - obj._set_pk_valu... |
java | private void init(Context context, AttributeSet attrs, int defStyle)
{
// Initialize paint objects
paint = new Paint();
paint.setAntiAlias(true);
paintBorder = new Paint();
paintBorder.setAntiAlias(true);
paintSelectorBorder = new Paint();
paintSelectorBorder.setAntiAlias(true);
// load the styled a... |
python | def simple_write(filename, group, times, features,
properties=None, item='item', mode='a'):
"""Simplified version of `write()` when there is only one item."""
write(filename, group, [item], [times], [features], mode=mode,
properties=[properties] if properties is not None else None) |
python | def get_field_setup_query(query, model, column_name):
"""
Help function for SQLA filters, checks for dot notation on column names.
If it exists, will join the query with the model
from the first part of the field name.
example:
Contact.created_by: if created_by is a User... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.