language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | @Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
if ("name".equals(qName)) {
isName = true;
} else if ("state".equals(qName)) {
isState = true;
} else if ("np".equals(qName)) {
isNp... |
java | @SuppressWarnings({"fallthrough"})
public static void spooky4(final long[] triple, final long seed, final long[] tuple) {
long h0, h1, h2, h3;
h0 = seed;
h1 = ARBITRARY_BITS + triple[0];
h2 = ARBITRARY_BITS + triple[1];
h3 = ARBITRARY_BITS + triple[2];
h2 = Long.rotateLeft(h2, 50);
h2 += h3;
h0 ^= h2;... |
java | private void writeTask(Task task) throws IOException
{
writeFields(null, task, TaskField.values());
for (Task child : task.getChildTasks())
{
writeTask(child);
}
} |
python | def check_in_ase(atoms, ase_db, energy=None):
"""Check if entry is allready in ASE db"""
db_ase = ase.db.connect(ase_db)
if energy is None:
energy = atoms.get_potential_energy()
formula = get_chemical_formula(atoms)
rows = db_ase.select(energy=energy)
n = 0
ids = []
for row in r... |
python | def get(self, prop):
""" get the value off the passed in dot notation
args:
prop: a string of the property to retreive
"a.b.c" ~ dictionary['a']['b']['c']
"""
prop_parts = prop.split(".")
val = None
for part in prop_parts:
if val i... |
java | private static WebParam buildParam(WebBuilder builder, Parameter param)
{
if (RequestWeb.class.equals(param.getType())) {
return new WebParamRequest();
}
else if (Result.class.equals(param.getType())) {
return new WebParamResult();
}
else if (param.isAnnotationPresent(Query.class)) {
... |
java | public Map<String, String> resolve(Map<String, String> config) {
config = resolveSystemEnvironmentVariables(config);
config = resolveSystemDefaultSetup(config);
config = resolveDockerInsideDocker(config);
config = resolveDownloadDockerMachine(config);
config = resolveAutoStartDoc... |
java | protected List<Vertex> toVertexList(List<Term> wordList, boolean appendStart)
{
ArrayList<Vertex> vertexList = new ArrayList<Vertex>(wordList.size() + 2);
if (appendStart) vertexList.add(Vertex.newB());
for (Term word : wordList)
{
CoreDictionary.Attribute attribute = gue... |
java | public final void serverStopping() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "serverStopping", this);
if (okayToSendServerStopping()) {
Iterator<ComponentList> vIter = jmeComponents.iterator();
while (vIter.hasNext()) {
... |
java | public void write(@NonNull MultiNormalizerHybrid normalizer, @NonNull OutputStream stream) throws IOException {
try (DataOutputStream dos = new DataOutputStream(stream)) {
writeStatsMap(normalizer.getInputStats(), dos);
writeStatsMap(normalizer.getOutputStats(), dos);
writeSt... |
python | def crop(self, min, max):
"""
Crop a region by removing coordinates outside bounds.
Follows normal slice indexing conventions.
Parameters
----------
min : tuple
Minimum or starting bounds for each axis.
max : tuple
Maximum or ending boun... |
python | def agp(args):
"""
%prog agp evidencefile contigs.fasta
Convert SSPACE scaffold structure to AGP format.
"""
p = OptionParser(agp.__doc__)
opts, args = p.parse_args(args)
if len(args) != 2:
sys.exit(not p.print_help())
evidencefile, contigs = args
ef = EvidenceFile(evidenc... |
python | def boxplot(self, **vargs):
"""Plots a boxplot for the table.
Every column must be numerical.
Kwargs:
vargs: Additional arguments that get passed into `plt.boxplot`.
See http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.boxplot
for addition... |
python | def validate(self):
""" Validate filter condition (template method).
"""
super(TaggedAsFilter, self).validate()
self._value = self._value.lower()
# If the tag starts with '=', test on equality (just this tag, no others)
if self._value.startswith('='):
self._e... |
java | public static void swap(long[] longArray1, int array1Index, long[] longArray2, int array2Index) {
if(longArray1[array1Index] != longArray2[array2Index]) {
longArray1[array1Index] = longArray1[array1Index] ^ longArray2[array2Index];
longArray2[array2Index] = longArray1[array1Index] ^ long... |
java | private void updateCacheState(Map<String, Object> props) {
getAuthenticationConfig(props);
if (cacheEnabled) {
authCacheServiceRef.activate(cc);
} else {
authCacheServiceRef.deactivate(cc);
}
} |
python | def closeall(**params):
"""
Close all file descriptors. This turns out to be harder than you'd
think. For example, here is a discussion:
http://stackoverflow.com/questions/899038/getting-the-highest-allocated-file-descriptor
The default algorithm here is to close until "closeall.beyond_last_fd"
... |
java | public XAttributeList createAttributeList(String key, XExtension extension) {
return new XAttributeListImpl(intern(key), extension);
} |
python | def remove_package(package, image=None, restart=False):
'''
Uninstall a package
Args:
package (str): The full path to the package. Can be either a .cab file
or a folder. Should point to the original source of the package, not
to where the file is installed. This can also be ... |
java | private boolean cacheBlockFromRemoteWorker(long blockId, long blockSize,
InetSocketAddress sourceAddress, Protocol.OpenUfsBlockOptions openUfsBlockOptions) {
try {
mBlockWorker.createBlockRemote(Sessions.ASYNC_CACHE_SESSION_ID, blockId,
mStorageTierAssoc.getAlias(0), blockSize);
} catch (B... |
python | def is_module_has_decorated(path,decorator_module,decorator_name):
'''
Finds out if a python module uses a given decorator.
Args :
loaded_module : The loaded module to be scanned.
decorator_module : Then name of the module defining the decorator.
decora... |
java | public static RemoteRepository remoteRepositoryFromUrl(String url) throws MalformedURLException {
URL parsedUrl = new URL(url);
StringBuffer id = new StringBuffer(parsedUrl.getHost());
String path = parsedUrl.getPath();
if (path.length() > 0) {
path = path.replaceFirst("/", ... |
python | def calc_one_vert_gauss(one_vert, xyz=None, std=None):
"""Calculate how many electrodes influence one vertex, using a Gaussian
function.
Parameters
----------
one_vert : ndarray
vector of xyz position of a vertex
xyz : ndarray
nChan X 3 with the position of all the channels
... |
java | private static boolean isFiltered(MavenCoordinate artifactCoordinate) {
if (artifactCoordinate.getGroupId().startsWith("org.jboss.shrinkwrap")) {
return true;
}
if (artifactCoordinate.getGroupId().startsWith("org.jboss.arquillian")) {
return true;
}
if (ar... |
java | @Override
public void write(byte[] record) throws IOException {
Preconditions.checkNotNull(record);
byte[] toWrite = record;
if (this.recordDelimiter.isPresent()) {
toWrite = Arrays.copyOf(record, record.length + 1);
toWrite[toWrite.length - 1] = this.recordDelimiter.get();
}
if (this... |
python | def cycle_dist(x, y, n):
"""Find Distance between x, y by means of a n-length cycle.
Example:
cycle_dist(1, 23, 24) = 2
cycle_dist(5, 13, 24) = 8
cycle_dist(0.0, 2.4, 1.0) = 0.4
cycle_dist(0.0, 2.6, 1.0) = 0.4
"""
dist = abs(x - y) % n
if dist >= 0.5 * n:
di... |
python | def _iter_info(self, niter, level=logging.INFO):
"""
Log iteration number and mismatch
Parameters
----------
level
logging level
Returns
-------
None
"""
max_mis = self.iter_mis[niter - 1]
msg = ' Iter {:<d}. max misma... |
java | public static CharSequence take(CharSequence self, int num) {
if (num < 0) {
return self.subSequence(0, 0);
}
if (self.length() <= num) {
return self;
}
return self.subSequence(0, num);
} |
python | def guess_tags(filename):
"""
Function to get potential tags for files using the file names.
:param filename: This field is the name of file.
"""
tags = []
stripped_filename = strip_zip_suffix(filename)
if stripped_filename.endswith('.vcf'):
tags.append('vcf')
if stripped_filena... |
python | def loop(self):
"""
Thread's main loop. Don't meant to be called by user directly.
Call inherited start() method instead.
Events are read only once time every min(read_freq, timeout)
seconds at best and only if the size of events to read is >= threshold.
"""
# Wh... |
java | @Override
public StartAssociationsOnceResult startAssociationsOnce(StartAssociationsOnceRequest request) {
request = beforeClientExecution(request);
return executeStartAssociationsOnce(request);
} |
java | public DestructuredPropertyInfo addDestructuredProperty(String propertyType,
String propertyName,
LocalVariableInfo destructuredVariable) {
return contextLayers.getFirst()
.addDestructuredProperty(propertyType, propertyName, destructuredVariable);
} |
python | def max_min_l1(self, reaction, weights={}):
"""Maximize flux of reaction then minimize the L1 norm.
During minimization the given reaction will be fixed at the maximum
obtained from the first solution. If reaction is a dictionary object,
each entry is interpreted as a weight on the obje... |
java | public Reservation findByReservationId(ReservationId reservationId) throws NoResultException {
EntityManager entityManager = getEntityManager();
try {
return entityManager.createQuery("SELECT t FROM io.motown.operatorapi.viewmodel.persistence.entities.Reservation AS t WHERE t.reservationId =... |
python | def post_event_cancel(self, id, **data):
"""
POST /events/:id/cancel/
Cancels an event if it has not already been deleted. In order for cancel to be permitted, there must be no pending or
completed orders. Returns a boolean indicating success or failure of the cancel.
"""
... |
python | def get_orders(self, address, chain_name='NEO', contract_version='V2', pair=None, from_epoch_time=None,
order_status=None, before_id=None, limit=50):
"""
Function to fetch the order history of the given address.
Execution of this function is as follows::
get_order... |
java | public void readDwgInsertV15(int[] data, int offset) throws Exception {
//System.out.println("readDwgInsert() executed ...");
int bitPos = offset;
bitPos = readObjectHeaderV15(data, bitPos);
Vector v = DwgUtil.getBitDouble(data, bitPos);
bitPos = ((Integer)v.get(0)).intValue();
double x = ((Double)v.get(1))... |
python | def from_(self, table, alias=None):
"""
Establece el origen de datos (y un alias opcionalmente).
"""
if isinstance(table, str):
table = [[table, alias]]
self.raw_tables = table
return self |
java | public Permissions getEffective() {
final ModeledAuthenticatedUser authenticatedUser = getCurrentUser();
final Set<String> effectiveGroups;
// If this user is the currently-authenticated user, include any
// additional effective groups declared by the authentication system
if (... |
python | def clean_text(self, text, preserve_space):
"""Text cleaning as per https://www.w3.org/TR/SVG/text.html#WhiteSpace
"""
if text is None:
return
if preserve_space:
text = text.replace('\r\n', ' ').replace('\n', ' ').replace('\t', ' ')
else:
text ... |
java | private static URL[] getUrls(File directory) throws MalformedURLException, IOException
{
List<URL> list = new LinkedList<URL>();
if (directory.exists() && directory.isDirectory())
{
// Add directory
list.add(directory.toURI().toURL());
// Add the contents of the directo... |
python | def linked_form(viewset, form_id=None, link=None, link_id=None, method=None):
"""
When having foreign key or m2m relationships between models A and B (B has foreign key to A named parent),
we want to have a form that sits on A's viewset but creates/edits B and sets it relationship to A
automatically.
... |
python | def init_app(self, app):
"""
This callback can be used to initialize an application for the
use with this prometheus reporter setup.
This is usually used with a flask "app factory" configuration. Please
see: http://flask.pocoo.org/docs/1.0/patterns/appfactories/
Note, t... |
java | public static void trace(String msg) {
log(null, LEVEL_TRACE, msg, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0);
} |
python | def describe_splits_ex(self, cfName, start_token, end_token, keys_per_split):
"""
Parameters:
- cfName
- start_token
- end_token
- keys_per_split
"""
self._seqid += 1
d = self._reqs[self._seqid] = defer.Deferred()
self.send_describe_splits_ex(cfName, start_token, end_token, k... |
java | public static ns_ssl_certkey_policy do_poll(nitro_service client, ns_ssl_certkey_policy resource) throws Exception
{
return ((ns_ssl_certkey_policy[]) resource.perform_operation(client, "do_poll"))[0];
} |
java | private TypedScope getScopeDeclaredIn() {
if (declarationScope != null) {
return declarationScope;
}
int dotIndex = fnName.indexOf('.');
if (dotIndex != -1) {
String rootVarName = fnName.substring(0, dotIndex);
TypedVar rootVar = enclosingScope.getVar(rootVarName);
if (rootVar !... |
java | public DTMXRTreeFrag getDTMXRTreeFrag(int dtmIdentity){
if(m_DTMXRTreeFrags == null){
m_DTMXRTreeFrags = new HashMap();
}
if(m_DTMXRTreeFrags.containsKey(new Integer(dtmIdentity))){
return (DTMXRTreeFrag)m_DTMXRTreeFrags.get(new Integer(dtmIdentity));
}else{
final DTMXRTreeF... |
java | public static CommerceTierPriceEntry findByCommercePriceEntryId_First(
long commercePriceEntryId,
OrderByComparator<CommerceTierPriceEntry> orderByComparator)
throws com.liferay.commerce.price.list.exception.NoSuchTierPriceEntryException {
return getPersistence()
.findByCommercePriceEntryId_First(commerc... |
python | def aic(eval_data, predictions, scores, learner):
'''
Return Akaike information criterion (AIC) scores for the given
`learner` producing the given `scores` (log likelihoods in base e):
aic = 2 * learner.num_params - 2 * sum(log_2(exp(scores)))
The result is a list *one element longer* than the... |
java | @Override
public String decryptAES(String value, String privateKey) {
try {
byte[] raw = privateKey.getBytes(UTF_8);
SecretKeySpec skeySpec = new SecretKeySpec(raw, AES_ECB_ALGORITHM);
Cipher cipher = Cipher.getInstance(AES_ECB_ALGORITHM);
cipher.init(Cipher.D... |
python | def load(self, dataset_keys, previous_datasets=None):
"""Load `dataset_keys`.
If `previous_datasets` is provided, do not reload those."""
all_datasets = previous_datasets or DatasetDict()
datasets = DatasetDict()
# Include coordinates in the list of datasets to load
dsi... |
java | public static void writeProperties2File(final String filename, final Properties properties)
throws IOException
{
// Write properties to the file.
try (FileOutputStream fos = new FileOutputStream(filename))
{
properties.store(fos, null);
}
} |
python | def _reduce(self, op, name, axis=0, skipna=True, numeric_only=None,
filter_type=None, **kwds):
""" perform a reduction operation """
return op(self.get_values(), skipna=skipna, **kwds) |
python | def _cldf2lexstat(
dataset,
segments='segments',
transcription='value',
row='parameter_id',
col='language_id'):
"""Read LexStat object from cldf dataset."""
D = _cldf2wld(dataset)
return lingpy.LexStat(D, segments=segments, transcription=transcription, row=row, col=co... |
java | public static String getStringFromDateTime(Date date) throws ParseException {
SimpleDateFormat formatter = new SimpleDateFormat(DATE_yyyyMMddTHHmmssSSSZone);
return formatter.format(date);
} |
python | def plotEzJz(self,*args,**kwargs):
"""
NAME:
plotEzJz
PURPOSE:
plot E_z(.)/sqrt(dens(R)) along the orbit
INPUT:
pot= Potential instance or list of instances in which the orbit was
integrated
d1= - plot Ez vs d1: e.g., 't', 'z',... |
python | def IsMetaMetaDict(AST):
"""
Checks whether a given AST (abstract syntax tree) object represents a
metametadata dictionary.
"""
isintpair = lambda x : (isinstance(x,Tuple) and (len(x.asList()) == 2) and
isctype(x.asList()[0], int) and
... |
python | def status(name=None, user=None, conf_file=None, bin_env=None):
'''
List programs and its state
user
user to run supervisorctl as
conf_file
path to supervisord config file
bin_env
path to supervisorctl bin or path to virtualenv with supervisor
installed
CLI Exam... |
python | def homogeneity_score(self, reference_clusters):
"""
Calculates the homogeneity score w.r.t. the reference clusters (explicit evaluation)
:param reference_clusters: Clusters that are to be used as reference
:return: The resulting homogeneity score.
"""
return homogeneity... |
java | public void marshall(MsSmoothGroupSettings msSmoothGroupSettings, ProtocolMarshaller protocolMarshaller) {
if (msSmoothGroupSettings == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(msSmoothGroupSet... |
python | def activate():
"""Install the path-based import components."""
global PathFinder, FileFinder, ff_path_hook
path_hook_index = len(sys.path_hooks)
sys.path_hooks.append(ff_path_hook)
# Resetting sys.path_importer_cache values,
# to support the case where we have an implicit package inside an al... |
python | def intersect_one_round(candidates, intersections):
"""Perform one step of the intersection process.
.. note::
This is a helper for :func:`_all_intersections` and that function
has a Fortran equivalent.
Checks if the bounding boxes of each pair in ``candidates``
intersect. If the boundi... |
python | def expose(self, commandObject):
"""
Declare a method as being related to the given command object.
@param commandObject: a L{Command} subclass.
"""
thunk = super(_AMPExposer, self).expose(commandObject.commandName)
def thunkplus(function):
result = thunk(fun... |
java | protected int computeGregorianMonthStart(int year, int month) {
// If the month is out of range, adjust it into range, and
// modify the extended year value accordingly.
if (month < 0 || month > 11) {
int[] rem = new int[1];
year += floorDivide(month, 12, rem);
... |
java | @Override
protected void init(CmsObject cms, CmsMessages widgetDialog, I_CmsWidgetParameter param, String configuration) {
if (configuration == null) {
// no configuration String found, return
return;
}
configuration = CmsMacroResolver.resolveMacros(configuration, cm... |
python | def _dist_to_annot_donor_acceptor(df, d, strand, novel_feature):
"""Find nearest annotated upstream/downstream donor/acceptor for novel
donor/acceptors.
Parameters
----------
df : pandas.DataFrame
Dataframe with observed splice junctions (novel and known) with columns
'chrom', 'firs... |
java | private static File getCodeSourceArchive() {
try {
CodeSource codeSource = DocumentRootHelper.class.getProtectionDomain().getCodeSource();
URL location = (codeSource == null ? null : codeSource.getLocation());
if (location == null) {
return null;
}... |
java | public static <T, R> StreamParametersMapFunction<T> map(int idx,
Function<T, R> mapFunction) {
if (idx < 0) {
throw new IllegalArgumentException("idx can't be negative");
}
return new StreamParametersMapFunction<T>().andMap(idx, mapFunction);
} |
java | public void parse() {
// read resource file header.
ResourceTableHeader resourceTableHeader = (ResourceTableHeader) readChunkHeader();
// read string pool chunk
stringPool = ParseUtils.readStringPool(buffer, (StringPoolHeader) readChunkHeader());
resourceTable = new ResourceTab... |
java | public static List<FileItem> readMultipartFileItems(HttpServletRequest request) {
return readMultipartFileItems(request, OpenCms.getSystemInfo().getPackagesRfsPath());
} |
python | def wait_for_service_tasks_all_changed(
service_name,
old_task_ids,
task_predicate=None,
timeout_sec=120
):
""" Returns once ALL of old_task_ids have been replaced with new tasks
:param service_name: the service name
:type service_name: str
:param old_task_id... |
python | def bind(self, event_name, callback):
"""Bind an event to a callback
:param event_name: The name of the event to bind to.
:type event_name: str
:param callback: The callback to notify of this event.
"""
if event_name not in self.event_callbacks.keys():
self... |
java | @Override
public HttpResponse execute() throws IOException {
if (this.method == HttpMethod.GET) {
String url = this.toString();
if (url.length() > this.cutoff) {
if (log.isLoggable(Level.FINER))
log.finer("URL length " + url.length() + " too long, converting GET to POST: " + url);
Str... |
python | def main_generate(table_names, stream):
"""This will print out valid prom python code for given tables that already exist
in a database.
This is really handy when you want to bootstrap an existing database to work
with prom and don't want to manually create Orm objects for the tables you want
to us... |
java | public final void remove(ApplicationWindow window) {
if (windows.contains(window)) {
windows.remove(window);
window.setWindowManager(null);
setChanged();
notifyObservers();
}
} |
java | public int compareTo(Rule o) {
int i;
i = doCompare(this.getSurt(), o.getSurt());
if (i != 0) {
return i;
}
// exact matches come after non-exact
i = doCompare(this.getExactMatch(), o.getExactMatch());
if (i != 0) {
... |
java | private boolean isHeteroRingSystem(IAtomContainer ac) {
if (ac != null) {
for (int i = 0; i < ac.getAtomCount(); i++) {
if (!(ac.getAtom(i).getSymbol()).equals("H") && !(ac.getAtom(i).getSymbol()).equals("C")) {
return true;
}
}
... |
python | def import_datasource(
session,
i_datasource,
lookup_database,
lookup_datasource,
import_time):
"""Imports the datasource from the object to the database.
Metrics and columns and datasource will be overrided if exists.
This function can be used to import/export das... |
java | @Override
public Cookie[] getCookies() {
final IPortletWindowId portletWindowId = this.portletWindow.getPortletWindowId();
return this.portletCookieService.getAllPortletCookies(this.servletRequest, portletWindowId);
} |
java | public void removeMessageListener(MessageListener<? extends Message> messageListener) {
removeListener(messageListener.getChannelIdentifier(), messageListener.getMessageType(), messageListener);
} |
python | def read_links_file(self,file_path):
'''
Read links and associated categories for specified articles
in text file seperated by a space
Args:
file_path (str): The path to text file with news article links
and category
Returns:
... |
python | def get_sliding_window_properties(self, scale, window):
"""Run a property calculator given a sliding window size
Stores statistics in the ``letter_annotations`` attribute.
Todo:
- Add and document all scales available to set
"""
# XTODO: documentation
if sel... |
java | public void addPropertiesFieldBehavior(BaseField fldDisplay, String strProperty)
{
BaseField fldProperties = this.getField(MessageInfo.MESSAGE_PROPERTIES);
FieldListener listener = new CopyConvertersHandler(new PropertiesConverter(fldProperties, strProperty));
listener.setRespondsToMode(DBCo... |
java | private void parseAndCallback(String rawImage, ScreenshotCallback callback)
{
if(callback == null)
{
return;
}
// find the mime type
final String[] typeInfoAndData = rawImage.split(",");
String[] mimeAndEncoding = typeInfoAndData[0].replaceFirst("data:", "").split(";");
if(typeI... |
java | private static byte[][] rotateArray(byte[][] bitarray) {
byte[][] temp = new byte[bitarray[0].length][bitarray.length];
for (int ii = 0; ii < bitarray.length; ii++) {
// This makes the direction consistent on screen when rotating the
// screen;
int inverseii = bitarray.length - ii - 1;
f... |
python | def find_first_declaration(
declarations,
decl_type=None,
name=None,
parent=None,
recursive=True,
fullname=None):
"""
Returns first declaration that match criteria, defined by developer.
For more information about arguments see :class:`match_declaration_t`
... |
python | def default(self):
"""
Returns the default value for this column to return
when generating new instances.
:return <variant>
"""
if isinstance(self.__default, (str, unicode)):
return self.valueFromString(self.__default)
else:
return sel... |
java | @Override
public Configuration defaultInterval(long time, TimeUnit unit) {
return defaultInterval(new Duration(time, unit));
} |
python | def _get_plm_info(self):
"""Request PLM Info."""
_LOGGER.info('Requesting Insteon Modem Info')
msg = GetImInfo()
self.send_msg(msg, wait_nak=True, wait_timeout=.5) |
java | private void formatJournal(NamespaceInfo nsInfo) throws IOException {
Preconditions.checkState(nsInfo.getNamespaceID() != 0,
"can't format with uninitialized namespace info: %s",
nsInfo.toColonSeparatedString());
LOG.info("Formatting journal" + this.getJournalId()
+ " with namespace info... |
python | def init_widget(self):
""" Our widget may not exist yet so we have to diverge from the normal
way of doing initialization. See `update_widget`
"""
if not self.widget:
return
super(AndroidSnackbar, self).init_widget()
d = self.declaration
#:... |
java | protected void unsetFileMonitorRegistration() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(this, tc, "unsetFileMonitorRegistration");
}
if (keyStoreFileMonitorRegistration != null) {
keyStoreFileMonitorRegistration.unregister();
... |
java | public static void parseQueryProperties(String q, Properties props) throws MalformedURLException {
if (q == null || q.length() == 0) {
return;
}
for (StringTokenizer iter = new StringTokenizer(q, "&");
iter.hasMoreElements();) {
String pair = iter.nextToken();... |
python | def maybe_center_plot(result):
"""Embeds a possible tikz image inside a center environment.
Searches for matplotlib2tikz last commend line to detect tikz images.
Args:
result: The code execution result
Returns:
The input result if no tikzpicture was found, otherwise a centered
... |
python | def get(self, account_id):
"""
Return a specific account given its ID
"""
response = self.client._make_request('/accounts/{0}'.format(account_id))
return response.json() |
java | public void beginResetPassword(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName, ResetPasswordPayload resetPasswordPayload) {
beginResetPasswordWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, envir... |
python | def termination_check(self):
# type: (Downloader) -> bool
"""Check if terminated
:param Downloader self: this
:rtype: bool
:return: if terminated
"""
with self._transfer_lock:
with self._disk_operation_lock:
return (self._download_termi... |
python | def origin(self, origin):
"""Set the origin. Pass a length three tuple of floats"""
ox, oy, oz = origin[0], origin[1], origin[2]
self.SetOrigin(ox, oy, oz)
self.Modified() |
python | def getVersion(init_file):
"""
Return BUILDBOT_VERSION environment variable, content of VERSION file, git
tag or 'latest'
"""
try:
return os.environ['BUILDBOT_VERSION']
except KeyError:
pass
try:
cwd = os.path.dirname(os.path.abspath(init_file))
fn = os.path... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.