language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def _add_gainloss_to_output(out, data):
"""Add gainloss based on genes, helpful for identifying changes in smaller genes.
"""
out_file = "%s-gainloss.txt" % os.path.splitext(out["cns"])[0]
if not utils.file_exists(out_file):
with file_transaction(data, out_file) as tx_out_file:
cmd =... |
java | public BufferedImage drawTileQueryIndex(int x, int y, int zoom) {
// Get the web mercator bounding box
BoundingBox webMercatorBoundingBox = TileBoundingBoxUtils
.getWebMercatorBoundingBox(x, y, zoom);
BufferedImage image = null;
// Query for the geometry count matching the bounds in the index
long tile... |
java | @Override
public void addAttack(Attack attack) {
TTransport transport = getTransport();
final TProtocol protocol = new TBinaryProtocol(transport);
final AppSensorApi.Client client = new AppSensorApi.Client(protocol);
//All hooked up, start using the service
try {
org.owasp.appsensor.rpc.thrift.generated.... |
python | def _return_handler(self, ret_value, func, arguments):
"""Check return values for errors and warnings.
TODO: THIS IS JUST COPIED PASTED FROM NIVisaLibrary.
Needs to be adapted.
"""
logger.debug('%s%s -> %r',
func.__name__, _args_to_str(arguments), ret_value... |
java | @Override
public String getName(String languageId, boolean useDefault) {
return _commerceCurrency.getName(languageId, useDefault);
} |
python | def profileMain(self, M, z):
"""
returns all needed parameter (in comoving units modulo h) to draw the profile of the main halo
r200 in co-moving Mpc/h
rho_s in h^2/Mpc^3 (co-moving)
Rs in Mpc/h co-moving
c unit less
"""
c = self.c_M_z(M, z)
r200 ... |
python | def _parse_result_page(self, url, payload, only_region=False):
""" Get data from a result page
:param url: url to query
:param payload: payload to pass
:return: a dictlist with data
"""
data = []
try:
if only_region:
html =... |
python | def non_decreasing(values):
"""True if values are not decreasing."""
return all(x <= y for x, y in zip(values, values[1:])) |
java | public void setEventTriggers(java.util.Collection<EventTriggerDefinition> eventTriggers) {
if (eventTriggers == null) {
this.eventTriggers = null;
return;
}
this.eventTriggers = new java.util.ArrayList<EventTriggerDefinition>(eventTriggers);
} |
python | def get_kind_name_plural(kind):
"e.g. 'Gigs' or 'Movies'."
if kind in ['comedy', 'cinema', 'dance', 'theatre']:
return kind.title()
elif kind == 'museum':
return 'Galleries/Museums'
else:
return '{}s'.format(Event.get_kind_name(kind)) |
python | def folderitem(self, obj, item, index):
"""Service triggered each time an item is iterated in folderitems.
The use of this service prevents the extra-loops in child objects.
:obj: the instance of the class to be foldered
:item: dict containing the properties of the object to be used by... |
java | static <K, V> ViewQueryParameters<K, V> forwardPaginationQueryParameters
(ViewQueryParameters<K, V> initialQueryParameters, K startkey, String startkey_docid) {
// Copy the initial query parameters
ViewQueryParameters<K, V> pageParameters = initialQueryParameters.copy();
// Now override wi... |
java | private synchronized void fetchAccessToken() throws ConnectionException, HTTPException {
if (accessToken != null) {
return;
}
Map<String, String> params = new HashMap<>();
params.put(Constants.PARAM_CLIENT_ID, clientId);
params.put(Constants.PARAM_CLIENT_SECRET, clie... |
python | def keep_labels(self, labels, relabel=False):
"""
Keep only the specified labels.
Parameters
----------
labels : int, array-like (1D, int)
The label number(s) to keep.
relabel : bool, optional
If `True`, then the segmentation image will be relabe... |
java | public java.util.List<Evaluation> getFailedEvaluations() {
if (failedEvaluations == null) {
failedEvaluations = new com.amazonaws.internal.SdkInternalList<Evaluation>();
}
return failedEvaluations;
} |
python | def add_external_tracker(self, bug_ids, ext_bz_bug_id, ext_type_id=None,
ext_type_description=None, ext_type_url=None,
ext_status=None, ext_description=None,
ext_priority=None):
"""
Wrapper method to allow adding of e... |
python | def get_by_bucket(cls, bucket, versions=False, with_deleted=False):
"""Return query that fetches all the objects in a bucket.
:param bucket: The bucket (instance or id) to query.
:param versions: Select all versions if True, only heads otherwise.
:param with_deleted: Select also deleted... |
java | protected synchronized String upHost(ZoneInfo zoneInfo, boolean useHttps, String lastUpHost) {
String upHost = null;
String upDomain = null;
if (lastUpHost != null) {
URI uri = URI.create(lastUpHost);
//frozen domain
String frozenDomain = uri.getHost();
... |
python | def vector_normalize(vector_in, decimals=18):
""" Generates a unit vector from the input.
:param vector_in: vector to be normalized
:type vector_in: list, tuple
:param decimals: number of significands
:type decimals: int
:return: the normalized vector (i.e. the unit vector)
:rtype: list
... |
python | def point_data_to_cell_data(dataset, pass_point_data=False):
"""Transforms point data (i.e., data specified per node) into cell data
(i.e., data specified within cells).
Optionally, the input point data can be passed through to the output.
See aslo: :func:`vtki.DataSetFilters.cell_data_... |
python | def kmean_clustering(network, n_clusters=10, load_cluster=False,
line_length_factor=1.25,
remove_stubs=False, use_reduced_coordinates=False,
bus_weight_tocsv=None, bus_weight_fromcsv=None,
n_init=10, max_iter=300, tol=1e-4,
... |
java | protected void write(Writer writer, String s) {
try {
writer.write(s);
} catch (IOException e) {
throw new DukeException(e);
}
} |
python | def _initialize_encryption(self, options):
# type: (Descriptor, blobxfer.models.options.Upload) -> None
"""Download is resume capable
:param Descriptor self: this
:param blobxfer.models.options.Upload options: upload options
"""
if (options.rsa_public_key is not None and ... |
python | def start_plasma_store(stdout_file=None,
stderr_file=None,
object_store_memory=None,
plasma_directory=None,
huge_pages=False,
plasma_store_socket_name=None):
"""This method starts an object store proce... |
java | public synchronized void clearDisappearedJob() {
getCron4jJobList().stream().filter(job -> job.isDisappeared()).forEach(job -> {
final LaJobKey jobKey = job.getJobKey();
jobKeyJobMap.remove(jobKey);
jobOrderedList.remove(job);
job.getJobUnique().ifPresent(jobUniqu... |
python | def get_applications(self):
"""Return the list of supported applications."""
applications = []
# Isolate all of the bnodes referring to target applications
for target_app in self.get_objects(None,
self.uri('targetApplication')):
app... |
python | def sign_request(self, url, method, body, headers):
"""Sign a request.
:param url: The URL to which the request is to be sent.
:param headers: The headers in the request. These will be updated with
the signature.
"""
# The use of PLAINTEXT here was copied from MAAS, ... |
java | public static double percentile(long[] counts, double p) {
double[] pcts = new double[] {p};
double[] results = new double[1];
percentiles(counts, pcts, results);
return results[0];
} |
python | def svds_descending(M, k):
'''
In contrast to MATLAB, numpy's svds() arranges the singular
values in ascending order. In order to have matching codes,
we wrap it around by a function which re-sorts the singular
values and singular vectors.
Args:
M: 2D numpy array; the matrix whose... |
python | def _rds_cluster_tags(model, dbs, session_factory, generator, retry):
"""Augment rds clusters with their respective tags."""
client = local_session(session_factory).client('rds')
def process_tags(db):
try:
db['Tags'] = retry(
client.list_tags_for_resource,
... |
python | def from_frame(klass, frame, connection):
"""
Create a new TaskStateChange event from a Stompest Frame.
"""
event = frame.headers['new']
data = json.loads(frame.body)
info = data['info']
task = Task.fromDict(info)
task.connection = connection
retur... |
python | def startswith(text, ignore_case=True):
"""
Test if a string-field start with ``text``.
Example::
filters = {"path": Text.startswith(r"C:\\")}
"""
if ignore_case:
compiled = re.compile(
"^%s" % text.replace("\\", "\\\\"), re.IGNORECASE)
... |
java | public void marshall(CreateEmailIdentityRequest createEmailIdentityRequest, ProtocolMarshaller protocolMarshaller) {
if (createEmailIdentityRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(c... |
java | @Override
public void send(Queue queue, Message message) throws JMSException
{
send((Destination)queue,message,defaultDeliveryMode,defaultPriority,defaultTimeToLive);
} |
python | def save(filename, contents, include_params=False, variable_batch_size=True):
'''Save network definition, inference/training execution
configurations etc.
Args:
filename (str): Filename to store information. The file
extension is used to determine the saving file format.
``.... |
python | def visitShapeDefinition(self, ctx: ShExDocParser.ShapeDefinitionContext):
""" shapeDefinition: qualifier* '{' oneOfShape? '}' annotation* semanticActions """
if ctx.qualifier():
for q in ctx.qualifier():
self.visit(q)
if ctx.oneOfShape():
oneof_parser = S... |
java | @Deprecated
protected double[] convertToDouble(final Object... fromStack) throws Exception
{
final double[] converted = new double[fromStack.length];
for (int c = 0; c < fromStack.length; c++)
{
final Object data = fromStack[c];
if (data instanceof Number)
... |
python | def spellcheck(config_file, names=None, groups=None, binary='', checker='', sources=None, verbose=0, debug=False):
"""Spell check."""
hunspell = None
aspell = None
spellchecker = None
config = util.read_config(config_file)
if sources is None:
sources = []
matrix = config.get('matri... |
python | def save_xml(self, doc, element):
'''Save this location into an xml.dom.Element object.'''
element.setAttributeNS(RTS_EXT_NS, RTS_EXT_NS_S + 'x', str(self.x))
element.setAttributeNS(RTS_EXT_NS, RTS_EXT_NS_S + 'y', str(self.y))
element.setAttributeNS(RTS_EXT_NS, RTS_EXT_NS_S + 'height',
... |
java | public static long getExplicitPermission(Channel channel, Member member)
{
Checks.notNull(channel, "Channel");
Checks.notNull(member, "Member");
final Guild guild = member.getGuild();
checkGuild(channel.getGuild(), guild, "Member");
long permission = getExplicitPermission(m... |
python | def orthonormality(V, ip_B=None):
"""Measure orthonormality of given basis.
:param V: a matrix :math:`V=[v_1,\ldots,v_n]` with ``shape==(N,n)``.
:param ip_B: (optional) the inner product to use, see :py:meth:`inner`.
:return: :math:`\\| I_n - \\langle V,V \\rangle \\|_2`.
"""
return norm(numpy... |
python | def close(self):
"""
Break reference cycles to allow instance to be garbage-collected.
Raises if called on a submitted transfer.
"""
if self.__submitted:
raise ValueError('Cannot close a submitted transfer')
self.doom()
self.__initialized = False
... |
python | def bind_settings():
"""
Put DJANGO_TEMPLATE_* under the right settings.* name according to django-version
:return:
"""
from django_productline import settings
if settings.TEMPLATE_LOADER_CACHED_ENABLED:
loaders = [
['django.template.loaders.cached.Loader', settings.DJANGO_T... |
python | def vm_present(name, vmconfig, config=None):
'''
Ensure vm is present on the computenode
name : string
hostname of vm
vmconfig : dict
options to set for the vm
config : dict
fine grain control over vm_present
.. note::
The following configuration properties can... |
java | public static long unixTimestamp(String dateStr, String format, TimeZone tz) {
long ts = parseToTimeMillis(dateStr, format, tz);
if (ts == Long.MIN_VALUE) {
return Long.MIN_VALUE;
} else {
// return the seconds
return ts / 1000;
}
} |
python | def guid(valu=None):
'''
Get a 16 byte guid value.
By default, this is a random guid value.
Args:
valu: Object used to construct the guid valu from. This must be able
to be msgpack'd.
Returns:
str: 32 character, lowercase ascii string.
'''
if valu is None:
... |
python | def strip_system_metadata(etree_obj):
"""In-place remove elements and attributes that are only valid in v2 types from v1
System Metadata.
Args: etree_obj: ElementTree ElementTree holding a v1 SystemMetadata.
"""
for series_id_el in etree_obj.findall('seriesId'):
etree_obj.remove(seri... |
python | def _adapt_WSDateTime(dt):
"""Return unix timestamp of the datetime like input.
If conversion overflows high, return sint64_max ,
if underflows, return 0
"""
try:
ts = int(
(dt.replace(tzinfo=pytz.utc)
- datetime(1970,1,1,tzinfo=pytz.utc)
).total_seconds()... |
python | def build_args():
"""Create command line argument parser."""
parser = argparse.ArgumentParser(description=DESCRIPTION, formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument('recipe', type=str, help="The recipe file to load and run.")
parser.add_argument('-d', '--define', action="appe... |
python | def _check_load_paths(load_path):
'''
Checks the validity of the load_path, returns a sanitized version
with invalid paths removed.
'''
if load_path is None or not isinstance(load_path, six.string_types):
return None
_paths = []
for _path in load_path.split(':'):
if os.path... |
python | def _draw_calendar(self, canvas, redraw=False):
"""Draws calendar."""
options = self.__options
# Update labels:
name = self._cal.formatmonthname(self._date.year, self._date.month, 0,
withyear=False)
self._lmonth.configure(text=name.title()... |
java | public void handleMove(HttpServletRequest request, HttpServletResponse response, String pathInContext, Resource resource) throws ServletException, IOException
{
if (!resource.exists() || !passConditionalHeaders(request, response, resource))
return;
String newPath = URI.canonicalPath(req... |
java | public static List<Word> parseWithoutStopWords(String str) {
List<Word> words = WordSegmenter.seg(str, SegmentationAlgorithm.MaxNgramScore);
//词性标注
PartOfSpeechTagging.process(words);
return words;
} |
python | def _send_raw(self, command):
"""
Sends an raw command directly to the physical bridge.
:param command: A bytearray.
"""
try:
self._socket.send(bytearray(command))
self._sn = (self._sn + 1) % 256
return True
except (socket.error, socket... |
java | @Override @Local
public IPromise<Actor> reanimate(String sessionId, long remoteRefId) {
if ( sessionStorage == null )
return resolve(null);
Promise res = new Promise();
sessionStorage.getUserFromSessionId(sessionId).then( (user, err) -> {
if ( user == null )
... |
java | @Deprecated
public static String generateToken(String secret, long seconds, String oid, String... payload) {
return generateToken(secret.getBytes(Charsets.UTF_8), seconds, oid, payload);
} |
java | public String getErrorReport() {
Map<String, List<PropertyMigration>> content = getContent(
LegacyProperties::getUnsupported);
if (content.isEmpty()) {
return null;
}
StringBuilder report = new StringBuilder();
report.append(String.format("%nThe use of configuration keys that are no longer "
+ "sup... |
python | def csv_reader(unicode_csv_data, dialect=None, **kwargs):
"""csv.reader doesn't support Unicode input, so need to use some tricks
to work around this.
Source: https://docs.python.org/2/library/csv.html#csv-examples
"""
import csv
dialect = dialect or csv.excel
if is_py3:
# Python3... |
python | def _validate_index_level(self, level):
"""
Validate index level.
For single-level Index getting level number is a no-op, but some
verification must be done like in MultiIndex.
"""
if isinstance(level, int):
if level < 0 and level != -1:
rais... |
python | def hash_file(file_path, block_size = 65536):
""" Hashes a file with sha256 """
sha = hashlib.sha256()
with open(file_path, 'rb') as h_file:
file_buffer = h_file.read(block_size)
while len(file_buffer) > 0:
sha.update(file_buffer)
file_buffer = h_file.read(block_size)... |
python | def rabi_oscillations(sampler: sim.Sampler,
qubit: devices.GridQubit,
max_angle: float = 2 * np.pi,
*,
repetitions: int = 1000,
num_points: int = 200) -> RabiResult:
"""Runs a Rabi oscillation experiment.
... |
java | public static List<List<Term>> seg2sentence(String text)
{
List<List<Term>> resultList = new LinkedList<List<Term>>();
{
for (String sentence : SentencesUtil.toSentenceList(text))
{
resultList.add(segment(sentence));
}
}
return res... |
java | public static byte[] decodeFromString(String src) {
assertSupported();
if (src == null) {
return null;
}
if (src.length() == 0) {
return new byte[0];
}
return delegate.decode(src.getBytes(DEFAULT_CHARSET));
} |
python | def append(self, item, select=False):
"""Add an item to the end of the list.
:param item: The item to be added
:param select: Whether the item should be selected after adding
"""
if item in self:
raise ValueError("item %s already in list" % item)
modeliter = ... |
python | def intersection(self, meta):
"""
Get the intersection between the meta data given and the meta data contained within the plates.
Since all of the streams have the same meta data keys (but differing values) we only need to consider
the first stream.
:param meta: The meta data to ... |
python | def woa_track_from_file(d, lat, lon, filename, varnames=None):
""" Temporary solution: WOA for surface track
"""
d = np.asanyarray(d)
lat = np.asanyarray(lat)
lon = np.asanyarray(lon)
lon[lon < 0] += 360
doy = np.array([int(dd.strftime('%j')) for dd in d])
nc = netCDF4.Dataset(expandu... |
python | def check_indexes(self):
"""Check if the indexes exists"""
for collection_name in INDEXES:
existing_indexes = self.indexes(collection_name)
indexes = INDEXES[collection_name]
for index in indexes:
index_name = index.document.get('name')
... |
python | def cart2dir(self,cart):
"""
converts a direction to cartesian coordinates
"""
# print "calling cart2dir(), not in anything"
cart=numpy.array(cart)
rad=old_div(numpy.pi,180.) # constant to convert degrees to radians
if len(cart.shape)>1:
Xs,Ys,Zs=cart[:... |
python | def borrow_optimizer(self, shared_module):
"""Borrows optimizer from a shared module. Used in bucketing, where exactly the same
optimizer (esp. kvstore) is used.
Parameters
----------
shared_module : Module
"""
assert shared_module.optimizer_initialized
s... |
java | public static String stringFor(int n)
{
if (n == 0)
{
return "CU_GRAPHICS_REGISTER_FLAGS_NONE";
}
String result = "";
if ((n & CU_GRAPHICS_REGISTER_FLAGS_READ_ONLY ) != 0) result += "CU_GRAPHICS_REGISTER_FLAGS_READ_ONLY ";
if ((n & CU_GRAPHICS_R... |
python | def get_base_type_of_signal(signal):
# type: (canmatrix.Signal) -> typing.Tuple[str, int]
"""Get signal arxml-type and size based on the Signal properties."""
if signal.is_float:
if signal.size > 32:
create_type = "double"
size = 64
else:
create_type = "si... |
java | public static void logUncaughtExceptions(Logging logger) {
try {
Thread.setDefaultUncaughtExceptionHandler((t, e) -> logger.exception(e));
}
catch(SecurityException e) {
logger.warning("Could not set the Default Uncaught Exception Handler", e);
}
} |
java | public void adjustChildren(int widthMeasureSpec, int heightMeasureSpec) {
if (Log.isLoggable(TAG, Log.DEBUG)) {
Log.d(TAG, "adjustChildren: " + mHost + " widthMeasureSpec: "
+ View.MeasureSpec.toString(widthMeasureSpec) + " heightMeasureSpec: "
+ View.MeasureS... |
python | def load(self, base_settings):
"""Merge local settings from file with ``base_settings``.
Returns a new settings dict containing the base settings and the
loaded settings. Includes:
- base settings
- settings from extended file(s), if any
- settings from file... |
python | def validate(version, comparison):
"""
Returns whether or not the version for this plugin satisfies the
inputted expression. The expression will follow the dependency
declaration rules associated with setuptools in Python. More
information can be found at
[https://pythonhosted.org/setupto... |
python | def is_json(string):
"""
Check if a string is a valid json.
:param string: String to check.
:type string: str
:return: True if json, false otherwise
:rtype: bool
"""
if not is_full_string(string):
return False
if bool(JSON_WRAPPER_RE.search(string)):
try:
... |
java | public void merge(StandaloneConfiguration other) {
if (other == null) {
return;
}
if (isMergeAble(Integer.class, other.browserTimeout, browserTimeout)) {
browserTimeout = other.browserTimeout;
}
if (isMergeAble(Integer.class, other.jettyMaxThreads, jettyMaxThreads)) {
jettyMaxThre... |
java | public <X> DataSource<X> fromCollection(Iterator<X> data, TypeInformation<X> type) {
if (!(data instanceof Serializable)) {
throw new IllegalArgumentException("The iterator must be serializable.");
}
return new DataSource<X>(this, new IteratorInputFormat<X>(data), type);
} |
java | @Override
public String[] findMemberGroupKeys(IEntityGroup group) throws GroupsException {
if (isTreeRefreshRequired()) {
refreshTree();
}
log.debug("Invoking findMemberGroupKeys() for group: {}", group.getLocalKey());
List<String> rslt = new ArrayList<>();
fo... |
python | def decompress(infile, outdir='.'):
"""Decompress an XRIT data file and return the path to the decompressed file.
It expect to find Eumetsat's xRITDecompress through the environment variable
XRIT_DECOMPRESS_PATH.
"""
cmd = get_xritdecompress_cmd()
infile = os.path.abspath(infile)
cwd = os.g... |
java | public ArrayList<String> urlSeeds() {
string_vector v = p.get_url_seeds();
int size = (int) v.size();
ArrayList<String> l = new ArrayList<>();
for (int i = 0; i < size; i++) {
l.add(v.get(i));
}
return l;
} |
java | public void marshall(VirtualRouterSpec virtualRouterSpec, ProtocolMarshaller protocolMarshaller) {
if (virtualRouterSpec == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(virtualRouterSpec.getListene... |
python | def add_subgroups(self, subgroups):
"""
Add a list of SubGroupDefinition objects to this composite.
Note that in contrast to :meth:`BaseTrack`, which takes a single
dictionary indicating the particular subgroups for the track, this
method takes a list of :class:`SubGroupDefiniti... |
python | def _getSaveAsFilter(self):
""" Return a string to be used as the filter arg to the save file
dialog during Save-As. """
# figure the dir to use, start with the one from the file
absRcDir = os.path.abspath(self._rcDir)
thedir = os.path.abspath(os.path.dirname(self._taskParsOb... |
python | def _to_representation(self, instance):
"""Uncached `to_representation`."""
if self.enable_optimization:
representation = self._faster_to_representation(instance)
else:
representation = super(
WithDynamicSerializerMixin,
self
)... |
java | protected boolean isDataTableResultType(DefaultResultSetHandler resultSetHandler)
{
MappedStatement mappedStatement= reflect(resultSetHandler);
List<ResultMap> res=mappedStatement.getResultMaps();
if(res.size()==1&&res.get(0).getType().equals(DataTable.class))
{
return tr... |
java | @Override
public void onAutoHide() {
JFXTimePicker datePicker = (JFXTimePicker) getControl();
JFXTimePickerSkin cpSkin = (JFXTimePickerSkin) datePicker.getSkin();
cpSkin.syncWithAutoUpdate();
if (!datePicker.isShowing()) {
super.onAutoHide();
}
} |
python | def lock(self):
"""Lock specified (abstract) requirements into (concrete) candidates.
The locking procedure consists of four stages:
* Resolve versions and dependency graph (powered by ResolveLib).
* Walk the graph to determine "why" each candidate came to be, i.e.
what top-l... |
python | def update_trigger(self, service):
"""
update the date when occurs the trigger
:param service: service object to update
"""
now = arrow.utcnow().to(settings.TIME_ZONE).format('YYYY-MM-DD HH:mm:ssZZ')
TriggerService.objects.filter(id=service.id).update(date_trigger... |
python | def read_word_data(self, i2c_addr, register, force=None):
"""
Read a single word (2 bytes) from a given register.
:param i2c_addr: i2c address
:type i2c_addr: int
:param register: Register to read
:type register: int
:param force:
:type force: Boolean
... |
java | public static void fatal(final Logger logger, final String format, final Object... params) {
fatal(logger, format, null, params);
} |
python | def _graphite_url(self, query, raw_data=False, graphite_url=None):
"""Build Graphite URL."""
query = escape.url_escape(query)
graphite_url = graphite_url or self.reactor.options.get('public_graphite_url')
url = "{base}/render/?target={query}&from=-{from_time}&until=-{until}".format(
... |
python | def remove_script(zap_helper, script_name):
"""Remove a script."""
with zap_error_handler():
console.debug('Removing script "{0}"'.format(script_name))
result = zap_helper.zap.script.remove(script_name)
if result != 'OK':
raise ZAPError('Error removing script: {0}'.format(re... |
python | def format_unencoded(self, tokensource, outfile):
"""
The formatting process uses several nested generators; which of
them are used is determined by the user's options.
Each generator should take at least one argument, ``inner``,
and wrap the pieces of text generated by this.
... |
java | @UsedByGeneratedCode
public static Object istcheck(int ids, String nameAndDescriptor) {
if (TypeRegistry.nothingReloaded) {
return null;
}
int registryId = ids >>> 16;
int typeId = ids & 0xffff;
TypeRegistry typeRegistry = registryInstances[registryId].get();
ReloadableType reloadableType = typeRegistry... |
java | @Override
public void close()
{
if (isShutdown.getAndSet(true)) {
return;
}
HikariPool p = pool;
if (p != null) {
try {
LOGGER.info("{} - Shutdown initiated...", getPoolName());
p.shutdown();
LOGGER.info("{} - Shutdown completed.", get... |
python | def get_subdomain_entry(self, fqn, accepted=True, cur=None):
"""
Given a fully-qualified subdomain, get its (latest) subdomain record.
Raises SubdomainNotFound if there is no such subdomain
"""
get_cmd = "SELECT * FROM {} WHERE fully_qualified_subdomain=? {} ORDER BY sequence DES... |
python | def sequence_quality_plot (self):
""" Create the HTML for the phred quality score plot """
data = dict()
for s_name in self.fastqc_data:
try:
data[s_name] = {self.avg_bp_from_range(d['base']): d['mean'] for d in self.fastqc_data[s_name]['per_base_sequence_quality']}
... |
python | def index(ref_file, out_dir, data):
"""Create a STAR index in the defined reference directory.
"""
(ref_dir, local_file) = os.path.split(ref_file)
gtf_file = dd.get_gtf_file(data)
if not utils.file_exists(gtf_file):
raise ValueError("%s not found, could not create a star index." % (gtf_file)... |
java | static boolean grisu3(double v, FastDtoaBuilder buffer) {
long bits = Double.doubleToLongBits(v);
DiyFp w = DoubleHelper.asNormalizedDiyFp(bits);
// boundary_minus and boundary_plus are the boundaries between v and its
// closest floating-point neighbors. Any number strictly between
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.