language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | public StartResumeUsersPlaybackRequest.Builder startResumeUsersPlayback() {
return new StartResumeUsersPlaybackRequest.Builder(accessToken)
.setDefaults(httpManager, scheme, host, port);
} |
java | public void init(Object parent, Object record)
{
m_parent = parent;
this.setOpaque(false);
if (this.getBaseApplet() != null)
{
String strScreenDesc = this.getScreenDesc();
this.getBaseApplet().setStatusText(strScreenDesc); // Display screen desc or ... |
java | public static void generateCompileTimeGlobalsFile(
Map<String, ?> compileTimeGlobalsMap, Appendable output) throws IOException {
Map<String, PrimitiveData> compileTimeGlobals =
InternalValueUtils.convertCompileTimeGlobalsMap(compileTimeGlobalsMap);
for (Map.Entry<String, PrimitiveData> entry : c... |
python | def merge_networks(network, donor=[]):
r"""
Combine multiple networks into one without doing any topological
manipulations (such as stiching nearby pores to each other).
Parameters
----------
network : OpenPNM Network Object
The network to which all the other networks should be added.
... |
java | public static String getRemoteImplClassName(EnterpriseBean enterpriseBean, boolean isPost11DD) // d114199
{
String remoteInterfaceName = getRemoteInterfaceName(enterpriseBean);
if (remoteInterfaceName == null) { // f111627
return null; // f111627
} // f111627
String pack... |
java | @Nullable
public static VATINStructure getFromVATINCountry (@Nullable final String sVATIN)
{
if (StringHelper.getLength (sVATIN) >= 2)
{
final String sCountry = sVATIN.substring (0, 2);
for (final VATINStructure aStructure : s_aList)
if (aStructure.getExamples ().get (0).substring (0, 2)... |
java | public void calcScale(int zoomFactor){
float s = getScaleForZoom(zoomFactor);
scale = s;
//logger.info("calc scale zoom:"+zoomFactor+ " s: " + s);
panel1.setScale(s);
panel2.setScale(s);
panel1.repaint();
panel2.repaint();
//return scale;
} |
python | def setup(self, # pylint: disable=arguments-differ
endpoint=None,
username=None,
password=None,
incident_id=None,
sketch_id=None):
"""Setup a connection to a Timesketch server and create a sketch if needed.
Args:
endpoint: str, Timesketch endpo... |
java | public static Date setSeconds(final Date date, final int amount) {
return set(date, Calendar.SECOND, amount);
} |
python | def ExtractEvents(
self, parser_mediator, registry_key, codepage='cp1252', **kwargs):
"""Extracts events from a Windows Registry key.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
registry_key (dfwinreg... |
python | def login(self):
"""
Logs the user in.
The log in information is saved in the client
- userid
- username
- cookies
:return: The raw response from the request
"""
if self.options['token']:
self.client.token = self.options['token']
result = self.users.get_user('me')
else:
response = self... |
python | def register_value_proxy(namespace, value_proxy, help_text):
"""Register a value proxy with the namespace, and add the help_text."""
namespace.register_proxy(value_proxy)
config.config_help.add(
value_proxy.config_key, value_proxy.validator, value_proxy.default,
namespace.get_name(), help_te... |
python | async def get_power_parameters_for(
cls, system_ids: typing.Sequence[str]):
"""
Get a list of power parameters for specified systems.
*WARNING*: This method is considered 'alpha' and may be modified
in future.
:param system_ids: The system IDs to get power parameters... |
python | def create_default_config():
"""
Create default ConfigParser instance
"""
import codecs
config = ConfigParser.SafeConfigParser()
config.readfp(StringIO(DEFAULT_CONFIG))
# Load user settings
filename = get_user_config_filename()
if not os.path.exists(filename):
from wizard im... |
java | private boolean writeToCharacteristic(BluetoothGattCharacteristic charc, byte[] data) {
charc.setValue(data);
boolean result = mGattClient.writeCharacteristic(charc);
if (result) {
Log.d(TAG, "Wrote to characteristic: " + charc.getUuid() +
", data: " + Arrays.toSt... |
python | def schedule_branches(b: bool, quoted_true, quoted_false):
"""
Helper function to choose which workflow to execute
based on the boolean `b`.
:param b:
promised boolean value
:param quoted_true:
quoted workflow to eval if the boolean is true.
:param quoted_true:
quoted work... |
python | def _create_record(self, rtype, name, content):
"""
Connects to Hetzner account, adds a new record to the zone and returns a
boolean, if creation was successful or not. Needed record rtype, name and
content for record to create.
"""
with self._session(self.domain, self.do... |
java | protected final ModelNode correctValue(final ModelNode newValue, final ModelNode oldValue) {
if (valueCorrector != null) {
return valueCorrector.correct(newValue, oldValue);
}
return newValue;
} |
java | public static SingleID parseFilterID(String id, int[] pos) {
int start = pos[0];
Specs specs = parseFilterID(id, pos, true);
if (specs == null) {
pos[0] = start;
return null;
}
// Assemble return results
SingleID single = specsToID(specs, FORWARD... |
python | def boost(self, dtrain, grad, hess):
"""
Boost the booster for one iteration, with customized gradient statistics.
Parameters
----------
dtrain : DMatrix
The training DMatrix.
grad : list
The first order of gradient.
hess : list
... |
python | def compile_folder(self, directory, write=True, package=True, *args, **kwargs):
"""Compile a directory and returns paths to compiled files."""
if not isinstance(write, bool) and os.path.isfile(write):
raise CoconutException("destination path cannot point to a file when compiling a directory"... |
python | def accumulate(self, axis: AxisIdentifier) -> HistogramBase:
"""Calculate cumulative frequencies along a certain axis.
Returns
-------
new_hist: Histogram of the same type & size
"""
# TODO: Merge with Histogram1D.cumulative_frequencies
# TODO: Deal with errors a... |
java | public void onChangeMode(IndexerIoMode mode)
{
try
{
switch (mode)
{
case READ_ONLY :
setReadOnly();
break;
case READ_WRITE :
setReadWrite();
break;
}
}
catch (IOException e)
{... |
java | public void setProxyChainName(String proxyChainName) {
if (proxyChainName == null) {
return;
}
this.proxyChainName = proxyChainName.trim();
if (proxyChainName.isEmpty()) {
setUseProxyChain(false);
}
getConfig().setProperty(PROXY_CHAIN_NAME, this.proxyChainName);
} |
java | public void draw(Canvas canvas) {
for (int i = 0; i < mHolders.size(); ++i) {
Drawable drawable = get(i).getTopLevelDrawable();
if (drawable != null) {
drawable.draw(canvas);
}
}
} |
python | def get_tasks(client, list_id, completed=False):
''' Gets un/completed tasks for the given list ID '''
params = {
'list_id' : str(list_id),
'completed' : completed
}
response = client.authenticated_request(client.api.Endpoints.TASKS, params=params)
return response.... |
java | public static String getCollation(final int id) {
Entry entry = getEntry(id);
if (entry != null) {
return entry.mysqlCollation;
} else {
logger.warn("Unexpect mysql charset: " + id);
return null;
}
} |
python | def _do_document(self, node):
'''_do_document(self, node) -> None
Process a document node. documentOrder holds whether the document
element has been encountered such that PIs/comments can be written
as specified.'''
self.documentOrder = _LesserElement
for child in node.c... |
java | @SuppressWarnings("unchecked")
public static <T> String join(String separator, T... items) {
StringBuilder result = new StringBuilder();
for (int i = 0; i < items.length; ++i) {
T item = items[i];
if (item instanceof Number) {
result.append(Op.str((Number) ite... |
python | def plot(self, qubit_subset=None):
"""
Plots a bar chart with bitstring on the x axis and probability on the y axis.
:param list qubit_subset: Optional parameter used for plotting a subset of the Hilbert space.
"""
import matplotlib.pyplot as plt
prob_dict = self.get_out... |
python | def process_raw_data(self, fname, max_size):
"""
Loads data from the input file.
:param fname: input file name
:param max_size: loads at most 'max_size' samples from the input file,
if None loads the entire dataset
"""
logging.info(f'Processing data from {fna... |
java | private void finishValue()
{
final ContainerInfo current = currentContainer();
if (current != null && current.type == ContainerType.ANNOTATION)
{
// close out and patch the length
popContainer();
}
hasWrittenValuesSinceFinished = true;
hasWritt... |
python | async def _capability_negotiated(self, capab):
""" Mark capability as negotiated, and end negotiation if we're done. """
self._capabilities_negotiating.discard(capab)
if not self._capabilities_requested and not self._capabilities_negotiating:
await self.rawmsg('CAP', 'END') |
java | private ValueUnitWrapper normalizeMolarUnit(final double value, final String unit)
throws UnknownUnitException {
Matcher matcher = mMolarUnitPattern.matcher(unit);
if (matcher.find()) {
String siPrefix = matcher.group(1);
Double convFactor = getSIFactor(siPrefix);
... |
java | public Set<Constructor> getConstructorsWithAnyParamAnnotated(Annotation annotation) {
return filter(getConstructorsWithAnyParamAnnotated(annotation.annotationType()), withAnyParameterAnnotation(annotation));
} |
java | public void setMessage(String data) throws HttpMalformedHeaderException {
clear();
try {
if (!this.parse(data)) {
mMalformedHeader = true;
}
} catch (Exception e) {
mMalformedHeader = true;
}
if (mMalformedHeader) {
... |
java | public String getRootPath(Resource resource) {
int rootLevel = urlHandlerConfig.getSiteRootLevel(resource);
if (rootLevel > 0) {
return Path.getAbsoluteParent(resource.getPath(), rootLevel, resource.getResourceResolver());
}
return null;
} |
python | def config_value_changed(option):
"""
Determine if config value changed since last call to this function.
"""
hook_data = unitdata.HookData()
with hook_data():
db = unitdata.kv()
current = config(option)
saved = db.get(option)
db.set(option, current)
if saved ... |
java | void lpc_to_curve(float[] curve, float[] lpc, float amp){
for(int i=0; i<ln*2; i++)
curve[i]=0.0f;
if(amp==0)
return;
for(int i=0; i<m; i++){
curve[i*2+1]=lpc[i]/(4*amp);
curve[i*2+2]=-lpc[i]/(4*amp);
}
fft.backward(curve);
{
int l2=ln*2;
float unit=(floa... |
python | def _prepare_files(self, encoding):
""" private function to prepare content for paramType=form with File
"""
content_type = 'multipart/form-data'
if self.__op.consumes and content_type not in self.__op.consumes:
raise errs.SchemaError('content type {0} does not present in {1}... |
java | public static Date getLastNDay(Date d, int n, int unitType) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.add(unitType, -n);
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
... |
python | def _gen_pool_xml(name,
ptype,
target=None,
permissions=None,
source_devices=None,
source_dir=None,
source_adapter=None,
source_hosts=None,
source_auth=None,
... |
python | def compose(self, text, minimal_clears=False, no_clears=False):
'''
Returns the sequence of combinations necessary to compose given text.
If the text expression is not possible with the given layout an ComposeException is thrown.
Iterate over the string, converting each character into ... |
python | def feats_from_doc(self, raw_text):
'''
Parameters
----------
raw_text, uncleaned text for parsing out features
Returns
-------
csr_matrix, feature matrix
'''
parsed_text = self._nlp(self._clean_function(raw_text))
X_factory = CSRMatrixFac... |
python | async def check_result(method_name: str, content_type: str, status_code: int, body: str):
"""
Checks whether `result` is a valid API response.
A result is considered invalid if:
- The server returned an HTTP response code other than 200
- The content of the result is invalid JSON.
- The method c... |
python | def _set_isns_vrf(self, v, load=False):
"""
Setter method for isns_vrf, mapped from YANG variable /isns/isns_vrf (list)
If this variable is read-only (config: false) in the
source YANG file, then _set_isns_vrf is considered as a private
method. Backends looking to populate this variable should
d... |
python | def currentdir(self) -> str:
"""Name of the current working directory containing the relevant files.
To show most of the functionality of |property|
|FileManager.currentdir| (unpacking zip files on the fly is
explained in the documentation on function
(|FileManager.zip_currentdi... |
python | def encode_int(code, bits_per_char=6):
"""Encode int into a string preserving order
It is using 2, 4 or 6 bits per coding character (default 6).
Parameters:
code: int Positive integer.
bits_per_char: int The number of bits per coding character.
Returns:
str: the enc... |
python | def toggle(self, key):
""" Toggles a boolean key """
val = self[key]
assert isinstance(val, bool), 'key[%r] = %r is not a bool' % (key, val)
self.pref_update(key, not val) |
java | @Override
public void loadTiff(URL tiff, ImageProcessor imageProcessor, int... pages) throws VectorPrintException {
try {
if (log.isLoggable(Level.FINE)) {
log.fine(String.format("loading tiff from %s", String.valueOf(tiff)));
}
if ("file".equals(tiff.getProtocol())) {
... |
java | private void setSoftwareLayerType()
{
if (setLayerTypeMethod == null)
return;
try
{
int LAYER_TYPE_SOFTWARE = View.class.getField("LAYER_TYPE_SOFTWARE").getInt(new View(getContext()));
setLayerTypeMethod.invoke(this, LAYER_TYPE_SOFTWARE, null);
}
... |
java | public static host_cpu_core[] get_filtered(nitro_service service, String filter) throws Exception
{
host_cpu_core obj = new host_cpu_core();
options option = new options();
option.set_filter(filter);
host_cpu_core[] response = (host_cpu_core[]) obj.getfiltered(service, option);
return response;
} |
java | public Date getDate(FrenchRepublicanAlgorithm algorithm) {
if (algorithm == DEFAULT_ALGORITHM) {
return new Date(this, DEFAULT_ALGORITHM);
}
long utcDays = DEFAULT_ALGORITHM.transform(this);
return new Date(algorithm.transform(utcDays), algorithm);
} |
python | def updateSynapses(self, synapses, delta):
"""Update a set of synapses in the segment.
@param tp The owner TP
@param synapses List of synapse indices to update
@param delta How much to add to each permanence
@returns True if synapse reached 0
"""
reached0 = False
if delta >... |
python | def process_sample(job, inputs, tar_id):
"""
Converts sample.tar(.gz) into two fastq files.
Due to edge conditions... BEWARE: HERE BE DRAGONS
:param JobFunctionWrappingJob job: passed by Toil automatically
:param Namespace inputs: Stores input arguments (see main)
:param str tar_id: FileStore I... |
java | @Override
public final void process(final Map<String, Object> pRqVs,
final IRequestData pRqDt) throws Exception {
OnlineBuyer buyer = this.buySr.getBuyr(pRqVs, pRqDt);
if (buyer == null) {
buyer = this.buySr.createBuyr(pRqVs, pRqDt);
}
String nm = pRqDt.getParameter("nm");
String em = pR... |
java | public ResumeProcessesRequest withScalingProcesses(String... scalingProcesses) {
if (this.scalingProcesses == null) {
setScalingProcesses(new com.amazonaws.internal.SdkInternalList<String>(scalingProcesses.length));
}
for (String ele : scalingProcesses) {
this.scalingProc... |
java | public void resumeJob (@Nonnull final TriggerKey aTriggerKey)
{
ValueEnforcer.notNull (aTriggerKey, "TriggerKey");
try
{
m_aScheduler.resumeTrigger (aTriggerKey);
LOGGER.info ("Succesfully resumed job with TriggerKey " + aTriggerKey.toString ());
}
catch (final SchedulerException ex)
... |
java | private void unmarshalDescriptor() throws CmsXmlException, CmsException {
if (null != m_desc) {
// unmarshal descriptor
m_descContent = CmsXmlContentFactory.unmarshal(m_cms, m_cms.readFile(m_desc));
// configure messages if wanted
CmsProperty bundleProp = m_cms... |
java | public LocalVariable getLocalVariable(Location useLocation, int number) {
int useLoc = useLocation.getLocation();
if (useLoc < 0) {
return null;
} else {
return getLocalVariable(useLoc, number);
}
} |
java | @Override
public MetaData getMetaData() throws CDIException {
MetaData metaData = null;
if (isModule()) {
metaData = getModuleMetaData();
} else {
metaData = application.getApplicationMetaData();
}
return metaData;
} |
java | public static String getAppId() {
if (appId != null)
return appId;
appId = PropertyManager.getProperty(PropertyNames.MDW_APP_ID);
if (appId == null) // try legacy property
appId = PropertyManager.getProperty("mdw.application.name");
if (appId == null)
... |
python | def remove_range(self, start, end, callback=None):
'''Remove a range by rank.
This is equivalent to perform::
del l[start:end]
on a python list.
It returns the number of element removed.
'''
N = len(self)
if start < 0:
start = max(N + st... |
python | def timeout_queue_process(self):
"""
Check the timeout_queue and set any due modules to update.
"""
# process any items that need adding to the queue
while self.timeout_add_queue:
self.timeout_process_add_queue(*self.timeout_add_queue.popleft())
now = time.tim... |
python | def atmos_worker(srcs, window, ij, args):
"""A simple atmospheric correction user function."""
src = srcs[0]
rgb = src.read(window=window)
rgb = to_math_type(rgb)
atmos = simple_atmo(rgb, args["atmo"], args["contrast"], args["bias"])
# should be scaled 0 to 1, scale to outtype
return scale... |
python | def bind(self, source=None, destination=None, node=None,
edge_title=None, edge_label=None, edge_color=None, edge_weight=None,
point_title=None, point_label=None, point_color=None, point_size=None):
"""Relate data attributes to graph structure and visual representation.
To faci... |
python | def draw_pathcollection(data, obj):
"""Returns PGFPlots code for a number of patch objects.
"""
content = []
# gather data
assert obj.get_offsets() is not None
labels = ["x" + 21 * " ", "y" + 21 * " "]
dd = obj.get_offsets()
draw_options = ["only marks"]
table_options = []
if o... |
python | def _dihed_angle_low(av, bv, cv, deriv):
"""Similar to dihed_cos, but with relative vectors"""
a = Vector3(9, deriv, av, (0, 1, 2))
b = Vector3(9, deriv, bv, (3, 4, 5))
c = Vector3(9, deriv, cv, (6, 7, 8))
b /= b.norm()
tmp = b.copy()
tmp *= dot(a, b)
a -= tmp
tmp = b.copy()
tmp ... |
java | public PageKey withParentId(String parentId) {
if (StringUtil.isBlank(parentId)) {
throw new IllegalArgumentException("Parent ID cannot be empty");
}
return new PageKey(parentId, this.offset, this.blockSize);
} |
python | def _create_server(
shell,
server_address,
port,
cert_file=None,
key_file=None,
key_password=None,
ca_file=None,
):
"""
Creates the TCP console on the given address and port
:param shell: The remote shell handler
:param server_address: Server bound address
:param port: S... |
python | def sup_inf(u):
"""SI operator."""
if np.ndim(u) == 2:
P = _P2
elif np.ndim(u) == 3:
P = _P3
else:
raise ValueError("u has an invalid number of dimensions "
"(should be 2 or 3)")
erosions = []
for P_i in P:
erosions.append(ndi.binary_ero... |
java | public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case STATUS:
return isSetStatus();
case METADATA_IN_JSON:
return isSetMetadataInJson();
case COLUMNS_LIST:
return isSetColumnsList();
case DATA_TYPE:
... |
python | def disconnect(self):
"""
Disconnects from the SSDB server
"""
self._parser.on_disconnect()
if self._sock is None:
return
try:
self._sock.shutdown(socket.SHUT_RDWR)
self._sock.close()
except socket.error:
pass
... |
java | public UnsafeSorterIterator getSortedIterator() throws IOException {
assert(recordComparatorSupplier != null);
if (spillWriters.isEmpty()) {
assert(inMemSorter != null);
readingIterator = new SpillableIterator(inMemSorter.getSortedIterator());
return readingIterator;
} else {
final U... |
java | public LocationInfo whatIsAtPoint( int pixelX , int pixelY , LocationInfo output ) {
if( output == null )
output = new LocationInfo();
int numCategories = confusion.getNumRows();
synchronized ( this ) {
if( pixelX >= gridWidth ) {
output.insideMatrix = false;
output.col = output.row = pixelY*numCa... |
python | def license_id(filename):
"""Return the spdx id for the license contained in `filename`. If no
license is detected, returns `None`.
spdx: https://spdx.org/licenses/
licenses from choosealicense.com: https://github.com/choosealicense.com
Approximate algorithm:
1. strip copyright line
2. n... |
python | def _generate_message_error(cls, response_code, messages, response_id):
"""
:type response_code: int
:type messages: list[str]
:type response_id: str
:rtype: str
"""
line_response_code = cls._FORMAT_RESPONSE_CODE_LINE \
.format(response_code)
... |
python | def upload_local_file(filename=None, file=None, media_type=None, keep_open=False,
wait_on_close=False, use_existing_dxfile=None, show_progress=False,
write_buffer_size=None, multithread=True, **kwargs):
'''
:param filename: Local filename
:type filename: string
... |
python | def set_key_state(self, key, state):
"""Sets the key state and redraws it.
:param key: Key to update state for.
:param state: New key state.
"""
key.state = state
self.renderer.draw_key(self.surface, key) |
python | def _generate_mark_code(rule_name):
"""Generates a two digit string based on a provided string
Args:
rule_name (str): A configured rule name 'pytest_mark3'.
Returns:
str: A two digit code based on the provided string '03'
"""
code = ''.join([i for i in str(rule_name) if i.isdigit()... |
java | public List<JoinColumn<ManyToOne<T>>> getAllJoinColumn()
{
List<JoinColumn<ManyToOne<T>>> list = new ArrayList<JoinColumn<ManyToOne<T>>>();
List<Node> nodeList = childNode.get("join-column");
for(Node node: nodeList)
{
JoinColumn<ManyToOne<T>> type = new JoinColumnImpl<ManyToOne<T>>... |
java | @Override
public <R2> Lazy<Either<L, R2>> lazyZip(
Lazy<? extends Applicative<Function<? super R, ? extends R2>, Either<L, ?>>> lazyAppFn) {
return match(l -> lazy(left(l)),
r -> lazyAppFn.fmap(eitherLF -> eitherLF.<R2>fmap(f -> f.apply(r)).coerce()));
} |
java | @CanIgnoreReturnValue
public final Ordered containsAtLeastElementsIn(Iterable<?> expectedIterable) {
List<?> actual = Lists.newLinkedList(actual());
final Collection<?> expected = iterableToCollection(expectedIterable);
List<Object> missing = newArrayList();
List<Object> actualNotInOrder = newArrayLi... |
java | public ServiceFuture<KeyBundle> updateKeyAsync(String vaultBaseUrl, String keyName, String keyVersion, final ServiceCallback<KeyBundle> serviceCallback) {
return ServiceFuture.fromResponse(updateKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion), serviceCallback);
} |
python | def make_article_info_copyright(self, article_info_div):
"""
Makes the copyright section for the ArticleInfo. For PLoS, this means
handling the information contained in the metadata <permissions>
element.
"""
perm = self.article.root.xpath('./front/article-meta/permission... |
python | def detect(self):
"""Detect and return the IP address."""
if PY3: # py23
import subprocess # noqa: S404 @UnresolvedImport pylint: disable=import-error
else:
import commands as subprocess # @UnresolvedImport pylint: disable=import-error
try:
theip = ... |
python | def load_code(fp, magic_int, code_objects={}):
"""
marshal.load() written in Python. When the Python bytecode magic loaded is the
same magic for the running Python interpreter, we can simply use the
Python-supplied marshal.load().
However we need to use this when versions are different since the in... |
python | def run(debug=False):
"""PURPOSE: start a starcraft2 process using the defined the config parameters"""
FLAGS(sys.argv)
config = gameConfig.Config(
version=None, # vers is None... unless a specific game version is desired
themap=selectMap(ladder=True), # pick a random ladder map
play... |
java | public LockedInodePath lockFullInodePath(AlluxioURI uri, LockPattern lockPattern)
throws InvalidPathException, FileDoesNotExistException {
LockedInodePath inodePath = lockInodePath(uri, lockPattern);
if (!inodePath.fullPathExists()) {
inodePath.close();
throw new FileDoesNotExistException(Exce... |
java | public static <E, T, X extends RuntimeException> List<E> parallelConvertIfNullThrow(List<T> source,
Class<E> targetClass, Supplier<X> exceptionSupplier) {
return BeansConvertStrategy.parallelConvertBeans(source, targetClass, exceptionSupplier, false);
} |
python | def setup_dir(self):
"""Change directory for script if necessary."""
cd = self.opts.cd or self.config['crony'].get('directory')
if cd:
self.logger.debug(f'Adding cd to {cd}')
self.cmd = f'cd {cd} && {self.cmd}' |
java | @Modified
protected synchronized void modified(Map<String, Object> cfwConfiguration) {
if (null == cfwConfiguration) {
return;
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(this, tc, "Processing config", cfwConfiguration);
}
... |
java | public static Calendar addYears(Calendar origin, int value) {
Calendar cal = sync((Calendar) origin.clone());
cal.add(Calendar.YEAR, value);
return sync(cal);
} |
python | def major(self, major: int) -> None:
"""
param major
Major version number property. Must be a non-negative integer.
"""
self.filter_negatives(major)
self._major = major |
python | def media_upload(self, media, additional_owners=None):
"""
Uploads an image to Twitter for later embedding in tweets.
https://dev.twitter.com/rest/reference/post/media/upload
:param file media:
The image file to upload (see the API docs for limitations).
:param lis... |
python | def get_root_bins(self):
"""Gets the root bins in the bin hierarchy.
A node with no parents is an orphan. While all bin ``Ids`` are
known to the hierarchy, an orphan does not appear in the
hierarchy unless explicitly added as a root node or child of
another node.
return... |
python | def _proxy_bypass_macosx_sysconf(host, proxy_settings):
"""
Return True iff this host shouldn't be accessed using a proxy
This function uses the MacOSX framework SystemConfiguration
to fetch the proxy information.
proxy_settings come from _scproxy._get_proxy_settings or get mocked ie:
{ 'exclu... |
python | def CSS_setKeyframeKey(self, styleSheetId, range, keyText):
"""
Function path: CSS.setKeyframeKey
Domain: CSS
Method name: setKeyframeKey
Parameters:
Required arguments:
'styleSheetId' (type: StyleSheetId) -> No description
'range' (type: SourceRange) -> No description
'keyText' (type... |
python | def survey_change_name(request, pk):
"""
Works well with:
http://www.appelsiini.net/projects/jeditable
"""
survey = get_object_or_404(Survey, pk=pk)
if not request.user.has_perm("formly.change_survey_name", obj=survey):
raise PermissionDenied()
survey.name = request.POST.get("nam... |
java | private CmsTemplateMapperConfiguration getConfiguration(final CmsObject cms) {
if (!m_enabled) {
return CmsTemplateMapperConfiguration.EMPTY_CONFIG;
}
if (m_configPath == null) {
m_configPath = OpenCms.getSystemInfo().getConfigFilePath(cms, "template-mapping.xml");
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.