language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | public Document loadDocument(String location) throws Exception
{
Vector<String> definition = getDefinition(location);
DocumentRepository repository = getRepository(definition);
String specLocation = definition.get(4) + (implemented != null ? "?implemented="+implemented : "");
Document document = ... |
python | def resample(source_area, data, destination_area,
resampler=None, **kwargs):
"""Do the resampling."""
if 'resampler_class' in kwargs:
import warnings
warnings.warn("'resampler_class' is deprecated, use 'resampler'",
DeprecationWarning)
resampler = kwarg... |
java | public CompanyDomain currentDomain() {
Criteria criteria = this.dao.newCriteria(CompanyDomain.class)
.add(Restrictions.eq("host", this.request.getHeader("Host")));
return (CompanyDomain) criteria.uniqueResult();
} |
java | @Override
public boolean propagate() {
// Do nothing, AllenIntervalNetworkSolver takes care of propagation...
if(filteringboxes.size() != 0){
// System.out.println("___________________________________");
for (int i = 0; i < this.getVariables().length; i++) {
// System.out.println(this.getVariables()[... |
java | public void setInclude(Stylesheet v)
{
if (null == m_includes)
m_includes = new Vector();
m_includes.addElement(v);
} |
java | @Override
public InternalCacheEntry<WrappedBytes, WrappedBytes> fromMemory(long address) {
// 16 bytes for eviction if needed (optional)
// 8 bytes for linked pointer
int offset = evictionEnabled ? 24 : 8;
byte metadataType = MEMORY.getByte(address, offset);
offset += 1;
int hash... |
java | @Override
public ServerSocketBar bind(ServerSocketBar ss)
throws ConfigException, IOException, GeneralSecurityException
{
throw new ConfigException(L.l("jsse is not allowed here"));
} |
java | public static Object convertSqlXml(Object sqlXml, InputStream input) throws SQLException {
return convertSqlXml(sqlXml, toByteArray(input));
} |
java | public void marshall(GetVoiceConnectorTerminationHealthRequest getVoiceConnectorTerminationHealthRequest, ProtocolMarshaller protocolMarshaller) {
if (getVoiceConnectorTerminationHealthRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
tr... |
java | public long listSize(String listName) {
Long size = redisClient.llen(listName);
return size != null ? size.longValue() : -1;
} |
python | def _frame_structure_check(structure_description):
"""
check if the structure of the frame is conform to the basic
frame structure defined by the standard
:param structure_description: string-list reflecting LLDP-msg structure
"""
standard_frame_structure = [LLDPDUChassi... |
java | public void prunePoints(int neighbors , double distance ) {
// Use a nearest neighbor search to find near by points
Point3D_F64 worldX = new Point3D_F64();
List<Point3D_F64> cloud = new ArrayList<>();
for (int i = 0; i < structure.points.length; i++) {
SceneStructureMetric.Point structureP = structure.point... |
java | protected ThreadContextDescriptor createThreadContext(Map<String, String> execProps, J2EEName j2eeName) {
ThreadContext classloaderContext = classLoaderContextProvider.createThreadContext(execProps, getContextClassLoaderIdentifier(j2eeName));
ThreadContext jeeContext = jeeMetaDataContextProvider.create... |
java | @Override
public DescribeBandwidthRateLimitResult describeBandwidthRateLimit(DescribeBandwidthRateLimitRequest request) {
request = beforeClientExecution(request);
return executeDescribeBandwidthRateLimit(request);
} |
python | def run_migrations_online():
"""Run migrations in 'online' mode.
In this scenario we need to create an Engine
and associate a connection with the context.
"""
print("Running migrations online")
project_path = get_project_path()
project_config = get_project_config(project_path)
backen... |
python | def initialize(self, author=""):
''' Initialize the database. This is dangerous since it removes any
existing content.'''
self.cur.execute("CREATE TABLE version(major, minor);")
self.cur.execute("INSERT INTO version(major, minor) VALUES (?,?);",
(self.appversion[0], self... |
java | public static Parameters fromProperties(Properties properties) {
final ImmutableMap.Builder<String, String> ret = ImmutableMap.builder();
for (final Map.Entry<Object, Object> property : properties.entrySet()) {
ret.put(property.getKey().toString(), property.getValue().toString());
}
return fromMap... |
python | def compute(self):
'''
Compute the model for the current value of lambda.
'''
# Is there a transit model?
if self.transit_model is not None:
return self.compute_joint()
log.info('Computing the model...')
# Loop over all chunks
model = [None... |
java | @SuppressWarnings("squid:S3725")
public static void touch(Path file) throws IOException {
if (Files.exists(file)) {
Files.setLastModifiedTime(file, FileTime.from(Instant.now()));
} else {
Files.createFile(file);
}
} |
python | def _getBasicOrbit(self, orbit=None):
"""Load a particular orbit into .data for loaded day.
Parameters
----------
orbit : int
orbit number, 1 indexed, negative indexes allowed, -1 last orbit
Note
----
A day of data must be loaded before this routine ... |
java | @Override
public InputStream download(String uri) {
HttpURLConnection connection = null;
String errorMsg;
try {
URL url = new URI(uri).toURL();
connection = (HttpURLConnection) url.openConnection();
connection.setDoOutput(false);
// Check the ... |
python | def add(self, obj):
""" Adds a member to the collection.
:param obj: Object to add.
Example:
>>> mycollection.add(pump.Person('bob@example.org'))
"""
activity = {
"verb": "add",
"object": {
"objectType": obj.object_type,
... |
java | @Override
public void onEvent(final javax.jcr.observation.EventIterator events) {
Session lookupSession = null;
try {
lookupSession = getJcrSession(repository.login());
@SuppressWarnings("unchecked")
final Iterator<Event> filteredEvents = filter(events, eventFilt... |
java | private void cleanup() {
m_folder1Exclusive = null;
m_folder2Exclusive = null;
m_foldersSibling = null;
m_foldersEqualnames = null;
m_foldersDifferenttypes = null;
} |
java | public void init(BaseField field, String iMainFilesField)
{
super.init(field);
m_iMainFilesFieldSeq = iMainFilesField;
m_bReadMove = false; // Don't move on read!
} |
java | public static boolean isSameDay(final Date date1, final Date date2) {
if (date1 == null || date2 == null) {
throw new IllegalArgumentException("The date must not be null");
}
return isSameDay(calendar(date1), calendar(date2));
} |
java | void finishDownload(OfflineDownloadOptions offlineDownload, OfflineRegion offlineRegion) {
OfflineDownloadStateReceiver.dispatchSuccessBroadcast(this, offlineDownload);
offlineRegion.setDownloadState(OfflineRegion.STATE_INACTIVE);
offlineRegion.setObserver(null);
removeOfflineRegion(offlineDownload.uuid... |
java | public static InputStream getResource2(String uri) {
try {
// If -Dwebdev=1 is set in VM args, we're in front end dev mode, so skip the class loader.
// This is to allow the front end scripts/styles/templates to be loaded from the build
// directory during development.
// Try all registere... |
java | public com.google.privacy.dlp.v2.InspectConfig.FindingLimits getLimits() {
return limits_ == null
? com.google.privacy.dlp.v2.InspectConfig.FindingLimits.getDefaultInstance()
: limits_;
} |
java | public void marshall(DeleteAppRequest deleteAppRequest, ProtocolMarshaller protocolMarshaller) {
if (deleteAppRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(deleteAppRequest.getAppId(), AP... |
java | @Override
public boolean getIsEmpty() {
if (m_contentValue == null) {
// this is the case for non existing values
return true;
}
if (m_contentValue.isSimpleType()) {
// return values for simple type
return CmsStringUtil.isEmpty(m_contentValue.... |
java | private void setupSubjects(List<Subject> subjects) throws ParsingException {
// make sure that there is at least one Subject
if (subjects.size() == 0)
throw new ParsingException("Request must a contain subject");
// now go through the subject attributes
Iterator<Subject> it ... |
python | def run(configobj=None,editpars=False):
""" Teal interface for running this code.
"""
if configobj is None:
configobj =teal.teal(__taskname__,loadOnly=(not editpars))
update(configobj['input'],configobj['refdir'],
local=configobj['local'],interactive=configobj['interactive'],
w... |
python | def recv(self):
"""
Receive string data(byte array) from the server.
return value: string(byte array) value.
"""
with self.readlock:
opcode, data = self.recv_data()
if six.PY3 and opcode == ABNF.OPCODE_TEXT:
return data.decode("utf-8")
eli... |
java | public static void processFile(String infile, String outfile,String delimer,int tagnum) throws IOException {
BufferedReader in = new BufferedReader(new UnicodeReader(new FileInputStream(infile), "utf8"));
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(
outfile), "utf8"));... |
java | public CellConstraints xyw(int col, int row, int colSpan) {
return xywh(col, row, colSpan, 1, DEFAULT, DEFAULT);
} |
python | def parse(fp):
"""
Parse the contents of the `~io.IOBase.readline`-supporting file-like object
``fp`` as a simple line-oriented ``.properties`` file and return a
generator of ``(key, value, original_lines)`` triples for every entry in
``fp`` (including duplicate keys) in order of occurrence. The th... |
python | def fromHumanly(klass, humanStr, tzinfo=None, now=None):
"""Return a new Time instance from a string a human might type.
@param humanStr: the string to be parsed.
@param tzinfo: A tzinfo instance indicating the timezone to assume if
none is specified in humanStr. If None, assume UTC.
... |
python | def annotate_powerlaw(text, exp, startx, starty, width=None, rx=0.5, ry=0.5, **kwargs):
r'''
Added a label to the middle of a power-law annotation (see ``goosempl.plot_powerlaw``).
:arguments:
**exp** (``float``)
The power-law exponent.
**startx, starty** (``float``)
Start coordinates.
:options:
**... |
python | def build(force):
""" Builds the distribution files: wheels and source. """
dist_path = Path(DIST_PATH)
if dist_path.exists() and list(dist_path.glob('*')):
if force or click.confirm('{} is not empty - delete contents?'.format(dist_path)):
dist_path.rename(DIST_PATH_DELETE)
s... |
java | public void export(Package... packages) {
String[] pkgs = new String[packages.length];
for (int i = 0; i < packages.length; i++) {
pkgs[i] = packages[i].getName();
}
export(pkgs);
} |
python | def get_frame(self, in_data, frame_count, time_info, status):
""" Callback function for the pyaudio stream. Don't use directly. """
while self.keep_listening:
try:
frame = self.queue.get(False, timeout=queue_timeout)
return (frame, pyaudio.paContinue)
except Empty:
pass
return (None, pyaudio.paC... |
python | def interfaces():
'''
Return a dictionary of information about all the interfaces on the minion
'''
if salt.utils.platform.is_windows():
return win_interfaces()
elif salt.utils.platform.is_netbsd():
return netbsd_interfaces()
else:
return linux_interfaces() |
java | public void grant(OrderedHashSet granteeList, SchemaObject dbObject,
Right right, Grantee grantor, boolean withGrantOption) {
if (!grantor.isGrantable(dbObject, right)) {
throw Error.error(ErrorCode.X_0L000, grantor.getNameString());
}
if (grantor.isAdmin()) {... |
python | def hours(start, end=None):
"""Iterate over the hours between the given datetime_tzs.
Args:
start: datetime_tz to start from.
end: (Optional) Date to end at, if not given the iterator will never
terminate.
Returns:
An iterator which generates datetime_tz objects a hour apart.
... |
python | def get_logger(name):
"""Get a logger by name."""
if name is None:
return NoLogger()
logger = logging.getLogger(name)
if Logger.use_external_configuration:
logger.propagate = False
return logger |
python | def feature_analysis(fname="feature_analysis.png"):
"""
Create figures for feature analysis
"""
# Create side-by-side axes grid
_, axes = plt.subplots(ncols=2, figsize=(18,6))
# Draw RadViz on the left
data = load_occupancy(split=False)
oz = RadViz(ax=axes[0], classes=["unoccupied", "o... |
java | public static void main(String[] args) throws IOException, SAXException {
if (args != null && args.length > 0) {
validateXml(new URL(args[0]));
} else {
System.out.println(getXsd());
}
} |
java | public String resolveUri(Document document)throws GreenPepperServerException
{
if(!StringUtil.isEmpty(testUrlFormat))
{
return String.format(testUrlFormat, document.getRepository().getBaseTestUrl(), document.getName());
}
return null;
} |
java | public boolean isOpenInResults() {
if (I_CmsGalleryProviderConstants.GalleryTabId.cms_tab_results.name().equals(m_searchObject.getTabId())) {
return true;
}
return false;
} |
python | def make_file_extension_assertion(extension):
"""Function factory for file extension argparse assertion
Args:
extension (string): the file extension to assert
Returns:
string: the supplied extension, if assertion is successful.
"""
def file_extension_assertion(file_... |
java | public StorageAccountCredentialInner createOrUpdate(String deviceName, String name, String resourceGroupName, StorageAccountCredentialInner storageAccountCredential) {
return createOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, storageAccountCredential).toBlocking().last().body();
} |
java | public Level level(Config config, Throwable error) {
if (error == null) {
return config.defaultMessageLevel();
}
if (error instanceof Error) {
return config.defaultErrorLevel();
}
return config.defaultThrowableLevel();
} |
python | def fuse_get_context():
'Returns a (uid, gid, pid) tuple'
ctxp = _libfuse.fuse_get_context()
ctx = ctxp.contents
return ctx.uid, ctx.gid, ctx.pid |
java | public final IonSystemBuilder withStreamCopyOptimized(boolean optimized)
{
IonSystemBuilder b = mutable();
b.setStreamCopyOptimized(optimized);
return b;
} |
python | def _GenerateInitConfigs(self, template_dir, rpm_build_dir):
"""Generates init-system configs."""
client_name = config.CONFIG.Get("Client.name", context=self.context)
initd_target_filename = os.path.join(rpm_build_dir, "etc/init.d",
client_name)
# Generate init.... |
java | public StreamResponse startStream(String uuid, String streamUrl, int loop) throws IOException, NexmoClientException {
return streams.put(new StreamRequest(uuid, streamUrl, loop));
} |
java | public Traverson setLinkDiscoverers(@Nullable List<? extends LinkDiscoverer> discoverer) {
List<? extends LinkDiscoverer> defaultedDiscoverers = discoverer == null //
? DEFAULTS.getLinkDiscoverers(mediaTypes) //
: discoverer;
this.discoverers = new LinkDiscoverers(PluginRegistry.of(defaultedDiscoverers));... |
java | private Map<URI, Set<URI>> addMapFilePrefix(final Map<URI, Set<URI>> map) {
final Map<URI, Set<URI>> res = new HashMap<>();
for (final Map.Entry<URI, Set<URI>> e: map.entrySet()) {
final URI key = e.getKey();
final Set<URI> newSet = new HashSet<>(e.getValue().size());
... |
python | def plot_cumulative_moment(year, mag, figure_size=(8, 6),
filename=None, filetype='png', dpi=300, ax=None):
'''Calculation of Mmax using aCumulative Moment approach, adapted from
the cumulative strain energy method of Makropoulos & Burton (1983)
:param year: Year of Earthquake
... |
java | @Override
public DeleteDynamicThingGroupResult deleteDynamicThingGroup(DeleteDynamicThingGroupRequest request) {
request = beforeClientExecution(request);
return executeDeleteDynamicThingGroup(request);
} |
java | public Token getNextToken(final String logFormat, final int startOffset) {
final int pos = logFormat.indexOf(logFormatToken, startOffset);
if (pos == -1) {
return null;
}
Token token = new Token(
regex,
pos,
logFormatToken.leng... |
python | def get_wiki(self, section):
"""
Returns a section of the wiki.
Only for Album/Track.
section can be "content", "summary" or
"published" (for published date)
"""
doc = self._request(self.ws_prefix + ".getInfo", True)
if len(doc.getElementsByTagName("... |
java | synchronized void update(BlockInfo blockInfo, int curReplicas,
int decommissionedReplicas,
int curExpectedReplicas,
int curReplicasDelta, int expectedReplicasDelta) {
int oldReplicas = curReplicas-curReplicasDelta;
int oldExpected... |
python | def ExamineEvent(self, mediator, event):
"""Evaluates whether an event contains the right data for a hash lookup.
Args:
mediator (AnalysisMediator): mediates interactions between
analysis plugins and other components, such as storage and dfvfs.
event (EventObject): event.
"""
self... |
java | public DevState[] extractDevStateArray() throws DevFailed {
manageExceptions("extractDevStateArray()");
try {
if (use_union) {
// Check if scalar (State attribute itself !)
if (attributeValue_5.value.discriminator().value() == AttributeDataType._DEVICE_STATE) {
... |
java | public static String trim(String str, boolean removeBOM, boolean removeSpecialWhiteSpace, String defaultValue) {
if (str == null) return defaultValue;
if (str.isEmpty()) return str;
// remove leading BOM Marks
if (removeBOM) {
// UTF-16, big-endian
if (str.charAt(0) == '\uFEFF') str = str.substring(1);
... |
python | def sync_connect_master(self, timeout=None, failed=False):
'''
Block until we are connected to a master
'''
self._sync_connect_master_success = False
log.debug("sync_connect_master")
def on_connect_master_future_done(future):
self._sync_connect_master_success... |
java | @Override
public Node<OWLObjectPropertyExpression> getInverseObjectProperties(
OWLObjectPropertyExpression pe)
throws InconsistentOntologyException, FreshEntitiesException,
ReasonerInterruptedException, TimeOutException {
throw new ReasonerInternalException(
... |
java | @Override
public XsNumericExpr add(ServerExpression... left) {
if (left == null) {
throw new IllegalArgumentException("left parameter for add() cannot be null");
}
return new XsExprImpl.NumericCallImpl("op", "add", left);
} |
python | def _delete_device_from_device_group(self, device):
'''Remove device from device service cluster group.
:param device: ManagementRoot object -- device to delete from group
'''
device_name = get_device_info(device).name
dg = pollster(self._get_device_group)(device)
devic... |
python | def get_version_details(path):
"""Parses version file
:param path: path to version file
:return: version details
"""
with open(path, "r") as reader:
lines = reader.readlines()
data = {
line.split(" = ")[0].replace("__", ""):
line.split(" = ")[1].strip().... |
java | protected AstNode parseAlterTableStatement( DdlTokenStream tokens,
AstNode parentNode ) throws ParsingException {
assert tokens != null;
assert parentNode != null;
markStartOfStatement(tokens);
// <alter table statement> ::=
// AL... |
java | protected void moveRightToLeft() {
Object[] chosenSelectedValues = chosenList.getSelectedValues();
int nChosenSelected = chosenSelectedValues.length;
int[] chosenSelected = new int[nChosenSelected];
if (nChosenSelected == 0) {
return; // Nothing to move
}
//... |
python | def receive_message(
sock, operation, request_id, max_message_size=MAX_MESSAGE_SIZE):
"""Receive a raw BSON message or raise socket.error."""
header = _receive_data_on_socket(sock, 16)
length = _UNPACK_INT(header[:4])[0]
actual_op = _UNPACK_INT(header[12:])[0]
if operation != actual_op:
... |
python | def add_subtree(cls, for_node, node, options):
""" Recursively build options tree. """
if cls.is_loop_safe(for_node, node):
options.append(
(node.pk,
mark_safe(cls.mk_indent(node.get_depth()) + escape(node))))
for subnode in node.get_children():
... |
java | static public String normalize(String path) {
if (path == null || path.length() == 0) return ROOT;
if (path.charAt(0) != PATH_SEPARATOR) {
throw new IllegalArgumentException(
"Network Location path does not start with "
... |
python | def compile_files_cwd(*args, **kwargs):
"""change working directory to contract's dir in order to avoid symbol
name conflicts"""
# get root directory of the contracts
compile_wd = os.path.commonprefix(args[0])
# edge case - compiling a single file
if os.path.isfile(compile_wd):
compile_w... |
java | public PactDslJsonArray numberType(Number number) {
body.put(number);
matchers.addRule(rootPath + appendArrayIndex(0), new NumberTypeMatcher(NumberTypeMatcher.NumberType.NUMBER));
return this;
} |
java | byte[][] getQualifierKeys(String family) {
Map<String, TypeInformation<?>> qualifierMap = familyMap.get(family);
if (qualifierMap == null) {
throw new IllegalArgumentException("Family " + family + " does not exist in schema.");
}
Charset c = Charset.forName(charset);
byte[][] qualifierKeys = new byte[qua... |
java | public static EthiopianCalendar of(
EthiopianEra era,
int yearOfEra,
int month,
int dayOfMonth
) {
if (!CALSYS.isValid(era, yearOfEra, month, dayOfMonth)) {
throw new IllegalArgumentException(
"Invalid Ethiopian date: era="
+ e... |
java | public void add(int theField, int theValue) {
switch (theField) {
case Calendar.YEAR:
setValue(DateUtils.addYears(getValue(), theValue), getPrecision());
break;
case Calendar.MONTH:
setValue(DateUtils.addMonths(getValue(), theValue), getPrecision());
break;
case Calendar.DATE:
setValue(DateUtils.... |
java | public int filterObject(CaptureSearchResult r) {
String resultUrl = r.getUrlKey();
return resultUrl.startsWith(prefix) ? FILTER_INCLUDE : FILTER_ABORT;
} |
java | public void setIndexRebuildMode(String searchIndex, String mode) {
I_CmsSearchIndex index = OpenCms.getSearchManager().getIndex(searchIndex);
if (index != null) {
index.setRebuildMode(mode);
// required for this setting to take effect
OpenCms.getSearchManager().initO... |
python | def __parse_target(targetstr, current_repo=None):
"""Parse a build target string.
General form: //repo[gitref]/dir/path:target.
These are all valid:
//repo
//repo[a038fi31d9e8bc11582ef1b1b1982d8fc]
//repo[a039aa30853298]:foo
//repo/dir
//repo[a... |
java | public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case SUPERVISOR:
return is_set_supervisor();
case WORKERS:
return is_set_workers();
case WORKER_METRIC:
return is_set_workerMetric();
}
throw new I... |
python | def _calendar_classes_for_occurrence(self, occurrence):
"""
Return css classes to be used in admin calendar JSON
"""
classes = [slugify(occurrence.event.polymorphic_ctype.name)]
# Add a class name for the type of event.
if occurrence.is_all_day:
classes.appen... |
java | private static void getResPathKeys(String path, int num, String[] keys, int start) {
if (num == 0) {
return;
}
if (num == 1) {
keys[start] = path;
return;
}
int i = 0;
for (;;) {
int j = path.indexOf(RES_PATH_SEP_CHAR, i);
... |
java | protected ProcessInstance buildProcessInstance(ResultSet rs) throws SQLException {
ProcessInstance pi = new ProcessInstance();
pi.setMasterRequestId(rs.getString("master_request_id"));
pi.setId(rs.getLong("process_instance_id"));
pi.setProcessId(rs.getLong("process_id"));
pi.setO... |
python | def _build_tag_param_list(params, tags):
'''
helper function to build a tag parameter list to send
'''
keys = sorted(tags.keys())
i = 1
for key in keys:
value = tags[key]
params['Tags.member.{0}.Key'.format(i)] = key
if value is not None:
params['Tags.member.{... |
java | public void setValidationData(java.util.Collection<AttributeType> validationData) {
if (validationData == null) {
this.validationData = null;
return;
}
this.validationData = new java.util.ArrayList<AttributeType>(validationData);
} |
java | public Track getTrack(int trackID) throws MusixMatchException {
Track track = new Track();
Map<String, Object> params = new HashMap<String, Object>();
params.put(Constants.API_KEY, apiKey);
params.put(Constants.TRACK_ID, new String("" + trackID));
track = getTrackResponse(Methods.TRACK_GET, params);
retu... |
java | @Override
public void run(SiteProcedureConnection siteConnection)
{
hostLog.debug("STARTING: " + this);
m_mailbox.send(com.google_voltpatches.common.primitives.Longs.toArray(m_initiatorHSIds), m_initiationMsg);
m_txnState.setDone();
m_queue.flush(getTxnId());
execLog.l7dl... |
java | public boolean removeSearchIndexSource(CmsSearchIndexSource indexsource) throws CmsIllegalStateException {
// validation if removal will be granted
Iterator<I_CmsSearchIndex> itIndexes = m_indexes.iterator();
I_CmsSearchIndex idx;
// the list for collecting indexes that use the given in... |
python | def clear_old_log_entries():
"""
Removes older log entries, if the appropriate setting has been set
"""
if hasattr(settings, 'DJANGO_CRON_DELETE_LOGS_OLDER_THAN'):
delta = timedelta(days=settings.DJANGO_CRON_DELETE_LOGS_OLDER_THAN)
CronJobLog.objects.filter(end_time__lt=get_current_time(... |
python | def TemporaryDirectory(suffix=None, prefix=None, dir=None, on_error='ignore'): # @ReservedAssignment
'''
An extension to `tempfile.TemporaryDirectory`.
Unlike with `python:tempfile`, a :py:class:`~pathlib.Path` is yielded on
``__enter__``, not a `str`.
Parameters
----------
suffix : str
... |
java | public void setMesh(GVRMesh mesh) {
mMesh = mesh;
NativeMeshCollider.setMesh(getNative(), mesh.getNative());
} |
java | @Override
public List<CPOption> findByGroupId(long groupId) {
return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} |
java | public ServiceFuture<OperationStatus> deletePatternAnyEntityModelAsync(UUID appId, String versionId, UUID entityId, final ServiceCallback<OperationStatus> serviceCallback) {
return ServiceFuture.fromResponse(deletePatternAnyEntityModelWithServiceResponseAsync(appId, versionId, entityId), serviceCallback);
} |
python | def get_current_user(self):
"""
Override get_current_user for Google AppEngine
Checks for oauth capable request first, if this fails fall back to standard users API
"""
from google.appengine.api import users
if _IS_DEVELOPMENT_SERVER:
return users.get_current... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.