language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def where_has(self, relation, extra, operator='>=', count=1):
"""
Add a relationship count condition to the query with where clauses.
:param relation: The relation to count
:type relation: str
:param extra: The extra query
:type extra: Builder or callable
:para... |
java | @RequestMapping(value = "/api/profile/{profileIdentifier}/clients/{clientUUID}", method = RequestMethod.POST)
public
@ResponseBody
HashMap<String, Object> updateClient(Model model,
@PathVariable("profileIdentifier") String profileIdentifier,
... |
java | private void setLocation(WebElement webElement, WebView webView, int x, int y, int width, int height ){
float scale = webView.getScale();
int[] locationOfWebViewXY = new int[2];
webView.getLocationOnScreen(locationOfWebViewXY);
int locationX = (int) (locationOfWebViewXY[0] + (x + (Math.floor(width / 2))) * sca... |
python | def param_set(name, value, retries=3):
'''set a parameter'''
name = name.upper()
return mpstate.mav_param.mavset(mpstate.master(), name, value, retries=retries) |
java | public boolean ready() {
for (VertxFileUpload file : files) {
if (file.getErrorIfAny() != null) {
return false;
}
}
String contentType = request.headers().get(HeaderNames.CONTENT_TYPE);
if (contentType != null) {
contentType = HttpUtil... |
java | public List<CorporationContactsLabelsResponse> getCorporationsCorporationIdContactsLabels(Integer corporationId,
String datasource, String ifNoneMatch, String token) throws ApiException {
ApiResponse<List<CorporationContactsLabelsResponse>> resp = getCorporationsCorporationIdContactsLabelsWithHttpIn... |
python | def _teardown_redundancy_router_gw_connectivity(self, context, router,
router_db,
plugging_driver):
"""To be called in update_router() if the router gateway is to change
BEFORE router has been updated... |
java | private Optional<String> tryGerritHttpFormAuth(HttpClientBuilder client, HttpContext httpContext) throws IOException, HttpStatusException {
if (!authData.isLoginAndPasswordAvailable()) {
return Optional.absent();
}
String loginUrl = authData.getHost() + "/login/";
HttpPost me... |
java | public void loadXmlConfiguration() throws SAXException, IOException {
URL baseUrl = m_baseFolder.toURI().toURL();
if (LOG.isDebugEnabled()) {
LOG.debug(Messages.get().getBundle().key(Messages.LOG_BASE_URL_1, baseUrl));
}
// first load the base configuration
loadXmlC... |
java | public static void tracePostInvokeBegins(EJSDeployedSupport s,
EJSWrapperBase wrapper)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
StringBuffer sbuf = new StringBuffer();
sbuf
.... |
python | def _filter_execs(self, isSubroutine):
"""Filters the executables in the dictionary by their type."""
result = {}
for key in self.executables:
if (isinstance(self.executables[key], Subroutine) and isSubroutine) or \
(isinstance(self.executables[key], Function) and not ... |
java | public final VoltTableRow fetchRow(int index) {
assert(verifyTableInvariants());
// check bounds
if ((index < 0) || (index >= m_rowCount)) {
throw new IndexOutOfBoundsException("index = " + index + "; rows = " + m_rowCount);
}
// if no memoized value or looking in f... |
java | public static <T> double seed(smile.math.distance.Distance<T> distance, T[] data, T[] medoids, int[] y, double[] d) {
int n = data.length;
int k = medoids.length;
T medoid = data[Math.randomInt(n)];
medoids[0] = medoid;
Arrays.fill(d, Double.MAX_VALUE);
// pick the next... |
java | public static ManagedChannel createNettyChannel(String host,
BigtableOptions options, ClientInterceptor ... interceptors) throws SSLException {
LOG.info("Creating new channel for %s", host);
if (LOG.getLog().isDebugEnabled()) {
LOG.debug(Throwables.getStackTraceAsString(new Throwable()));
}
... |
python | def add_instance(self, name, properties):
# type: (str, dict) -> None
"""
Stores the description of a component instance. The given properties
are stored as is.
:param name: Instance name
:param properties: Instance properties
:raise NameError: Already known inst... |
python | def parse_atoms(self):
'''All ATOM lines are parsed even though only one per residue needs to be parsed. The reason for parsing all the
lines is just to sanity-checks that the ATOMs within one residue are consistent with each other.'''
atom_site_header_tag = self.main_tag.getElementsByTagNam... |
java | private ResponseEntity<Object> translateState(boolean selectedTemplateUpdated) {
if (selectedTemplateUpdated) {
return new ResponseEntity<>("updated", HttpStatus.OK);
} else {
return new ResponseEntity<>(HttpStatus.NOT_MODIFIED);
}
} |
python | def MPTfileCSV(file_or_path):
"""Simple function to open MPT files as csv.DictReader objects
Checks for the correct headings, skips any comments and returns a
csv.DictReader object and a list of comments
"""
if isinstance(file_or_path, str):
mpt_file = open(file_or_path, 'r')
else:
... |
java | public Yytoken yylex() throws java.io.IOException, ParseException {
int zzInput;
int zzAction;
// cached fields:
int zzCurrentPosL;
int zzMarkedPosL;
int zzEndReadL = zzEndRead;
char [] zzBufferL = zzBuffer;
char [] zzCMapL = ZZ_CMAP;
int [] zzTransL = ZZ_TRANS;
int [] zzRowMap... |
java | public static long parseDuration(Object configAlias, String propertyKey, Object obj, long defaultValue) {
return parseDuration(configAlias, propertyKey, obj, defaultValue, TimeUnit.MILLISECONDS);
} |
java | public MultiPoint fromTransferObject(MultiPointTo input, CrsId crsId) {
if (input == null) { return null; }
crsId = getCrsId(input, crsId);
isValid(input);
Point[] points = new Point[input.getCoordinates().length];
for (int i = 0; i < points.length; i++) {
points[i]... |
java | void materialize() {
// already materialized?
if (cachefill < 0) {
return;
}
// Compute minimum and maximum
double min = Double.MAX_VALUE, max = Double.MIN_VALUE;
for (int i = 0; i < cachefill; i++) {
min = Math.min(min, cachec[i]);
max = Math.max(max, cachec[i]);
}
// ... |
python | def y(self):
"""
Returns a dictionary with all the current values for the Y of the grid.
Keys for the dictionary: property, min, max, step, base, expression
Types: property=str, min=float, max=float, step=float, base=float, expression=str
:return: the dictionary with the paramet... |
java | public final TrmFirstContactMessageType getMessageType() {
/* Get the int value and get the corresponding TrmFirstContactMessageType to return */
int mType = jmo.getIntField(TrmFirstContactAccess.MESSAGETYPE);
return TrmFirstContactMessageType.getTrmFirstContactMessageType(mType);
} |
java | public VirtualNetworkGatewayInner getByResourceGroup(String resourceGroupName, String virtualNetworkGatewayName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body();
} |
java | @Override
protected HylaFAXClient createResourceImpl()
{
HylaFAXClient client=null;
try
{
//create new instance
client=this.createHylaFAXClient();
//open host
client.open(this.host,this.port);
//set use... |
java | public final void entryRuleOpAdd() throws RecognitionException {
try {
// InternalXbase.g:434:1: ( ruleOpAdd EOF )
// InternalXbase.g:435:1: ruleOpAdd EOF
{
if ( state.backtracking==0 ) {
before(grammarAccess.getOpAddRule());
}
... |
java | private static double get_angle(final int p1,
final int p2) {
int delta_x, delta_y;
double ret = 0.0;
/*
* Calculate (x2 - x1) and (y2 - y1). The points are passed in the form
* x1y1 and x2y2. get_x() and get_y() are passed these points and r... |
java | public Observable<Page<DetectorDefinitionInner>> getSiteDetectorNextAsync(final String nextPageLink) {
return getSiteDetectorNextWithServiceResponseAsync(nextPageLink)
.map(new Func1<ServiceResponse<Page<DetectorDefinitionInner>>, Page<DetectorDefinitionInner>>() {
@Override
... |
python | def enrich_fields(cls, fields, eitem):
"""Enrich the fields property of an issue.
Loops through al properties in issue['fields'],
using those that are relevant to enrich eitem with new properties.
Those properties are user defined, depending on options
configured in Jira. For ex... |
java | public static File[] getLogFiles(File[] logDirList,long snapshotZxid) {
List<File> files = Util.sortDataDir(logDirList, "log", true);
long logZxid = 0;
// Find the log file that starts before or at the same time as the
// zxid of the snapshot
for (File f : files) {
lo... |
java | private Point2d horizontalOffset(Point2d[] points, Turn[] turns, Projection projection) {
// Haworth must currently be drawn vertically, I have seen them drawn
// slanted but it's difficult to determine which way the projection
// is relative
if (projection != Projection.Chair)
... |
java | @Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AfplibPackage.TEXT_FIDELITY__STP_TXT_EX:
return STP_TXT_EX_EDEFAULT == null ? stpTxtEx != null : !STP_TXT_EX_EDEFAULT.equals(stpTxtEx);
case AfplibPackage.TEXT_FIDELITY__REP_TXT_EX:
return REP_TXT_EX_EDEFAULT == null ? repTxtEx ... |
java | public String interpolate() {
getValues();
if (definition == null) {
return "";
}
int variableStart = definition.indexOf("{");
if (variableStart < 0) {
return definition;
}
int index = 0;
int variableEnd = 0;
StringBuilder... |
java | public Map<String, String> toMetaData() {
Map<String, String> metaData = new HashMap<String, String>();
metaData.put(META_KEY_ID, id);
return metaData;
} |
java | public final String prn(final Map<String, Object> pAddParam,
final BigDecimal pVal) {
return this.srvNumberToString.print(pVal.toString(),
(String) pAddParam.get("decSepv"),
(String) pAddParam.get("decGrSepv"),
(Integer) pAddParam.get("reportDp"),
(Integer) pAddParam.get("dig... |
python | def get_address_transactions(self, account_id, address_id, **params):
"""https://developers.coinbase.com/api/v2#list-address39s-transactions"""
response = self._get(
'v2',
'accounts',
account_id,
'addresses',
address_id,
'transactio... |
java | public void deleteFromTask(String jobId, String taskId, String filePath, Boolean recursive, FileDeleteFromTaskOptions fileDeleteFromTaskOptions) {
deleteFromTaskWithServiceResponseAsync(jobId, taskId, filePath, recursive, fileDeleteFromTaskOptions).toBlocking().single().body();
} |
python | def set_user_avatar(self, username, avatar):
"""Set a user's avatar.
:param username: the user to set the avatar for
:param avatar: ID of the avatar to set
"""
self._set_avatar(
{'username': username}, self._get_url('user/avatar'), avatar) |
python | def embedManifestDllCheck(target, source, env):
"""Function run by embedManifestDllCheckAction to check for existence of manifest
and other conditions, and embed the manifest by calling embedManifestDllAction if so."""
if env.get('WINDOWS_EMBED_MANIFEST', 0):
manifestSrc = target[0].get_abspath() + ... |
python | def transform_source(text):
'''Replaces instances of
repeat n:
by
for __VAR_i in range(n):
where __VAR_i is a string that does not appear elsewhere
in the code sample.
'''
loop_keyword = 'repeat'
nb = text.count(loop_keyword)
if nb == 0:
return text
var_... |
java | protected void processProjectListItem(Map<Integer, String> result, Row row)
{
Integer id = row.getInteger("PROJ_ID");
String name = row.getString("PROJ_NAME");
result.put(id, name);
} |
java | @Override
public void clear() {
removeAllUserData();
if (this.children != null) {
final List<N> nodes = new ArrayList<>(this.children);
while (!this.children.isEmpty()) {
setChildAt(0, null);
}
for (final N child : nodes) {
child.clear();
}
nodes.clear();
}
} |
java | public void setData (Object data)
{
_data.clear();
_data.add(data);
_model.fireTableDataChanged();
} |
python | def set_image(self, img, bgr=False):
'''set the currently displayed image'''
if not self.is_alive():
return
if bgr:
img = cv.CloneImage(img)
cv.CvtColor(img, img, cv.CV_BGR2RGB)
self.in_queue.put(MPImageData(img)) |
python | def run(self, batch: Batch, train: bool=False, stream: StreamWrapper=None) -> Batch:
"""
Run feed-forward pass with the given batch using all the models, aggregate and return the results.
.. warning::
:py:class:`Ensemble` can not be trained.
:param batch: batch to be proces... |
python | def sparql(self, select='*', body=None, inject_prefixes=None, single_column=False):
"""
Execute a SPARQL query.
The query is specified using `select` and `body` parameters.
The argument for the Named Graph is injected into the query.
The select parameter should be either '*' or... |
java | public static void write(CharSequence content, File file, String encoding) {
OutputStream os = null;
try {
os = new FileOutputStream(file);
PrintWriter printWriter = new PrintWriter(new OutputStreamWriter(os, encoding));
printWriter.print(content);
printWr... |
python | def get_criteria(self, sess, model, advx, y, batch_size=BATCH_SIZE):
"""
Returns a dictionary mapping the name of each criterion to a NumPy
array containing the value of that criterion for each adversarial
example.
Subclasses can add extra criteria by implementing the `extra_criteria`
method.
... |
java | private Iterator<ConcurrentServiceReferenceElement<T>> elements() {
Collection<ConcurrentServiceReferenceElement<T>> set;
synchronized (elementMap) {
if (elementSetUnsorted) {
elementSet = new ConcurrentSkipListSet<ConcurrentServiceReferenceElement<T>>(elementMap.values());
... |
python | def subtrees_for_phrase(self, phrase_type):
"""
Returns subtrees corresponding all phrases matching a given phrase type
:param phrase_type: POS such as "NP", "VP", "det", etc.
:type phrase_type: str
:return: a list of NLTK.Tree.Subtree instances
:rtype: list of NLTK.Tre... |
java | public static boolean removeConnectionManager(HttpClientConnectionManager connectionManager) {
boolean wasRemoved = connectionManagers.remove(connectionManager) != null;
if (connectionManagers.isEmpty()) {
shutdown();
}
return wasRemoved;
} |
python | def an_text_url(identifiant, code):
"""
Port of the PHP function used by the National Assembly:
public function urlOpaque($identifiant, $codeType = NULL)
{
$datas = array(
'PRJL' => array('repertoire' => 'projets', 'prefixe' => 'pl', 'suffixe' => ''),
'PION' => array('re... |
java | public static SearchType parseSearchType(final String type) {
if (type == null || type.isEmpty()) {
throw new IllegalArgumentException("Type provided was null or empty");
}
if (type.toLowerCase().equals("tsmeta")) {
return SearchType.TSMETA;
} else if (type.toLowerCase().equals("tsmeta_... |
python | def _list_ports(self):
"""
Generate the list of port display in the client
if the compute has sent a list we return it (use by
node where you can not personnalize the port naming).
"""
self._ports = []
# Some special cases
if self._node_type == "atm_switch... |
java | private void save(OutputStream os, String id, SessionData data) throws IOException {
DataOutputStream out = new DataOutputStream(os);
out.writeUTF(id);
out.writeLong(data.getCreationTime());
out.writeLong(data.getAccessedTime());
out.writeLong(data.getLastAccessedTime());
... |
python | def keycmp(a, b, pth=()):
"""Recurse down the tree of nested dicts `b`, at each level checking
that it does not have any keys that are not also at the same
level in `a`. The key path is recorded in `pth`. If an unknown key
is encountered in `b`, an `UnknownKeyError` exception is
raised. If a non-dic... |
python | def transition(self, data, year, linked_tables=None):
"""
Add or remove rows from a table based on population targets.
Parameters
----------
data : pandas.DataFrame
Rows will be removed from or added to this table.
year : int
Year number that will... |
java | @Override
public void add(Difference difference) {
differenceCount += 1;
if(differenceCount <= DIFFERENCE_COUNT_MAX) {
list.add(difference);
}
try {
writer.write(difference.toString());
} catch (IOException e) {
throw new DiffException("Fai... |
java | public static NearbySearchRequest nearbySearchQuery(GeoApiContext context, LatLng location) {
NearbySearchRequest request = new NearbySearchRequest(context);
request.location(location);
return request;
} |
python | def result(self):
""" Get the result for a job. This will block if the job is incomplete.
Returns:
The result for the Job.
Raises:
An exception if the Job resulted in an exception.
"""
self.wait()
if self._fatal_error:
raise self._fatal_error
return self._result |
python | def _get_drive_api(credentials):
"""
For a given set of credentials, return a drive API object.
"""
http = httplib2.Http()
http = credentials.authorize(http)
service = discovery.build('drive', 'v2', http=http)
service.credentials = credentials # duck punch service obj. with credentials
... |
java | @Override
public InputStream downloadToStream(SFSession connection, String command, int parallelism,
String remoteStorageLocation, String stageFilePath,
String stageRegion) throws SnowflakeSQLException
{
int retryCount = 0;
do
... |
java | public static <K, V> ImmutableMapJsonDeserializer<K, V> newInstance( KeyDeserializer<K> keyDeserializer,
JsonDeserializer<V> valueDeserializer ) {
return new ImmutableMapJsonDeserializer<K, V>( keyDeserializer, valueDeserializer );
} |
java | public String printBody() throws IOException {
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
this.printBody(baos);
return new Utf8String(baos.toByteArray()).asString();
} |
python | def read_cpp_source_file(self, source_file):
"""
Reads C++ source file and returns declarations tree
:param source_file: path to C++ source file
:type source_file: str
"""
xml_file = ''
try:
ffname = self.__file_full_name(source_file)
se... |
java | public TableCellStyle addChildCellStyle(final TableCellStyle style, final TableCell.Type type) {
final TableCellStyle newStyle;
final DataStyle dataStyle = this.format.getDataStyle(type);
if (dataStyle == null) {
newStyle = style;
} else {
newStyle = this.st... |
python | def get_comments_for_commentor_and_reference(self, resource_id, reference_id):
"""Gets a list of comments corresponding to a resource and reference ``Id``.
arg: resource_id (osid.id.Id): the ``Id`` of the resource
arg: reference_id (osid.id.Id): the ``Id`` of the reference
return:... |
python | def fixer(base, target):
"""Parse data from fixer.io."""
api_url = 'http://api.fixer.io/latest'
resp = requests.get(
api_url,
params={
'base': base,
'symbols': target,
},
timeout=1,
)
data = resp.json()
return decimal.Decimal(data['rates'][... |
python | def cr_login(self, response):
"""
Login using email/username and password, used to get the auth token
@param str account
@param str password
@param str hash_id (optional)
"""
self._state_params['auth'] = response['auth']
self._user_data = response['user']... |
python | def retrieve_ocsps(self, cert, issuer):
"""
:param cert:
An asn1crypto.x509.Certificate object
:param issuer:
An asn1crypto.x509.Certificate object of cert's issuer
:return:
A list of asn1crypto.ocsp.OCSPResponse objects
"""
if not s... |
python | def func_accepts_var_args(func):
"""
Return True if function 'func' accepts positional arguments *args.
"""
if six.PY2:
return inspect.getargspec(func)[1] is not None
return any(
p for p in inspect.signature(func).parameters.values()
if p.kind == p.VAR_POSITIONAL
) |
python | def __connect_to_bus(self, bus):
"""
Attempt to connect to an I2C bus
"""
def connect(bus_num):
try:
self.log.debug("Attempting to connect to bus %s..." % bus_num)
self.bus = smbus.SMBus(bus_num)
self.log.debug("Success")
... |
java | public static <T> T getLast(@javax.annotation.Nonnull final Stream<T> stream) {
final List<T> collect = stream.collect(Collectors.toList());
final T last = collect.get(collect.size() - 1);
return last;
} |
java | public static <T extends AbstractJaxb> void removeDescendants(T target,
String clazz) {
execute(target, null, clazz);
} |
java | public static boolean isHaveAttribute(AttributeSet attrs, String attribute) {
return attrs.getAttributeValue(Ui.androidStyleNameSpace, attribute) != null;
} |
java | public static Date parseDate(
final String dateValue,
final String[] dateFormats,
final Date startDate) {
notNull(dateValue, "Date value");
final String[] localDateFormats = dateFormats != null ? dateFormats : DEFAULT_PATTERNS;
final Date localStartDate = star... |
java | @SuppressWarnings("unchecked")
@Override
public int hash(T value) {
int i = 0;
try {
int code = this.comparators[0].hash(value.getFieldNotNull(keyPositions[0]));
for (i = 1; i < this.keyPositions.length; i++) {
code *= HASH_SALT[i & 0x1F]; // salt code with (i % HASH_SALT.length)-th salt component
c... |
python | def get_plugin_module(self, plugin_name):
"""Returns the module containing the plugin of the given name."""
try:
return self.plugin_modules[plugin_name]
except KeyError:
raise RezPluginError("Unrecognised %s plugin: '%s'"
% (self.pretty_ty... |
python | def sort_by(items, attr):
"""
General sort filter - sorts by either attribute or key.
"""
def key_func(item):
try:
return getattr(item, attr)
except AttributeError:
try:
return item[attr]
except TypeError:
getattr(item, ... |
java | public static int[] subset(final int n, final int[] a, final Random random) {
requireNonNull(random, "Random");
requireNonNull(a, "Sub set array");
final int k = a.length;
checkSubSet(n, k);
// Early return.
if (a.length == n) {
for (int i = 0; i < k; ++i) a[i] = i;
return a;
}
// (A): Initiali... |
python | def _process_function(chaining, routine):
"""Chain function which returns a function.
:param routine: routine to process.
:return: routine embedding execution function.
"""
def processing(*args, **kwargs):
"""Execute routine with input args and kwargs and add reuslt in
chaining.___... |
java | public synchronized PathHandler addPrefixPath(final String path, final HttpHandler handler) {
Handlers.handlerNotNull(handler);
pathMatcher.addPrefixPath(path, handler);
return this;
} |
python | def collect(self):
"""
Collect s3 bucket stats
"""
if boto is None:
self.log.error("Unable to import boto python module")
return {}
for s3instance in self.config['s3']:
self.log.info("S3: byte_unit: %s" % self.config['byte_unit'])
a... |
python | def country_code_for_valid_region(region_code):
"""Returns the country calling code for a specific region.
For example, this would be 1 for the United States, and 64 for New
Zealand. Assumes the region is already valid.
Arguments:
region_code -- The region that we want to get the country calling ... |
java | @Override
public <E> Choice4<A, B, C, E> discardL(Applicative<E, Choice4<A, B, C, ?>> appB) {
return Monad.super.discardL(appB).coerce();
} |
java | public void setReferences(Map<String, List<UniqueId>> references) {
if (references != null) {
this.references = new HashMap<>(references);
} else {
this.references = null;
}
} |
java | public FTMusicLabel getMusicLabel(String id) throws FanartTvException {
URL url = ftapi.getImageUrl(BaseType.LABEL, id);
String page = requestWebPage(url);
FTMusicLabel label = null;
try {
label = mapper.readValue(page, FTMusicLabel.class);
} catch (IOException ex) ... |
python | def _OpenFileObject(self, path_spec):
"""Opens the file-like object defined by path specification.
Args:
path_spec (PathSpec): path specification.
Returns:
pysmraw.handle: a file-like object or None.
Raises:
PathSpecError: if the path specification is invalid.
"""
if not pat... |
python | def info(self, event=None, *args, **kw):
"""
Process event and call :meth:`logging.Logger.info` with the result.
"""
if not self._logger.isEnabledFor(logging.INFO):
return
kw = self._add_base_info(kw)
kw['level'] = "info"
return self._proxy_to_logger(... |
python | def find_document_type_by_name(self, entity_name, active='Y',
match_case=True):
"""
search document types by name and active(Y/N) status
:param entity_name: entity name
:return:
"""
all_types = self.get_dictionary('Document_Type_DE')
... |
java | public List<Option> getOptions(boolean includeDisabled) {
List< Option> result = new ArrayList<>();
for (OptionGroup group : optionGroups.values()) {
result.addAll(group.getOptions(includeDisabled));
}
return result;
} |
java | @Override
public boolean unsubscribe(String topic, MessageListener messageListener) {
Set<MessageListener> subcription = topicSubscriptions.get(topic);
boolean unsubscribe = false;
WrappedJedisPubSub wrappedJedisPubSub = null;
if (subcription != null) {
synchronized (subc... |
python | def volume_list(search_opts=None, profile=None, **kwargs):
'''
List storage volumes
search_opts
Dictionary of search options
profile
Profile to use
CLI Example:
.. code-block:: bash
salt '*' nova.volume_list search_opts='{"display_name": "myblock"}' profile=openstack... |
java | private Entry<V> computeIfAbsent(K key) {
Entry<V> v = map.get(key);
if (v == null) {
Entry<V> tmp = entryGetter.apply(key);
v = map.putIfAbsent(key, tmp);
if (v == null) {
v = tmp;
}
}
return v;
} |
java | @Override
public boolean logout() throws LoginException {
if (mSubject.isReadOnly()) {
throw new LoginException("logout Failed: Subject is Readonly.");
}
if (mUser != null) {
mSubject.getPrincipals().remove(mUser);
}
return true;
} |
python | def verify_cb(conn, cert, errnum, depth, ok):
"""
The default OpenSSL certificate verification callback.
"""
if not ok:
raise SecurityError("Could not verify CA certificate {0}"
.format(cert.get_subject()))
return ok |
java | public boolean handleControlWord(RtfCtrlWordData ctrlWordData) {
boolean result = true;
// just let fonttbl fall through and set last ctrl word object.
if(ctrlWordData.ctrlWord.equals("f")) { this.setFontNumber(ctrlWordData.param); result=true;}
if(ctrlWordData.ctrlWord.equals("fcharset")) { this.setCharset(... |
java | public static <S extends Storable> Class<? extends S>
getAbstractClass(Class<S> type, EnumSet<MasterFeature> features)
throws SupportException, IllegalArgumentException
{
StorableInfo<S> info = StorableIntrospector.examine(type);
if (features == null) {
features =... |
java | public static void initTEAPPS (@Nonnull final ValidationExecutorSetRegistry aRegistry)
{
ValueEnforcer.notNull (aRegistry, "Registry");
final boolean bNotDeprecated = false;
// No Schematrons here
aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_TEAPPS_272,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.