language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | protected SSLServerSocketFactory createFactory()
throws Exception
{
SSLContext context;
if (_provider == null) {
context = SSLContext.getInstance(_protocol);
} else {
context = SSLContext.getInstance(_protocol, _provider);
}
KeyManagerFactory keyManagerFactory = KeyManagerFa... |
python | def _pca_scores(
scores,
pc1=0,
pc2=1,
fcol=None,
ecol=None,
marker='o',
markersize=30,
label_scores=None,
show_covariance_ellipse=True,
optimize_label_iter=OPTIMIZE_LABEL_ITER_DEFAULT,
**kwargs
):
"""
Plot a scores plot... |
python | def ordered_symbols(self):
"""
:return: list of all symbols in this model, topologically sorted so they
can be evaluated in the correct order.
Within each group of equal priority symbols, we sort by the order of
the derivative.
"""
key_func = lambda s... |
java | public static String getFullName(final ZoneId self, Locale locale) {
return self.getDisplayName(TextStyle.FULL, locale);
} |
java | public OperatorSubtaskState putSubtaskStateByOperatorID(
@Nonnull OperatorID operatorID,
@Nonnull OperatorSubtaskState state) {
return subtaskStatesByOperatorID.put(operatorID, Preconditions.checkNotNull(state));
} |
java | private void removeValuesInOtherLocales(String elementPath, Locale sourceLocale) {
for (Locale locale : getLocales()) {
if (locale.equals(sourceLocale)) {
continue;
}
while (hasValue(elementPath, locale)) {
removeValue(elementPath, locale, 0);... |
python | def activate_axes(self, axes):
'''
Sets motors to a high current, for when they are moving
and/or must hold position
Activating XYZABC axes before both HOMING and MOVING
axes:
String containing the axes to set to high current (eg: 'XYZABC')
'''
axes ... |
java | @Override
public <NV extends NumberVector> NV projectRenderToDataSpace(double[] v, NumberVector.Factory<NV> prototype) {
final int dim = v.length;
double[] vec = projectRenderToScaled(v);
// Not calling {@link #projectScaledToDataSpace} to avoid extra copy of
// vector.
for(int d = 0; d < dim; d++... |
java | public void synchronizeTaskIDToHierarchy()
{
clear();
int currentID = (getByID(Integer.valueOf(0)) == null ? 1 : 0);
for (Task task : m_projectFile.getChildTasks())
{
task.setID(Integer.valueOf(currentID++));
add(task);
currentID = synchroizeTaskIDToHierarchy(task,... |
python | def delete_column(self, id_or_name):
"""
Deletes a Column by its id or name
:param id_or_name: the id or name of the column
:return bool: Success or Failure
"""
url = self.build_url(self._endpoints.get('delete_column').format(id=quote(id_or_name)))
return bool(sel... |
python | async def updateHook(self, *args, **kwargs):
"""
Update a hook
This endpoint will update an existing hook. All fields except
`hookGroupId` and `hookId` can be modified.
This method takes input: ``v1/create-hook-request.json#``
This method gives output: ``v1/hook-defin... |
java | public SubscriptionState getSubscriptionState(String subscriptionName, String database) {
if (StringUtils.isEmpty(subscriptionName)) {
throw new IllegalArgumentException("SubscriptionName cannot be null");
}
RequestExecutor requestExecutor = _store.getRequestExecutor(ObjectUtils.fir... |
python | def allclose(a, b, rtol=4*np.finfo(float).eps, atol=0.0, equal_nan=False, verbose=False):
"""
Returns True if two arrays are element-wise equal within a tolerance.
This function is essentially a wrapper for the `quaternion.isclose`
function, but returns a single boolean value of True if all elements
... |
python | def find_wavs(folder: str) -> Tuple[List[str], List[str]]:
"""Finds wake-word and not-wake-word wavs in folder"""
return (glob_all(join(folder, 'wake-word'), '*.wav'),
glob_all(join(folder, 'not-wake-word'), '*.wav')) |
python | def change_axis(self, axis_num, channel_name):
"""
TODO: refactor that and set_axes
what to do with ax?
axis_num: int
axis number
channel_name: str
new channel to plot on that axis
"""
current_channels = list(self.current_channels)
i... |
java | private void rebuildKey() {
final StringBuilder sb = new StringBuilder();
sb.append(classField().getCanonicalName()).append('|');
for (final Object keyObject : this.keyPartList) {
sb.append(buildObjectKey(keyObject)).append('|');
}
this.key = sb.toString();
... |
java | public void marshall(BatchGetApplicationRevisionsRequest batchGetApplicationRevisionsRequest, ProtocolMarshaller protocolMarshaller) {
if (batchGetApplicationRevisionsRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
pr... |
java | protected String getStringImpl() throws SQLException {
try {
return StringConverter.inputStreamToString(getBinaryStreamImpl(),
"US-ASCII");
} catch (IOException ex) {
throw Exceptions.transformFailed(ex);
}
} |
java | void rollFSImage(CheckpointSignature sig) throws IOException {
long start = System.nanoTime();
sig.validateStorageInfo(this.storage);
saveDigestAndRenameCheckpointImage(sig.mostRecentCheckpointTxId,
sig.imageDigest);
long rollTime = DFSUtil.getElapsedTimeMicroSeconds(start);
if (metrics !=... |
python | def organization_show(self, id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/organizations#show-organization"
api_path = "/api/v2/organizations/{id}.json"
api_path = api_path.format(id=id)
return self.call(api_path, **kwargs) |
python | def _common(s1, s2, i1, i2):
"""calculate the common % percentage of sequences"""
c = len(set(s1).intersection(s2))
t = min(len(s1), len(s2))
pct = 1.0 * c / t * t
is_gt = up_threshold(pct, t * 1.0, parameters.similar)
logger.debug("_common: pct %s of clusters:%s %s = %s" % (1.0 * c / t, i1, i2,... |
python | def codeComplete(self, path, line, column, unsaved_files=None,
include_macros=False, include_code_patterns=False,
include_brief_comments=False):
"""
Code complete in this translation unit.
In-memory contents for files can be provided by passing a list o... |
python | def merge_up(self, target_branch=None, feature_branch=None, delete=True, create=True):
"""
Merge a change into one or more release branches and the default branch.
:param target_branch: The name of the release branch where merging of
the feature branch starts (a st... |
java | public void pushVariableScope(VariableScope el) {
pushState();
scope = el;
superBlockNamedLabels = new HashMap(superBlockNamedLabels);
superBlockNamedLabels.putAll(currentBlockNamedLabels);
currentBlockNamedLabels = new HashMap();
} |
java | protected Module addSerializer(SimpleModule module) {
module.addSerializer(ConfigModel.class, Holder.CONFIG_MODEL_SERIALIZER);
module.addSerializer(Config.class, Holder.CONFIG_SERIALIZER);
module.addSerializer(Json.RawValue.class, Holder.RAW_VALUE_SERIALIZER);
return module;
} |
java | public static long ipToLong(String ip) {
if (!isValidIp(ip)) {
throw new IllegalArgumentException("Invalid IP address: " + ip);
}
long result = 0;
String[] ipArr = ip.split("\\.");
for (int i = 3; i >= 0; i--) {
long part = Long.parseLong(ipArr[3 - i]);
... |
java | @Override
public void setStartingPosition(int offsetLine, int offsetIndex) {
checkState(offsetLine >= 0);
checkState(offsetIndex >= 0);
offsetPosition = new FilePosition(offsetLine, offsetIndex);
} |
python | def handle_request(self, msg):
"""Dispatch a request message to the appropriate method.
Parameters
----------
msg : Message object
The request message to dispatch.
"""
method = self.__class__.unhandled_request
if msg.name in self._request_handlers:
... |
python | def _clip_shape(shape, buffer_padded_bounds, is_clipped, clip_factor):
"""
Return the shape clipped to a clip_factor expansion of buffer_padded_bounds
if is_clipped is True. Otherwise return the original shape, or None if the
shape does not intersect buffer_padded_bounds at all.
This is used to red... |
java | public static AssociateDescription<TupleDesc_F64> kdtree( @Nullable ConfigAssociateNearestNeighbor configNN ,
int dimension, int maxNodesSearched ) {
NearestNeighbor nn = FactoryNearestNeighbor.kdtree(new KdTreeTuple_F64(dimension),maxNodesSearched);
return associateNearestNeighbor(configNN,nn);
... |
java | public void setAttribute(String arg0, Object arg1) {
// 321485
if (TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.logp(Level.FINE, CLASS_NAME,"setAttribute", "this->"+this+": "+" name --> [" + arg0 + "], value --> [" + arg1 + "]");
}
... |
python | def extract_github_repo_owner_and_name(url):
"""Given an URL, return the repo name and who owns it.
Args:
url (str): The URL to the GitHub repository
Raises:
ValueError: on url that aren't from github
Returns:
str, str: the owner of the repository, the repository name
"""... |
python | def GetAuditLogEntries(offset, now, token):
"""Return all audit log entries between now-offset and now.
Args:
offset: rdfvalue.Duration how far back to look in time
now: rdfvalue.RDFDatetime for current time
token: GRR access token
Yields:
AuditEvents created during the time range
"""
start_t... |
java | public String mapSafely(XAttribute attribute, String mappingName) {
return mapSafely(attribute, mappings.get(mappingName));
} |
java | public static CoreMap getMergedChunk(List<? extends CoreMap> chunkList,
int chunkIndexStart, int chunkIndexEnd,
Map<Class, CoreMapAttributeAggregator> aggregators)
{
CoreMap newChunk = new Annotation("");
for (Map.Entry<Class,C... |
python | def visit_Stmt(self, node):
""" Add new variable definition before the Statement. """
save_defs, self.defs = self.defs or list(), list()
self.generic_visit(node)
new_defs, self.defs = self.defs, save_defs
return new_defs + [node] |
java | public HystrixCollapserProperties getCollapserProperties(HystrixCollapserKey collapserKey, HystrixCollapserProperties.Setter builder) {
return new HystrixPropertiesCollapserDefault(collapserKey, builder);
} |
python | def GetReportDescriptor(cls):
"""Returns plugins' metadata in ApiReportDescriptor."""
if cls.TYPE is None:
raise ValueError("%s.TYPE is unintialized." % cls)
if cls.TITLE is None:
raise ValueError("%s.TITLE is unintialized." % cls)
if cls.SUMMARY is None:
raise ValueError("%s.SUMMARY... |
java | public void callService(String url, String templateName, Object model, XmlHttpResponse result) {
callService(url, templateName, model, result, null);
} |
java | private synchronized int seekCountry(long ipAddress) {
byte[] buf = new byte[2 * MAX_RECORD_LENGTH];
int[] x = new int[2];
int offset = 0;
_check_mtime();
for (int depth = 31; depth >= 0; depth--) {
readNode(buf, x, offset);
if ((ipAddress & (1 << depth))... |
python | def weld_vec_of_struct_to_struct_of_vec(vec_of_structs, weld_types):
"""Create a struct of vectors.
Parameters
----------
vec_of_structs : WeldObject
Encoding a vector of structs.
weld_types : list of WeldType
The Weld types of the arrays in the same order.
Returns
-------
... |
python | def to_record_per_alt(self):
'''Returns list of vcf_records. One per variant
in the ALT column. Does not change INFO/FORMAT etc columns, which
means that they are now broken'''
record_list = []
for alt in self.ALT:
record_list.append(copy.copy(self))
recor... |
python | def put(self, event):
"""Put an object"""
try:
data, schema, user, client = self._get_args(event)
except AttributeError:
return
try:
clientobject = data['obj']
uuid = clientobject['uuid']
except KeyError as e:
self.log... |
java | public void setPermissions(java.util.Collection<String> permissions) {
if (permissions == null) {
this.permissions = null;
return;
}
this.permissions = new com.amazonaws.internal.SdkInternalList<String>(permissions);
} |
python | def user_get(auth=None, **kwargs):
'''
Get a single user
CLI Example:
.. code-block:: bash
salt '*' keystoneng.user_get name=user1
salt '*' keystoneng.user_get name=user1 domain_id=b62e76fbeeff4e8fb77073f591cf211e
salt '*' keystoneng.user_get name=02cffaa173b2460f98e40eda3748d... |
python | def _build_url(self, resource, **kwargs):
# type: (str, **str) -> str
"""Build the correct API url."""
return urljoin(self.api_root, API_PATH[resource].format(**kwargs)) |
java | public NfsCreateResponse create(NfsCreateMode createMode, NfsSetAttributes attributes, byte[] verifier)
throws IOException {
NfsCreateResponse response = getNfs().wrapped_sendCreate(getNfs().makeCreateRequest(createMode,
getParentFile().getFileHandle(), getName(), attributes, verifie... |
java | public T addTableColumn(final Connection _con,
final String _tableName,
final String _columnName,
final ColumnType _columnType,
final String _defaultValue,
final int _length,
... |
java | public final static String getHeaderIgnoreCase(HttpServletRequest request, String nameIgnoreCase) {
Enumeration<String> names = request.getHeaderNames();
String name = null;
while (names.hasMoreElements()) {
name = names.nextElement();
if (name != null && name.equalsIgnoreCase(nameIgnoreCase)) {
r... |
python | def recv(self, filename, dest_file, timeout=None):
"""Retrieve a file from the device into the file-like dest_file."""
transport = DataFilesyncTransport(self.stream)
transport.write_data('RECV', filename, timeout)
for data_msg in transport.read_until_done('DATA', timeout):
dest_file.write(data_msg... |
python | def get_user_activities(self, username, tournament=1):
"""Get user activities (works for all users!).
Args:
username (str): name of the user
tournament (int): ID of the tournament (optional, defaults to 1)
Returns:
list: list of user activities (`dict`)
... |
python | def postprocess_key_for_export(self, key, client_random, server_random,
con_end, read_or_write, req_len):
"""
Postprocess cipher key for EXPORT ciphersuite, i.e. weakens it.
An export key generation example is given in section 6.3.1 of RFC 2246.
See als... |
java | public static <V> Predicate<TaskContext<V>> ifException(Predicate<? super Exception> predicate) {
return ctx -> predicate.test(ctx.getException());
} |
java | public void putPasswordResetSecurityQuestions(final RequestContext requestContext, final List<String> value) {
val flowScope = requestContext.getFlowScope();
flowScope.put("questions", value);
} |
python | def list_to_cells(lst):
'''convert list of cells to notebook form
list should be of the form:
[[list of strings representing python code for cell]]
'''
cells = '"cells": ['
for cell in lst:
to_add = '{"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ... |
python | def gunzip(input_gzip_file, block_size=1024):
"""
Gunzips the input file to the same directory
:param input_gzip_file: File to be gunzipped
:return: path to the gunzipped file
:rtype: str
"""
assert os.path.splitext(input_gzip_file)[1] == '.gz'
assert is_gzipfile(input_gzip_file)
wi... |
python | def update_label(self, name, color, new_name=''):
"""Update the label ``name``.
:param str name: (required), name of the label
:param str color: (required), color code
:param str new_name: (optional), new name of the label
:returns: bool
"""
label = self.label(na... |
python | def get_grade_form_for_create(self, grade_system_id, grade_record_types):
"""Gets the grade form for creating new grades.
A new form should be requested for each create transaction.
arg: grade_system_id (osid.id.Id): the ``Id`` of a
``GradeSystem``
arg: grade_reco... |
python | def sign_tx(self, rawtx, wifs):
"""Sign <rawtx> with given <wifs> as json data.
<wifs>: '["privatekey_in_wif_format", ...]'
"""
tx = deserialize.tx(rawtx)
keys = deserialize.keys(self.testnet, wifs)
tx = control.sign_tx(self.service, self.testnet, tx, keys)
retur... |
python | def full_redraw(self):
"""Perform a full redraw of the UI."""
self.left.draw_statuses(self.statuses, self.selected)
self.right.draw(self.get_selected_status())
self.header.draw(self.user)
self.draw_footer_status() |
python | def get_my_contributions(self, *args, **kwargs):
"""Return a get_content generator of subreddits.
The Subreddits generated are those where the session's user is a
contributor.
The additional parameters are passed directly into
:meth:`.get_content`. Note: the `url` parameter can... |
python | def deepCopyContours(
glyphSet, parent, composite, transformation, specificComponents=None
):
"""Copy contours from component to parent, including nested components.
specificComponent: an optional list of glyph name strings. If not passed or
None, decompose all components of a glyph unconditionally and... |
java | @Override
public CommercePriceEntry[] findByGroupId_PrevAndNext(
long commercePriceEntryId, long groupId,
OrderByComparator<CommercePriceEntry> orderByComparator)
throws NoSuchPriceEntryException {
CommercePriceEntry commercePriceEntry = findByPrimaryKey(commercePriceEntryId);
Session session = null;
try... |
python | def _write_to_file(self, filename, bytesvalue):
"""Write bytesvalue to filename."""
fh, tmp = tempfile.mkstemp()
with os.fdopen(fh, self._flag) as f:
f.write(self._dumps(bytesvalue))
rename(tmp, filename)
os.chmod(filename, self._mode) |
java | public boolean onBackPressed() {
if (subForm != null) {
final boolean shouldDisplayPreviousForm = configuration.allowLogIn() || configuration.allowSignUp();
if (shouldDisplayPreviousForm) {
resetHeaderTitle();
showSignUpTerms(subForm instanceof CustomField... |
java | public FlowLogInformationInner setFlowLogConfiguration(String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) {
return setFlowLogConfigurationWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().last().body();
} |
python | def cli(env, sortby):
"""List all CDN accounts."""
manager = SoftLayer.CDNManager(env.client)
accounts = manager.list_accounts()
table = formatting.Table(['id',
'account_name',
'type',
'created',
... |
java | private static byte[] convertToByteArray(CharSequence charSequence) {
checkNotNull(charSequence);
byte[] byteArray = new byte[charSequence.length() << 1];
for(int i = 0; i < charSequence.length(); i++) {
int bytePosition = i << 1;
byteArray[bytePosition] = (byte) ((charS... |
python | def impute_svd(df, rank=10, convergence_threshold=0.00001, max_iters=200):
"""
Imputes the missing values by using SVD decomposition
Based on the following publication: 'Missing value estimation methods for DNA microarrays' by Troyanskaya et. al.
:param df:The input dataframe that conta... |
java | protected int numFreeEntries() {
int res = 0;
for (int i = 0; i < entries.length; i++) {
Entry entry = entries[i];
if (entry.isEmpty()) {
res++;
}
}
assert (NUMBER_ENTRIES == entries.length);
return res;
} |
python | def max_enrichment(fg_vals, bg_vals, minbg=2):
"""
Computes the maximum enrichment.
Parameters
----------
fg_vals : array_like
The list of values for the positive set.
bg_vals : array_like
The list of values for the negative set.
minbg : int, optional
Minimum n... |
java | public String getPOS() {
if (WordForm_Type.featOkTst && ((WordForm_Type)jcasType).casFeat_POS == null)
jcasType.jcas.throwFeatMissing("POS", "com.digitalpebble.rasp.WordForm");
return jcasType.ll_cas.ll_getStringValue(addr, ((WordForm_Type)jcasType).casFeatCode_POS);} |
java | public boolean computeShiftDirect(DMatrixRMaj A , double alpha) {
SpecializedOps_DDRM.addIdentity(A,B,-alpha);
return computeDirect(B);
} |
python | def getDistrict(self, default=None):
"""Return the Province from the Physical or Postal Address
"""
physical_address = self.getPhysicalAddress().get("district", default)
postal_address = self.getPostalAddress().get("district", default)
return physical_address or postal_address |
python | def get_xpath(stmt, qualified=False, prefix_to_module=False):
"""Gets the XPath of the statement.
Unless qualified=True, does not include prefixes unless the prefix
changes mid-XPath.
qualified will add a prefix to each node.
prefix_to_module will resolve prefixes to module names instead.
F... |
java | public ResultSet executeQuery(ReadContext context, Options.QueryOption... options) {
return context.executeQuery(this, options);
} |
python | def seconds_to_str_fromatter(_format):
"""
Accepted format directives: %i %s %m %h
"""
# check directives are correct
if _format == "%S":
def _fromatter(seconds):
return "{:.2f}".format(seconds)
elif _format == "%I":
def _fromatter(seconds):
ret... |
python | def phone_text_subs():
"""
Gets a dictionary of dictionaries that each contain alphabetic number manifestations mapped to their actual
Number value.
Returns:
dictionary of dictionaries containing Strings mapped to Numbers
"""
Small = {
'zero': 0,
'zer0': 0,
'one': 1,
'two': 2,
'th... |
java | @Override
public T addAsModules(final String... resourceNames) throws IllegalArgumentException {
// Precondition checks
Validate.notNull(resourceNames, "resourceNames must be specified");
// Add each
for (final String resourceName : resourceNames) {
this.addAsModule(reso... |
java | private void initComponents(URL baseurl)
{
documentScroll = new javax.swing.JScrollPane();
//Create the browser canvas
browserCanvas = new BrowserCanvas(docroot, decoder, new java.awt.Dimension(1000, 600), baseurl);
//A simple mouse listener that displays the coordinates c... |
python | def __set_timestamp(self, clock):
"""
If "clock" is None, set the time now.
This function is called self.__init__()
"""
if clock is None:
unix_timestamp = time.mktime(
datetime.datetime.now().utctimetuple()
)
timestamp = int(uni... |
java | public static File touch(String fullFilePath) throws IORuntimeException {
if (fullFilePath == null) {
return null;
}
return touch(file(fullFilePath));
} |
java | public boolean getLastSegment() {
if (SourceDocumentInformation_Type.featOkTst && ((SourceDocumentInformation_Type)jcasType).casFeat_lastSegment == null)
jcasType.jcas.throwFeatMissing("lastSegment", "org.apache.uima.examples.SourceDocumentInformation");
return jcasType.ll_cas.ll_getBooleanValue(addr, ((S... |
java | public void setXBase(Integer newXBase) {
Integer oldXBase = xBase;
xBase = newXBase;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.IID__XBASE, oldXBase, xBase));
} |
java | public void convert(String fromVariable, TypeMirror to) throws IOException, IllegalConversionException
{
TypeMirror from = getLocalType(fromVariable);
if (Typ.isAssignable(from, to))
{
tload(fromVariable);
checkcast(to);
return;
}
... |
python | def updateModel(self, X_all, Y_all, X_new, Y_new):
"""
Updates the model with new observations.
"""
if self.model is None:
self._create_model(X_all, Y_all)
else:
self.model.set_XY(X_all, Y_all)
# WARNING: Even if self.max_iters=0, the hyperparamet... |
python | def setup_lldpad_ports(self):
"""Setup the flows for passing LLDP/VDP frames in OVS. """
# Creating the physical bridge and setting up patch ports is done by
# OpenStack
ovs_bridges = ovs_lib.get_bridges(self.root_helper)
if self.ext_br not in ovs_bridges or self.integ_br not in ... |
python | def ecg_find_peaks(signal, sampling_rate=1000):
"""
Find R peaks indices on the ECG channel.
Parameters
----------
signal : list or ndarray
ECG signal (preferably filtered).
sampling_rate : int
Sampling rate (samples/second).
Returns
----------
rpeaks : list
... |
python | def _map_to_memory(self, stride=1):
r"""Maps results to memory. Will be stored in attribute :attr:`_Y`."""
self._mapping_to_mem_active = True
try:
self._Y = self.get_output(stride=stride)
from pyemma.coordinates.data import DataInMemory
self._Y_source = DataIn... |
python | def cookie_name_check(cookie_name):
""" Check cookie name for validity. Return True if name is valid
:param cookie_name: name to check
:return: bool
"""
cookie_match = WHTTPCookie.cookie_name_non_compliance_re.match(cookie_name.encode('us-ascii'))
return len(cookie_name) > 0 and cookie_match is None |
java | private void inflate() {
((LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.ebm__menu, this, true);
mOverlay = findViewById(R.id.ebm__menu_overlay);
mMidContainer = findViewById(R.id.ebm__menu_middle_container);
mLeftContainer = findViewB... |
python | def routing_feature(app):
"""
Add routing feature
Allows to define application routes un urls.py file and use lazy views.
Additionally enables regular exceptions in route definitions
"""
# enable regex routes
app.url_map.converters['regex'] = RegexConverter
urls = app.name.rsplit('.', 1... |
python | def help(self):
"""Help on Spyder console"""
QMessageBox.about(self, _("Help"),
"""<b>%s</b>
<p><i>%s</i><br> edit foobar.py
<p><i>%s</i><br> xedit foobar.py
<p><i>%s</i><br> run foobar... |
java | public static String fileToString(String fileName, String charsetName) {
return fileToString(new File(fileName), charsetName);
} |
java | public void processUpdates(FacesContext context) {
if (context == null) {
throw new NullPointerException();
}
// Skip processing if our rendered flag is false
if (!isRendered()) {
return;
}
super.processUpdates(context);
try {
... |
java | public String getXAExceptionContents(XAException x) {
StringBuilder xsb = new StringBuilder(200);
Throwable cause = x.getCause();
if (cause != null) {
String EOLN = AdapterUtil.EOLN;
xsb.append(EOLN).append("Caused by ").append(cause.getClass().getName()).append(": ").app... |
java | public int getGoldConfigIdxPred(int factorId) {
VarSet vars = VarSet.getVarsOfType(fgLatPred.getFactor(factorId).getVars(), VarType.PREDICTED);
return goldConfig.getConfigIndexOfSubset(vars);
} |
java | @Override
public Request<DeleteVpnConnectionRouteRequest> getDryRunRequest() {
Request<DeleteVpnConnectionRouteRequest> request = new DeleteVpnConnectionRouteRequestMarshaller().marshall(this);
request.addParameter("DryRun", Boolean.toString(true));
return request;
} |
java | public boolean save(DataOutputStream out)
{
try
{
out.writeInt(size);
for (int i = 0; i < size; i++)
{
out.writeInt(base[i]);
out.writeInt(check[i]);
}
}
catch (Exception e)
{
return f... |
java | @Nonnull
public static List<String> removeEmptyEntries(@Nullable List<String> input) {
if(input==null) {
return Collections.emptyList();
}
Iterable<String> trimmedInputs = Iterables.transform(input, TRIM);
Iterable<String> nonEmptyInputs = Iterables.filter(trimmedInputs, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.