language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def contains(self, token: str) -> bool:
"""Return if the token is in the list or not."""
self._validate_token(token)
return token in self |
java | public void parseResponse(String results) {
cancelUpdateProgress();
stopLoadingAnimation();
if ((!m_canceled) && CmsStringUtil.isNotEmptyOrWhitespaceOnly(results)) {
JSONObject jsonObject = JSONParser.parseStrict(results).isObject();
boolean success = jsonObject.get(I_C... |
python | def build_responses(self):
"""
DNS measurement results are a little wacky. Sometimes you get a single
response, other times you get a set of responses (result set). In order
to establish a unified interface, we conform all results to the same
format: a list of response objects.... |
java | @Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case PureXbasePackage.MODEL__IMPORT_SECTION:
return getImportSection();
case PureXbasePackage.MODEL__BLOCK:
return getBlock();
}
return super.eGet(featureID, resolve, cor... |
python | def _get_accepted(self, graph):
"""
Find the accepted states
Args:
graph (DFA): The DFA states
Return:
list: Returns the list of the accepted states
"""
accepted = []
for state in graph.states:
if state.final != TropicalWeight(f... |
python | def append(self, value):
"""Insert *value* at the end of the list of nodes.
*value* can be anything parsable by :func:`.parse_anything`.
"""
nodes = parse_anything(value).nodes
for node in nodes:
self.nodes.append(node) |
python | def characteristic_times(path,name,Omega=1):
r'''This function can be called after calling ``run_diagonalization`` if the option ``save_eigenvalues``
is set to ``True``. It will return the oscillation periods, and the shortest and half lives.
The results are lists ordered as:
``[detunings, oscillation_periods_1, osci... |
python | def SetBuddyStatusPendingAuthorization(self, Text=u''):
"""Sets the BuddyStaus property to `enums.budPendingAuthorization`
additionally specifying the authorization text.
:Parameters:
Text : unicode
The authorization text.
:see: `BuddyStatus`
"""
s... |
python | def create_poll(title, options, multi=True, permissive=True, captcha=False, dupcheck='normal'):
""" Create a strawpoll.
Example:
new_poll = strawpy.create_poll('Is Python the best?', ['Yes', 'No'])
:param title:
:param options:
:param multi:
:param permissive:
:param captcha:
... |
python | def is_blocked(self):
""":class:`bool`: Checks if the user is blocked.
.. note::
This only applies to non-bot accounts.
"""
r = self.relationship
if r is None:
return False
return r.type is RelationshipType.blocked |
java | @Override
public java.util.concurrent.Future<ConfirmSubscriptionResult> confirmSubscriptionAsync(String topicArn, String token, String authenticateOnUnsubscribe) {
return confirmSubscriptionAsync(new ConfirmSubscriptionRequest().withTopicArn(topicArn).withToken(token)
.withAuthenticateOnUns... |
python | def active_pt_window(self):
" The active prompt_toolkit layout Window. "
if self.active_tab:
w = self.active_tab.active_window
if w:
return w.pt_window |
python | def _set_range(self, v, load=False):
"""
Setter method for range, mapped from YANG variable /rbridge_id/router/ospf/area/range (list)
If this variable is read-only (config: false) in the
source YANG file, then _set_range is considered as a private
method. Backends looking to populate this variable s... |
java | public static Specification<JpaRollout> isDeletedWithDistributionSet(final Boolean isDeleted) {
return (root, query, cb) -> {
final Predicate predicate = cb.equal(root.<Boolean> get(JpaRollout_.deleted), isDeleted);
root.fetch(JpaRollout_.distributionSet);
return predicate;
... |
python | def blue_hour(self, direction=SUN_RISING, date=None, local=True, use_elevation=True):
"""Returns the start and end times of the Blue Hour when the sun is traversing
in the specified direction.
This method uses the definition from PhotoPills i.e. the
blue hour is when the sun is between ... |
java | @Nonnull
@Nonempty
public static String getHSLColorValue (final float fHue, final float fSaturation, final float fLightness)
{
return new StringBuilder (18).append (CCSSValue.PREFIX_HSL_OPEN)
.append (getHSLHueValue (fHue))
.append (',')
... |
python | def extracted(name,
source,
source_hash=None,
source_hash_name=None,
source_hash_update=False,
skip_verify=False,
password=None,
options=None,
list_options=None,
force=False,
overw... |
java | public JBBPDslBuilder Comment(final String text) {
this.addItem(new ItemComment(text == null ? "" : text, false));
return this;
} |
python | def update_bank(self, bank_form):
"""Updates an existing bank.
arg: bank_form (osid.assessment.BankForm): the form
containing the elements to be updated
raise: IllegalState - ``bank_form`` already used in an update
transaction
raise: InvalidArgument ... |
java | public Config setCacheConfigs(Map<String, CacheSimpleConfig> cacheConfigs) {
this.cacheConfigs.clear();
this.cacheConfigs.putAll(cacheConfigs);
for (final Entry<String, CacheSimpleConfig> entry : this.cacheConfigs.entrySet()) {
entry.getValue().setName(entry.getKey());
}
... |
java | public void marshall(Core core, ProtocolMarshaller protocolMarshaller) {
if (core == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(core.getCertificateArn(), CERTIFICATEARN_BINDING);
prot... |
java | static String chargeAdjunctText(final int charge, final int unpaired) {
StringBuilder sb = new StringBuilder();
if (unpaired == 1) {
if (charge != 0) {
sb.append('(').append(BULLET).append(')');
} else {
sb.append(BULLET);
}
} ... |
java | Stream<String> getRessourceLines(Class<?> clazz, String filepath) {
try (final BufferedReader fileReader = new BufferedReader(
new InputStreamReader(clazz.getResourceAsStream(filepath),
StandardCharsets.UTF_8)
)) {
// Collect the read lines before converting b... |
java | private HTTPExchange claimExchange(int idx) {
assertLocked();
HTTPExchange exch = null;
// Claim the exchange
for (HTTPExchange toClaim : exchanges) {
if (findProcessorForExchange(toClaim) == null) {
exch = toClaim;
break;
}
... |
python | def GetRpcServer(options):
"""Returns an instance of an AbstractRpcServer.
Returns:
A new AbstractRpcServer, on which RPC calls can be made.
"""
rpc_server_class = HttpRpcServer
def GetUserCredentials():
"""Prompts the user for a username and password."""
# Disable status prints so they don't obscure the ... |
java | public static Builder builder() {
return new AutoValue_MapboxStaticMap.Builder()
.styleId(StaticMapCriteria.STREET_STYLE)
.baseUrl(Constants.BASE_API_URL)
.user(Constants.MAPBOX_USER)
.cameraPoint(Point.fromLngLat(0d, 0d))
.cameraAuto(false)
.attribution(true)
.width(250)
... |
java | public static SoyType computeLowestCommonType(
SoyTypeRegistry typeRegistry, SoyType t0, SoyType t1) {
if (t0 == ErrorType.getInstance() || t1 == ErrorType.getInstance()) {
return ErrorType.getInstance();
}
if (t0.isAssignableFrom(t1)) {
return t0;
} else if (t1.isAssignableFrom(t0)) {... |
java | @Override
public boolean asyncSupported() {
boolean sup = true;
for (val i: iterators)
if (!i.asyncSupported()) {
sup = false;
break;
}
return sup;
} |
python | def fishqq(lon=None, lat=None, di_block=None):
"""
Test whether a distribution is Fisherian and make a corresponding Q-Q plot.
The Q-Q plot shows the data plotted against the value expected from a
Fisher distribution. The first plot is the uniform plot which is the
Fisher model distribution in terms... |
java | public List<FacesConfigOrderingType<WebFacesConfigDescriptor>> getAllOrdering()
{
List<FacesConfigOrderingType<WebFacesConfigDescriptor>> list = new ArrayList<FacesConfigOrderingType<WebFacesConfigDescriptor>>();
List<Node> nodeList = model.get("ordering");
for(Node node: nodeList)
{
... |
java | public void setExportWorkPath(String exportWorkPath) {
if (exportWorkPath.equals(OpenCms.getSystemInfo().getWebApplicationRfsPath())) {
// not allowed because a full static export would delete the opencms directory
throw new CmsIllegalArgumentException(Messages.get().container(Messages.... |
python | def button_clicked(self, button):
"""Action when button was clicked.
Parameters
----------
button : instance of QPushButton
which button was pressed
"""
if button is self.idx_ok:
chans = self.get_channels()
group = self.one_grp
... |
python | def help(self, context):
"""
Prints this help (use --verbosity 2 for more details)
"""
context.info('%s\n%s [global options] [task] [task options]...\n' % (self.name, sys.argv[0]))
def print_parameter(prn, p):
if p.description:
suffix = ' - {0.desc... |
python | def filename(cls, tag, schemas, ext='.rnc'):
"""given a tag and a list of schemas, return the filename of the schema.
If schemas is a string, treat it as a comma-separated list.
"""
if type(schemas)==str:
schemas = re.split("\s*,\s*", schemas)
for schema in schemas:
... |
java | private void validateArgumentDefinitions() {
for (final NamedArgumentDefinition mutexSourceDef : namedArgumentDefinitions) {
for (final String mutexTarget : mutexSourceDef.getMutexTargetList()) {
final NamedArgumentDefinition mutexTargetDef = namedArgumentsDefinitionsByAlias.get(mute... |
python | def download_file(download_url, target_filepath, max_bytes=MAX_FILE_DEFAULT):
"""
Download a file.
:param download_url: This field is the url from which data will be
downloaded.
:param target_filepath: This field is the path of the file where
data will be downloaded.
:param max_byte... |
python | def render_error(
project: 'projects.Project',
error: Exception,
stack: typing.List[dict] = None
) -> dict:
"""
Renders an Exception to an error response that includes rendered text and
html error messages for display.
:param project:
Currently open project.
:param e... |
java | void addTag(StringBuilder resultString, String tagName, String tagValue) {
resultString.append(" ");
resultString.append(sanitizeString(tagName));
resultString.append("=");
resultString.append(sanitizeString(tagValue));
} |
python | def discover(service="ssdp:all", timeout=1, retries=2, ipAddress="239.255.255.250", port=1900):
"""Discovers UPnP devices in the local network.
Try to discover all devices in the local network which do support UPnP. The discovery process can fail
for various reasons and it is recommended to do ... |
java | public com.google.api.ads.adwords.axis.v201809.mcm.ManagedCustomer[] getEntries() {
return entries;
} |
java | public static int copyFile(String from, String to) {
InputStream inStream = null;
FileOutputStream fs = null;
try {
int bytesum = 0;
int byteread;
File oldfile = new File(from);
if (oldfile.exists()) {
inStream = new FileInputStream(from);
fs = new FileOutputStream(to);
byte[] buffer = new... |
python | def k_nearest_approx(self, vec, k):
"""Get the k nearest neighbors of a vector (in terms of cosine similarity).
:param (np.array) vec: query vector
:param (int) k: number of top neighbors to return
:return (list[tuple[str, float]]): a list of (word, cosine similarity) pairs, in descend... |
java | public Val end(Val returning) {
sanity_check_refs(returning);
// Remove all temp frames
Futures fs = new Futures();
for (Frame fr : FRAMES.values()) {
fs = downRefCnt(fr, fs); // Remove internal Vecs one by one
DKV.remove(fr._key, fs); // Shallow remove, internal Vecs removed 1-by-1
... |
java | public static DateInterval between(
LocalDate start,
LocalDate end
) {
return DateInterval.between(PlainDate.from(start), PlainDate.from(end));
} |
java | protected String getPath(String urlName) {
if (urlName.equals("")) {
return m_entry.getSitePath();
}
return CmsResource.getParentFolder(m_entry.getSitePath()) + urlName + "/";
} |
java | public void addTangoInterfaceChangeListener(ITangoInterfaceChangeListener listener, String deviceName, boolean stateless)
throws DevFailed {
TangoInterfaceChange interfaceChange;
if ((interfaceChange = tango_interface_change_source.get(deviceName)) == null) {
interfaceChange = ne... |
python | def extend(a: dict, b: dict) -> dict:
"""Merge two dicts and return a new dict. Much like subclassing works."""
res = a.copy()
res.update(b)
return res |
java | public static synchronized void initEventHandlerInstance(int maxEntries,
int flushPeriodMs)
{
if (eventHandler.get() == null)
{
eventHandler.set(new EventHandler(maxEntries, flushPeriodMs));
}
//eventHandler.startFlusher();
} |
python | def _check_directory(name,
user=None,
group=None,
recurse=False,
mode=None,
file_mode=None,
clean=False,
require=False,
exclude_pat=None,
... |
python | def Delete(self):
"""Delete public IP.
>>> clc.v2.Server("WA1BTDIX01").PublicIPs().public_ips[0].Delete().WaitUntilComplete()
0
"""
public_ip_set = [{'public_ipId': o.id} for o in self.parent.public_ips if o!=self]
self.parent.public_ips = [o for o in self.parent.public_ips if o!=self]
return(clc.v2.Re... |
python | def parse_strike_dip(strike, dip):
"""
Parses strings of strike and dip and returns strike and dip measurements
following the right-hand-rule.
Dip directions are parsed, and if the measurement does not follow the
right-hand-rule, the opposite end of the strike measurement is returned.
Accepts ... |
java | public void eachRow(String sql, Closure closure) throws SQLException {
eachRow(sql, (Closure) null, closure);
} |
python | def make_exponential_temperature(initial_temperature, alpha):
'''returns a function like initial / exp(n * alpha)'''
def _function(n):
try:
return initial_temperature / math.exp(n * alpha)
except OverflowError:
return 0.01
return _function |
python | def job_requeue_message(self, job, queue):
"""
Return the message to log when a job is requeued
"""
priority, delayed_until = job.hmget('priority', 'delayed_until')
msg = '[%s|%s|%s] requeued with priority %s'
args = [queue._cached_name, job.pk.get(), job._cached_identif... |
python | def fill_auth_list(self, auth_provider, name, groups, auth_list=None, permissive=None):
'''
Returns a list of authorisation matchers that a user is eligible for.
This list is a combination of the provided personal matchers plus the
matchers of any group the user is in.
'''
... |
java | public static ReuseResult loadReuse(Uri uri, Context context, Bitmap dest) throws ImageLoadException {
return loadBitmapReuse(new UriSource(uri, context), dest);
} |
python | def main(dialogpath=None):
""" Parse the state transition graph for a set of dialog-definition tables to find an fix deadends """
if dialogpath is None:
args = parse_args()
dialogpath = os.path.abspath(os.path.expanduser(args.dialogpath))
else:
dialogpath = os.path.abspath(os.path.ex... |
java | public double[] getForwards(AnalyticModel model, double[] fixingTimes)
{
double[] values = new double[fixingTimes.length];
for(int i=0; i<fixingTimes.length; i++) {
values[i] = getForward(model, fixingTimes[i]);
}
return values;
} |
python | def threshold(self, data_1, data_2, recall_weight=1.5): # pragma: no cover
"""
Returns the threshold that maximizes the expected F score,
a weighted average of precision and recall for a sample of
data.
Arguments:
data_1 -- Dictionary of records from first datas... |
java | public ValidationData ruleSync(List<ValidationRule> rules) {
List<ValidationRule> ruleList = new ArrayList<>();
rules.forEach(rule -> {
ValidationRule existRule = this.getExistRule(rule);
ruleList.add(existRule != null ? existRule : rule);
});
this.validationRul... |
python | def parseGTF(inGTF):
"""
Reads an extracts all attributes in the attributes section of a GTF and constructs a new dataframe wiht one collumn per attribute instead of the attributes column
:param inGTF: GTF dataframe to be parsed
:returns: a dataframe of the orignal input GTF with attributes parsed.
... |
java | public boolean getRTS() throws IllegalStateException, IOException{
// validate state
if (isClosed())
throw new IllegalStateException("Serial connection is not open; cannot 'getRTS()'.");
// get pin state
return com.pi4j.jni.Serial.getRTS(fileDescriptor);
} |
java | @Override
public IRenderingElement generate(IAtomContainer container, RendererModel model) {
ElementGroup numbers = new ElementGroup();
if (!model.getParameter(WillDrawAtomNumbers.class).getValue()) return numbers;
Vector2d offset = new Vector2d(this.offset.getValue().x, -this.offset.getVal... |
java | public void setNumberFormat(final NumberFormat FORMAT) {
if (null == numberFormat) {
_numberFormat = null == FORMAT ? NumberFormat.getInstance(getLocale()) : FORMAT;
fireTileEvent(RESIZE_EVENT);
} else {
numberFormat.set(FORMAT);
}
} |
java | @Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case AfplibPackage.LLE__LNK_TYPE:
return getLnkType();
case AfplibPackage.LLE__RG:
return getRG();
}
return super.eGet(featureID, resolve, coreType);
} |
java | public void deployApplication(String applicationName) throws IOException {
final Optional<URL> defaultFileOptional = this.kubernetesAssistantDefaultResourcesLocator.locate();
if (defaultFileOptional.isPresent()) {
deployApplication(applicationName, defaultFileOptional.get());
} els... |
java | @Fix(io.sarl.lang.validation.IssueCodes.INVALID_CAPACITY_TYPE)
public void fixInvalidCapacityType(final Issue issue, IssueResolutionAcceptor acceptor) {
CapacityReferenceRemoveModification.accept(this, issue, acceptor);
} |
python | def _check_soma_topology_swc(points):
'''check if points form valid soma
Currently checks if there are bifurcations within a soma
with more than three points.
'''
if len(points) == 3:
return
parents = tuple(p[COLS.P] for p in points if p[COLS.P] != ROOT_ID)
if len(parents) > len(se... |
python | def create_feature_dict(files):
""" X_MSI_FEATURE and doc FileTag's can be used to collect files in a
hierarchy. This function collects the files into this hierarchy.
"""
dict = {}
def add_to_dict( feature, file ):
if not SCons.Util.is_List( feature ):
feature = [ feature ]
... |
java | public NotificationChain basicSetPriority(Parameter newPriority, NotificationChain msgs) {
Parameter oldPriority = priority;
priority = newPriority;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, BpsimPackage.PRIORITY_PARAMETERS__PRIORITY, oldPrior... |
python | def initLogging(verbosity=0, name="SCOOP"):
"""Creates a logger."""
global loggingConfig
verbose_levels = {
-2: "CRITICAL",
-1: "ERROR",
0: "WARNING",
1: "INFO",
2: "DEBUG",
3: "DEBUG",
4: "NOSET",
}
... |
python | def database_set_properties(object_id, input_params={}, always_retry=True, **kwargs):
"""
Invokes the /database-xxxx/setProperties API method.
For more info, see: https://wiki.dnanexus.com/API-Specification-v1.0.0/Properties#API-method%3A-%2Fclass-xxxx%2FsetProperties
"""
return DXHTTPRequest('/%s/... |
java | static double getRelErr(final boolean upperBound, final boolean oooFlag,
final int lgK, final int stdDev) {
final int idx = ((lgK - 4) * 3) + (stdDev - 1);
final int sw = (oooFlag ? 2 : 0) | (upperBound ? 1 : 0);
double f = 0;
switch (sw) {
case 0 : { //HIP, LB
f = HIP_LB[idx];
... |
java | public static ResultSet combineResultSets(ResultSet first, ResultSet second) {
Function<ColumnType, String> columnTypeToString = new Function<ColumnType, String>() {
public String apply(ColumnType input) {
return input.getLabelName();
}
};
List<String> firstColumns =
Lists.transf... |
python | def hierarchy_spectrum(mg, filter=True, plot=False):
"""Examine a multilevel hierarchy's spectrum.
Parameters
----------
mg { pyamg multilevel hierarchy }
e.g. generated with smoothed_aggregation_solver(...) or
ruge_stuben_solver(...)
Returns
-------
(1) table to standard o... |
java | protected long getItemId(final int index) {
long id = -1;
if (index < getDataCount() && index >= 0 && mAdapter != null) {
id = mAdapter.getItemId(index);
}
return id;
} |
java | private void initTopicTree() {
DefaultMutableTreeNode topicTree = getDataAsTree();
if (topicTree != null) {
initTopicTree(rootNode, topicTree.getRoot());
}
} |
java | JCVariableDecl variableDeclaratorRest(int pos, JCModifiers mods, JCExpression type, Name name,
boolean reqInit, Comment dc) {
type = bracketsOpt(type);
JCExpression init = null;
if (token.kind == EQ) {
nextToken();
init = variableInitiali... |
python | def meanvR(self,R,t=0.,nsigma=None,deg=False,phi=0.,
epsrel=1.e-02,epsabs=1.e-05,
grid=None,gridpoints=101,returnGrid=False,
surfacemass=None,
hierarchgrid=False,nlevels=2,integrate_method='dopr54_c'):
"""
NAME:
meanvR
PURP... |
python | def _insert_paragraph_before(self):
"""
Return a newly created paragraph, inserted directly before this
paragraph.
"""
p = self._p.add_p_before()
return Paragraph(p, self._parent) |
python | async def get_power_settings(self) -> List[Setting]:
"""Get power settings."""
return [
Setting.make(**x)
for x in await self.services["system"]["getPowerSettings"]({})
] |
java | private static JQL buildJQLSelect(final SQLiteModelMethod method, final JQL result, final Map<JQLDynamicStatementType, String> dynamicReplace, String preparedJql) {
final Class<? extends Annotation> annotation = BindSqlSelect.class;
final SQLiteDaoDefinition dao = method.getParent();
if (StringUtils.hasText(prep... |
java | private void advance() {
next = null;
while (next == null) {
// If
if (ext != null) {
next = ext.next();
if (next != null)
return;
}
if (!vertexIter.hasNext())
return;
... |
python | def get_nn(unit):
"""获取文本行中阿拉伯数字数的个数
Keyword arguments:
unit -- 文本行
Return:
nn -- 数字数
"""
nn = 0
match_re = re.findall(number, unit)
if match_re:
string = ''.join(match_re)
nn = len(string)
return int(nn) |
java | protected void handleErrorCodes(final int responseCode) throws FetcherException {
// Handle 2xx codes as OK, so ignore them here
// 3xx codes are handled by the HttpURLConnection class
if (responseCode == 403) {
// Authentication is required
throwAuthenticationError(respo... |
python | def record(self):
# type: () -> bytes
'''
Generate a string representing the Rock Ridge Relocated Directory
record.
Parameters:
None.
Returns:
String containing the Rock Ridge record.
'''
if not self._initialized:
raise pycdl... |
java | public void close() {
if (closed.compareAndSet(false, true)) {
synchronized (meterMapLock) {
for (Meter meter : meterMap.values()) {
meter.close();
}
}
}
} |
java | public Object toObject(String pString, Class pType, String pFormat)
throws ConversionException {
if (pString == null) {
return null;
}
if (pType == null) {
throw new MissingTypeException();
}
// Get converter
PropertyConver... |
python | def _move_agent(self, agent, direction, wrap_allowed=True):
"""
moves agent 'agent' in 'direction'
"""
x,y = agent.coords['x'], agent.coords['y']
print('moving agent ', agent.name, 'to x,y=', direction, 'wrap_allowed = ', wrap_allowed)
agent.coords['x'] = x + direction[0]... |
java | public static boolean isFieldDeprecated(JavacNode field) {
if (!(field.get() instanceof JCVariableDecl)) return false;
JCVariableDecl fieldNode = (JCVariableDecl) field.get();
if ((fieldNode.mods.flags & Flags.DEPRECATED) != 0) {
return true;
}
for (JavacNode child : field.down()) {
if (annotationTypeMa... |
java | @Override
@SuppressWarnings("unchecked")
public <T> Dataset<T> asType(Class<T> type) {
if (getType().equals(type)) {
return (Dataset<T>) this;
}
return Datasets.load(getUri(), type);
} |
java | private void updateAttributes(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
String name = request.getParameter("name");
if (trace)
log.trace("updateAttributes, name=" + name);
Enumeration paramNames = request.getParameterNames();
... |
java | public String calculateServerDigest(boolean passwordAlreadyEncoded, String password) {
return generateDigest(passwordAlreadyEncoded, username,
realm, password, httpMethod, uri, qop, nonce, nc, cnonce);
} |
python | def getXY(self, debug=False):
'''
Returns the I{screen} coordinates of this C{View}.
WARNING: Don't call self.getX() or self.getY() inside this method
or it will enter an infinite loop
@return: The I{screen} coordinates of this C{View}
'''
if DEBUG_COORDS or de... |
python | def buffer(self, buffer):
""" Changes both BBox dimensions (width and height) by a percentage of size of each dimension. If number is
negative, the size will decrease. Returns a new instance of BBox object.
:param buffer: A percentage of BBox size change
:type buffer: float
:ret... |
python | def version_range(version):
"""\
Returns the version range for the provided version. This applies to QR Code
versions, only.
:param int version: The QR Code version (1 .. 40)
:rtype: int
"""
# ISO/IEC 18004:2015(E)
# Table 3 — Number of bits in character count indicator for QR Code (pag... |
python | def get_legacy_storage_path(self):
"""
Detect and return existing legacy storage path.
"""
config_dir = os.path.dirname(
self.py3_wrapper.config.get("i3status_config_path", "/tmp")
)
storage_path = os.path.join(config_dir, "py3status.data")
if os.path.... |
python | def create_labels(da, labels, locations, direction):
"""
Return an OffsetBox with label texts
"""
# The box dimensions are determined by the size of
# the text objects. We put two dummy children at
# either end to gaurantee that when center packed
# the labels in the labels_box matchup with ... |
python | def create_local_arrays(reified_arrays, array_factory=None):
"""
Function that creates arrays, given the definitions in
the reified_arrays dictionary and the array_factory
keyword argument.
Arguments
---------
reified_arrays : dictionary
Dictionary keyed on array name and ar... |
python | def handle_comment(self, comment):
"""
Remove comment except IE conditional comment.
.. seealso::
`About conditional comments
<http://msdn.microsoft.com/en-us/library/ms537512.ASPX>`_
"""
match = _COND_COMMENT_PATTERN.match(comment)
if match is no... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.