language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | public void setOption(String key, Object value) throws UnsupportedOption {
if (key.equals(INCLUDE_COOKIE)) {
options.put(key, null);
} else if (key.equals(INCLUDE_OPTIONS)) {
options.put(key, null);
} else if (key.equals(INCLUDE_SCHEMA_ID)) {
options.put(key, null);
} else if (key.equals(RETAIN_ENTITY_... |
java | public void marshall(DescribeIndexRequest describeIndexRequest, ProtocolMarshaller protocolMarshaller) {
if (describeIndexRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(describeIndexReques... |
python | def run(self, error_on_warning=False, region=None, accounts=[]):
"""
Main entry point.
"""
all_warnings = []
all_criticals = []
if len(accounts) == 0:
# if no accounts specified, run all of them
accounts = self._conf.list_account_ids
for ac... |
java | private IncludeAllPageAndToc addPaginationInformation(List<IncludeAllPageWithOutput> pages, boolean includeChildSummary) {
List<Header> globalToc = new ArrayList<>();
List<IncludeAllPageWithPagination> processedResources = new ArrayList<>();
for (int i = 0; i < pages.size(); i++) {
if (!pages.get(i)... |
python | def create_mask(indexer, shape, chunks_hint=None):
"""Create a mask for indexing with a fill-value.
Parameters
----------
indexer : ExplicitIndexer
Indexer with -1 in integer or ndarray value to indicate locations in
the result that should be masked.
shape : tuple
Shape of t... |
python | def _load_jobs(self):
"""
Load the job definitions from the Flask configuration.
"""
jobs = self.app.config.get('SCHEDULER_JOBS')
if not jobs:
jobs = self.app.config.get('JOBS')
if jobs:
for job in jobs:
self.add_job(**job) |
java | @Override
public int compareTo(final AnnotationEnumValue o) {
final int diff = className.compareTo(o.className);
return diff == 0 ? valueName.compareTo(o.valueName) : diff;
} |
java | private <T> T nullableWithFallback(final T first, final T second) {
return first != null ? first : second;
} |
python | def render_GET(self, request):
"""Handle a GET request."""
if not request.args:
request.setHeader("Content-Type", "text/plain")
return self.get_status_text()
else:
self.handle(request)
return NOT_DONE_YET |
java | public final long appendRecord(T record) throws IOException {
long pointer = this.writeView.getCurrentPointer();
try {
this.serializer.serialize(record, this.writeView);
this.recordCounter++;
return pointer;
} catch (EOFException e) {
// we ran out of pages.
// first, reset the pages and then we n... |
python | def get_artifact(self):
"""Return the job artifact built by the parser."""
self.artifact[self.parser.name] = self.parser.get_artifact()
return self.artifact |
python | def _get_handler(self, node_id):
"""Get the handler of a given node."""
handler = self._get_attrs(node_id).get(self.HANDLER, self._default_handler)
# Here we make sure the handler is an instance of `BasicNodeHandler` or inherited
# types. While generally being bad Python practice, we st... |
java | public void setRangesOnIndexedValues(java.util.Collection<ObjectAttributeRange> rangesOnIndexedValues) {
if (rangesOnIndexedValues == null) {
this.rangesOnIndexedValues = null;
return;
}
this.rangesOnIndexedValues = new java.util.ArrayList<ObjectAttributeRange>(rangesOnI... |
python | def subplots(scale_x=None, scale_y=None, scale=None, **kwargs):
r'''
Run ``matplotlib.pyplot.subplots`` with ``figsize`` set to the correct multiple of the default.
:additional options:
**scale, scale_x, scale_y** (``<float>``)
Scale the figure-size (along one of the dimensions).
'''
if 'figsize' in kwar... |
java | private boolean increment(int index)
{
if (index == -1)
{
return false;
}
int value = current.get(index);
if (value < max.get(index))
{
current.set(index, value+1);
updateMinMax(index+1);
return true;
... |
java | public synchronized void reconnect() {
LOGGER.info("start to reconnect....");
int retries = 0;
while (true) {
try {
if (!zk.getState().equals(States.CLOSED)) {
break;
}
LOGGER.warn("zookeeper lost connection, re... |
java | public static void packDirectory(File dir, ZipOutputStream zos) throws IOException {
byte[] buffer = new byte[64 * 1024]; // a reusable buffer
try {
traverseAndWrite(dir, zos, new StringBuilder(), true, buffer);
} finally {
close(zos);
}
} |
python | def _resource(self, resource_id):
"""Return the ``sandman2.model.Model`` instance with the given
*resource_id*.
:rtype: :class:`sandman2.model.Model`
"""
resource = self.__model__.query.get(resource_id)
if not resource:
raise NotFoundException()
retur... |
java | @Deprecated
public static void submitJobToQueue(
JobConfig.Builder jobConfigBuilder,
String queueName,
String jobName,
TaskDriver helixTaskDriver,
HelixManager helixManager,
long jobQueueDeleteTimeoutSeconds) throws Exception {
submitJobToWorkFlow(jobConfigBuilder, queueName, j... |
java | private boolean createGeometryIndexTable() {
boolean created = false;
// Create the geometry index table if needed as well
try {
if (!geometryIndexDao.isTableExists()) {
created = geoPackage.createGeometryIndexTable();
}
} catch (SQLException e) {
throw new GeoPackageException(
"Failed to cr... |
python | def _get_running_app_ids(self, rm_address, auth, ssl_verify):
"""
Return a dictionary of {app_id: (app_name, tracking_url)} for the running MapReduce applications
"""
metrics_json = self._rest_request_to_json(
rm_address,
auth,
ssl_verify,
... |
python | def _create_mapping(grammar):
# type: (Grammar) -> (Dict[int, Set[Type[Rule]]], Dict[int, Set[Type[Rule]]])
"""
Create mapping between symbols and rules rewritable to these symbols.
:param grammar: Grammar to use.
:return: Tuple of two dictionaries.
First dictionary maps rule to terminal hash.
... |
python | def _get_page_with_optional_heading(self, page_file_path: str) -> str or Dict:
'''Get the content of first heading of source Markdown file, if the file
contains any headings. Return a data element of ``pages`` section
of ``mkdocs.yml`` file.
:param page_file_path: path to source Markdow... |
python | def _make_module_refnode(self, builder, fromdocname, name, contnode):
"""Helper function to generate new xref node based on
current environment.
"""
# Get additional info for modules.
docname, synopsis, platform, deprecated = self.data['modules'][name]
title = name
... |
java | public Observable<Page<DataLakeStoreAccountInner>> listByResourceGroupAsync(final String resourceGroupName) {
return listByResourceGroupWithServiceResponseAsync(resourceGroupName)
.map(new Func1<ServiceResponse<Page<DataLakeStoreAccountInner>>, Page<DataLakeStoreAccountInner>>() {
@O... |
python | def run(self):
'''
Collect all tests to run and run them.
Each method will be run :attr:`Benchmark.times`.
'''
tests = self._collect()
if not tests:
return
self.times
self.before_class()
for test in tests:
func = getattr... |
java | @Override
public double rand() {
int mm = m;
int nn = n;
if (mm > N / 2) {
// invert mm
mm = N - mm;
}
if (nn > N / 2) {
// invert nn
nn = N - nn;
}
if (nn > mm) {
// swap nn and mm
int... |
java | private static String getRegEx(int position, String... options) {
String value = "" + position;
for (int i = 0; i < options.length; i++) {
value += "," + options[i];
}
return "{" + value + "}";
} |
python | def to_datetime(date):
"""Turn a date into a datetime at midnight.
"""
return datetime.datetime.combine(date, datetime.datetime.min.time()) |
python | def save_family(self, family_form, *args, **kwargs):
"""Pass through to provider FamilyAdminSession.update_family"""
# Implemented from kitosid template for -
# osid.resource.BinAdminSession.update_bin
if family_form.is_for_update():
return self.update_family(family_form, *ar... |
java | @Override
public void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.about);
TextView tv = (TextView) findViewById(R.id.legal_text);
tv.setText(readRawTextFile(R.raw.legal));
tv = (TextView) findViewById(R.id.info_text);
tv.setText(Html.fromHtml(readRawTextFile... |
python | def imwrite(file, data=None, shape=None, dtype=None, **kwargs):
"""Write numpy array to TIFF file.
Refer to the TiffWriter class and its asarray function for documentation.
A BigTIFF file is created if the data size in bytes is larger than 4 GB
minus 32 MB (for metadata), and 'bigtiff' is not specifie... |
java | private String buildPayForm(Map<String, String> payParams) {
StringBuilder form = new StringBuilder();
form.append("<form id=\"pay_form\" name=\"pay_form\"").append(" action=\"" + Alipay.GATEWAY).append(AlipayField.INPUT_CHARSET+"=").append(alipay.inputCharset).append("\" method=\"POST\">");
fo... |
python | def handle_type(self, frames):
"""
Config video types
"""
if self.vtype == 'mouth':
self.process_frames_mouth(frames)
elif self.vtype == 'face':
self.process_frames_face(frames)
else:
raise Exception('Video type not found') |
java | @Override
public void visitClassContext(ClassContext clsContext) {
try {
if ((collectionCls == null) || (setCls == null) || (mapCls == null)) {
return;
}
stack = new OpcodeStack();
super.visitClassContext(clsContext);
} finally {
... |
java | public static base_response add(nitro_service client, vpnclientlessaccesspolicy resource) throws Exception {
vpnclientlessaccesspolicy addresource = new vpnclientlessaccesspolicy();
addresource.name = resource.name;
addresource.rule = resource.rule;
addresource.profilename = resource.profilename;
return addre... |
java | private void validateDefinesDeclaration(Node n, JSDocInfo info) {
if (info != null && info.isDefine() && n.isLet()) {
report(n, INVALID_DEFINE_ON_LET);
}
} |
java | protected HttpURLConnection openConnection(String url, Map<String, String> header) throws IOException {
// Initialize connection
URL urlObj = null;
HttpURLConnection conn = null;
int redirectCount = 0;
boolean redirect = true;
while (redirect) {
if (redirectCount > 10) {
throw new ProtocolException(... |
java | public void addEventListener(EventListener listener)
throws IllegalArgumentException
{
if (listener instanceof HttpSessionAttributeListener)
_sessionAttributeListeners.add(listener);
if (listener instanceof HttpSessionListener)
_sessionListeners.add(listener);
... |
java | private TableAlias createTableAlias(ClassDescriptor cld, List hints, String path)
{
TableAlias alias;
boolean lookForExtents = false;
if (!cld.getExtentClasses().isEmpty() && path.length() > 0)
{
lookForExtents = true;
}
String aliasName = Stri... |
java | public void load(CmsObject cms, CmsResource resource) throws CmsException {
CmsFile file = cms.readFile(resource);
CmsObject rootCms = OpenCms.initCmsObject(cms);
rootCms.getRequestContext().setSiteRoot("");
CmsXmlContent content = CmsXmlContentFactory.unmarshal(cms, file);
... |
java | public void setProjectionMatrix(float x1, float y1, float z1, float w1,
float x2, float y2, float z2, float w2, float x3, float y3,
float z3, float w3, float x4, float y4, float z4, float w4) {
NativeCustomCamera.setProjectionMatrix(getNative(), x1, y1, z1, w1, x2,
y2, z2... |
java | public static int dot (int vsx, int vsy, int v1ex, int v1ey, int v2ex, int v2ey)
{
return ((v1ex - vsx) * (v2ex - vsx) + (v1ey - vsy) * (v2ey - vsy));
} |
java | @Override
public EClass getIfcInterceptorType() {
if (ifcInterceptorTypeEClass == null) {
ifcInterceptorTypeEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI)
.getEClassifiers().get(325);
}
return ifcInterceptorTypeEClass;
} |
python | def get(key, default=''):
'''
.. versionadded: 0.14.0
Attempt to retrieve the named value from opts, pillar, grains of the master
config, if the named value is not available return the passed default.
The default return is an empty string.
The value can also represent a value in a nested dict ... |
java | public void changeSite(String siteRoot, String path, boolean force) {
CmsObject cms = A_CmsUI.getCmsObject();
String currentSiteRoot = cms.getRequestContext().getSiteRoot();
if (force || !currentSiteRoot.equals(siteRoot)) {
CmsAppWorkplaceUi.get().changeSite(siteRoot);
i... |
java | private Optional<String> get(String key, Set<String> processingKeys) {
for (ConfigurationSource configurationSource : config.getConfigurationSources()) {
Optional<String> value = configurationSource.get(key);
if (value.isPresent()) {
return Optional.of(interpolateStri... |
python | def create_pipeline_field(self, pipeline_key, name, field_type, **kwargs):
'''Creates a pipeline field with the provided attributes.
Args:
pipeline_key specifying the pipeline to add the field to
name required name string
field_type required type string [TEXT_INPUT, DATE or PERSON]
kwargs {}
ret... |
python | def prepare_initial(self, X):
"""Prepare the initial embedding which can be optimized as needed.
Parameters
----------
X: np.ndarray
The data matrix to be embedded.
Returns
-------
TSNEEmbedding
An unoptimized :class:`TSNEEmbedding` objec... |
python | def batch_eval(*args, **kwargs):
"""
Wrapper around deprecated function.
"""
# Inside function to avoid circular import
from cleverhans.evaluation import batch_eval as new_batch_eval
warnings.warn("batch_eval has moved to cleverhans.evaluation. "
"batch_eval will be removed from utils_tf on ... |
python | def filter(self, path_filters):
"""
Filters the loaded AttrTree using the supplied path_filters.
"""
if not path_filters: return self
# Convert string path filters
path_filters = [tuple(pf.split('.')) if not isinstance(pf, tuple)
else pf for pf in... |
java | public static void copyStreamAndClose(InputStream is, OutputStream os) throws IOException {
copyStreamAndClose(is, os, DEFAULT_BUFFER_SIZE);
} |
python | def csv(
self,
dirPath=None):
"""*Render the results in csv format*
**Key Arguments:**
- ``dirPath`` -- the path to the directory to save the rendered results to. Default *None*
**Return:**
- `csvSources` -- the top-level transient data
... |
java | @Nullable
public AbsoluteRange getHistogramBoundaries() {
if (boundaries == null) {
boundaries = Tools.extractHistogramBoundaries(getBuiltQuery()).orElse(null);
}
return boundaries;
} |
python | def generate_gaussian_profile(seeing_fwhm):
"""Generate a normalized Gaussian profile from its FWHM"""
FWHM_G = 2 * math.sqrt(2 * math.log(2))
sigma = seeing_fwhm / FWHM_G
amplitude = 1.0 / (2 * math.pi * sigma * sigma)
seeing_model = Gaussian2D(amplitude=amplitude,
x_m... |
java | public Optional<Member> getOptionalMember(Object projectIdOrPath, Integer userId) {
try {
return (Optional.ofNullable(getMember(projectIdOrPath, userId)));
} catch (GitLabApiException glae) {
return (GitLabApi.createOptionalFromException(glae));
}
} |
python | def dict_to_csv(orig_dict, file_name, field_names_tuple, file_location):
"""
Function to export a dictionary to a csv file
Args:
orig_dict: The dictionary you want exported
file_name: The name of the exported file
field_names_tuple: The fieldnames in a tuple
file_location: Th... |
java | public void setEnabled(boolean bEnableFlag) // Init this field override for other value
{
if (m_fldTarget != null)
m_fldTarget.setEnabled(bEnableFlag);
else if (m_sField != null)
m_sField.setEnabled(bEnableFlag);
else
{ // No field means enable/disable the... |
python | def fit_transform(self, data):
"""Fit the model and transform data or load already processed data.
Loads cached or persisted output or adapts data for the current transformer and
executes ``transformer.fit_transform``.
Args:
data (dict): data dictionary with keys as input n... |
python | def from_axis_angle_and_translation(axis, angle, angle_in_radians=False,
translation_vec=(0, 0, 0)):
"""
Generates a SymmOp for a rotation about a given axis plus translation.
Args:
axis: The axis of rotation in cartesian space. For example,
... |
python | def addtobase(subject, base_suffix):
"""
Adds the string *base_suffix* to the basename of *subject*.
"""
if not base_suffix:
return subject
base, ext = os.path.splitext(subject)
return base + base_suffix + ext |
python | def verify_config_container(object_):
"""Verify object is a valid config container
Valid config containers provide zope.interface.common.mapping.IEnumerableMapping
or an iterable of zope.interface.common.mapping.IEnumerableMapping.
verification is performed by checking required interfaces attr... |
python | def template_chooser_clicked(self):
"""Slot activated when report file tool button is clicked.
.. versionadded: 4.3.0
"""
path = self.template_path.text()
if not path:
path = setting('lastCustomTemplate', '', str)
if path:
directory = dirname(path... |
python | def _grow(growth, walls, target, i, j, steps, new_steps, res):
'''
fills [res] with [distance to next position where target == 1,
x coord.,
y coord. of that position in target]
using region growth
i,j -> pixel position
growth -> a work array, ne... |
python | def upload(self, version=None, tags=None, ext=None, source_fpath=None,
overwrite=False, **kwargs):
"""Uploads the given instance of this dataset to dataset store.
Parameters
----------
version: str, optional
The version of the instance of this dataset.
... |
python | def rr_present(name, HostedZoneId=None, DomainName=None, PrivateZone=False, Name=None, Type=None,
SetIdentifier=None, Weight=None, Region=None, GeoLocation=None, Failover=None,
TTL=None, ResourceRecords=None, AliasTarget=None, HealthCheckId=None,
TrafficPolicyInstanceId=None... |
python | def GetSubkeyByPath(self, key_path):
"""Retrieves a subkey by path.
Args:
key_path (str): path of the subkey.
Returns:
WinRegistryKey: Windows Registry subkey or None if not found.
"""
if not self._registry_key and self._registry:
self._GetKeyFromRegistry()
subkey = self
... |
python | def _register_self(self, logfile, key=JobDetails.topkey, status=JobStatus.unknown):
"""Runs this link, captures output to logfile,
and records the job in self.jobs"""
fullkey = JobDetails.make_fullkey(self.full_linkname, key)
if fullkey in self.jobs:
job_details = self.jobs[f... |
java | public TransferState asynchGet(String remoteFileName,
DataSink sink,
MarkerListener mListener)
throws IOException, ClientException, ServerException {
checkTransferParamsGet();
localServer.store(sink);
controlChannel.w... |
python | def to_lines(s):
"""
Like `str.splitlines()`, except that an empty string results in a
one-element list and a trailing newline results in a trailing empty string
(and all without re-implementing Python's changing line-splitting
algorithm).
>>> to_lines('')
['']
>>> to_lines('\\n')
[... |
java | public static String createDirectoryPath(String source)
{
if (tc.isEntryEnabled()) Tr.entry(tc, "createDirectoryPath",source);
String directoryPath = null;
if (source != null)
{
directoryPath = "";
final StringTokenizer tokenizer = new StringTokenizer(source,"\\/... |
python | def cli(yaml_paths, pptx_template_path, font_size, master_slide_idx, slide_layout_idx, dst_dir, font_name,
slide_txt_alignment, validate):
"""
A powerpoint builder
https://github.com/sukujgrg/pptx-builder-from-yaml
"""
dst_dir = Path(dst_dir)
pptx_template_path = Path(pptx_template_p... |
java | public void reset() throws IOException {
check();
this.position(0);
this.commit();
// forget about the rest
this.getRandomAccessFile().getChannel().truncate(TAEnabledRandomAccessFile.HEADER_LENGTH);
} |
python | def cluster_node(self, node_id):
"""
A node resource contains information about a node in the cluster.
:param str node_id: The node id
:returns: API response object with JSON data
:rtype: :py:class:`yarn_api_client.base.Response`
"""
path = '/ws/v1/cluster/nodes/... |
python | def verify_and_fill_address_paths_from_bip32key(address_paths, master_key, network):
'''
Take address paths and verifies their accuracy client-side.
Also fills in all the available metadata (WIF, public key, etc)
'''
assert network, network
wallet_obj = Wallet.deserialize(master_key, network=... |
python | def to_image(dataset):
"""convert ``dataset`` into a :class:`~trollimage.xrimage.XRImage` instance.
Convert the ``dataset`` into an instance of the
:class:`~trollimage.xrimage.XRImage` class. This function makes no other
changes. To get an enhanced image, possibly with overlays and decoration,
se... |
java | private void growSingleElectronArray() {
growArraySize = (singleElectrons.length < growArraySize) ? growArraySize : singleElectrons.length;
ISingleElectron[] newSingleElectrons = new ISingleElectron[singleElectrons.length + growArraySize];
System.arraycopy(singleElectrons, 0, newSingleElectrons,... |
python | def put_script(self, id, body, context=None, params=None):
"""
Create a script in given language with specified ID.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html>`_
:arg id: Script ID
:arg body: The document
"""
for param... |
java | @Override
public EClass getIfcCartesianPointList3D() {
if (ifcCartesianPointList3DEClass == null) {
ifcCartesianPointList3DEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI)
.getEClassifiers().get(80);
}
return ifcCartesianPointList3DEClass;
} |
python | def create_form(self, obj=None):
"""Create form."""
kbtype = request.args['kbtype'] if 'kbtype' in request.args else 'w'
if kbtype == KnwKB.KNWKB_TYPES['written_as']:
self.form = WrittenAsKnowledgeForm
elif kbtype == KnwKB.KNWKB_TYPES['dynamic']:
self.form = Dyna... |
java | public static double convert(TemperatureScale from, TemperatureScale to, double temperature) {
switch(from) {
case FARENHEIT:
return convertFromFarenheit(to, temperature);
case CELSIUS:
return convertFromCelsius(to, temperature);
case KELVIN:... |
python | def get_script_from_egg(name, dist):
"""Returns location, content of script in distribution or (None, None) if not there."""
if dist.metadata_isdir('scripts') and name in dist.metadata_listdir('scripts'):
return (
os.path.join(dist.egg_info, 'scripts', name),
dist.get_metadata('scripts/%s' % nam... |
java | public void close() throws IOException {
if (closed) {
checkWriteThread();
return;
}
try {
buffer.close();
// writeThread should exit after this
// and close underlying stream
try {
writeThread.join();
} catch (InterruptedException e) {
throw new... |
java | @Override
public FileContent getFileContent(Class<? extends FileEntity> type, Integer entityId, Integer fileId) {
return this.handleGetFileContent(type, entityId, fileId);
} |
python | def readSentence(self):
"""
Read every word untill empty word (NULL byte) is received.
:return: Reply word, tuple with read words.
"""
sentence = tuple(word for word in iter(self.readWord, b''))
self.log('--->', *sentence)
reply_word, words = sentence[0], sentenc... |
java | public static byte[] getBytesUnchecked(String string, String charsetName) {
if (string == null) {
return null;
}
try {
return string.getBytes(charsetName);
} catch (UnsupportedEncodingException e) {
throw StringUtils.newIllegalStateException(charsetNam... |
python | def common_api_auth_options(f):
"""Add common API authentication options to commands."""
@click.option(
"-k",
"--api-key",
hide_input=True,
envvar="CLOUDSMITH_API_KEY",
help="The API key for authenticating with the API.",
)
@click.pass_context
@functools.wrap... |
python | def from_gps(gps):
"""Convert a GPS time into a `datetime.datetime`.
Parameters
----------
gps : `LIGOTimeGPS`, `int`, `float`
GPS time to convert
Returns
-------
datetime : `datetime.datetime`
ISO-format datetime equivalent of input GPS time
Examples
--------
... |
python | def spider_url(zap_helper, url, context_name, user_name):
"""Run the spider against a URL."""
console.info('Running spider...')
with helpers.zap_error_handler():
zap_helper.run_spider(url, context_name, user_name) |
python | def get_object(objref, data=None, return_fields=None, max_results=None,
ensure_none_or_one_result=False, **api_opts):
'''
Get raw infoblox object. This is a low level api call.
CLI Example:
.. code-block:: bash
salt-call infoblox.get_object objref=[_ref of object]
'''
i... |
python | def set_options_values(self, options, parse=False, strict=False):
""" Set the options from a dict of values (in string).
:param option_values: the values of options (in format `{"opt_name": "new_value"}`)
:type option_values: dict
:param parse: whether to parse the given value
... |
java | public void info(Enum<?> key, Object... args) {
if (!logger.isInfoEnabled()) {
return;
}
String translatedMsg = imc.getMessage(key, args);
MessageParameterObj mpo = new MessageParameterObj(key, args);
if (instanceofLAL) {
((LocationAwareLogger) logger).lo... |
java | @Override
public int getTransactionTimeout() {
for (TransactionSettingsProvider s : _serverWideConfigProvider.getTransactionSettingsProviders().services()) {
if (s.isActive()) {
final GlobalTransactionSettings gts = s.getGlobalTransactionSettings();
if (gts != n... |
python | def add_autoshape(self, id_, name, prst, x, y, cx, cy):
"""
Append a new ``<p:sp>`` shape to the group/shapetree having the
properties specified in call.
"""
sp = CT_Shape.new_autoshape_sp(id_, name, prst, x, y, cx, cy)
self.insert_element_before(sp, 'p:extLst')
r... |
java | @Override
public BigDecimal getBigDecimal(final String key, final BigDecimal defaultValue) {
try {
String value = get(key);
if (value == null) {
return defaultValue;
}
return new BigDecimal(value);
} catch (NumberFormatException ex) {
throw new ConversionException(ex);
}
} |
python | def get_exec_start_kwargs(self, action, container_name, exec_id, kwargs=None):
"""
Generates keyword arguments for the Docker client to set up the HostConfig or start a container.
:param action: Action configuration.
:type action: ActionConfig
:param container_name: Container na... |
python | def fit_gaussian(spectra, f_ppm, lb=2.6, ub=3.6):
"""
Fit a gaussian function to the difference spectra to be used for estimation
of the GABA peak.
Parameters
----------
spectra : array of shape (n_transients, n_points)
Typically the difference of the on/off spectra in each transient.
f_... |
java | public DelimiterWriterFactory addColumnTitles(final Collection<String> columnTitles) {
if (columnTitles != null) {
for (final String columnTitle : columnTitles) {
addColumnTitle(columnTitle);
}
}
return this;
} |
java | @Override public void makeBuildVariables(AbstractBuild build, Map<String,String> variables) {
super.makeBuildVariables(build, variables);
} |
java | @Handler(priority = -1000)
public void onStop(Stop event) {
if (closing || !serverSocketChannel.isOpen()) {
return;
}
newSyncEventPipeline().fire(new Close(), this);
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.