language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def get_header_dict(response, header):
""" returns a dictionary of the cache control headers
the same as is used by django.utils.cache.patch_cache_control
if there are no Cache-Control headers returns and empty dict
"""
def dictitem(s):
t = s.split('=', 1)
if len(t) > 1:
... |
python | def show_letter(letter, text_color=None, back_color=None):
'''
Displays a single letter on the LED matrix.
letter
The letter to display
text_color
The color in which the letter is shown. Defaults to '[255, 255, 255]' (white).
back_color
The background color of the display. D... |
java | public static Object toObject(Class<?> clazz, Object value) throws ParseException {
if (value == null) {
return null;
}
if (clazz == null) {
return value;
}
if (java.sql.Date.class.isAssignableFrom(clazz)) {
return toDate(value);
}
... |
python | def inis2dict(ini_paths: Union[str, Sequence[str]]) -> dict:
"""
Take one or more ini files and return a dict with configuration from all,
interpolating bash-style variables ${VAR} or ${VAR:-DEFAULT}.
:param ini_paths: path or paths to .ini files
"""
var_dflt = r'\${(.*?):-(.*?)}'
def _int... |
python | def nsamples_to_hourmin(x, pos):
'''Convert axes labels to experiment duration in hours/minutes
Notes
-----
Matplotlib FuncFormatter function
https://matplotlib.org/examples/pylab_examples/custom_ticker1.html
'''
h, m, s = hourminsec(x/16.0)
return '{:.0f}h {:2.0f}′'.format(h, m+round(... |
java | @Override
public Map<String, Object> getSettings(Set<String> settingSet) {
return this.handleGetSettingsData(settingSet);
} |
python | def __load_settings(self):
""" Load settings from .json file """
#file_path = path.relpath(settings_file_path)
#file_path = path.abspath(settings_file_path)
file_path = self.file_path
try:
self.data = json.load(open(file_path))
except FileNotFoundError:
... |
java | public boolean add(Object element) {
last.next = new Node(element, null);
last = last.next;
elementCount++;
return true;
} |
java | private static String parameterizedTypeToString(final ParameterizedType p) {
final StringBuilder buf = new StringBuilder();
final Type useOwner = p.getOwnerType();
final Class<?> raw = (Class<?>) p.getRawType();
if (useOwner == null) {
buf.append(raw.getName());
} e... |
java | public ConfigValueImpl<List<T>> asList() {
isList = true;
ConfigValueImpl<List<T>> listTypedResolver = (ConfigValueImpl<List<T>>) this;
if (defaultValue == null) {
// the default for lists is an empty list instead of null
return listTypedResolver.withDefault(Collections.... |
java | public boolean updateEmailsOnPush(Integer projectId, String emailAddress) throws IOException {
GitlabServiceEmailOnPush emailOnPush = this.getEmailsOnPush(projectId);
GitlabEmailonPushProperties properties = emailOnPush.getProperties();
String appendedRecipients = properties.getRecipients();
... |
java | public void editable(double seconds) {
double end = System.currentTimeMillis() + (seconds * 1000);
try {
elementPresent(seconds);
while (!element.is().editable() && System.currentTimeMillis() < end) ;
double timeTook = Math.min((seconds * 1000) - (end - System.current... |
python | def l2traceroute_result_output_reason(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
l2traceroute_result = ET.Element("l2traceroute_result")
config = l2traceroute_result
output = ET.SubElement(l2traceroute_result, "output")
reason = ET.S... |
java | @Override
public Object visit(Intersects filter, Object userData) {
String finalName = parsePropertyName(geomName, userData);
return SpatialRestrictions.intersects(finalName, asGeometry(getLiteralValue(filter.getExpression2())));
} |
python | def args_options():
""" Generates an arugment parser.
:returns:
Parser object
"""
parser = argparse.ArgumentParser(prog='landsat',
formatter_class=argparse.RawDescriptionHelpFormatter,
description=textwrap.dedent(DESCRIP... |
python | def get_field_mapping(self):
"""Obtain metadata from current state of the widget.
Null or empty list will be removed.
:returns: Dictionary of values by type in this format:
{'fields': {}, 'values': {}}.
:rtype: dict
"""
field_mapping = self.field_mapping_wid... |
python | def render_asides(self, block, view_name, frag, context):
"""
Collect all of the asides' add ons and format them into the frag. The frag already
has the given block's rendering.
"""
aside_frag_fns = []
for aside in self.get_asides(block):
aside_view_fn = aside... |
python | def _clear_mountpoint(self):
"""Clears a created mountpoint. Does not unmount it, merely deletes it."""
if self.mountpoint:
os.rmdir(self.mountpoint)
self.mountpoint = "" |
java | public static int toDecimalDigits(float v,
char[] digits, int offset, int maxDigits,
int maxFractDigits, int roundMode)
{
int bits = Float.floatToIntBits(v);
int f = bits & 0x7fffff;
int e = (bits >> 23) & 0xff;
... |
python | def _graphql_query_waittime(self, query_hash: str, current_time: float, untracked_queries: bool = False) -> int:
"""Calculate time needed to wait before GraphQL query can be executed."""
sliding_window = 660
if query_hash not in self._graphql_query_timestamps:
self._graphql_query_tim... |
java | @Override
public EClass getIfcStructuralActivity() {
if (ifcStructuralActivityEClass == null) {
ifcStructuralActivityEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI)
.getEClassifiers().get(629);
}
return ifcStructuralActivityEClass;
} |
java | public void marshall(ListBulkDeploymentsRequest listBulkDeploymentsRequest, ProtocolMarshaller protocolMarshaller) {
if (listBulkDeploymentsRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(l... |
python | def log_tensor_stats(self, tensor, name):
"""Add distribution statistics on a tensor's elements to the current History entry
"""
# TODO Handle the case of duplicate names.
if (isinstance(tensor, tuple) or isinstance(tensor, list)):
while (isinstance(tensor, tuple) or isinsta... |
java | public void clickOnImage(int index) {
if(config.commandLogging){
Log.d(config.commandLoggingTag, "clickOnImage("+index+")");
}
clicker.clickOn(ImageView.class, index);
} |
python | def simxReadForceSensor(clientID, forceSensorHandle, operationMode):
'''
Please have a look at the function description/documentation in the V-REP user manual
'''
state = ct.c_ubyte()
forceVector = (ct.c_float*3)()
torqueVector = (ct.c_float*3)()
ret = c_ReadForceSensor(clientID, forceSenso... |
python | def start_executing_host_checks(self):
"""Enable host check execution (globally)
Format of the line that triggers function call::
START_EXECUTING_HOST_CHECKS
:return: None
"""
# todo: #783 create a dedicated brok for global parameters
if not self.my_conf.execute... |
python | def i2b(self, pkt, x):
"""Convert internal value to internal value"""
if type(x) is str:
x = bytes([ ord(i) for i in x ])
return x |
java | public Observable<Object> listSwaggerAsync(String resourceGroupName, String workflowName) {
return listSwaggerWithServiceResponseAsync(resourceGroupName, workflowName).map(new Func1<ServiceResponse<Object>, Object>() {
@Override
public Object call(ServiceResponse<Object> response) {
... |
java | @SafeVarargs
public static <T> T[] addAll(T[]... arrays) {
if (arrays.length == 1) {
return arrays[0];
}
int length = 0;
for (T[] array : arrays) {
if (array == null) {
continue;
}
length += array.length;
}
T[] result = newArray(arrays.getClass().getComponentType().getComponen... |
python | def verify(token, public_key, validate_nonce=None, algorithms=[DEFAULT_ALGORITHM]):
"""
Verify the validity of the given JWT using the given public key.
:param token: JWM claim
:param public_key: Public key to use when verifying the claim's signature.
:param validate_nonce: Callable to use to valid... |
java | public static <T extends java.util.Date> T setYears(final T date, final int amount) {
return set(date, Calendar.YEAR, amount);
} |
python | def _date_val(self, dt: datetime) -> None:
"""
Add a date value
:param dt: datetime to add
"""
self._tval_char = dt.strftime('%Y-%m-%d %H:%M')
self._nval_num = (dt.year * 10000) + (dt.month * 100) + dt.day + \
(((dt.hour / 100.0) + (dt.minute / 10... |
java | public static int len(String list, char delimiter, boolean ignoreEmpty) {
int len = StringUtil.length(list);
if (len == 0) return 0;
int count = 0;
int last = 0;
for (int i = 0; i < len; i++) {
if (list.charAt(i) == delimiter) {
if (!ignoreEmpty || last < i) count++;
last = i + 1;
}
}
if (!ignore... |
python | def editpropset(self):
'''
:foo=10
'''
self.ignore(whitespace)
if not self.nextstr(':'):
self._raiseSyntaxExpects(':')
relp = self.relprop()
self.ignore(whitespace)
self.nextmust('=')
self.ignore(whitespace)
valu = self.va... |
java | public void marshall(CreateFunctionDefinitionRequest createFunctionDefinitionRequest, ProtocolMarshaller protocolMarshaller) {
if (createFunctionDefinitionRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarsha... |
python | def after(self, after):
"""
Sets the after of this ServicePackageQuotaHistoryResponse.
After which quota history ID this paged response is fetched.
:param after: The after of this ServicePackageQuotaHistoryResponse.
:type: str
"""
if after is not None and len(aft... |
java | public JSONObject tableResultGet(String requestId, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
request.addBody("request_id", requestId);
if (options != null) {
request.addBody(options);
}
request.se... |
java | public void updateSession(BackedSession backedSess) {
if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
LoggingUtil.SESSION_LOGGER_WAS.entering(methodClassName, methodNames[UPDATE_SESSION]);
}
if (!backedSess.i... |
java | public static void setDebugConfigs(OneProperties debugConfigsObj, String debugConfigAbsoluteClassPath) {
if (debugConfigsObj != null) {
Configs.debugConfigs = debugConfigsObj;
}
if (debugConfigAbsoluteClassPath != null) {
Configs.debugConfigAbsoluteClassPath = debugC... |
python | def _column_names(self):
"""Return the column names"""
index_names = set(_normalize_index_names(self._index_names))
column_names = [col_name for col_name in self._schema_rdd.columns if
col_name not in index_names]
return column_names |
python | def installation_report(self, req, dist, what="Installed"):
"""Helpful installation message for display to package users"""
msg = "\n%(what)s %(eggloc)s%(extras)s"
if self.multi_version and not self.no_report:
msg += '\n' + self.__mv_warning
if self.install_dir not in map... |
python | def lower_folded_outputs(ir_blocks):
"""Lower standard folded output fields into GremlinFoldedContextField objects."""
folds, remaining_ir_blocks = extract_folds_from_ir_blocks(ir_blocks)
if not remaining_ir_blocks:
raise AssertionError(u'Expected at least one non-folded block to remain: {} {} '
... |
java | public String format(Calendar then)
{
if (then == null)
return format(now());
return format(then.getTime());
} |
java | public void addRequestHttpHeader(final String key, final String value) {
addRequestHttpHeader(new HashMap<String, String>() {{
put(key, value);
}});
} |
java | public ResultSet execute(String keyspace, @NotNull Statement statement) {
Timer time = getMetricsFactory().getTimer(MetricsType.CASSANDRA_EXECUTE.name());
getMetricsFactory().getCounter(MetricsType.CASSANDRA_QUERIES_COUNT.name()).inc();
ResultSet resultSetFuture = getOrCreateSession(keyspace).... |
python | def handle_captcha(self, query_params: dict,
html: str,
login_data: dict) -> requests.Response:
"""
Handling CAPTCHA request
"""
check_url = get_base_url(html)
captcha_url = '{}?s={}&sid={}'.format(self.CAPTCHA_URI,
... |
java | public StructuredQueryDefinition word(TextIndex index, String... words) {
return new WordQuery(index, null, null, null, words);
} |
python | def get(self, sid):
"""
Constructs a FunctionContext
:param sid: The sid
:returns: twilio.rest.serverless.v1.service.function.FunctionContext
:rtype: twilio.rest.serverless.v1.service.function.FunctionContext
"""
return FunctionContext(self._version, service_sid... |
python | def enhance(self):
""" Function enhance
Enhance the object with new item or enhanced items
"""
self.update({'puppetclasses':
SubDict(self.api, self.objName,
self.payloadObj, self.key,
SubItemPuppetClasses)})
... |
python | def _update_widget_choices(self, widget):
"""
Updates widget choices with special choice iterator that removes blank values and adds none value to clear
filter data.
:param widget: widget with choices
:return: updated widget with filter choices
"""
widget.choices... |
java | public long getUInt32(int index) throws IOException
{
validateIndex(index, 4);
if (_isMotorolaByteOrder) {
// Motorola - MSB first (big endian)
return (((long)getByte(index )) << 24 & 0xFF000000L) |
(((long)getByte(index + 1)) << 16 & 0xFF0000L) |
... |
python | def _set_pfc_threshold(self, v, load=False):
"""
Setter method for pfc_threshold, mapped from YANG variable /interface/port_channel/qos/flowcontrol/pfc_threshold (container)
If this variable is read-only (config: false) in the
source YANG file, then _set_pfc_threshold is considered as a private
meth... |
python | def finalize(self, *args):
"""Add my tabs"""
if not self.canvas:
Clock.schedule_once(self.finalize, 0)
return
deck_builder_kwargs = {
'pos_hint': {'x': 0, 'y': 0},
'starting_pos_hint': {'x': 0.05, 'top': 0.95},
'card_size_hint': (0.3, ... |
java | private static int discardWhitespace(byte[] data)
{
final int length = data.length;
int i = 0;
while (i < length)
{
byte c = data[i++];
if (c == (byte) ' ' || c == (byte) '\n' || c == (byte) '\r'
|| c == (byte) '\t')
{
int count = i - 1;
while (i < length)
{
c = data[i++];
i... |
java | public boolean contains(final String n, final boolean fwd) {
synchronized (this) {
return find_i(n, fwd) != null ? true : false;
}
} |
java | @Override
public boolean visit(final JavaInstance<?> node) {
this.graphStr
.append(" \"")
.append(node.getClass())
.append('_')
.append(node.getNode().getName())
.append("\" [label=\"")
.append(node.getNode().getName())
.append(" = ")
.append(node.g... |
python | def execstr_dict(dict_, local_name=None, exclude_list=None, explicit=False):
"""
returns execable python code that declares variables using keys and values
execstr_dict
Args:
dict_ (dict):
local_name (str): optional: local name of dictionary. Specifying this
is much safer
... |
python | def _check_tagmode_and_tmos_version(self, **kwargs):
'''Raise an exception if tagMode in kwargs and tmos version < 11.6.0
:param kwargs: dict -- keyword arguments for request
:raises: TagModeDisallowedForTMOSVersion
'''
tmos_version = self._meta_data['bigip']._meta_data['tmos_v... |
java | public static Context createContext(Collection<PropertyMapping<?>> mappings)
{
IdentityHashMap<ContextProperty<?>, Object> properties = new IdentityHashMap<ContextProperty<?>, Object>(mappings.size());
for (final PropertyMapping<?> mapping : mappings)
{
properties.put(mapping.pro... |
java | public static void queueException(final Throwable e) {
if (e != null) {
try {
LogAppender<LogEvent> appender = LogManager.getAppender();
if (appender != null) {
appender.append(LogEvent.newBuilder().level("ERROR").message(e.getMessage()).exception(e).build());
}
} catch (Throwable t) {
LO... |
python | def fn_max(self, a, axis=None):
"""
Return the maximum of an array, ignoring any NaNs.
:param a: The array.
:return: The maximum value of the array
"""
return numpy.nanmax(self._to_ndarray(a), axis=axis) |
java | public TransactionBroadcast broadcastTransaction(final Transaction tx, final int minConnections) {
// If we don't have a record of where this tx came from already, set it to be ourselves so Peer doesn't end up
// redownloading it from the network redundantly.
if (tx.getConfidence().getSource().e... |
python | def configValue(self):
""" Creates a QPen made of the children's config values.
"""
if not self.data:
return None
else:
pen = QtGui.QPen()
pen.setCosmetic(True)
pen.setColor(self.colorCti.configValue)
style = self.styleCti.confi... |
java | @Override
protected void handleTransliterate(Replaceable text,
Position pos, boolean isIncremental) {
int allStart = pos.start;
int allLimit = pos.limit;
ScriptRunIterator it =
new ScriptRunIterator(text, pos.contextStart, pos.contextLimit)... |
python | def qth_survival_time(q, survival_function, cdf=False):
"""
Returns the time when a single survival function reaches the qth percentile.
Parameters
----------
q: float
a float between 0 and 1 that represents the time when the survival function hit's the qth percentile.
survival_function: ... |
python | def lex(args):
""" Lex input and return a list of actions to perform. """
if len(args) == 0 or args[0] == SHOW:
return [(SHOW, None)]
elif args[0] == LOG:
return [(LOG, None)]
elif args[0] == ECHO:
return [(ECHO, None)]
elif args[0] == SET and args[1] == RATE:
return ... |
java | @Override
public JarEntryDirectoryImpl getOrCreateDirectory(String relativeName) {
IResource resource = _resources.get(relativeName);
if(resource instanceof IFile){
throw new UnsupportedOperationException("The requested resource " + relativeName + " is now being accessed as a directory, but was previous... |
java | private void writeByteArrayTagPayload(ByteArrayTag tag) throws IOException {
byte[] bytes = tag.getValue();
os.writeInt(bytes.length);
os.write(bytes);
} |
java | private void setupAcceptHeader(String action, Map<String, String> requestHeaders, Map<String, String> requestParameters) {
// validates whether to add headers for accept for serialization
String serializeAcceptFormat = getSerializationResponseFormat();
if (StringUtils.hasText(serializeAcceptForm... |
python | def edge_history(self, source, target, attribute):
"""
Returns a dictionary of attribute vales for each Graph in the
:class:`.GraphCollection` for a single edge.
Parameters
----------
source : str
Identifier for source node.
target : str
I... |
java | private long doWrap(ByteBuffer[] userBuffers, int off, int len) throws IOException {
if(anyAreSet(state, FLAG_CLOSED)) {
throw new ClosedChannelException();
}
if(outstandingTasks > 0) {
return 0;
}
if(anyAreSet(state, FLAG_WRITE_REQUIRES_READ)) {
... |
java | public static void processMessageToMatchSession(HttpMessage message, List<HttpCookie> requestCookies,
HttpSession session) {
// Make a copy of the session tokens set, as they will be modified
HttpSessionTokensSet tokensSet = session.getTokensNames();
// If no tokens exists create dummy Object -> NPE
if (... |
java | public ServiceFuture<StorageBundle> setStorageAccountAsync(String vaultBaseUrl, String storageAccountName, String resourceId, String activeKeyName, boolean autoRegenerateKey, final ServiceCallback<StorageBundle> serviceCallback) {
return ServiceFuture.fromResponse(setStorageAccountWithServiceResponseAsync(vault... |
python | def rebuild( self ):
"""
Clears out all the child widgets from this widget and creates the
widget that best matches the column properties for this edit.
"""
plugins.init()
self.blockSignals(True)
self.setUpdatesEnabled(False)
#... |
java | public void monitor(LocalStore ls) {
int in = 0;
EventRecord er = null;
Environment.logInfo("Started processing log...");
while ((er = getNext()) != null) {
// Environment.logInfo("Processing log line:\t" + in++);
if (er.isValid()) {
ls.insert(er);
}
}
PersistentState... |
java | private void broadcastError(final Exception exception) {
Logger.info(LOG_TAG, "Broadcasting error for upload with ID: "
+ params.id + ". " + exception.getMessage());
final UploadInfo uploadInfo = new UploadInfo(params.id, startTime, uploadedBytes,
totalBytes, (attempts ... |
java | public void setupFields()
{
FieldInfo field = null;
field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
field.setDataClass(Integer.class);
field.setHidden(true);
field = new FieldInfo(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
... |
java | public String getContent(String resourceGroupName, String automationAccountName, String configurationName) {
return getContentWithServiceResponseAsync(resourceGroupName, automationAccountName, configurationName).toBlocking().single().body();
} |
java | private Map<String, GroovyRunner> getMap() {
Map<String, GroovyRunner> map = runnerMap;
if (map == null) {
writeLock.lock();
try {
if ((map = runnerMap) == null) {
runnerMap = map = new LinkedHashMap<>();
load(null);
... |
java | public static FloatIterator of(final Supplier<? extends FloatIterator> iteratorSupplier) {
N.checkArgNotNull(iteratorSupplier, "iteratorSupplier");
return new FloatIterator() {
private FloatIterator iter = null;
private boolean isInitialized = false;
@Overrid... |
java | @Override
public boolean isKeyColumn(String columnName) {
for ( String keyColumName : getColumnNames() ) {
if ( keyColumName.equals( columnName ) ) {
return true;
}
}
return false;
} |
python | def object_patch_add_link(self, root, name, ref, create=False, **kwargs):
"""Creates a new merkledag object based on an existing one.
The new object will have a link to the provided object.
.. code-block:: python
>>> c.object_patch_add_link(
... 'QmR79zQQj2aDfnrNgc... |
java | public LabelTypeCB acceptPK(String id) {
assertObjectNotNull("id", id);
BsLabelTypeCB cb = this;
cb.query().docMeta().setId_Equal(id);
return (LabelTypeCB) this;
} |
java | private void accum_all(Chunk chks[], Chunk wrks, Chunk weight, int nnids[]) {
// Sort the rows by NID, so we visit all the same NIDs in a row
// Find the count of unique NIDs in this chunk
int nh[] = new int[_hcs.length+1];
for( int i : nnids )
if( i >= 0 )
nh[i+1]++;
// Rollup the his... |
python | def get(self, app_id, view_specifier):
"""
Retrieve the definition of a given view, provided the app_id and the view_id
:param app_id: the app id
:param view_specifier:
Can be one of the following:
1. The view ID
2. The view's name
3. "las... |
python | def main(self):
"""
Run the required methods in the appropriate order
"""
self.targets()
self.bait(k=49)
self.reversebait(maskmiddle='t', k=19)
self.subsample_reads() |
java | @BetaApi
public final ListNetworksPagedResponse listNetworks(ProjectName project) {
ListNetworksHttpRequest request =
ListNetworksHttpRequest.newBuilder()
.setProject(project == null ? null : project.toString())
.build();
return listNetworks(request);
} |
python | def pole_error(ax, fit, **kwargs):
"""
Plot the error to the pole to a plane on a `mplstereonet`
axis object.
"""
ell = normal_errors(fit.axes, fit.covariance_matrix)
lonlat = -N.array(ell)
n = len(lonlat)
codes = [Path.MOVETO]
codes += [Path.LINETO]*(n-1)
vertices = list(lonlat)... |
python | def calc_inuh_v1(self):
"""Calculate the unit hydrograph input.
Required derived parameters:
|RelLandArea|
Required flux sequences:
|Q0|
|Q1|
Calculated flux sequence:
|InUH|
Basic equation:
:math:`InUH = Q0 + Q1`
Example:
The unit hydrographs receiv... |
python | def discard(self, min_freq, unknown_token):
"""Discards tokens with frequency below min_frequency and represents them
as `unknown_token`.
Parameters
----------
min_freq: int
Tokens whose frequency is under min_freq is counted as `unknown_token` in
the Cou... |
python | def create_platform(platform):
'''
.. versionadded:: 2019.2.0
Create a new device platform
platform
String of device platform, e.g., ``junos``
CLI Example:
.. code-block:: bash
salt myminion netbox.create_platform junos
'''
nb_platform = get_('dcim', 'platforms', slu... |
java | public boolean isFractionalTranslation() {
if ((Math.abs(matTransform.m03-crystalTranslation.x)>SpaceGroup.DELTA) ||
(Math.abs(matTransform.m13-crystalTranslation.y)>SpaceGroup.DELTA) ||
(Math.abs(matTransform.m23-crystalTranslation.z)>SpaceGroup.DELTA)) {
return true;
}
return false;
} |
java | public List<String> messageSources() {
if (null == _messageSources) {
_messageSources = Arrays.asList(get(I18N_MESSAGE_SOURCES).toString().split("[, \\t]+"));
}
return _messageSources;
} |
python | def _ScanFileSystemForWindowsDirectory(self, path_resolver):
"""Scans a file system for a known Windows directory.
Args:
path_resolver (WindowsPathResolver): Windows path resolver.
Returns:
bool: True if a known Windows directory was found.
"""
result = False
for windows_path in se... |
python | def delete_from_matching_blacklist(db, entity):
"""Remove an blacklisted entity from the registry.
This function removes the given blacklisted entity from the registry.
It checks first whether the excluded entity is already on the registry.
When it is found, the entity is removed. Otherwise, it will ra... |
java | public void registerSequenceQuery(long sequence, Runnable query) {
// Add a query to be run once the session's sequence number reaches the given sequence number.
List<Runnable> queries = this.sequenceQueries.computeIfAbsent(sequence, v -> new LinkedList<Runnable>());
queries.add(query);
} |
python | async def get_codec(self):
"""Get codec settings."""
act = self.service.action("X_GetCodec")
res = await act.async_call()
return res |
java | protected ServerLayer<?> createLayer(MapConfiguration mapConfiguration, ClientLayerInfo layerInfo,
ViewPort viewPort, MapEventBus eventBus) {
ServerLayer<?> layer = null;
switch (layerInfo.getLayerType()) {
case RASTER:
layer = new RasterServerLayerImpl(mapConfiguration, (ClientRasterLayerInfo) layerInfo,... |
python | def main(argv=None):
"""Run Tika from command line according to USAGE."""
global Verbose
global EncodeUtf8
global csvOutput
if argv is None:
argv = sys.argv
if (len(argv) < 3 and not (('-h' in argv) or ('--help' in argv))):
log.exception('Bad args')
raise TikaException('... |
python | def create_lazy_user(self):
""" Create a lazy user. Returns a 2-tuple of the underlying User
object (which may be of a custom class), and the username.
"""
user_class = self.model.get_user_class()
username = self.generate_username(user_class)
user = user_class.objects.cre... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.