language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def list(self, container_or_share_name, container=None, account=None):
"""List the blobs/files inside a container/share_name.
Args:
container_or_share_name(str): Name of the container/share_name where we want to list the blobs/files.
container(bool): flag to know it you are li... |
python | def z_score(raw_scores, center=True, scale=True):
"""
Transform an array, serie or list into Z scores (scaled and centered scores).
Parameters
----------
raw_scores : list, ndarray or pandas.Series
ECG signal array.
centered : bool
Center the array (mean = 0).
scale : bool
... |
java | public static void fsyncIfPossible(String path) throws IOException {
if (nativeLoaded) {
fsync(path);
} else {
LOG.warn("Cannot fsync : " + path +
" since native libraries are not available");
}
} |
python | def stop(self):
"""
This method stops the brokers interaction with the kafka stream
"""
self.loop.run_until_complete(self._consumer.stop())
self.loop.run_until_complete(self._producer.stop())
# attempt
try:
# to cancel the service
self... |
java | public FormValidation doCheckIncludeRegex( @QueryParameter String value ) throws IOException, ServletException, InterruptedException {
String v = Util.fixEmpty(value);
if (v != null) {
try {
Pattern.compile(v);
} catch (PatternSyntaxException pse) {
... |
python | def continuous_frequency(self, data_frame):
"""
This method returns continuous frequency
:param data_frame: the data frame
:type data_frame: pandas.DataFrame
:return cont_freq: frequency
:rtype cont_freq: float
"""
tap_timestamps = da... |
java | public static WorkflowRuleTarget fromJson(String json) throws IOException {
ObjectMapper mapper = new ObjectMapper();
return mapper.readValue(json, WorkflowRuleTarget.class);
} |
python | def _prepare_consume_payload(did, service_agreement_id, service_definition_id, signature,
consumer_address):
"""Prepare a payload to send to `Brizo`.
:param did: DID, str
:param service_agreement_id: Service Agreement Id, str
:param service_definition_i... |
java | public void unitOfWorkEnd(ContainerAS as, BeanO bean)
{
bean.getActivationStrategy().atUnitOfWorkEnd(as, bean);
} |
java | void get_cluster_from_dependency(final Dependency data,
List<Integer> cluster4,
List<Integer> cluster6,
List<Integer> cluster)
{
if (use_cluster)
{
int L = data.forms.size();
... |
python | def peid_features(self, pefile_handle):
''' Get features from PEid signature database'''
peid_match = self.peid_sigs.match(pefile_handle)
return peid_match if peid_match else [] |
java | public static void logError(Span span, Throwable e) {
HashMap<String, Object> fields = new HashMap<>();
fields.put(Fields.ERROR_OBJECT, e);
String message = e.getMessage();
if (message != null) {
fields.put(Fields.MESSAGE, message);
}
span.log(fields);
} |
java | private void handlePresenceAnnouncement(SsdpResponse response) {
SsdpServiceAnnouncement ssdpServiceAnnouncement = response.toServiceAnnouncement();
if (ssdpServiceAnnouncement.getSerialNumber() == null) {
callback.onFailed(new NoSerialNumberException());
return;
}
if (cache.containsKey(ssdp... |
python | def get_instance(self, payload):
"""
Build an instance of DeploymentInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.serverless.v1.service.environment.deployment.DeploymentInstance
:rtype: twilio.rest.serverless.v1.service.environment.deployment... |
python | def to_header(self):
"""Converts the object back into an HTTP header."""
if self.date is not None:
return http_date(self.date)
if self.etag is not None:
return quote_etag(self.etag)
return "" |
python | def _create_borderchoice_combo(self):
"""Create border choice combo box"""
choices = [c[0] for c in self.border_toggles]
self.borderchoice_combo = \
_widgets.BorderEditChoice(self, choices=choices,
style=wx.CB_READONLY, size=(50, -1))
s... |
python | def to_csv(self, dest:str)->None:
"Save `self.to_df()` to a CSV file in `self.path`/`dest`."
self.to_df().to_csv(self.path/dest, index=False) |
java | public static <T, P, R extends Collection<T>> R selectWith(
Iterable<T> iterable,
Predicate2<? super T, ? super P> predicate,
P parameter,
R targetCollection)
{
if (iterable instanceof RichIterable)
{
return ((RichIterable<T>) iterable).sel... |
python | def instruction_BLS(self, opcode, ea):
"""
Causes a branch if the previous operation caused either a carry or a
zero result. When used after a subtract or compare operation on unsigned
binary values, this instruction will branch if the register was lower
than or the same as the m... |
python | def _move_to_desired_location(self):
"""Animate movement to desired location on map."""
self._next_update = 100000
x_start = self._convert_longitude(self._longitude)
y_start = self._convert_latitude(self._latitude)
x_end = self._convert_longitude(self._desired_longitude)
... |
python | def getback(config, force=False):
"""Goes back to the master branch, deletes the current branch locally
and remotely."""
repo = config.repo
active_branch = repo.active_branch
if active_branch.name == "master":
error_out("You're already on the master branch.")
if repo.is_dirty():
... |
python | def run_tensorboard(logdir, listen_on="0.0.0.0", port=0, tensorboard_args=None, timeout=10):
"""
Launch a new TensorBoard instance.
:param logdir: Path to a TensorFlow summary directory
:param listen_on: The IP address TensorBoard should listen on.
:param port: Port number to listen on. 0 for a ran... |
python | def execute(self, env, args):
""" Removes a task.
`env`
Runtime ``Environment`` instance.
`args`
Arguments object from arg parser.
"""
# extract args
old_task_name = args.old_task_name
new_task_name = args.new_task_nam... |
python | async def wait_for(self, event_type: Type[TWaitForEvent]) -> TWaitForEvent: # type: ignore
"""
Wait for a single instance of an event that matches the specified event type.
"""
# mypy thinks we are missing a return statement but this seems fair to do
async for event in self.stre... |
python | def find(self, path, all=False):
"""
Work out the uncached name of the file and look that up instead
"""
try:
start, _, extn = path.rsplit('.', 2)
except ValueError:
return []
path = '.'.join((start, extn))
return find(path, all=all) or [] |
python | def add_timex(self, timex_obj):
"""
Adds a timex object to the layer.
@type timex_obj: L{Ctime}
@param timex_obj: the timex object
"""
timex_id = timex_obj.get_id()
#check if id is not already present
if not timex_id in self.idx:
t... |
python | def __createElementNS(self, root, uri, name, value):
'''
Creates and returns an element with a qualified name and a name space
@param root:Element Parent element
@param uri:str Namespace URI
@param tag:str Tag name.
'''
tag = root.ownerDocument.createElementNS(to_... |
java | protected RadioGroup<T> newRadioGroup(final String id, final IModel<T> model)
{
final RadioGroup<T> group = ComponentFactory.newRadioGroup(id, model);
group.add(new AjaxFormChoiceComponentUpdatingBehavior()
{
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(final AjaxR... |
java | public void setIopsToStorageRatio(java.util.Collection<DoubleRange> iopsToStorageRatio) {
if (iopsToStorageRatio == null) {
this.iopsToStorageRatio = null;
return;
}
this.iopsToStorageRatio = new java.util.ArrayList<DoubleRange>(iopsToStorageRatio);
} |
python | def by_puuid(self, region, encrypted_puuid):
"""
Get a summoner by PUUID.
:param string region: The region to execute this request on
:param string encrypted_puuid: PUUID
:returns: SummonerDTO: represents a summoner
"""
url, query = SummonerApiV4Urls.... |
java | public static int getId(Context context, String id, String defType) {
String type = "R." + defType + ".";
if (id.startsWith(type)) {
id = id.substring(type.length());
}
Resources r = context.getResources();
int resId = r.getIdentifier(id, defType,
con... |
python | def content(self): # type: () -> object
"""The request incoming data.
It automatic decodes from utf-8
Returns:
(obj): incoming data
"""
as_text = self.content_type in _content_types.UTF8_TYPES
return self.get_data(as_text=as_text) |
java | public static <T> Set<T> asSet(T[] o) {
return new HashSet<T>(Arrays.asList(o));
} |
python | def horizontal_scroll(self, image, padding=True):
"""Returns a list of images which appear to scroll from left to right
across the input image when displayed on the LED matrix in order.
The input image is not limited to being 8x16. If the input image is
larger than this, then all column... |
java | public <T> void runProcessors(final WordprocessingMLPackage document, final ProxyBuilder<T> proxyBuilder) {
final Map<BigInteger, CommentWrapper> comments = CommentUtil.getComments(document);
CoordinatesWalker walker = new BaseCoordinatesWalker(document) {
@Override
protected void onParagraph(Para... |
python | def statistics(self):
"""
Access the statistics
:returns: twilio.rest.taskrouter.v1.workspace.workflow.workflow_statistics.WorkflowStatisticsList
:rtype: twilio.rest.taskrouter.v1.workspace.workflow.workflow_statistics.WorkflowStatisticsList
"""
if self._statistics is No... |
java | public com.squareup.okhttp.Call getCharactersCharacterIdMailLabelsAsync(Integer characterId, String datasource,
String ifNoneMatch, String token, final ApiCallback<MailLabelsResponse> callback) throws ApiException {
com.squareup.okhttp.Call call = getCharactersCharacterIdMailLabelsValidateBeforeCal... |
python | def _add_interaction(int_type, **kwargs):
"""Add the interaction for the specified type.
If a figure is passed using the key-word argument `figure` it is used. Else
the context figure is used.
If a list of marks are passed using the key-word argument `marks` it
is used. Else the latest mark that is... |
java | @SuppressWarnings({"resource", "checkstyle:magicnumber"})
protected void readHeader() throws IOException {
final ReadableByteChannel in = Channels.newChannel(this.input);
final int limit = HEADER_KEY.getBytes().length + 2;
final ByteBuffer hBuffer = ByteBuffer.allocate(limit);
hBuffer.limit(limit);
// Check... |
python | def IFFT_filter(Signal, SampleFreq, lowerFreq, upperFreq, PyCUDA = False):
"""
Filters data using fft -> zeroing out fft bins -> ifft
Parameters
----------
Signal : ndarray
Signal to be filtered
SampleFreq : float
Sample frequency of signal
lowerFreq : float
Lower fr... |
python | def dropEvent( self, event ):
"""
Processes drop event.
:param event | <QDropEvent>
"""
if event.mimeData().hasUrls():
url = event.mimeData().urls()[0]
filepath = url.toLocalFile()
if filepath:
self.... |
python | def s3_get_dir_backup(aws_access_key_id, aws_secret_access_key, bucket_name, s3_folder, zip_backups_dir, project):
"""
get last uploaded directory backup
:param aws_access_key_id:
:param aws_secret_access_key:
:param bucket_name:
:param s3_folder:
:param zip_backups_dir:
:param project:
... |
java | public JobFlowDetail withBootstrapActions(BootstrapActionDetail... bootstrapActions) {
if (this.bootstrapActions == null) {
setBootstrapActions(new com.amazonaws.internal.SdkInternalList<BootstrapActionDetail>(bootstrapActions.length));
}
for (BootstrapActionDetail ele : bootstrapAct... |
python | def jensen_shannon(h1, h2): # 85 us @array, 110 us @list \w 100 bins
r"""
Jensen-Shannon divergence.
A symmetric and numerically more stable empirical extension of the Kullback-Leibler
divergence.
The Jensen Shannon divergence between two histograms :math:`H` and :math:`H'` of size
:ma... |
java | public boolean isTextContentType(String contentType) {
if (contentType != null) {
String lowerContentType = contentType.toLowerCase();
for (String textContentType : this.parsableContentTypes) {
if (lowerContentType.startsWith(textContentType)) {
return... |
python | def frame(self):
"""Convert the trades to transaction level details necessary for long/short accouting.
:param trades:
:param pricer: provides the interface to get premium for a specified quanity, price, and timestamp.
:return:
"""
rows = []
pricer = self.pricer
... |
python | def _widget_from_p(self, pname, ptype):
"""Returns a widget from its ptype and pname"""
widget_name = self.type2widget[ptype].__name__.lower()
widget_name = "_".join([widget_name, pname])
return getattr(self, widget_name) |
python | def init_widget(self):
""" Initialize the underlying widget.
"""
w = self.widget
# Selection listener
w.setAdapter(self.adapter)
w.setOnItemSelectedListener(w.getId())
w.onItemSelected.connect(self.on_item_selected)
w.onNothingSelected.connect(self.on_not... |
python | def clear_limit(self, identifier=None):
"""
Remove a single limit or all defined limits
:param identifier: The identifier to clear limits for, or if no identifier is supplied, clears ALL limits
:type identifier: int
:return: True if a limit was successfully found and removed, F... |
python | def asmono(samples:np.ndarray, channel:Union[int, str]=0) -> np.ndarray:
"""
convert samples to mono if they are not mono already.
The returned array will always have the shape (numframes,)
channel: the channel number to use, or 'mix' to mix-down
all channels
"""
if numchannels(sa... |
python | def weld_str_lower(array):
"""Convert values to lowercase.
Parameters
----------
array : numpy.ndarray or WeldObject
Input data.
Returns
-------
WeldObject
Representation of this computation.
"""
obj_id, weld_obj = create_weld_object(array)
weld_template = """... |
python | def unique_iterator(seq):
"""
Returns an iterator containing all non-duplicate elements
in the input sequence.
"""
seen = set()
for item in seq:
if item not in seen:
seen.add(item)
yield item |
python | def ascii_printable(self, keysym):
"""
If the keysym corresponds to a non-printable ascii character this will
return False. If it is printable, then True will be returned.
ascii 11 (vertical tab) and ascii 12 are printable, chr(11) and chr(12)
will return '\x0b' and '\x0c' respe... |
java | public NotificationChain basicSetStart(Parameter newStart, NotificationChain msgs) {
Parameter oldStart = start;
start = newStart;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO_PARAMETERS__START, oldStart, newStart);
if (m... |
python | def _nelder_mead_algorithm(fun, vertices, bounds=np.array([[], []]).T,
args=(), ρ=1., χ=2., γ=0.5, σ=0.5, tol_f=1e-8,
tol_x=1e-8, max_iter=1000):
"""
.. highlight:: none
Implements the Nelder-Mead algorithm described in Lagarias et al. (1998)
modifi... |
java | private Map<String, String> readEvent() throws IOException {
Map<String, String> map = new HashMap<>();
ByteBuffer b;
synchronized (this) {
b = buffer;
if (b == null) {
return map;
}
}
int length = _readEvent(fd, b);
syn... |
python | def get_parameter_limits(xval, loglike, cl_limit=0.95, cl_err=0.68269, tol=1E-2,
bounds=None):
"""Compute upper/lower limits, peak position, and 1-sigma errors
from a 1-D likelihood function. This function uses the
delta-loglikelihood method to evaluate parameter limits by
sear... |
python | def verify_ocsp(cls, certificate, issuer):
""" Runs OCSP verification and returns error code - 0 means success
"""
return OCSPVerifier(certificate, issuer,
cls.get_ocsp_url(),
cls.get_ocsp_responder_certificate_path()).verify() |
python | def broadcast_variables(*variables):
"""Given any number of variables, return variables with matching dimensions
and broadcast data.
The data on the returned variables will be a view of the data on the
corresponding original arrays, but dimensions will be reordered and
inserted so that both broadca... |
python | def create_volume(self, name=None, driver=None, driver_opts=None,
labels=None):
"""
Create and register a named volume
Args:
name (str): Name of the volume
driver (str): Name of the driver used to create the volume
driver_opts (dict): Dr... |
python | def mag_roll(RAW_IMU, inclination, declination):
'''estimate roll from mag'''
m = mag_rotation(RAW_IMU, inclination, declination)
(r, p, y) = m.to_euler()
return degrees(r) |
java | public static sms_profile[] get(nitro_service client) throws Exception
{
sms_profile resource = new sms_profile();
resource.validate("get");
return (sms_profile[]) resource.get_resources(client);
} |
python | def _load_significant_pathways_file(path_to_file):
"""Read in the significant pathways file as a
pandas.DataFrame.
"""
feature_pathway_df = pd.read_table(
path_to_file, header=0,
usecols=["feature", "side", "pathway"])
feature_pathway_df = feature_pathway_df.sort_values(
by=[... |
python | def Deserialize(self, reader: BinaryReader):
"""
Deserialize full object.
Args:
reader (neocore.IO.BinaryReader):
"""
super(ValidatorState, self).Deserialize(reader)
self.PublicKey = ECDSA.Deserialize_Secp256r1(reader)
self.Registered = reader.ReadBoo... |
python | def refresh(self, document):
""" Load a new copy of a document from the database. does not
replace the old one """
try:
old_cache_size = self.cache_size
self.cache_size = 0
obj = self.query(type(document)).filter_by(mongo_id=document.mongo_id).one()
finally:
self.cache_size = old_cache_size
self... |
python | def _get_contexts_for_squash(self, batch_signature):
"""Starting with the batch referenced by batch_signature, iterate back
through the batches and for each valid batch collect the context_id.
At the end remove contexts for txns that are other txn's predecessors.
Args:
batch... |
python | def _transform_col(self, x, i):
"""Encode one categorical column into average target values.
Args:
x (pandas.Series): a categorical column to encode
i (int): column index
Returns:
x (pandas.Series): a column with labels.
"""
return x.fillna(NAN... |
java | public void unjarDir(File jarFile, File destDir) throws IOException {
BufferedOutputStream dest = null;
FileInputStream fis = new FileInputStream(jarFile);
unjar(fis, destDir);
} |
java | private boolean isResetOp(int seen) {
return resetOps.get(seen) || OpcodeUtils.isStore(seen) || OpcodeUtils.isReturn(seen)
|| ((OpcodeUtils.isInvoke(seen) && getSigConstantOperand().endsWith(")V")) || (isBranch(seen) && (getBranchOffset() < 0)));
} |
java | public static String escapeJsString(String string, String quote) {
// This should be expanded to match all invalid characters (e.g. newlines) but for the moment
// we'll trust we'll only get quotes.
Pattern escapePattern = Pattern.compile("([^\\\\])" + quote);
// Prepend a space so that the regex can m... |
python | def serve(application, host='127.0.0.1', port=8080):
"""Gevent-based WSGI-HTTP server."""
# Instantiate the server with a host/port configuration and our application.
WSGIServer((host, int(port)), application).serve_forever() |
python | def dont_crash(fn):
"""
Wraps callbacks: a simple information is raised in place of a program crash.
"""
def safe_exec(self, *args, **kwargs):
try:
return fn(self, *args, **kwargs)
except Exception as e:
logging.exception(e)
QMessageBox.information(
... |
python | def _cc_round(num, dp):
"""
Convenience function to take a float and round it to dp padding with zeros
to return a string
:type num: float
:param num: Number to round
:type dp: int
:param dp: Number of decimal places to round to.
:returns: str
>>> print(_cc_round(0.25364, 2))
... |
java | public Observable<ServiceResponse<InputStream>> downloadQueryLogsWithServiceResponseAsync(UUID appId) {
if (this.client.endpoint() == null) {
throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null.");
}
if (appId == null) {
thr... |
python | def get(cls, device_id, custom_headers=None):
"""
Get a single Device. A Device is either a DevicePhone or a DeviceServer.
:type api_context: context.ApiContext
:type device_id: int
:type custom_headers: dict[str, str]|None
:rtype: BunqResponseDevice
"""
... |
java | @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
public boolean getIncludeFontPadding (){
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN && mInputView.getIncludeFontPadding();
} |
python | def create(self, name, **kwargs):
"""Create an array. Keyword arguments as per
:func:`zarr.creation.create`."""
return self._write_op(self._create_nosync, name, **kwargs) |
python | def tangent_bundle(self):
"""The tangent bundle associated with `domain` using `partition`.
The tangent bundle of a space ``X`` of functions ``R^d --> F`` can be
interpreted as the space of vector-valued functions ``R^d --> F^d``.
This space can be identified with the power space ``X^d`... |
java | private void readStreamCancel(InH3 hIn, HeadersAmp headers)
throws IOException
{
ServiceRefAmp serviceRef = readToAddress(hIn);
GatewayReply from = readFromAddress(hIn);
long qid = hIn.readLong();
if (log.isLoggable(_logLevel)) {
log.log(_logLevel, "stream-cancel-r " + from + "," + qi... |
java | @Override
public ContentSerializer getBestSerializer(Collection<MediaType> mediaTypes) {
if (mediaTypes == null || mediaTypes.isEmpty()) {
mediaTypes = ImmutableList.of(MediaType.HTML_UTF_8);
}
for (MediaType type : mediaTypes) {
for (ContentSerializer ser : serializ... |
java | public static Credentials credentials(final String scheme, final byte[] authToken) {
MorePreconditions.checkNotBlank(scheme);
Objects.requireNonNull(authToken);
return new Credentials() {
@Override public void authenticate(ZooKeeper zooKeeper) {
zooKeeper.addAuthInfo(scheme, authToken);
... |
python | def build(self, words):
"""Construct dictionary DAWG from tokenized words."""
words = [self._normalize(tokens) for tokens in words]
self._dawg = dawg.CompletionDAWG(words)
self._loaded_model = True |
python | def create(self, metric_id, value, timestamp=None):
"""Add a Metric Point to a Metric
:param int metric_id: Metric ID
:param int value: Value to plot on the metric graph
:param str timestamp: Unix timestamp of the point was measured
:return: Created metric point data (:class:`di... |
java | public INode addNode(VFAtomMatcher matcher, IAtom atom) {
NodeBuilder node = new NodeBuilder(matcher);
nodesList.add(node);
nodeBondMap.put(node, atom);
return node;
} |
python | def save(cls, network, phases=[], filename='', delim=' | ', fill_nans=None):
r"""
Save network and phase data to a single vtp file for visualizing in
Paraview
Parameters
----------
network : OpenPNM Network Object
The Network containing the data to be written... |
java | protected char scanSurrogates() {
if (surrogatesSupported && Character.isHighSurrogate(ch)) {
char high = ch;
scanChar();
if (Character.isLowSurrogate(ch)) {
return high;
}
ch = high;
}
return 0;
} |
python | def xml(self):
"""
xml representation of the metadata.
:return: xml representation of the metadata
:rtype: ElementTree.Element
"""
tree = ElementTree.parse(METADATA_XML_TEMPLATE)
root = tree.getroot()
for name, prop in list(self.properties.items()):
... |
java | public SparseTypedEdgeSet<T> copy(IntSet vertices) {
SparseTypedEdgeSet<T> copy = new SparseTypedEdgeSet<T>(rootVertex);
TIntObjectIterator<Set<T>> iter = edges.iterator();
while (iter.hasNext()) {
iter.advance();
int v = iter.key();
if (vertices... |
python | def _parse_response(self, resp):
"""Gets the authentication information from the returned JSON."""
access = resp["access"]
token = access.get("token")
self.token = token["id"]
self.tenant_id = token["tenant"]["id"]
self.tenant_name = token["tenant"]["name"]
self.e... |
java | public void setOnline(boolean online) throws XMPPException, SmackException, InterruptedException {
// If the online status hasn't changed, do nothing.
if (this.online == online) {
return;
}
Presence presence;
// If the user is going online...
if (online) {
... |
java | public static void deleteRelatedTables(GeoPackageCore geoPackage,
String table) {
RelatedTablesCoreExtension relatedTablesExtension = getRelatedTableExtension(geoPackage);
if (relatedTablesExtension.has()) {
relatedTablesExtension.removeRelationships(table);
}
} |
java | private JAXBContext getSingleton() throws JAXBException {
if (jcSingelton == null) {
ClassLoader classLoader = ch.epfl.bbp.uima.xml.genia.ObjectFactory.class
.getClassLoader();// TODO needed?
jcSingelton = JAXBContext.newInstance(Set.class.getPackage()
... |
java | public DAO[] convert(){
int size = data.size();
DAO[] daoList = new DAO[size];
for(int i = 0; i < size; i++){
Object[] dat = data.get(i);
DAO dao = new DAO(modelName);
for(int j = 0; j < attributes.length; j++){
dao.set_Value(attributes[j], dat[j]);
}
daoList[i] = dao;
}
return daoList;
... |
python | def expand_source_declarations(map_el, dirs, local_conf):
""" This provides mechanism for externalizing and sharing data sources. The datasource configs are
python files, and layers reference sections within that config:
<DataSourcesConfig src="datasources.cfg" />
<Layer class="road major" source_... |
python | def standardize_cell(cell,
to_primitive=False,
no_idealize=False,
symprec=1e-5,
angle_tolerance=-1.0):
"""Return standardized cell.
Args:
cell, symprec, angle_tolerance:
See the docstring of get_symmetry.
... |
java | T cycle() {
if (_prioritize != null) {
return _prioritize;
}
if (!_queue.isEmpty()) {
T first = _queue.keySet().iterator().next();
_queue.get(first); // Access the object so it gets bumped to the back of the queue.
return first;
}
... |
java | public JsHandlerRegistration addGeometryEditShapeChangedHandler(final GeometryEditShapeChangedHandler handler) {
org.geomajas.plugin.editing.client.event.GeometryEditShapeChangedHandler h;
h = new org.geomajas.plugin.editing.client.event.GeometryEditShapeChangedHandler() {
public void onGeometryShapeChanged(Geo... |
python | def appdataPath(appname):
"""
Returns the generic location for storing application data in a cross
platform way.
:return <str>
"""
# determine Mac OS appdata location
if sys.platform == 'darwin':
# credit: MHL
try:
from AppKit import NSSearchPathForDirect... |
python | def StopProfiling(self):
"""Stops profiling."""
if self._cpu_time_profiler:
self._cpu_time_profiler.Stop()
self._cpu_time_profiler = None
if self._memory_profiler:
self._memory_profiler.Stop()
self._memory_profiler = None
self._process_information = None |
java | public void setDelegate(JvmTypeReference newDelegate)
{
JvmTypeReference oldDelegate = delegate;
delegate = newDelegate;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TypesPackage.JVM_DELEGATE_TYPE_REFERENCE__DELEGATE, oldDelegate, delegate));
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.