language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def load_collection_from_url(resource, url, content_type=None):
"""
Creates a new collection for the registered resource and calls
`load_into_collection_from_url` with it.
"""
coll = create_staging_collection(resource)
load_into_collection_from_url(coll, url, content_type=content_type)
retur... |
python | def _krige(X, y, coords, variogram_function,
variogram_model_parameters, coordinates_type):
"""Sets up and solves the ordinary kriging system for the given
coordinate pair. This function is only used for the statistics calculations.
Parameters
----------
X: ndarray
float array [n... |
java | public DataObject object(File[] files, int start, int count) {
return STRUCT.fromMapsAndCollections(map(files, start, count));
} |
java | public Object[] getRowData() throws SQLException {
Object[] row = new Object[columnCount];
for (int i = 1; i < columnCount + 1; i++) {
row[i - 1] = getObject(i);
}
return row;
} |
python | def get_all_tags_of_confirmation(self, confirmation_id):
"""
Get all tags of confirmation
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param confirmation_id: the confirmation id
... |
python | def _add_element_by_names(src, names, value, override=False, digit=True):
"""
Internal method recursive to Add element into a list or dict easily using
a path.
============= ============= =======================================
Parameter Type Description
============= ====... |
python | def _update_font_weight(self, font_weight):
"""Updates font weight widget
Parameters
----------
font_weight: Integer
\tButton down iif font_weight == wx.FONTWEIGHT_BOLD
"""
toggle_state = font_weight & wx.FONTWEIGHT_BOLD == wx.FONTWEIGHT_BOLD
self.Tog... |
java | protected int compatibilityGraph() throws IOException {
int compGraphNodesListSize = compGraphNodes.size();
cEdges = new ArrayList<Integer>(); //Initialize the cEdges List
dEdges = new ArrayList<Integer>(); //Initialize the dEdges List
for (int a = 0; a < compGraphNodesListSize; a += 3... |
java | protected void _createChildren(DocumentRootNode parentNode, SarlScript modelElement) {
if (!Strings.isNullOrEmpty(modelElement.getPackage())) {
// Create the node for the package declaration.
createEStructuralFeatureNode(
parentNode, modelElement,
XtendPackage.Literals.XTEND_FILE__PACKAGE,
this.i... |
python | def _stream(self, doc, source, new_data, rollover=None, setter=None):
''' Internal implementation to handle special-casing stream events
on ``ColumnDataSource`` columns.
Normally any changes to the ``.data`` dict attribute on a
``ColumnDataSource`` triggers a notification, causing all o... |
python | def combine_keys(pks: Iterable[Ed25519PublicPoint]) -> Ed25519PublicPoint:
"""Combine a list of Ed25519 points into a "global" CoSi key."""
P = [_ed25519.decodepoint(pk) for pk in pks]
combine = reduce(_ed25519.edwards_add, P)
return Ed25519PublicPoint(_ed25519.encodepoint(combine)) |
python | def jpegrescan(ext_args):
"""Run the EXTERNAL program jpegrescan."""
args = copy.copy(_JPEGRESCAN_ARGS)
if Settings.jpegrescan_multithread:
args += ['-t']
if Settings.destroy_metadata:
args += ['-s']
args += [ext_args.old_filename, ext_args.new_filename]
extern.run_ext(args)
... |
java | public static double[] stringToDoubleArray( String string, String separator ) {
if (separator == null) {
separator = ",";
}
String[] stringSplit = string.trim().split(separator);
double[] array = new double[stringSplit.length];
for( int i = 0; i < array.length; i++ ) ... |
python | def map_or(self, callback: Callable[[T], U], default: A) -> Union[U, A]:
"""
Applies the ``callback`` to the contained value or returns ``default``.
Args:
callback: The callback to apply to the contained value.
default: The default value.
Returns:
Th... |
python | def name(self):
"""str: name."""
if self._tsk_attribute:
# The value of the attribute name will be None for the default
# data stream.
attribute_name = getattr(self._tsk_attribute.info, 'name', None)
if attribute_name:
try:
# pytsk3 returns an UTF-8 encoded byte string.... |
python | def __add_hopscotch_tour_step(self, message, selector=None, name=None,
title=None, alignment=None):
""" Allows the user to add tour steps for a website.
@Params
message - The message to display.
selector - The CSS Selector of the Element to a... |
java | public static <T extends V, V> Value<V> from(Optional<T> optional) {
LettuceAssert.notNull(optional, "Optional must not be null");
if (optional.isPresent()) {
return new Value<V>(optional.get());
}
return (Value<V>) EMPTY;
} |
python | def get_parameter(self):
"""
get the parameter object from the system for this var
needs to be backend safe (not passing or storing bundle)
"""
if not self.is_param:
raise ValueError("this var does not point to a parameter")
# this is quite expensive, so let... |
python | def unit_response(self):
"""Calculate :ref:`pysynphot-formula-uresp`.
.. warning::
Result is correct only if ``self.waveunits`` is in Angstrom.
Returns
-------
ans : float
Bandpass unit response.
"""
hc = units.HC
if hasattr(se... |
python | def create_one_index(self,
instance,
update=False,
delete=False,
commit=True):
'''
:param instance: sqlalchemy instance object
:param update: when update is True,use `update_document`,default `Fal... |
java | @Path("{snapshotId}/error")
@POST
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response error(@PathParam("snapshotId") String snapshotId,
SnapshotErrorBridgeParameters params) {
try {
Snapshot snapshot =
... |
java | public Object convertToDynamicBean(ResultSet rs) throws SQLException{
ResultSetMetaData rsmd = rs.getMetaData();
Map<String, ColumnMetaData> columnToPropertyMappings = createColumnToPropertyMappings(rsmd);
Class<?> beanClass = reuseOrBuildBeanClass(rsmd, columnToPropertyMappings);
BeanProcessor bean... |
java | private Description checkToString(ExpressionTree tree, VisitorState state) {
Symbol sym = ASTHelpers.getSymbol(tree);
if (!(sym instanceof VarSymbol || sym instanceof MethodSymbol)) {
return NO_MATCH;
}
Type type = ASTHelpers.getType(tree);
if (type instanceof MethodType) {
type = type.g... |
python | def commit_input_persist(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
commit = ET.Element("commit")
config = commit
input = ET.SubElement(commit, "input")
persist = ET.SubElement(input, "persist")
persist.text = kwargs.pop('per... |
python | def get_credentials(self, filterTerm=None):
"""
Return credentials from the database.
"""
cur = self.conn.cursor()
# if we're returning a single credential by ID
if self.is_credential_valid(filterTerm):
cur.execute("SELECT * FROM credentials WHERE id=? LIMIT... |
python | def pcdata(self, tup_tree):
"""
Return the concatenated character data within the child nodes of a
tuple tree node, as a unicode string. Whitespace is preserved.
The child nodes must be text nodes (no element nodes).
"""
try:
data = u''.join(tup_tree[2])
... |
python | def dynamips_auto_idlepc(self):
"""
Compute the idle PC for a dynamips node
"""
return (yield from self._compute.get("/projects/{}/{}/nodes/{}/auto_idlepc".format(self._project.id, self._node_type, self._id), timeout=240)).json |
python | def find_all(query: Query=None) -> List['ApiKey']:
"""
List all API keys.
"""
return [ApiKey.from_db(key) for key in db.get_keys(query)] |
python | def bbox_vert_aligned(box1, box2):
"""
Returns true if the horizontal center point of either span is within the
horizontal range of the other
"""
if not (box1 and box2):
return False
# NEW: any overlap counts
# return box1.left <= box2.right and box2.left <= box1.right
box1_le... |
java | public void setLayers(java.util.Collection<String> layers) {
if (layers == null) {
this.layers = null;
return;
}
this.layers = new com.amazonaws.internal.SdkInternalList<String>(layers);
} |
python | def add_status_line(self, label):
"""Add a status bar line to the table.
This function returns the status bar and it can be modified
from this return value.
"""
status_line = StatusBar(label,
self._sep_start, self._sep_end,
... |
java | protected void addExportVariableIfPresent(String variable, String typeName) {
String expVar = findPropertyValue(variable).getLatestValue();
if(expVar != null && !expVar.isEmpty()) {
addVariable(new CodeVariableBuilder().exportOnly().variableType(typeName).variableName(expVar));
}
... |
java | public Set<Library> getMissingLibraries(MinecraftDirectory minecraftDir) {
Set<Library> missing = new LinkedHashSet<>();
for (Library library : libraries)
if (library.isMissing(minecraftDir))
missing.add(library);
return Collections.unmodifiableSet(missing);
} |
python | def allows(self, user, permission, obj=_nothing):
"""Checks that a user has permission. Returns True or False.
:param user: a user.
:param permission: permission to check.
:param obj: (optional) an object to check permission for.
"""
rule = self._get_rule(obj)
i... |
python | def findinputslice(coord, sliceshape, sheetshape):
"""
Gets the matrix indices of a slice within an array of size
sheetshape from a sliceshape, positioned at coord.
"""
center_row, center_col = coord
n_rows, n_cols = sliceshape
sheet_rows, sheet_cols = sheetshape
... |
java | public void updateBytes(int columnIndex, byte[] x) throws SQLException {
startUpdate(columnIndex);
preparedStatement.setParameter(columnIndex, x);
} |
java | @SneakyThrows
protected void handlePolicyAttributes(final AuthenticationResponse response) {
val attributes = response.getLdapEntry().getAttributes();
for (val attr : attributes) {
if (this.attributesToErrorMap.containsKey(attr.getName()) && Boolean.parseBoolean(attr.getStringValue())) {... |
python | def get_authentication_tokens(self, callback_url=None, force_login=False,
screen_name=''):
"""Returns a dict including an authorization URL, ``auth_url``, to
direct a user to
:param callback_url: (optional) Url the user is returned to after
... |
java | public <V3, M4, C, N, Q> Q getRotKeyQuaternion(int keyIndex,
AiWrapperProvider<V3, M4, C, N, Q> wrapperProvider) {
return wrapperProvider.wrapQuaternion(m_rotKeys,
ROT_KEY_SIZE * keyIndex + 8);
} |
python | def isRunActive(g):
"""
Polls the data server to see if a run is active
"""
if g.cpars['hcam_server_on']:
url = g.cpars['hipercam_server'] + 'summary'
response = urllib.request.urlopen(url, timeout=2)
rs = ReadServer(response.read(), status_msg=True)
if not rs.ok:
... |
java | public Observable<RegistryListCredentialsResultInner> regenerateCredentialAsync(String resourceGroupName, String registryName, PasswordName name) {
return regenerateCredentialWithServiceResponseAsync(resourceGroupName, registryName, name).map(new Func1<ServiceResponse<RegistryListCredentialsResultInner>, Regist... |
python | def solve_series(self, x0, params, varied_data, varied_idx,
internal_x0=None, solver=None, propagate=True, **kwargs):
""" Solve system for a set of parameters in which one is varied
Parameters
----------
x0 : array_like
Guess (subject to ``self.post_proc... |
java | @Override
public Request<CancelSpotInstanceRequestsRequest> getDryRunRequest() {
Request<CancelSpotInstanceRequestsRequest> request = new CancelSpotInstanceRequestsRequestMarshaller().marshall(this);
request.addParameter("DryRun", Boolean.toString(true));
return request;
} |
java | public static Optional<CmsResource> getDetailOnlyPage(
CmsObject cms,
CmsResource detailContent,
String contentLocale) {
try {
CmsObject rootCms = OpenCms.initCmsObject(cms);
rootCms.getRequestContext().setSiteRoot("");
String path = getDetailOnlyPage... |
java | protected void validate(String operationType) throws Exception
{
super.validate(operationType);
MPSString manager_ip_validator = new MPSString();
manager_ip_validator.setConstraintIsReq(MPSConstants.GENERIC_CONSTRAINT, true);
manager_ip_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 1... |
python | def to_pwm(self, precision=4, extra_str=""):
"""Return pwm as string.
Parameters
----------
precision : int, optional, default 4
Floating-point precision.
extra_str |: str, optional
Extra text to include with motif id line.
Retur... |
python | def viable_source_types_for_generator_real (generator):
""" Returns the list of source types, which, when passed to 'run'
method of 'generator', has some change of being eventually used
(probably after conversion by other generators)
"""
assert isinstance(generator, Generator)
source_typ... |
python | def set_raw_holding_register(self, name, value):
"""Write to register by name."""
self._conn.write_register(
unit=self._slave,
address=(self._holding_regs[name]['addr']),
value=value) |
python | def get_version_exec_mapping_from_path(path):
"""
Find valid application version from given path object and return
a mapping of version, executable.
"""
version_executable = {}
logger.debug('Getting exes from path: {}'.format(path))
for sub_dir in path.iterdir():
if not sub... |
python | def distance_gps2(GPS, GPS2):
'''distance between two points'''
if GPS.TimeMS != GPS2.TimeMS:
# reject messages not time aligned
return None
return distance_two(GPS, GPS2) |
java | private void onEmbeddableId(EntityMetadata entityMetadata, MetamodelImpl metaModel, Table schemaTable,
Object entity, Row row) throws InstantiationException, IllegalAccessException
{
FieldDef fieldMetadata;
FieldValue value;
EmbeddableType embeddableType = metaModel.embeddable(en... |
python | def compare_annotations(ref_sample, test_sample, window_width, signal=None):
"""
Compare a set of reference annotation locations against a set of
test annotation locations.
See the Comparitor class docstring for more information.
Parameters
----------
ref_sample : 1d numpy array
A... |
python | def run(self):
"""run"""
if self.callback:
log.info(("{} - using callback={}")
.format(self.name,
self.callback))
self.callback(name=self.response_name,
task_queue=self.task_queue,
... |
java | private static String extractFaultDetail(SoapFaultDetailElement detail) {
StringResult detailResult = new StringResult();
try {
TransformerFactory transformerFactory = TransformerFactory.newInstance();
Transformer transformer = transformerFactory.newTransformer();
t... |
python | def _validate(self, p):
"""
Recursively validates the pattern (p), ensuring it adheres to the proper key names and structure.
"""
if self._is_operator(p):
for operator_or_filter in (p[1] if p[0] != '!' else [p[1]]):
if p[0] == '^':
self._va... |
python | def ohlc(self, pair, timeframe=None, **kwargs):
"""
Subscribe to the passed pair's OHLC data channel.
:param pair: str, Pair to request data for.
:param timeframe: str, {1m, 5m, 15m, 30m, 1h, 3h, 6h, 12h,
1D, 7D, 14D, 1M}
:param kwargs:
:re... |
python | def _isnull(expr):
"""
Return a sequence or scalar according to the input indicating if the values are null.
:param expr: sequence or scalar
:return: sequence or scalar
"""
if isinstance(expr, SequenceExpr):
return IsNull(_input=expr, _data_type=types.boolean)
elif isinstance(expr,... |
java | public void addTangoDataReadyListener(ITangoDataReadyListener listener, boolean stateless)
throws DevFailed {
event_listeners.add(ITangoDataReadyListener.class, listener);
event_identifier = subscribe_data_ready_event(attr_name, filters, stateless);
} |
python | def _generate_voxel_image(network, pore_shape, throat_shape, max_dim=200,
verbose=1):
r"""
Generates a 3d numpy array from a network model.
Parameters
----------
network : OpenPNM GenericNetwork
Network from which voxel image is to be generated
pore_shape : st... |
python | def execute_service_endpoint_request(self, service_endpoint_request, project, endpoint_id):
"""ExecuteServiceEndpointRequest.
[Preview API] Proxy for a GET request defined by a service endpoint.
:param :class:`<ServiceEndpointRequest> <azure.devops.v5_0.service_endpoint.models.ServiceEndpointReq... |
python | def decompose_seconds_in_day(seconds):
"""Decomposes seconds in day into hour, minute and second components.
Arguments
---------
seconds : int
A time of day by the number of seconds passed since midnight.
Returns
-------
hour : int
The hour component of the given time of da... |
java | public static Type getReceiverType(ExpressionTree expressionTree) {
if (expressionTree instanceof JCFieldAccess) {
JCFieldAccess methodSelectFieldAccess = (JCFieldAccess) expressionTree;
return methodSelectFieldAccess.selected.type;
} else if (expressionTree instanceof JCIdent) {
JCIdent metho... |
java | public void marshall(ExportSnapshotRequest exportSnapshotRequest, ProtocolMarshaller protocolMarshaller) {
if (exportSnapshotRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(exportSnapshotRe... |
java | public final int getField(final Field field)
{
if (sexagesimalDegreeParts == null)
{
sexagesimalDegreeParts = sexagesimalSplit(getDegrees());
}
return sexagesimalDegreeParts[field.ordinal()];
} |
java | public static double Incomplete(double a, double x) {
double ans, ax, c, r;
if (x <= 0 || a <= 0) return 0.0;
if (x > 1.0 && x > a) return 1.0 - ComplementedIncomplete(a, x);
ax = a * Math.log(x) - x - Log(a);
if (ax < -Constants.LogMax) return (0.0);
ax = Math.exp(ax... |
python | def to_grayscale_depth(self):
""" Converts to a grayscale and depth (G-D) image. """
gray = self.color.to_grayscale()
return GdImage.from_grayscale_and_depth(gray, self.depth) |
java | @Override
public void delete(final String fileName) throws FileMissingException, IOException {
// This prevents other read/write/delete/merge/purge operations to occur
this.lock.writeLock().lock();
try {
// Check active flag
Preconditions.checkState(this.active.get(... |
java | public static String encode_password(String decoded_string, String crypto_algorithm, Map<String, String> properties) {
/*
* encoding process:
*
* -- check for empty algorithm tag
* -- convert input String to byte[] UTF8 conversion code
* -- encipher byte[]
... |
python | def make_email(to, cc=None, bcc=None, subject=None, body=None):
"""\
Encodes either a simple e-mail address or a complete message with
(blind) carbon copies and a subject and a body.
:param str|iterable to: The email address (recipient). Multiple
values are allowed.
:param str|iterable|... |
python | def get_vm_full_path(self, si, vm):
"""
:param vm: vim.VirtualMachine
:return:
"""
folder_name = None
folder = vm.parent
if folder:
folder_name = folder.name
folder_parent = folder.parent
while folder_parent and folder_parent.... |
python | def _populate_basic_data(mfg_event, record):
"""Copies data from the OpenHTF TestRecord to the MfgEvent proto."""
# TODO:
# * Missing in proto: set run name from metadata.
# * `part_tags` field on proto is unused
# * `timings` field on proto is unused.
# * Handle arbitrary units as uom_code/uom_suff... |
python | def plot(self):
"""
Plot the magnitude depth.
"""
msg = "'%s.plot': ADW 2018-05-05"%self.__class__.__name__
DeprecationWarning(msg)
import ugali.utils.plotting
mask = hp.UNSEEN * np.ones(hp.nside2npix(self.nside))
mask[self.roi.pixels] = self.mask_roi_sp... |
python | def write_config_from_api(self, api, config_file=None, profile=None):
'''
Create/update the config file from a DataAPI object
Parameters
----------
api : object
The :py:class:`datafs.DataAPI` object from which
to create the config profile
profil... |
python | def nvrtcGetLoweredName(self, prog, name_expression):
"""
Notes the given name expression denoting a __global__ function or
function template instantiation.
"""
lowered_name = c_char_p()
code = self._lib.nvrtcGetLoweredName(prog,
... |
python | def del_calculation(job_id, confirmed=False):
"""
Delete a calculation and all associated outputs.
"""
if logs.dbcmd('get_job', job_id) is None:
print('There is no job %d' % job_id)
return
if confirmed or confirm(
'Are you sure you want to (abort and) delete this calcula... |
java | public void setResultAttributeMapping(final Map<String, ?> resultAttributeMapping) {
final Map<String, Set<String>> parsedResultAttributeMapping = MultivaluedPersonAttributeUtils.parseAttributeToAttributeMapping(resultAttributeMapping);
if (parsedResultAttributeMapping.containsKey("")) {
th... |
java | private HistoryEntry processIndex(List<HistoryEntry> history) {
log.debug("I received entry: "+index);
HistoryEntry selectedEntry = null;
if(index != null && index > 0) {
for(HistoryEntry entry : history) {
if(entry.getIndex() == index) {
if(!entry.isRevertible()) {
Syste... |
java | public List<IssueDto> selectByKeys(DbSession session, Collection<String> keys) {
return executeLargeInputs(keys, mapper(session)::selectByKeys);
} |
java | public static BufferedImage toBufferedImage(Image image, String imageType) {
BufferedImage bufferedImage;
if (false == imageType.equalsIgnoreCase(IMAGE_TYPE_PNG)) {
// 当目标为非PNG类图片时,源图片统一转换为RGB格式
if (image instanceof BufferedImage) {
bufferedImage = (BufferedImage) image;
if (BufferedImage.TYPE_I... |
python | def resumeProducing(self):
"""
Starts or resumes the retrieval of messages from the server queue.
This method starts receiving messages from the server, they will be
passed to the consumer callback.
.. note:: This is called automatically when :meth:`.consume` is called,
... |
java | public @Nullable T invoke(@NotNull Object... args) {
checkNotNull(args);
Method method = target();
boolean accessible = method.isAccessible();
try {
makeAccessible(method);
Object returnValue = method.invoke(target, args);
return castSafely(returnValue, checkNotNull(returnType));
}... |
java | @Override
public final int get(int codePoint) {
int value;
int ix;
if (codePoint >= 0) {
if (codePoint < 0x0d800 || (codePoint > 0x0dbff && codePoint <= 0x0ffff)) {
// Ordinary BMP code point, excluding leading surrogates.
// BMP uses a si... |
java | private SnapshotTaskClient getSnapshotTaskClient(DuracloudEndPointConfig source) {
return this.snapshotTaskClientHelper.create(source,
bridgeConfig.getDuracloudUsername(),
bridgeConfig.getDuracloudPassword())... |
python | def eval_function(value):
""" Evaluate a timestamp function """
name, args = value[0], value[1:]
if name == "NOW":
return datetime.utcnow().replace(tzinfo=tzutc())
elif name in ["TIMESTAMP", "TS"]:
return parse(unwrap(args[0])).replace(tzinfo=tzlocal())
elif name in ["UTCTIMESTAMP", ... |
python | def zpoppush(self, source, destination, count, score, new_score,
client=None, withscores=False, on_success=None,
if_exists=None):
"""
Pops the first ``count`` members from the ZSET ``source`` and adds them
to the ZSET ``destination`` with a score of ``new_score`... |
python | def read_nonblocking(self, size=1, timeout=-1):
"""
Read from the file descriptor and return the result as a string.
The read_nonblocking method of :class:`SpawnBase` assumes that a call
to os.read will not block (timeout parameter is ignored). This is not
the case for POSIX fil... |
python | def wait_until_complete(job_list):
"""
Args: Accepts a list of GPJob objects
This method will not return until all GPJob objects in the list have
finished running. That us, they are either complete and have resulted in
an error state.
This method will occasionally query... |
java | public static Document buildPDFDocument (com.snowtide.pdf.Document pdf) throws IOException {
return buildPDFDocument(pdf, DEFAULT_CONFIG);
} |
python | def repr_feature(feature, max_keys=100, indent=8, lexigraphic=False):
'''
generate a pretty-printed string for a feature
Currently implemented:
* StringCounter
@max_keys: truncate long counters
@indent: indent multi-line displays by this many spaces
@lexigraphic: instead of sorting cou... |
python | def clone(self, **kwargs):
"""
Make a fresh thread with the same options. This is usually used on dead threads.
"""
return ManholeThread(
self.get_socket, self.sigmask, self.start_timeout,
connection_handler=self.connection_handler,
daemon_connection=s... |
java | @Override
public void processException(Throwable th, String sourceId, String probeId, Object callerThis, Object[] objectArray) {
log(sourceId, probeId, th, callerThis, objectArray);
} |
java | private static ImageDescriptor createUnManaged(String prefix, String name)
{
return create(prefix, name, true);
} |
python | def _build_date(date, kwargs):
"""
Builds the date argument for event rules.
"""
if date is None:
if not kwargs:
raise ValueError('Must pass a date or kwargs')
else:
return datetime.date(**kwargs)
elif kwargs:
raise ValueError('Cannot pass kwargs and ... |
python | def _dict_to_object(desired_type: Type[T], contents_dict: Dict[str, Any], logger: Logger,
options: Dict[str, Dict[str, Any]], conversion_finder: ConversionFinder = None,
is_dict_of_dicts: bool = False) -> T:
"""
Utility method to create an object from a dictionary of cons... |
java | public static boolean hasValidCppCharacters(String s) {
for (char c : s.toCharArray()) {
if (!isValidCppCharacter(c)) {
return false;
}
}
return true;
} |
python | def _grab_history(self):
"""Calculate the needed history/changelog changes
Every history heading looks like '1.0 b4 (1972-12-25)'. Extract them,
check if the first one matches the version and whether it has a the
current date.
"""
default_location = None
config =... |
python | def find_peaks(array, baseline=0.1, return_subarrays=False):
"""
This will try to identify the indices of the peaks in array, returning a list of indices in ascending order.
Runs along the data set until it jumps above baseline. Then it considers all the subsequent data above the baseline
as part of th... |
java | private <E> List<E> loadQueryDataGFS(EntityMetadata entityMetadata, BasicDBObject mongoQuery,
BasicDBObject orderBy, int maxResult, int firstResult, boolean isCountQuery)
{
List<GridFSDBFile> gfsDBfiles = getGFSDBFiles(mongoQuery, orderBy, entityMetadata.getTableName(), maxResult,
... |
java | public boolean recordNoCompile() {
if (!currentInfo.isNoCompile()) {
currentInfo.setNoCompile(true);
populated = true;
return true;
} else {
return false;
}
} |
java | @Pure
static int getOperatingSystemArchitectureDataModel() {
final String arch = System.getProperty("sun.arch.data.model"); //$NON-NLS-1$
if (arch != null) {
try {
return Integer.parseInt(arch);
} catch (AssertionError e) {
throw e;
} catch (Throwable exception) {
//
}
}
return 0;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.