language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def servermods():
'''
Return list of modules compiled into the server (``apachectl -l``)
CLI Example:
.. code-block:: bash
salt '*' apache.servermods
'''
cmd = '{0} -l'.format(_detect_os())
ret = []
out = __salt__['cmd.run'](cmd).splitlines()
for line in out:
if no... |
python | def rna_velocity(adata, loomfile, copy=False):
"""Estimate RNA velocity [LaManno17]_
This requires generating a loom file with Velocyto, which will store the
counts of spliced, unspliced and ambiguous RNA for every cell and every
gene.
In contrast to Velocyto, here, we neither use RNA velocities f... |
python | def stopdocs():
"stop Sphinx watchdog"
for i in range(4):
pid = watchdog_pid()
if pid:
if not i:
sh('ps {}'.format(pid))
sh('kill {}'.format(pid))
time.sleep(.5)
else:
break |
python | def intertwine(*iterables):
"""Constructs an iterable which intertwines given iterables.
The resulting iterable will return an item from first sequence,
then from second, etc. until the last one - and then another item from
first, then from second, etc. - up until all iterables are exhausted.
"""
... |
python | def psd(self, fftlength=None, overlap=None, window='hann',
method=DEFAULT_FFT_METHOD, **kwargs):
"""Calculate the PSD `FrequencySeries` for this `TimeSeries`
Parameters
----------
fftlength : `float`
number of seconds in single FFT, defaults to a single FFT
... |
python | def parse(readDataInstance):
"""
Returns a new L{ImageExportTable} object.
@type readDataInstance: L{ReadData}
@param readDataInstance: A L{ReadData} object with data to be parsed as a L{ImageExportTable} object.
@rtype: L{ImageExportTable}
@return: A ne... |
java | protected void applyStamp(CtClass candidateClass) throws CannotCompileException {
candidateClass.addField(createStampField(candidateClass), Initializer.constant(true));
} |
python | def cree_ws_lecture(self, champs_ligne):
"""Alternative to create read only widgets. They should be set after."""
for c in champs_ligne:
label = ASSOCIATION[c][0]
w = ASSOCIATION[c][3](self.acces[c], False)
w.setObjectName("champ-lecture-seule-details")
se... |
java | public static Boolean untilTrue(Callable<Boolean> callable, long timeout, TimeUnit unit) throws SystemException {
return SleepBuilder.<Boolean>sleep()
.withComparer(argument -> argument)
.withTimeout(timeout, unit)
.withStatement(callable)
.bu... |
python | def get_all_names(offset=None, count=None, include_expired=False, proxy=None, hostport=None):
"""
Get all names within the given range.
Return the list of names on success
Return {'error': ...} on failure
"""
assert proxy or hostport, 'Need proxy or hostport'
if proxy is None:
proxy ... |
python | def take_quality_screenshot(self, screenshot_name):
"""Take a quality screenshot
Use the screenshot_name args when you want to take a
screenshot for reference
Args:
screenshot_name (str) the name of the screenshot
"""
self.info_log("Taking a quality scre... |
python | def to_color(self, value, maxvalue, scale, minvalue=0.0):
"""
convert continuous values into colors using matplotlib colorscales
:param value: value to be converted
:param maxvalue: max value in the colorscale
:param scale: lin, log, sqrt
:param minvalue: minimum of the i... |
python | def fetch(self):
"""Samples up to current difficulty."""
length = np.random.randint(1, self._curr_length + 1)
nesting = np.random.randint(1, self._curr_nesting + 1)
return length, nesting |
java | public List<Node<Scope>> toList() {
List<Node<Scope>> list = new ArrayList<Node<Scope>>();
walk(rootElement, list);
return list;
} |
python | def _get_native_state(self):
"""
Save the model as a dictionary, which can be loaded with the
:py:func:`~turicreate.load_model` method.
"""
state = self.__proxy__.get_state()
state['classifier'] = state['classifier'].__proxy__
del state['feature_extractor']
... |
python | def from_symmop(cls, symmop, time_reversal):
"""
Initialize a MagSymmOp from a SymmOp and time reversal operator.
Args:
symmop (SymmOp): SymmOp
time_reversal (int): Time reversal operator, +1 or -1.
Returns:
MagSymmOp object
"... |
java | private void addTermFrequencies(Map<String, Int> termFreqMap, TermFreqVector vector)
{
String[] terms = vector.getTerms();
int[] freqs = vector.getTermFrequencies();
for (int j = 0; j < terms.length; j++)
{
String term = terms[j];
if (isNoiseWord(term))
{
... |
python | def cursor_up(self, count=None):
"""Move cursor up the indicated # of lines in same column.
Cursor stops at top margin.
:param int count: number of lines to skip.
"""
top, _bottom = self.margins or Margins(0, self.lines - 1)
self.cursor.y = max(self.cursor.y - (count or ... |
python | def post_status(
app,
user,
status,
visibility='public',
media_ids=None,
sensitive=False,
spoiler_text=None,
in_reply_to_id=None
):
"""
Posts a new status.
https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md#posting-a-new-status
"""
# Idempote... |
java | public static String getPublicIPAddress() throws Exception {
final String IPV4_REGEX = "\\A(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(\\.(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3}\\z";
String ipAddr = null;
Enumeration e = NetworkInterface.getNetworkInterfaces();
while (e.hasMoreElements()) {
... |
java | public static void writeXML(Document xmldocument, Writer writer) throws IOException {
assert xmldocument != null : AssertMessages.notNullParameter(0);
assert writer != null : AssertMessages.notNullParameter(1);
writeNode(xmldocument, writer);
} |
java | protected File getStoreFile(StoreReference store)
{
if (store instanceof FileStoreReference) {
return ((FileStoreReference) store).getFile();
}
throw new IllegalArgumentException(String.format("Unsupported store reference [%s] for this implementation.",
store.getClass... |
java | public FeatureCollection createCollection(JSONObject jsonObject, FeaturesSupported layer) {
FeatureCollection dto = new FeatureCollection(layer);
String type = JsonService.getStringValue(jsonObject, "type");
if ("FeatureCollection".equals(type)) {
JSONArray features = JsonService.getChildArray(jsonObject, "fea... |
python | def VictoryEnum(ctx):
"""Victory Type Enumeration."""
return Enum(
ctx,
standard=0,
conquest=1,
exploration=2,
ruins=3,
artifacts=4,
discoveries=5,
gold=6,
time_limit=7,
score=8,
standard2=9,
regicide=10,
las... |
java | public boolean processSecondRound(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
for (SQLiteDatabaseSchema schema : schemas) {
// Analyze beans BEFORE daos, because beans are needed for DAO
// definition
for (String daoName : schema.getDaoNameSet()) {
// check dao into bean definit... |
python | def _setup(self, inputs):
logger.info("Setting up the queue for CPU prefetching ...")
self.input_placehdrs = [build_or_reuse_placeholder(v) for v in inputs]
assert len(self.input_placehdrs) > 0, \
"BatchQueueInput has to be used with some input signature!"
# prepare placehol... |
java | protected void addListeningIterator(IClockwiseIterator iterator) {
if (this.listeningIterators == null) {
this.listeningIterators = new WeakArrayList<>();
}
this.listeningIterators.add(iterator);
} |
java | public DescribeHapgResult withPartitionSerialList(String... partitionSerialList) {
if (this.partitionSerialList == null) {
setPartitionSerialList(new com.amazonaws.internal.SdkInternalList<String>(partitionSerialList.length));
}
for (String ele : partitionSerialList) {
th... |
java | public Collection<String> predictSeveral(List<VocabWord> document, int limit) {
/*
This code was transferred from original ParagraphVectors DL4j implementation, and yet to be tested
*/
if (document.isEmpty())
throw new IllegalStateException("Document has no words inside"... |
java | @Override
public SourceProtocolItemStream getSourceProtocolItemStream()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "getSourceProtocolItemStream");
SourceProtocolItemStream sourceProtocolItemStream = _targetDestinationHandler.getSourceProtocolI... |
java | @Override
public FileSystem getFileSystem(final URI uri) {
// Get open FS
final FileSystem fs = this.createdFileSystems.get(uri.getHost());
// If not already created
if (fs == null) {
throw new FileSystemNotFoundException("Could not find an open file system with URI: " ... |
python | def run():
"""
Entry point for the `bolt` executable.
"""
options = btoptions.Options()
btlog.initialize_logging(options.log_level, options.log_file)
app = btapp.get_application()
app.run() |
java | public static void update(String id, FileStreamWriter fileStreamWriter) throws DaoManagerException {
if (isCurrentServer(id)){
connector.update(id, fileStreamWriter);
} else {
log.warn("Updating file id:'"+id+"' not belonging to current server:'"+serverName+"'");
}
} |
python | def update(self, *args, **kwargs):
"""
Base method for updating data.
Applies a plot-type specific cleaning operation, then
updates the data in the visualization.
"""
data = self._clean_data(*args, **kwargs)
if 'images' in data:
images = data['images... |
java | protected Collection<String> getSyntheticModuleNames() {
final String methodName = "getSyntheticModuleNames"; //$NON-NLS-1$
boolean traceLogging = log.isLoggable(Level.FINER);
if (traceLogging) {
log.entering(sourceClass, methodName);
}
Collection<String> result = new HashSet<String>();
result.add... |
python | def eigenvalue_sensitivity(T, k):
r"""Sensitivity matrix of a specified eigenvalue.
Parameters
----------
T : (M, M) ndarray
Transition matrix
k : int
Compute sensitivity matrix for k-th eigenvalue
Returns
-------
S : (M, M) ndarray
Sensitivity matrix for k-th e... |
java | private String getRfsName(File file, String vfsName) {
CmsStaticExportManager manager = OpenCms.getStaticExportManager();
String filePath = file.getAbsolutePath();
String result = CmsFileUtil.normalizePath(
manager.getRfsPrefix(vfsName)
+ filePath.substring(OpenCms.g... |
java | public static boolean isValidJavaIdentifier(String s)
{
if (s == null || s.length() == 0)
{
return false;
}
if (isJavaKeyword(s))
{
return false;
}
char[] c = s.toCharArray();
if (!Character.isJavaIdentifierStart(c[0]))
{
return false;
}
for (int i = 1; i < c.length; i++)
{
if (!... |
java | public static boolean containsExclusion(Collection<Exclusion> exclusions, Exclusion exclusion) {
return Optional.ofNullable(exclusions).orElse(Collections.emptyList())
.stream().anyMatch(selectedExclusion ->
null != exclusion && selectedExclusion.getGroupId().equals(exclu... |
java | public void setEnclosingAnnot(Annotation v) {
if (TopicToken_Type.featOkTst && ((TopicToken_Type)jcasType).casFeat_enclosingAnnot == null)
jcasType.jcas.throwFeatMissing("enclosingAnnot", "ch.epfl.bbp.uima.types.TopicToken");
jcasType.ll_cas.ll_setRefValue(addr, ((TopicToken_Type)jcasType).casFeatCode_enc... |
java | @Deprecated
public static void presentationModelCommand(final List<Command> response, final String id, final String presentationModelType, final DTO dto) {
if (response == null) {
return;
}
List<Map<String, Object>> list = new ArrayList<>();
for (Slot slot : dto.getSlots(... |
python | def do_call(self, path, method, body=None, headers=None):
"""
Send an HTTP request to the REST API.
:param string path: A URL
:param string method: The HTTP method (GET, POST, etc.) to use
in the request.
:param string body: A string representing any data to be sent ... |
java | @Override
public short getShort(int columnIndex) throws SQLException {
checkColumnBounds(columnIndex);
try {
Long longValue = getPrivateInteger(columnIndex);
if (longValue > Short.MAX_VALUE || longValue < Short.MIN_VALUE) {
throw new SQLException("Value out of... |
python | def p_ind8_I(p):
""" reg8_I : LP IX PLUS expr RP
| LP IX MINUS expr RP
| LP IY PLUS expr RP
| LP IY MINUS expr RP
| LP IX PLUS pexpr RP
| LP IX MINUS pexpr RP
| LP IY PLUS pexpr RP
| LP IY MINUS pexpr RP
... |
python | def p_nonblocking_substitution(self, p):
'nonblocking_substitution : delays lvalue LE delays rvalue SEMICOLON'
p[0] = NonblockingSubstitution(
p[2], p[5], p[1], p[4], lineno=p.lineno(2))
p.set_lineno(0, p.lineno(2)) |
python | def _classifiers(self):
"""
Get a set of supported classifiers.
Returns
-------
classifiers : {set}
The set of supported classifiers.
"""
# sklearn version < 0.18.0
classifiers = (
AdaBoostClassifier,
BernoulliNB,
... |
python | def unchanged(self, thresh=0.05, idx=True):
"""
Changed features.
{threshdoc}
"""
ind = (
(self.data[self.pval_column] > thresh)
| np.isnan(self.data[self.pval_column])
)
if idx:
return ind
return self[ind] |
java | public boolean profile_setMobileFBML(CharSequence fbmlMarkup)
throws FacebookException, IOException {
return profile_setFBML( /* profileFbmlMarkup */null, /* profileActionFbmlMarkup */null, fbmlMarkup,
/* profileId */null);
} |
python | def resume_unit(assess_status_func, services=None, ports=None,
charm_func=None):
"""Resume a unit by starting the services and clearning 'unit-paused'
in the local kv() store.
Also checks that the services have started and ports are being listened to.
An optional charm_func() can be ca... |
java | private void sortEntriesForDimension(int d, int[] entriesByLB, int[] entriesByUB) {
// Lists which hold entries sorted by their lower and
// upper bounds in the current dimension.
etdc.set(d, true);
IntegerArrayQuickSort.sort(entriesByLB, etdc);
etdc.setLb(false);
IntegerArrayQuickSort.sort(entr... |
java | public static String replaceAllBetweenDelimiter(final String source, final String startStr, final String endStr, final String replaceSrc,
final String replaceDest) {
StringBuilder str = new StringBuilder(source);
for (int procPointer = 0; procPointer >= 0;) {
int start = str.indexOf(startStr, procPointer);
... |
java | static Generator byWeekNoGenerator(int[] weekNumbers, final DayOfWeek weekStart, final DateValue dtStart) {
final int[] uWeekNumbers = Util.uniquify(weekNumbers);
return new Generator() {
int year = dtStart.year();
int month = dtStart.month();
/** number of weeks in the last year seen */
int weeksInYea... |
java | public void setUserLastModified(String userLastModified) {
if (null == userLastModified) { // The optional user last modified information is not provided
m_resourceBuilder.setUserLastModified(getRequestContext().getCurrentUser().getId());
} else { // use the user last modified information f... |
python | def AddDischargingBattery(self, device_name, model_name, percentage, seconds_to_empty):
'''Convenience method to add a discharging battery object
You have to specify a device name which must be a valid part of an object
path, e. g. "mock_ac", an arbitrary model name, the charge percentage, and
the seco... |
java | public String dateToMWTimeStamp(Date date) {
SimpleDateFormat mwTimeStampFormat = new SimpleDateFormat("yyyyMMddHHmmss");
String result = mwTimeStampFormat.format(date);
return result;
} |
java | @Override
public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
return commerceOrderPersistence.findWithDynamicQuery(dynamicQuery);
} |
java | public final TransferConfig updateTransferConfig(
TransferConfig transferConfig, FieldMask updateMask) {
UpdateTransferConfigRequest request =
UpdateTransferConfigRequest.newBuilder()
.setTransferConfig(transferConfig)
.setUpdateMask(updateMask)
.build();
retur... |
python | def ternarize(x, thresh=0.05):
"""
Implemented Trained Ternary Quantization:
https://arxiv.org/abs/1612.01064
Code modified from the authors' at:
https://github.com/czhu95/ternarynet/blob/master/examples/Ternary-Net/ternary.py
"""
shape = x.get_shape()
thre_x = tf.stop_gradient(tf.redu... |
python | def ConvertCloudMetadataResponsesToCloudInstance(metadata_responses):
"""Convert CloudMetadataResponses to CloudInstance proto.
Ideally we'd just get the client to fill out a CloudInstance proto, but we
need to keep the flexibility of collecting new metadata and creating new
fields without a client push. So in... |
java | public void afterThrowing(Method m, Object[] args, Object target, ConcurrencyFailureException e)
throws OptimisticLockingException {
handleOptimisticLockingException(target, e);
} |
python | def update(self, other):
"""Add all rdatas in other to self.
@param other: The rdataset from which to update
@type other: dns.rdataset.Rdataset object"""
self.update_ttl(other.ttl)
super(Rdataset, self).update(other) |
python | def get_image(self, image, chunk_size=DEFAULT_DATA_CHUNK_SIZE):
"""
Get a tarball of an image. Similar to the ``docker save`` command.
Args:
image (str): Image name to get
chunk_size (int): The number of bytes returned by each iteration
of the generator. ... |
java | @Override
public void eUnset(int featureID) {
switch (featureID) {
case AfplibPackage.AMI__DSPLCMNT:
setDSPLCMNT(DSPLCMNT_EDEFAULT);
return;
}
super.eUnset(featureID);
} |
java | private void readObject(final java.io.ObjectInputStream in)
throws IOException {
populateLevels();
boolean isUtilLogging = in.readBoolean();
int levelInt = in.readInt();
if (isUtilLogging) {
level = UtilLoggingLevel.toLevel(levelInt);
} else {
... |
java | public FNCPatTech createFNCPatTechFromString(EDataType eDataType, String initialValue) {
FNCPatTech result = FNCPatTech.get(initialValue);
if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
return result;
} |
java | public static rnat[] get(nitro_service service, options option) throws Exception{
rnat obj = new rnat();
rnat[] response = (rnat[])obj.get_resources(service,option);
return response;
} |
python | def check_env_cache(opts, env_cache):
'''
Returns cached env names, if present. Otherwise returns None.
'''
if not os.path.isfile(env_cache):
return None
try:
with salt.utils.files.fopen(env_cache, 'rb') as fp_:
log.trace('Returning env cache data from %s', env_cache)
... |
python | def migrate_ecp(in_ffp, out_ffp):
"""Migrates and ECP file to the current version of sfsimodels"""
objs, meta_data = load_json_and_meta(in_ffp)
ecp_output = Output()
for m_type in objs:
for instance in objs[m_type]:
ecp_output.add_to_dict(objs[m_type][instance])
ecp_output.name =... |
java | public void init (int socketPolicyPort)
{
_acceptor =
new ServerSocketChannelAcceptor(null, new int[] { socketPolicyPort }, this);
// build the XML once and for all
StringBuilder policy = new StringBuilder()
.append("<?xml version=\"1.0\"?>\n")
.append("<... |
python | def quick_add(self, api_token, text, **kwargs):
"""Add a task using the Todoist 'Quick Add Task' syntax.
:param api_token: The user's login api_token.
:type api_token: str
:param text: The text of the task that is parsed. A project
name starts with the `#` character, a label... |
python | def main(args=None, transform_func=None):
"""Main function for cli."""
args = get_args(args)
utils.init_log(args.log_level)
try:
config = _get_config(args)
except Dump2PolarionException as err:
logger.fatal(err)
return 1
return dumper(args, config, transform_func=trans... |
java | private static int getDoubleBondNumber(IAtomContainer container) {
int doubleNumber = 0;
for (IBond bond : container.bonds()) {
if (bond.getOrder().equals(IBond.Order.DOUBLE) || bond.getOrder().equals(IBond.Order.TRIPLE))
doubleNumber++;
}
return doubleNumber;... |
java | public static Command get(final String _name)
throws CacheReloadException
{
return AbstractUserInterfaceObject.<Command>get(_name, Command.class, CIAdminUserInterface.Command.getType());
} |
python | def validate(self, schema):
"""
Validate VDOM against given JSON Schema
Raises ValidationError if schema does not match
"""
try:
validate(instance=self.to_dict(), schema=schema, cls=Draft4Validator)
except ValidationError as e:
raise ValidationErr... |
java | public String getEnabledValueString() {
String valueEnabledString = this.getProperty("value");
if (valueEnabledString == null) {
valueEnabledString = DEFAULT_ENABLED_VALUE;
}
return valueEnabledString;
} |
python | def where(self, column_or_label, value_or_predicate=None, other=None):
"""
Return a new ``Table`` containing rows where ``value_or_predicate``
returns True for values in ``column_or_label``.
Args:
``column_or_label``: A column of the ``Table`` either as a label
(... |
python | def register_generic_run_arguments(parser, required=True):
"""
Only there for backward compatibility with third party extensions.
TODO: This should be deprecated (using the @deprecated decorator) in 0.7, and removed in 0.8 or 0.9.
"""
dummy_command = BaseGraphCommand()
dummy_command.required = r... |
python | def from_api(cls, **kwargs):
"""Create a new instance from API arguments.
This will switch camelCase keys into snake_case for instantiation.
It will also identify any ``Instance`` or ``List`` properties, and
instantiate the proper objects using the values. The end result being
... |
python | async def _stream_helper(self, response, decode=False):
"""Generator for data coming from a chunked-encoded HTTP response."""
if decode:
async for chunk in json_stream(
self._stream_helper(response, False)):
yield chunk
else:
async wit... |
java | @NonNull
public static Drop dropTable(@Nullable String keyspace, @NonNull String tableName) {
return dropTable(
keyspace == null ? null : CqlIdentifier.fromCql(keyspace),
CqlIdentifier.fromCql(tableName));
} |
java | public static void autowareStaticConfig(Class<?> cls, final String propertyFilePath) throws Exception {
// 读配置文件
Properties prop = getProperties(propertyFilePath);
if (null == prop) {
throw new Exception("cannot autowareConfig " + propertyFilePath);
}
autowareStatic... |
java | @SuppressWarnings({"unused", "WeakerAccess"})
public void pushFacebookUser(final JSONObject graphUser) {
postAsyncSafely("pushFacebookUser", new Runnable() {
@Override
public void run() {
_pushFacebookUser(graphUser);
}
});
} |
python | def _validate_hands(hands, missing):
'''
Validates hands, based on values that
are supposed to be missing from them.
:param list hands: list of Hand objects to validate
:param list missing: list of sets that indicate the values
that are supposed to be missing from
... |
python | def _readconfig():
"""Configures environment variables"""
config = ConfigParser.SafeConfigParser()
try:
found = config.read(littlechef.CONFIGFILE)
except ConfigParser.ParsingError as e:
abort(str(e))
if not len(found):
try:
found = config.read(['config.cfg', 'auth... |
java | public void marshall(SupportedEndpointType supportedEndpointType, ProtocolMarshaller protocolMarshaller) {
if (supportedEndpointType == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(supportedEndpoin... |
java | public DescribeOrderableReplicationInstancesResult withOrderableReplicationInstances(OrderableReplicationInstance... orderableReplicationInstances) {
if (this.orderableReplicationInstances == null) {
setOrderableReplicationInstances(new java.util.ArrayList<OrderableReplicationInstance>(orderableRepl... |
python | def hash_napiprojekt(video_path):
"""Compute a hash using NapiProjekt's algorithm.
:param str video_path: path of the video.
:return: the hash.
:rtype: str
"""
readsize = 1024 * 1024 * 10
with open(video_path, 'rb') as f:
data = f.read(readsize)
return hashlib.md5(data).hexdige... |
java | @Override
public Iterator<FeatureRow> iterator() {
return new Iterator<FeatureRow>() {
int index = -1;
private Iterator<FeatureRow> currentResults = null;
/**
* {@inheritDoc}
*/
@Override
public boolean hasNext() {
boolean hasNext = false;
if (currentResults != null) {
hasNext... |
java | protected void closeJar ()
{
try {
if (_jarSource != null) {
_jarSource.close();
}
} catch (Exception ioe) {
log.warning("Failed to close jar file", "path", _source, "error", ioe);
}
} |
java | public static String replaceAll(String haystack, String[] needle, String newNeedle[]) {
if (needle.length != newNeedle.length) {
throw new IllegalArgumentException("length of original and replace values do not match (" + needle.length + " != " + newNeedle.length + " )");
}
StringBuffer buf = new StringBuffer(h... |
java | public void removeListener(ILabelProviderListener listener)
{
if (fListeners != null)
{
fListeners.remove(listener);
if (fListeners.isEmpty() && fProblemChangedListener != null)
{
VdmUIPlugin.getDefault()
.getProblemMarkerManager()
.removeListener(fProblemChangedListener);
fProblemChan... |
java | private boolean isBranch(Execution execution) {
return execution != null && !StringUtils.isEmpty(execution.getSystemContext().getBranchId());
} |
python | def resizeEvent(self, event):
"""Fit the whole scene in view.
Parameters
----------
event : instance of Qt.Event
not important
"""
value = self.config.value
self.idx_fig.fitInView(value['x_min'],
value['y_min'],
... |
python | def is_child_of_family(self, id_, family_id):
"""Tests if a family is a direct child of another.
arg: id (osid.id.Id): an ``Id``
arg: family_id (osid.id.Id): the ``Id`` of a family
return: (boolean) - ``true`` if the ``id`` is a child of
``family_id,`` ``false`` o... |
java | @Override
public void processNewResult(ResultHierarchy hier, Result result) {
// Get all new clusterings
// TODO: handle clusterings added later, too. Can we update the result?
List<Clustering<?>> clusterings = Clustering.getClusteringResults(result);
// Abort if not enough clusterings to compare
... |
java | private Configuration getClientConf() {
return HeronClientConfiguration.CONF
.set(ClientConfiguration.ON_JOB_RUNNING, ReefClientSideHandlers.RunningJobHandler.class)
.set(ClientConfiguration.ON_JOB_FAILED, ReefClientSideHandlers.FailedJobHandler.class)
.set(ClientConfiguration.ON_RUNTIME_ERR... |
java | public static base_response unset(nitro_service client, scparameter resource, String[] args) throws Exception{
scparameter unsetresource = new scparameter();
return unsetresource.unset_resource(client,args);
} |
python | def create(self, model):
""" Given a model object instance create it """
signals.pre_create.send(model.__class__, model=model)
signals.pre_save.send(model.__class__, model=model)
param = self.to_pg(model)
query = """
INSERT INTO {table} ({dirty_cols})
... |
java | public void unarchive(String baseDir) throws MojoExecutionException {
try (FileInputStream fis = new FileInputStream(archive);
TarArchiveInputStream tarIn = new TarArchiveInputStream(new GzipCompressorInputStream(fis))) {
TarArchiveEntry tarEntry = tarIn.getNextTarEntry();
while (tarEntry != nul... |
python | def main(argv=None):
"""Main entry point for the cdstar CLI."""
args = docopt(__doc__, version=pycdstar.__version__, argv=argv, options_first=True)
subargs = [args['<command>']] + args['<args>']
if args['<command>'] in ['help', None]:
cmd = None
if len(subargs) > 1:
cmd = CO... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.