language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def extract_bag_of_words_from_corpus_parallel(corpus, lemmatizing="wordnet"):
"""
This extracts one bag-of-words from a list of strings. The documents are mapped to parallel processes.
Inputs: - corpus: A list of strings.
- lemmatizing: A string containing one of the following: "porter", "snowb... |
java | private void clickAtom() {
try {
String f = "(function(arg) { " + "var text = " + IosAtoms.CLICK + "(arg);" + "return text;})";
JSONArray args = new JSONArray();
args.put(new JSONObject().put("objectId", getRemoteObject().getId()));
JSONObject response = getInspectorResponse(f, args, true)... |
python | def get_identifier_input(self, identifier_data):
"""Convert the various formats of input identifier_data into
the proper json format expected by the ApiClient fetch method,
which is a list of dicts."""
identifier_input = []
if isinstance(identifier_data, list) and len(identifie... |
python | def directions(ctx, features, profile, alternatives,
geometries, overview, steps, continue_straight,
waypoint_snapping, annotations, language, output):
"""The Mapbox Directions API will show you how to get
where you're going.
mapbox directions "[0, 0]" "[1, 1]"
... |
java | String createQuery(CouchDBQueryInterpreter interpreter, EntityMetadata m, StringBuilder q, String _id)
throws URISyntaxException, UnsupportedEncodingException, IOException, ClientProtocolException
{
if (interpreter.isAggregation())
{
_id = CouchDBConstants.URL_SEPARATOR + m.g... |
python | def list_all_brands(cls, **kwargs):
"""List Brands
Return a list of Brands
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.list_all_brands(async=True)
>>> result = thread.get()
... |
python | def default(session):
"""Default unit test session.
This is intended to be run **without** an interpreter set, so
that the current ``python`` (on the ``PATH``) or the version of
Python corresponding to the ``nox`` binary the ``PATH`` can
run the tests.
"""
# Install all test dependencies, t... |
python | def page_changed(self, index):
"""Slot for when tab changes in the stacked widget changes.
:param index: Index of the now active tab.
:type index: int
"""
if index == 0: # profile edit page
for item in self.resource_editing_buttons:
item.hide()
... |
java | public static Matcher<ExpressionTree> nonNullLiteral() {
return new Matcher<ExpressionTree>() {
@Override
public boolean matches(ExpressionTree tree, VisitorState state) {
switch (tree.getKind()) {
case MEMBER_SELECT:
return ((MemberSelectTree) tree).getIdentifier().content... |
python | def sample_forward_transitions(self, batch_size, batch_info, forward_steps: int,
discount_factor: float) -> Transitions:
"""
Sample transitions from replay buffer with _forward steps_.
That is, instead of getting a transition s_t -> s_t+1 with reward r,
... |
python | def acquire(graftm_package_path):
'''Acquire a new graftm Package
Parameters
----------
graftm_output_path: str
path to base directory of graftm
'''
contents_hash = json.load(
open(
... |
java | private Address waitForReplicaAddress(int replica, IPartition partition, int backupCount) {
int tryCount = RETRY_COUNT;
Address replicaAddress = null;
while (replicaAddress == null && partitionService.getMaxAllowedBackupCount() >= backupCount && tryCount-- > 0) {
sleep();
... |
java | public static responderpolicylabel_stats get(nitro_service service, String labelname) throws Exception{
responderpolicylabel_stats obj = new responderpolicylabel_stats();
obj.set_labelname(labelname);
responderpolicylabel_stats response = (responderpolicylabel_stats) obj.stat_resource(service);
return response;... |
python | def WriteTaskStart(self):
"""Writes task start information.
Raises:
IOError: if the storage type is not supported or
when the storage writer is closed.
OSError: if the storage type is not supported or
when the storage writer is closed.
"""
self._RaiseIfNotWritable()
... |
python | def isexec(self, mode=stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH):
"""
isexec:
@rtype: bool
@return: Indicates whether the path points to a file or folder
which has the executable flag set.
Note that on systems which do not support executables flags the
result m... |
python | def one(iterable, too_short=None, too_long=None):
"""Return the first item from *iterable*, which is expected to contain only
that item. Raise an exception if *iterable* is empty or has more than one
item.
:func:`one` is useful for ensuring that an iterable contains only one item.
For example, it c... |
python | def describe_ingredient(self):
""" apple. tart apple with vinegar. """
resp = random.choice(ingredients)
if random.random() < .2:
resp = random.choice(foodqualities) + " " + resp
if random.random() < .2:
resp += " with " + self.describe_additive()
return r... |
python | def _get_dependencies_from_cache(ireq):
"""Retrieves dependencies for the requirement from the dependency cache.
"""
if os.environ.get("PASSA_IGNORE_LOCAL_CACHE"):
return
if ireq.editable:
return
try:
deps = DEPENDENCY_CACHE[ireq]
pyrq = REQUIRES_PYTHON_CACHE[ireq]
... |
java | public void code(Cache<G> cache, G xgen) throws APIException, IOException {
code(null, null,cache,xgen);
} |
java | public void addRoute(DirectionsRoute directionsRoute) {
List<DirectionsRoute> routes = new ArrayList<>();
routes.add(directionsRoute);
addRoutes(routes);
} |
java | public List<Discussion> getSnippetDiscussions(Object projectIdOrPath, Integer snippetId) throws GitLabApiException {
Pager<Discussion> pager = getSnippetDiscussionsPager(projectIdOrPath, snippetId, getDefaultPerPage());
return (pager.all());
} |
java | @SuppressWarnings("unchecked")
public <A extends Annotation> FieldProcessor<A> getProcessor(final Class<A> annoClass) {
ArgUtils.notNull(annoClass, "annoClass");
return (FieldProcessor<A>) pocessorMap.get(annoClass);
} |
python | def _get_fillcolor(resource_type, properties, known_sg=[], open_sg=[]):
"""Determine fillcolor for resources (public ones in this case)
"""
fillcolor = None
# check security groups
if 'SecurityGroups' in properties:
# check for external security groups
for sg in properties['SecurityG... |
python | def getChirality(self, order):
"""(order)->what is the chirality of a given order of
atoms?"""
indices = tuple([self._initialOrder.index(atom.handle)
for atom in order])
same = chiral_table[indices]
if same:
return self.chirality
else:... |
python | def read_metadata(sdmfile, scan=0, bdfdir=None):
""" Parses XML files to get scan and source information.
Returns tuple of dicts (scan, source).
bdfdir is optional location to look for bdfs, will try that first, then ASDMBinary subdirectory.
bdfstr in scan dict helps find BDFs with read_bdf (with sp... |
python | def _buildGraph(self):
"""
transforms the triples list into a proper rdflib graph
(which can be used later for querying)
"""
for n in self.namespaces:
self.rdflib_graph.bind(n[0], rdflib.Namespace(n[1]))
if self.triples:
for terzetto in self.triple... |
python | def compare_container_networks(first, second):
'''
.. versionadded:: 2018.3.0
Returns the differences between two containers' networks. When a network is
only present one of the two containers, that network's diff will simply be
represented with ``True`` for the side of the diff in which the networ... |
python | def delete_refund(self, refund_id):
"""Deletes an existing refund transaction."""
request = self._delete('transactions/refunds/' + str(refund_id))
return self.responder(request) |
python | def keys(self):
"""
On Python 2.7+:
D.keys() -> a set-like object providing a view on D's keys
On Python 2.6:
D.keys() -> an iterator over D's keys
"""
if ver == (2, 7):
return self.viewkeys()
elif ver == (2, 6):
return self... |
python | def recommendations(access_token, payload): # (Legacy)
'''
Name: recommendations
Parameters: access_token, payload
Return: dictionary
'''
headers = {'Authorization': 'Bearer ' + str(access_token)}
request = requests.post(recommendations_url, json=payload, headers=headers)
if request.status_code == 200:
metad... |
java | public DateStart setDateStart(Date dateStart, boolean hasTime) {
DateStart prop = (dateStart == null) ? null : new DateStart(dateStart, hasTime);
setDateStart(prop);
return prop;
} |
python | def getChemicalPotential(self, solution):
"""Call solver in order to calculate chemical potential.
"""
if isinstance(solution, Solution):
solution = solution.getSolution()
self.mu = self.solver.chemicalPotential(solution)
return self.mu |
java | public TResult queryForLike(String fieldName, ColumnValue value) {
String where = buildWhereLike(fieldName, value);
String[] whereArgs = buildWhereArgs(value);
TResult result = userDb.query(getTableName(), table.getColumnNames(),
where, whereArgs, null, null, null);
prepareResult(result);
return result;
... |
java | @Override
public void visitCode(Code obj) {
Method m = getMethod();
if (overloadedMethods.contains(m)) {
return;
}
int aFlags = m.getAccessFlags();
if ((((aFlags & Const.ACC_PRIVATE) != 0) || ((aFlags & Const.ACC_STATIC) != 0)) && ((aFlags & Const.ACC_SYNTHETIC)... |
python | def compute(self, activeInput, predictedActiveInput, learn):
"""
Computes one cycle of the Union Temporal Pooler algorithm.
@param activeInput (numpy array) A numpy array of 0's and 1's that comprises the input to the union pooler
@param predictedActiveInput (numpy array) A numpy array of 0... |
java | public TranslateTextRequest withTerminologyNames(String... terminologyNames) {
if (this.terminologyNames == null) {
setTerminologyNames(new java.util.ArrayList<String>(terminologyNames.length));
}
for (String ele : terminologyNames) {
this.terminologyNames.add(ele);
... |
python | def calcTransM(self, gamma=None, type='simu'):
"""calculate transport matrix
:param gamma: electron energy measured by mc^2
:return: transport matrix
:rtype: numpy array
"""
sconf = self.getConfig(type=type)
l = float(sconf['l'])
k1 = self.getK1(type='ctr... |
java | public void initialize(PyramidDiscrete<I> image ) {
if( previousDerivX == null || previousDerivX.length != image.getNumLayers()
|| previousImage.getInputWidth() != image.getInputWidth() || previousImage.getInputHeight() != image.getInputHeight() ) {
declareDataStructures(image);
}
for( int i = 0; i < imag... |
java | public Observable<ServiceResponseWithHeaders<Page<PoolNodeCounts>, AccountListPoolNodeCountsHeaders>> listPoolNodeCountsWithServiceResponseAsync(final AccountListPoolNodeCountsOptions accountListPoolNodeCountsOptions) {
return listPoolNodeCountsSinglePageAsync(accountListPoolNodeCountsOptions)
.conc... |
java | private int[] range(int start, int end) {
if (rangeList == null) {
rangeList = new int[] { start, end+1, HIGH };
} else {
rangeList[0] = start;
rangeList[1] = end+1;
}
return rangeList;
} |
java | @Override
public boolean isValidDataBase() {
int version = getPoiFileInfo().version;
// Check for table names
// TODO Is it necessary to get the tables meta data as well?
int numTables = 0;
Cursor cursor = null;
try {
String sql = version < 2 ? DbConstant... |
java | String mailboxNameFrom(final String candidateMailboxName) {
if (candidateMailboxName == null) {
return findDefaultMailboxName();
} else if (mailboxProviderKeeper.isValidMailboxName(candidateMailboxName)) {
return candidateMailboxName;
} else {
return findDefaultMailboxName();
}
} |
java | public String getDescription() {
StringBuilder builder = new StringBuilder("class path resource [");
if (clazz != null) {
builder.append(GrailsResourceUtils.classPackageAsResourcePath(clazz));
builder.append('/');
}
builder.append(path);
builder.append('... |
python | def process_corpus_online(self, corpus, output_path, frame_size=400, hop_size=160,
chunk_size=1, buffer_size=5760000):
"""
Process all utterances of the given corpus and save the processed features in a feature-container.
The utterances are processed in **online** m... |
java | public static char[] encode(final byte[] input, final int iLen) {
int oDataLen = (iLen * 4 + 2) / 3; // output length without padding
int oLen = ((iLen + 2) / 3) * 4; // output length including padding
char[] out = new char[oLen];
int ip = 0;
int op = 0;
while (ip < iLen) {
int i0 = input[ip++] & 0xff;
... |
java | public static String constructFileName(String filenamePrefix, String extension, long recordCount) {
Preconditions.checkArgument(
filenamePrefix.equals(M_OUTPUT_FILE_PREFIX) || filenamePrefix.equals(MR_OUTPUT_FILE_PREFIX),
String.format("%s is not a supported prefix, which should be %s, or %s.", file... |
java | static long getTotalUsage(Map<String, MemoryUsage> usages) {
long sum = 0L;
for (Map.Entry<String, MemoryUsage> e : usages.entrySet()) {
sum += e.getValue().getUsed();
}
return sum;
} |
python | def _get_stem_upper_boundary(self, timeperiod=None):
"""
:param timeperiod: optional parameter, applicable for QUALIFIER_DAILY qualifier only
:return: upper boundary for dictionary's time_qualifier
"""
if self.time_qualifier == QUALIFIER_HOURLY:
upper_boundary = 23
... |
python | def features(self):
"""
lazy fetch and cache features
"""
if self._features is None:
metadata = self.metadata()
if "features" in metadata:
self._features = metadata["features"]
else:
self._features = []
return se... |
python | def hash_files(method, *files):
"""
Calculate the hexadecimal digest of one or more local files.
:param method: The hash method (a string, given to :func:`hashlib.new()`).
:param files: The pathname(s) of file(s) to hash (zero or more strings).
:returns: The calculated hex digest (a string).
""... |
java | private Object execute(Class<?> service, Object actor, RequestDTO requestDTO) {
return invoke(service, actor, requestDTO.getMethod(), requestDTO.getParamterTypes(),
requestDTO.getParameters(), requestDTO.getAppId(), requestDTO.getToken());
} |
python | def _catalog_to_cells_neighbor(catalog, radius, order):
"""
Convert a catalog to a list of cells.
This is the original implementation of the `catalog_to_cells`
function which does not make use of the Healpy `query_disc` routine.
Note: this function uses a simple flood-filling approach and is
v... |
python | def l2c(l):
"unsigned long to char[4]"
c = []
c.append(int(l & U32(0xFF)))
c.append(int((l >> 8) & U32(0xFF)))
c.append(int((l >> 16) & U32(0xFF)))
c.append(int((l >> 24) & U32(0xFF)))
return c |
python | def validate_request_method_to_operation(request_method, path_definition):
"""
Given a request method, validate that the request method is valid for the
api path.
If so, return the operation definition related to this request method.
"""
try:
operation_definition = path_definition[reque... |
java | public Object get(int indexValue)
{
Object result = null;
TransactionLocalStorage txStorage = (TransactionLocalStorage) perTransactionStorage.get(MithraManagerProvider.getMithraManager().zGetCurrentTransactionWithNoCheck());
Index perThreadAdded = txStorage == null ? null : txStorage.add... |
python | def _update_axes_color(self, color):
"""Internal helper to set the axes label color"""
prop_x = self.axes_actor.GetXAxisCaptionActor2D().GetCaptionTextProperty()
prop_y = self.axes_actor.GetYAxisCaptionActor2D().GetCaptionTextProperty()
prop_z = self.axes_actor.GetZAxisCaptionActor2D().G... |
python | def trusted_permission(f):
"""Access only by D1 infrastructure."""
@functools.wraps(f)
def wrapper(request, *args, **kwargs):
trusted(request)
return f(request, *args, **kwargs)
return wrapper |
python | def depth_september_average_ground_temperature(self, value=None):
"""Corresponds to IDD Field
`depth_september_average_ground_temperature`
Args:
value (float): value for IDD Field `depth_september_average_ground_temperature`
Unit: C
if `value` is None... |
java | void captureValues(@NonNull ViewGroup sceneRoot, boolean start) {
clearValues(start);
if ((mTargetIds.size() > 0 || mTargets.size() > 0)
&& (mTargetNames == null || mTargetNames.isEmpty())
&& (mTargetTypes == null || mTargetTypes.isEmpty())) {
for (int i = 0; ... |
java | public void marshall(LabelingJobResourceConfig labelingJobResourceConfig, ProtocolMarshaller protocolMarshaller) {
if (labelingJobResourceConfig == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(labe... |
java | public int deleteProperty(String property) {
int count = 0;
for (String geoPackage : propertiesMap.keySet()) {
if (deleteProperty(geoPackage, property)) {
count++;
}
}
return count;
} |
java | @SuppressWarnings("UnusedReturnValue")
public static String webread(URL url) throws IOException {
StringBuilder result = new StringBuilder();
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
BufferedReader rd = new BufferedReader(new In... |
java | private String calculateHttpEncoding(final String cTMime, final String cTEnc, final String bomEnc, final String xmlGuessEnc, final String xmlEnc,
final InputStream is, final boolean lenient) throws IOException {
String encoding;
if (lenient && xmlEnc != null) {
encoding = xmlEnc;... |
java | @Override
public void mergeSaved(InjectionBinding<JMSDestinationDefinition> injectionBinding) throws InjectionException {
JMSDestinationDefinitionInjectionBinding jmsDestDefObjectBinding = (JMSDestinationDefinitionInjectionBinding) injectionBinding;
mergeSavedValue(name, jmsDestDefObjectBinding.nam... |
python | def seqrecord(self, allele, locus):
"""
Gets the Annotation from the found sequence
:return: The Annotation from the found sequence
:rtype: Annotation
"""
try:
db = self.server[self.dbversion + "_" + locus]
except:
self.logger.error("The d... |
java | protected void compareText(Text control, Text test,
DifferenceListener listener)
throws DifferenceFoundException {
compareText((CharacterData) control, (CharacterData) test, listener);
} |
python | def replace_certificate_signing_request(self, name, body, **kwargs):
"""
replace the specified CertificateSigningRequest
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.replace_certificate_... |
java | public B tls(SslContext sslContext) {
this.sslContext = VirtualHost.validateSslContext(requireNonNull(sslContext, "sslContext"));
return self();
} |
python | def setColor( self, name, color, colorGroup = None ):
"""
Sets the color for the inputed name in the given color group. If no \
specific color group is found then the color will be set for all \
color groups.
:param name | <str>
color ... |
java | public static <T> T checkNotNull(T obj, String name) {
if (obj == null) {
String msg = String.format("parameter '%s' cannot be null", name);
throw new NullPointerException(msg);
}
return obj;
} |
java | @Override
public final void onGenericTag(PdfWriter writer, Document document, final Rectangle rect, String genericTag) {
// if (log.isLoggable(Level.FINE)) {
// Collection<Advanced> av = doOnGenericTag.get(genericTag);
// String data = null;
// if (av!=null) {
// for (Advanced... |
java | public static void logVersion(){
String[] lines = {
"Apache HTTPD & NGINX Access log parsing made easy",
"For more information: https://github.com/nielsbasjes/logparser",
"Copyright (C) 2011-2019 Niels Basjes - License Apache 2.0"
};
String version = getVersio... |
python | async def async_get_current_program(channel, no_cache=False):
'''
Get the current program info
'''
chan = await async_determine_channel(channel)
guide = await async_get_program_guide(chan, no_cache)
if not guide:
_LOGGER.warning('Could not retrieve TV program for %s', channel)
re... |
python | def is_following(self, user, instance, flag=''):
"""
Check if a user is following an instance.
"""
if not user or user.is_anonymous:
return False
queryset = self.for_object(instance)
if flag:
queryset = queryset.filter(flag=flag)
return qu... |
python | def create_grid_menv(addr, slave_addrs, grid_size, origin, logger=logger,
extra_ser=None):
'''
:param addr: Address of the multi-environment
:param slave_addrs: Addresses for the slave environments.
:param tuple grid_size: Grid size for each slave environment, e.g. (4, 4)
:param... |
java | public final Task<T,TError> start() {
if (this instanceof Done) return this;
if (cancelling != null) result.cancelled(cancelling);
synchronized (this) {
if (result.isCancelled()) return this;
if (status != Task.STATUS_NOT_STARTED) {
if (status >= Task.STATUS_DONE)
throw new RuntimeException(... |
python | def all_true(a, indexes):
'''Find which vectors have all-true elements
Given an array, "a" and indexes into the first elements of vectors
within that array, return an array where each element is true if
all elements of the corresponding vector are true.
Example: a = [ 1,1,0,1,1,1,1], index... |
python | def get_device(name, device_dict, loader, resource_dict):
"""Get a device from a device dictionary.
:param name: name of the device
:param device_dict: device dictionary
:rtype: Device
"""
device = Device(name, device_dict.get('delimiter', ';').encode('utf-8'))
device_dict = get_bases(devi... |
java | public ImageVectorizationResult getImageVectorizationResultWait() throws Exception {
try {
ImageVectorizationResult imvr = pool.take().get();
return imvr;
} catch (Exception e) {
throw e;
} finally {
// in any case (Exception or not) the numPendingTask should be reduced
numPendingTasks--;
... |
python | def describe_keypairs(self, xml_bytes):
"""Parse the XML returned by the C{DescribeKeyPairs} function.
@param xml_bytes: XML bytes with a C{DescribeKeyPairsResponse} root
element.
@return: a C{list} of L{Keypair}.
"""
results = []
root = XML(xml_bytes)
... |
python | def json2sql(raw_json=None, **definition): # pylint: disable=too-many-branches
"""Convert raw dictionary, JSON/YAML to SQL statement.
:param raw_json: raw JSON/YAML or file to convert to SQL statement
:type raw_json: str or file
:return: raw SQL statement
:rtype: str
"""
if raw_json and de... |
python | def get_pd_by_id(self, id):
"""
Get ScaleIO ProtectionDomain object by its id
:param name: ID of ProtectionDomain
:return: ScaleIO ProctectionDomain object
:raise KeyError: No ProtectionDomain with specified name found
:rtype: ProtectionDomain object
"""
f... |
java | public InputStream fetch(URL url) throws DownloadFailedException {
if ("file".equalsIgnoreCase(url.getProtocol())) {
final File file;
try {
file = new File(url.toURI());
} catch (URISyntaxException ex) {
final String msg = format("Download fail... |
java | public void setDayFormatterContentDescription(DayFormatter formatter) {
this.contentDescriptionFormatter = formatter == null ? this.formatter : formatter;
setContentDescription(getContentDescriptionLabel());
} |
java | public void marshall(SearchExpression searchExpression, ProtocolMarshaller protocolMarshaller) {
if (searchExpression == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(searchExpression.getFilters(), ... |
java | protected static DeliveryStreamDescription describeDeliveryStream(String deliveryStreamName) {
DescribeDeliveryStreamRequest describeDeliveryStreamRequest = new DescribeDeliveryStreamRequest();
describeDeliveryStreamRequest.withDeliveryStreamName(deliveryStreamName);
DescribeDeliveryStreamResult... |
java | private StorageDirView getCandidateDirInTier(StorageTierView tierView, long blockSize) {
StorageDirView candidateDirView = null;
long maxFreeBytes = blockSize - 1;
for (StorageDirView dirView : tierView.getDirViews()) {
if (dirView.getAvailableBytes() > maxFreeBytes) {
maxFreeBytes = dirView.g... |
python | def upgrade_websocket(self, environ, start_response):
"""
Attempt to upgrade the socket environ['wsgi.input'] into a websocket enabled connection.
"""
websocket_version = environ.get('HTTP_SEC_WEBSOCKET_VERSION', '')
if not websocket_version:
raise UpgradeRequiredErro... |
java | @Nullable
public String getErrorText (@Nonnull final Locale aContentLocale)
{
return m_eError == null ? null : m_eError.getDisplayTextWithArgs (aContentLocale, (Object []) m_aErrorParams);
} |
python | def evaluate(self):
""" create and return the numexpr condition and filter """
try:
self.condition = self.terms.prune(ConditionBinOp)
except AttributeError:
raise ValueError("cannot process expression [{expr}], [{slf}] "
"is not a valid condi... |
java | public Resource getResource(String path) {
if (hasContext()) {
return context.getResource(path);
}
return getContext().getResource(getContextPath() + '/' + path);
} |
java | private JdbcTemplateProxy getProxy(){
if(_proxy == null){
_proxy = new JdbcTemplateProxy();
_proxy.setJdbcTemplate(jdbcTemplate);
}
return _proxy;
} |
python | async def get_authenticated_user(
self, http_client: httpclient.AsyncHTTPClient = None
) -> Dict[str, Any]:
"""Fetches the authenticated user data upon redirect.
This method should be called by the handler that receives the
redirect from the `authenticate_redirect()` method (which i... |
java | private List<Integer> calculateRowsToFilter(DataView dataView, FilterQuery filterQuery, DataSchema schema) {
JsArray<JavaScriptObject> propertiesJsArray = convertToColumnIndexAndValueArray(filterQuery, schema);
JsArrayInteger jsArrayInteger = getFilteredRows(dataView, propertiesJsArray);
return ... |
python | def _carbon(host, port):
'''
Context manager to ensure the clean creation and destruction of a socket.
host
The IP or hostname of the carbon server
port
The port that carbon is listening on
'''
carbon_sock = None
try:
carbon_sock = socket.socket(socket.AF_INET, sock... |
java | public void marshall(ListAssociationsForLicenseConfigurationRequest listAssociationsForLicenseConfigurationRequest, ProtocolMarshaller protocolMarshaller) {
if (listAssociationsForLicenseConfigurationRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
... |
python | def save(self, *args, **kwargs):
"""
custom save method to send email and push notification
"""
created = self.pk is None
# save notification to database only if user settings allow it
if self.check_user_settings(medium='web'):
super(Notification, self).save(... |
python | def junos_call(fun, *args, **kwargs):
'''
.. versionadded:: 2019.2.0
Execute an arbitrary function from the
:mod:`junos execution module <salt.module.junos>`. To check what ``args``
and ``kwargs`` you must send to the function, please consult the appropriate
documentation.
fun
The ... |
java | public Boolean deletePrivilege(String id) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
cleanError();
prepareToken();
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
OAuthClient oAuthClient = new OAuthClient(httpClient);
URIBuilder url = new URIBuilder(... |
java | public static CommerceTaxMethod remove(long commerceTaxMethodId)
throws com.liferay.commerce.tax.exception.NoSuchTaxMethodException {
return getPersistence().remove(commerceTaxMethodId);
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.