language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | public void trackEvent(String argCategory, String argAction, String argLabel, Integer argValue) {
AnalyticsRequestData data = new AnalyticsRequestData();
data.setEventCategory(argCategory);
data.setEventAction(argAction);
data.setEventLabel(argLabel);
data.setEventValue(argValue)... |
python | def export_public_key(self):
""" Export a public key in PEM-format
:return: bytes
"""
if self.__public_key is None:
raise ValueError('Unable to call this method. Public key must be set')
return self.__public_key.public_bytes(
encoding=serialization.Encoding.PEM,
format=serialization.PublicFormat.Su... |
java | public static CommerceTierPriceEntry removeByUUID_G(String uuid,
long groupId)
throws com.liferay.commerce.price.list.exception.NoSuchTierPriceEntryException {
return getPersistence().removeByUUID_G(uuid, groupId);
} |
java | public void addSpillIfNotEmpty(UnsafeSorterIterator spillReader) throws IOException {
if (spillReader.hasNext()) {
// We only add the spillReader to the priorityQueue if it is not empty. We do this to
// make sure the hasNext method of UnsafeSorterIterator returned by getSortedIterator
// does not... |
python | def pingable_ws_connect(request=None, on_message_callback=None,
on_ping_callback=None):
"""
A variation on websocket_connect that returns a PingableWSClientConnection
with on_ping_callback.
"""
# Copy and convert the headers dict/object (see comments in
# AsyncHTTPClient.... |
python | def main(argv: Optional[Sequence[str]] = None) -> None:
"""Parse arguments and process the exam assignment."""
parser = ArgumentParser(description="Convert Jupyter Notebook exams to PDFs")
parser.add_argument(
"--exam",
type=int,
required=True,
help="Exam number to convert",
... |
java | private void closeCursor() {
if (mCursor != null) {
int count = mCursor.getCount();
mCursor.close();
mCursor = null;
notifyItemRangeRemoved(0, count);
}
updateCursorObserver();
} |
python | def asynchronous(method):
""" Convenience wrapper for GObject.idle_add. """
def _async(*args, **kwargs):
GObject.idle_add(method, *args, **kwargs)
return _async |
java | private void clear() {
boolPropertySet = null;
databaseInputDir = null;
databaseOutputDir = null;
IO.close(project);
} |
python | def dead(self):
"""Returns True if this entity no longer exists in the underlying
model.
"""
return (
self.data is None or
self.model.state.entity_data(
self.entity_type, self.entity_id, -1) is None
) |
python | def deploy(self, id_networkv4):
"""Deploy network in equipments and set column 'active = 1' in tables redeipv4
:param id_networkv4: ID for NetworkIPv4
:return: Equipments configuration output
"""
data = dict()
uri = 'api/networkv4/%s/equipments/' % id_networkv4
... |
java | public TColumn getColumnById(long columnId) {
if (columns == null) {
return null;
}
TColumn result = null;
for (TColumn column : columns) {
if (column.getId() == columnId) {
result = column;
break;
}
}
r... |
java | protected Block visitBlock(Block block) {
if (block == null) {
return null;
}
Statement stmt = (Statement)block.accept(this);
if (stmt instanceof Block) {
return (Block)stmt;
}
else if (stmt != null) {
return new Block(stmt);
... |
java | protected <T> List<T> getResources(final ResourceType resourceType, final Class<T> type,
@Nullable final String locationUUID) throws FlexiantException {
SearchFilter sf = new SearchFilter();
if (locationUUID != null) {
FilterCondition fcLocation = new FilterCondition();
... |
java | public void createNewSecurityDomain(String securityDomainName, LoginModuleRequest... loginModules)
throws Exception {
//do not close the controller client here, we're using our own..
CoreJBossASClient coreClient = new CoreJBossASClient(getModelControllerClient());
String serverVersio... |
python | def roles_required(*roles):
"""
Decorator which specifies that a user must have all the specified roles.
Aborts with HTTP 403: Forbidden if the user doesn't have the required roles.
Example::
@app.route('/dashboard')
@roles_required('ROLE_ADMIN', 'ROLE_EDITOR')
def dashboard()... |
java | String selectSyncHistoryOwner()
throws IOException {
// L.1.2 Select the history of a follwer f to be the initial history
// of the new epoch. Follwer f is such that for every f' in the quorum,
// f'.a < f.a or (f'.a == f.a && f'.zxid <= f.zxid).
long ackEpoch = persistence.getAckEpoch();
Zxid... |
python | def GetMacAddresses(self):
"""MAC addresses from all interfaces."""
result = set()
for interface in self.interfaces:
if (interface.mac_address and
interface.mac_address != b"\x00" * len(interface.mac_address)):
result.add(Text(interface.mac_address.human_readable_address))
return... |
python | def _copy(self, filename, id_=-1, file_type=0):
"""Upload a file to the distribution server.
Directories/bundle-style packages must be zipped prior to
copying.
"""
if os.path.isdir(filename):
raise JSSUnsupportedFileType(
"Distribution Server type rep... |
java | @Override
public GetRouteResponsesResult getRouteResponses(GetRouteResponsesRequest request) {
request = beforeClientExecution(request);
return executeGetRouteResponses(request);
} |
java | private void assertPropertyIsIndexed(final PropertyKey key) {
if (key != null && !key.isIndexed() && key instanceof AbstractPrimitiveProperty) {
final Class declaringClass = key.getDeclaringClass();
String className = "";
if (declaringClass != null) {
className = declaringClass.getSimpleNam... |
python | def __GetMark(self):
" keep track of cursor position within text"
try:
self.__mark = min(wx.TextCtrl.GetSelection(self)[0],
len(wx.TextCtrl.GetValue(self).strip()))
except:
self.__mark = 0 |
java | @Override
public void initializeState(FunctionInitializationContext context) throws Exception {
final int subtaskIndex = getRuntimeContext().getIndexOfThisSubtask();
this.buckets = bucketsBuilder.createBuckets(subtaskIndex);
final OperatorStateStore stateStore = context.getOperatorStateStore();
bucketStates =... |
python | def to_hdf5(self, filepath: str):
"""Write the main dataframe to Hdf5 file
:param filepath: path where to save the file
:type filepath: str
:example: ``ds.to_hdf5_("./myfile.hdf5")``
"""
try:
self.start("Saving data to Hdf5...")
dd.io.save(filepa... |
java | public static boolean replaceEntry(File zip, String path, byte[] bytes, File destZip) {
return replaceEntry(zip, new ByteSource(path, bytes), destZip);
} |
python | def section_path_lengths(neurites, neurite_type=NeuriteType.all):
'''Path lengths of a collection of neurites '''
# Calculates and stores the section lengths in one pass,
# then queries the lengths in the path length iterations.
# This avoids repeatedly calculating the lengths of the
# same sections... |
java | public static DoubleMatrix identity(int n)
{
return getInstance(n ,n, (i, j) -> i == j ? 1 : 0);
} |
java | public static base_response update(nitro_service client, nsconfig resource) throws Exception {
nsconfig updateresource = new nsconfig();
updateresource.ipaddress = resource.ipaddress;
updateresource.netmask = resource.netmask;
updateresource.nsvlan = resource.nsvlan;
updateresource.ifnum = resource.ifnum;
u... |
java | @Override
public void afterCompletion(int status) {
logger.log(Level.FINE, "The status of the transaction commit is: " + status);
if (status == Status.STATUS_COMMITTED){
//Save the metrics object after a successful commit
runtimeStepExecution.setCommittedMetrics();
}... |
python | def variants(ctx, variant_id, chromosome, end_chromosome, start, end, variant_type,
sv_type):
"""Display variants in the database."""
if sv_type:
variant_type = 'sv'
adapter = ctx.obj['adapter']
if (start or end):
if not (chromosome and start and end):
LOG.warn... |
python | def get_unbound_arg_names(arg_names, arg_binding_keys):
"""Determines which args have no arg binding keys.
Args:
arg_names: a sequence of the names of possibly bound args
arg_binding_keys: a sequence of ArgBindingKey each of whose arg names is
in arg_names
Returns:
a sequence of... |
python | def _split_ns_by_scatter(cls,
shard_count,
namespace,
raw_entity_kind,
app):
"""Split a namespace by scatter index into key_range.KeyRange.
TODO(user): Power this with key_range.KeyRange.compute_split_po... |
python | def MergeFrom(self, other):
"""Appends the contents of another repeated field of the same type to this
one. We do not check the types of the individual fields.
"""
self._values.extend(other._values)
self._message_listener.Modified() |
python | def log(self, facility, level, text, pid=False):
"""Send the message text to all registered hosts.
The facility and level will be used to create the packet's PRI
part. The HEADER will be automatically determined from the
current time and hostname. The MSG will be set from the
ru... |
java | public void setXocBase(Integer newXocBase) {
Integer oldXocBase = xocBase;
xocBase = newXocBase;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.CDD__XOC_BASE, oldXocBase, xocBase));
} |
java | @Override
public synchronized P readPage(int pageID) {
countRead();
P page = map.get(pageID);
if(page != null) {
if(LOG.isDebuggingFine()) {
LOG.debugFine("Read from cache: " + pageID);
}
}
else {
if(LOG.isDebuggingFine()) {
LOG.debugFine("Read from backing: " + p... |
java | @Override
public RetryDecision onReadTimeout(
@NonNull Request request,
@NonNull ConsistencyLevel cl,
int blockFor,
int received,
boolean dataPresent,
int retryCount) {
RetryDecision decision =
(retryCount == 0 && received >= blockFor && !dataPresent)
? Ret... |
python | def upload_create(self, data, filename=None, token=None, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/attachments#upload-files"
api_path = "/api/v2/uploads.json"
api_query = {}
if "query" in kwargs.keys():
api_query.update(kwargs["query"])
del kwar... |
python | def notify_event_nowait(self, conn_string, name, event):
"""Notify an event.
This will move the notification to the background event loop and
return immediately. It is useful for situations where you cannot
await notify_event but keep in mind that it prevents back-pressure
when... |
python | def spawn(self, command):
""" Spawns a new process and adds it to the pool """
# process_name
# output
# time before starting (wait for port?)
# start_new_session=True : avoid sending parent signals to child
env = dict(os.environ)
env["MRQ_IS_SUBPROCESS"] = "1"
... |
python | def truncate(value: Decimal, n_digits: int) -> Decimal:
"""Truncates a value to a number of decimals places"""
return Decimal(math.trunc(value * (10 ** n_digits))) / (10 ** n_digits) |
python | def gen_part_from_line(lines: Iterable[str],
part_index: int,
splitter: str = None) -> Generator[str, None, None]:
"""
Splits lines with ``splitter`` and yields a specified part by index.
Args:
lines: iterable of strings
part_index: index of par... |
java | public Color getColorAt(float p) {
if (p <= 0) {
return ((Step) steps.get(0)).col;
}
if (p > 1) {
return ((Step) steps.get(steps.size()-1)).col;
}
for (int i=1;i<steps.size();i++) {
Step prev = ((Step) steps.get(i-1));
Step current = ((Step) steps.get(i));
if (p <= current.lo... |
python | def mousePressEvent(self, event):
"""Create a marker or start selection
Parameters
----------
event : instance of QtCore.QEvent
it contains the position that was clicked.
"""
if not self.scene:
return
if self.event_sel or self... |
python | def _get_validation_labels(val_path):
"""Returns labels for validation.
Args:
val_path: path to TAR file containing validation images. It is used to
retrieve the name of pictures and associate them to labels.
Returns:
dict, mapping from image name (str) to label (str).
"""
labels... |
python | def clear(self):
"""Clears all the axes to start fresh."""
for ax in self.flat_grid:
for im_h in ax.findobj(AxesImage):
im_h.remove() |
python | def validate_mutations(self, mutations):
'''This function has been refactored to use the SimpleMutation class.
The parameter is a list of Mutation objects. The function has no return value but raises a PDBValidationException
if the wildtype in the Mutation m does not match the residue type... |
python | def layout(self, value):
'Overloaded layout function to fix component names as needed'
if self._adjust_id:
self._fix_component_id(value)
return Dash.layout.fset(self, value) |
python | def get_account(self, username):
"""return user by username.
"""
try:
account = self.model.objects.get(
**self._filter_user_by(username)
)
except self.model.DoesNotExist:
return None
return account |
java | @Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case BpsimPackage.USER_DISTRIBUTION_DATA_POINT_TYPE__PARAMETER_VALUE_GROUP:
return parameterValueGroup != null && !parameterValueGroup.isEmpty();
case BpsimPackage.USER_DISTRIBUTION_DATA_POINT_TYPE__PARAMETER_VALUE:
return getParamet... |
python | def ctc_label(p):
"""Iterates through p, identifying non-zero and non-repeating values, and returns them in a list Parameters
----------
p: list of int
Returns
-------
list of int
"""
ret = []
p1 = [0] + p
for i, _ in enumerate(p):
... |
java | public synchronized long sendMessage(AbstractRequestMessage message) {
log.debug("Sending {} to {}", message, this);
message.setTicketNumber(this.nextTicketNumber.getAndIncrement());
this.outstandingRequests.put(Long.valueOf(message.getTicketNumber()),
message);
this.session.write(message);
... |
python | def compute_qpi(self):
"""Compute model data with current parameters
Returns
-------
qpi: qpimage.QPImage
Modeled phase data
Notes
-----
The model image might deviate from the fitted image
because of interpolation during the fitting process.
... |
python | def get_files(self):
"""
:calls: `GET /repos/:owner/:repo/pulls/:number/files <http://developer.github.com/v3/pulls>`_
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.File.File`
"""
return github.PaginatedList.PaginatedList(
github.File.File,
... |
java | @Override
public AnnotationDefinition resolveAnnotationDefinition(
String resourceLocation)
throws AnnotationDefinitionResolutionException {
synchronized (resourceLocation) {
// return if cached
if (annotations.containsKey(resourceLocation)) {
... |
python | def high_frequency_cutoff_from_config(cp):
"""Gets the high frequency cutoff from the given config file.
This looks for ``high-frequency-cutoff`` in the ``[model]`` section and
casts it to float. If none is found, will just return ``None``.
Parameters
----------
cp : WorkflowConfigParser
... |
java | public final void setSecurityController(SecurityController controller)
{
if (sealed) onSealedMutation();
if (controller == null) throw new IllegalArgumentException();
if (securityController != null) {
throw new SecurityException("Can not overwrite existing SecurityController obje... |
java | public CipherInputStream wrapInputStream(InputStream is, byte[] iv) throws GeneralSecurityException, IOException {
Cipher cipher = getCipher(true);
if(iv == null && ivLength > 0) {
if(prependIV) {
iv = new byte[ivLength];
is.read(iv);
} else {
throw new IllegalStateException("Could not obtain IV")... |
java | public static MozuUrl resetPasswordUrl()
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/accounts/Reset-Password");
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} |
java | public BoxRequestsFile.CreateNewVersionUploadSession getCreateUploadVersionSessionRequest(InputStream is, String fileName, long fileSize, String fileId)
throws FileNotFoundException {
return new BoxRequestsFile.CreateNewVersionUploadSession(is, fileName, fileSize, getUploadSessionForNewFileVersionUr... |
java | public WatchObject watch(final boolean enable, final boolean dumpData, final String device) throws IOException, JSONException {
JSONObject watch = new JSONObject();
watch.put("class", "WATCH");
watch.put("enable", enable);
watch.put("json", dumpData);
if (device != null) {
watch.put("device", device);
}
... |
java | public void init(Application app, Activity initActivity) {
HMSAgentLog.d("init");
if (application != null) {
application.unregisterActivityLifecycleCallbacks(this);
}
application = app;
setCurActivity(initActivity);
app.registerActivityLifecycleCall... |
java | private void showSignUpTermsDialog(@Nullable DialogInterface.OnClickListener acceptCallback) {
final String content = getResources().getString(R.string.com_auth0_lock_sign_up_terms_dialog_message, configuration.getTermsURL(), configuration.getPrivacyURL());
final AlertDialog.Builder builder = new AlertD... |
python | def stringify_device_meta(device_object):
""" Input: Portals device object.
Output: The same device object with the device meta
converted to a python string. """
try:
if isinstance(device_object['info']['description']['meta'], dict):
device_object['info']['description... |
java | boolean remove(Class<?> eventClass, ListenerReferenceHolder listener) {
lock.readLock().lock();
TreeSet<ListenerReferenceHolder> set = listeners.get(eventClass);
if (set != null) {
lock.readLock().unlock();
lock.writeLock().lock();
try {
return removeListenerAndSetIfNeeded(eventClass, listener, set);... |
python | def delete_tag_from_bookmark(self, bookmark_id, tag_id):
"""
Remove a single tag from a bookmark.
The identified bookmark must belong to the current user.
:param bookmark_id: ID of the bookmark to delete.
"""
url = self._generate_url('bookmarks/{0}/tags/{1}'.format(
... |
python | def add_signal_handler():
"""Adds a signal handler to handle KeyboardInterrupt."""
import signal
def handler(sig, frame):
if sig == signal.SIGINT:
librtmp.RTMP_UserInterrupt()
raise KeyboardInterrupt
signal.signal(signal.SIGINT, handler) |
python | def evaluate(self, gold):
"""Evaluate the accuracy of this tagger using a gold standard corpus.
:param list(list(tuple(str, str))) gold: The list of tagged sentences to score the tagger on.
:returns: Tagger accuracy value.
:rtype: float
"""
tagged_sents = self.tag_sents(... |
python | def __getSequenceVariants(self, x1, polyStart, polyStop, listSequence) :
"""polyStop, is the polymorphisme at wixh number where the calcul of combinaisons stops"""
if polyStart < len(self.polymorphisms) and polyStart < polyStop:
sequence = copy.copy(listSequence)
ret = []
pk = self.polymorphisms[polyS... |
java | private String extractGrantCode(String urlString) throws MalformedURLException {
URL url = new URL(urlString);
String code = Utils.getParameterValueFromQuery(url.getQuery(), "code");
if (code == null){
throw new RuntimeException("Failed to extract grant code from url");
}
... |
python | def registeredView(viewName, location='Central'):
"""
Returns the view that is registered to the inputed location for the \
given name.
:param viewName | <str>
location | <str>
:return <subclass of XView> || None
"""
... |
java | public Observable<CheckAvailabilityResourceInner> checkAvailabilityAsync(CheckAvailabilityParameters parameters) {
return checkAvailabilityWithServiceResponseAsync(parameters).map(new Func1<ServiceResponse<CheckAvailabilityResourceInner>, CheckAvailabilityResourceInner>() {
@Override
pub... |
python | def delete(self, exchange, if_unused=False, nowait=True, ticket=None,
cb=None):
'''
Delete an exchange.
'''
nowait = nowait and self.allow_nowait() and not cb
args = Writer()
args.write_short(ticket or self.default_ticket).\
write_shortstr(exch... |
java | public double getDistance(double[] sample1, double[] sample2) throws IllegalArgumentException {
int n = sample1.length;
if (n != sample2.length || n < 1)
throw new IllegalArgumentException("Input arrays must have the same length.");
double sumOfSquares = 0;
for (int i = 0; i < n; i++) {
if (Double.isNaN... |
java | public VectorIterator nonZeroIteratorOfRow(int i) {
final int ii = i;
return new VectorIterator(columns) {
private int j = -1;
@Override
public int index() {
return j;
}
@Override
public double get() {
... |
java | public static void fullViewLeft(CameraPinholeBrown paramLeft,
FMatrixRMaj rectifyLeft, FMatrixRMaj rectifyRight,
FMatrixRMaj rectifyK)
{
ImplRectifyImageOps_F32.fullViewLeft(paramLeft, rectifyLeft, rectifyRight, rectifyK);
} |
java | public void marshall(GetEmailIdentityRequest getEmailIdentityRequest, ProtocolMarshaller protocolMarshaller) {
if (getEmailIdentityRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(getEmailId... |
python | def get_nameserver_detail_output_show_nameserver_nameserver_portname(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_nameserver_detail = ET.Element("get_nameserver_detail")
config = get_nameserver_detail
output = ET.SubElement(get_nameserver_... |
java | @Override
public EClass getIfcPreDefinedProperties() {
if (ifcPreDefinedPropertiesEClass == null) {
ifcPreDefinedPropertiesEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI)
.getEClassifiers().get(443);
}
return ifcPreDefinedPropertiesEClass;
} |
python | def installShlibLinks(dest, source, env):
"""If we are installing a versioned shared library create the required links."""
Verbose = False
symlinks = listShlibLinksToInstall(dest, source, env)
if Verbose:
print('installShlibLinks: symlinks={:r}'.format(SCons.Tool.StringizeLibSymlinks(symlinks)))... |
python | def _handle_command(self, buffer):
" When text is accepted in the command line. "
text = buffer.text
# First leave command mode. We want to make sure that the working
# pane is focused again before executing the command handers.
self.pymux.leave_command_mode(append_to_history=Tr... |
python | def get_tweet(self, id):
"""
Get an existing tweet.
:param id: ID of the tweet in question
:return: Tweet object. None if not found
"""
try:
return Tweet(self._client.get_status(id=id)._json)
except TweepError as e:
if e.api_code == TWITTE... |
java | private void processVersionLine(String log) {
log = log.replace(start, "");
String[] pieces = log.split(" \\(");
if (pieces.length == 2) {
version = pieces[0];
build = pieces[1].replace(")", "");
// old builds do not include build info. Xcode 4.3.2 return 1.0 without build info
} else ... |
python | def duplicate(self, name):
"""
.. versionadded:: 0.5.8
Requires SMC version >= 6.3.2
Duplicate this element. This is a shortcut method that will make
a direct copy of the element under the new name and type.
:param str name: name for the duplicated e... |
java | private MilestoneManager getKilometerManager() {
final float backgroundRadius = 20;
final Paint backgroundPaint1 = getFillPaint(COLOR_BACKGROUND);
final Paint backgroundPaint2 = getFillPaint(COLOR_POLYLINE_ANIMATED);
final Paint textPaint1 = getTextPaint(COLOR_POLYLINE_STATIC);
f... |
python | def pause_knocks(obj):
"""
Context manager to suspend sending knocks for the given model
:param obj: model instance
"""
if not hasattr(_thread_locals, 'knock_enabled'):
_thread_locals.knock_enabled = {}
obj.__class__._disconnect()
_thread_locals.knock_enabled[obj.__class__] = False
... |
python | def checkout(self):
'''
Checkout the configured branch/tag. We catch an "Exception" class here
instead of a specific exception class because the exceptions raised by
GitPython when running these functions vary in different versions of
GitPython.
'''
tgt_ref = self... |
java | public static servicegroup_binding get(nitro_service service, String servicegroupname) throws Exception{
servicegroup_binding obj = new servicegroup_binding();
obj.set_servicegroupname(servicegroupname);
servicegroup_binding response = (servicegroup_binding) obj.get_resource(service);
return response;
} |
python | def request_uniq(func):
"""
return unique dict for each uwsgi request.
note: won't work on non-uwsgi cases
"""
def _wrapped(*args, **kwargs):
data = _get_request_unique_cache()
return func(data, *args, **kwargs)
return _wrapped |
python | def add_cmd_handler(self, handler_obj):
"""Registers a new command handler object.
All methods on `handler_obj` whose name starts with "cmd_" are
registered as a GTP command. For example, the method cmd_genmove will
be invoked when the engine receives a genmove command.
Args:
... |
python | def main(argv=None):
"""Run the pywhich command as if invoked with arguments `argv`.
If `argv` is `None`, arguments from `sys.argv` are used.
"""
if argv is None:
argv = sys.argv
parser = OptionParser()
parser.add_option('-v', '--verbose', dest="verbose", action="count",
defa... |
python | def debye_E_single(x):
"""
calculate Debye energy using old fortran routine
:params x: Debye x value
:return: Debye energy
"""
# make the function handles both scalar and array
if ((x > 0.0) & (x <= 0.1)):
result = 1. - 0.375 * x + x * x * \
(0.05 - (5.952380953e-4) * x ... |
python | def OnGridEditorCreated(self, event):
"""Used to capture Editor close events"""
editor = event.GetControl()
editor.Bind(wx.EVT_KILL_FOCUS, self.OnGridEditorClosed)
event.Skip() |
python | def collection_names(self, include_system_collections=True):
"""Get a list of all the collection names in this database.
:Parameters:
- `include_system_collections` (optional): if ``False`` list
will not include system collections (e.g ``system.indexes``)
"""
with ... |
java | private Object getEmbeddedObject(JsonParser jsonParser) throws IOException {
LOG.info("Start parsing an embedded object.");
Map<String, Object> embeddedMap = new HashMap<>();
while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
String key = jsonParser.getText();
jsonP... |
python | def transformer_base_v2():
"""Set of hyperparameters."""
hparams = transformer_base_v1()
hparams.layer_preprocess_sequence = "n"
hparams.layer_postprocess_sequence = "da"
hparams.layer_prepostprocess_dropout = 0.1
hparams.attention_dropout = 0.1
hparams.relu_dropout = 0.1
hparams.learning_rate_warmup_st... |
python | def selections(self):
"""Build list of extra selections for rectangular selection"""
selections = []
cursors = self.cursors()
if cursors:
background = self._qpart.palette().color(QPalette.Highlight)
foreground = self._qpart.palette().color(QPalette.HighlightedText... |
python | def get_ip(self):
"""
Retrieve a complete list of bought ip address related only to PRO Servers.
It create an internal object (Iplist) representing all of the ips object
iterated form the WS.
@param: None
@return: None
"""
json_scheme = self.gen_def_json_s... |
java | public void writeBootstrapData(String name,
ImmutableMap<String, ImmutableListMultimap<String, Double>> measuresToBreakdownsToStats,
File outputDir) throws IOException {
final StringBuilder chart = new StringBuilder();
final StringBuilder delim = new StringBuilder();
final StringBuilder mediansD... |
java | public static DateTime parseDateTime(String dateString) {
dateString = normalize(dateString);
return parse(dateString, DatePattern.NORM_DATETIME_FORMAT);
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.