language
stringclasses
2 values
func_code_string
stringlengths
63
466k
java
public SftpFileAttributes get(String path, FileTransferProgress progress) throws FileNotFoundException, SftpStatusException, SshException, TransferCancelledException { return get(path, progress, false); }
java
public Observable<ServerVulnerabilityAssessmentInner> createOrUpdateAsync(String resourceGroupName, String serverName, ServerVulnerabilityAssessmentInner parameters) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, parameters).map(new Func1<ServiceResponse<ServerVulnerabilityAssess...
python
def _ensure_array_list(arrays): """Ensures that every element in a list is an instance of a numpy array.""" # Note: the isinstance test is needed below so that instances of FieldArray # are not converted to numpy arrays return [numpy.array(arr, ndmin=1) if not isinstance(arr, numpy.ndarray) ...
python
def get_queryset(self): """ We just ensure preferences are actually populated before fetching from db """ self.init_preferences() queryset = super(PreferenceViewSet, self).get_queryset() section = self.request.query_params.get('section') if section: ...
python
def multithread_predict_dataflow(dataflows, model_funcs): """ Running multiple `predict_dataflow` in multiple threads, and aggregate the results. Args: dataflows: a list of DataFlow to be used in :func:`predict_dataflow` model_funcs: a list of callable to be used in :func:`predict_dataflow`...
python
def _binary_search(f, xmin, xmax, eps=1e-9): """Return the largest x such f(x) is True.""" middle = (xmax + xmin) / 2. while xmax - xmin > eps: assert xmin < xmax middle = (xmax + xmin) / 2. if f(xmax): return xmax if not f(xmin): return xmin i...
java
private Integer resolveStageOrder(long pipelineId, String stageName) { Integer order = getStageOrderInPipeline(pipelineId, stageName); if (order == null) { order = getMaxStageOrderInPipeline(pipelineId) + 1; } return order; }
python
def list_configs(): ''' List all available configs CLI example: .. code-block:: bash salt '*' snapper.list_configs ''' try: configs = snapper.ListConfigs() return dict((config[0], config[2]) for config in configs) except dbus.DBusException as exc: raise Com...
java
public QueryResults<Key> newKeyQuery(String kind) { // [START newKeyQuery] Query<Key> query = Query.newKeyQueryBuilder().setKind(kind).build(); QueryResults<Key> results = datastore.run(query); // Use results // [END newKeyQuery] return results; }
python
def create_deep_link_url(self, data=None, alias=None, type=0, duration=None, identity=None, tags=None, campaign=None, feature=None, channel=None, stage=None, skip_api_call=False): """ Creates a deep linking url See the URL https://dev.branch.io/references/http_api/#...
python
def postponed_from(self): """ Date that the event was postponed from (in the local time zone). """ fromDate = getLocalDate(self.except_date, self.time_from, self.tz) return dateFormat(fromDate)
python
def to_phonetics(self): """ Transcribing words in verse helps find alliteration. """ if len(self.long_lines) == 0: logger.error("No text was imported") self.syllabified_text = [] else: transcriber = Transcriber(DIPHTHONGS_IPA, DIPHTHONGS_IPA_cl...
java
public SAXRecords ts2saxViaWindowSkipping(double[] ts, int windowSize, int paaSize, double[] cuts, NumerosityReductionStrategy strategy, double nThreshold, ArrayList<Integer> skips) throws SAXException { // the resulting data structure init // SAXRecords saxFrequencyData = new SAXRecords(...
python
def reduce(self, dimensions=None, function=None, **reduce_map): """ Reduces the Raster using functions provided via the kwargs, where the keyword is the dimension to be reduced. Optionally a label_prefix can be provided to prepend to the result Element label. """ ...
python
def arc(pRA, pDecl, sRA, sDecl, mcRA, lat): """ Returns the arc of direction between a Promissor and Significator. It uses the generic proportional semi-arc method. """ pDArc, pNArc = utils.dnarcs(pDecl, lat) sDArc, sNArc = utils.dnarcs(sDecl, lat) # Select meridian and arcs to b...
python
def module(self): """The module in which the Rule is defined. Python equivalent of the CLIPS defrule-module command. """ modname = ffi.string(lib.EnvDefruleModule(self._env, self._rule)) defmodule = lib.EnvFindDefmodule(self._env, modname) return Module(self._env, defm...
python
def SAMflags(x): """ Explains a SAM flag. :param x: flag :returns: complete SAM flag explanaition """ flags=[] if x & 1: l="1: Read paired" else: l="0: Read unpaired" flags.append(l) if x & 2 : l="1: Read mapped in proper pair" else: l="0: ...
python
def rt_update(self, statement, linenum, mode, xparser): """Uses the specified line parser to parse the given line. :arg statement: a string of lines that are part of a single statement. :arg linenum: the line number of the first line in the list relative to the entire module contents....
java
@Override public ListTagsForResourcesResult listTagsForResources(ListTagsForResourcesRequest request) { request = beforeClientExecution(request); return executeListTagsForResources(request); }
java
private String ltrim(final String s) { for (int i = 0; i < s.length(); i++) { if (s.charAt(i) != ' ') { return s.substring(i); } } return s; }
java
public AbstractThinTableModel getModel(JTable table) { AbstractThinTableModel model = null; if (table != null) model = (AbstractThinTableModel)table.getModel(); return model; }
python
def _ir_calibrate(header, data, irchn, calib_type, mask=False): """IR calibration *calib_type* in brightness_temperature, radiance, count """ count = data["hrpt"][:, :, irchn + 2].astype(np.float) if calib_type == 0: return count # Mask unnaturally low values mask |= count == 0.0 ...
python
def escape_filename_sh(name): """Return a hopefully safe shell-escaped version of a filename.""" # check whether we have unprintable characters for ch in name: if ord(ch) < 32: # found one so use the ansi-c escaping return escape_filename_sh_ansic(name) # all printable ...
python
def channels_voice_phone_number_show(self, id, **kwargs): "https://developer.zendesk.com/rest_api/docs/voice-api/phone_numbers#show-phone-number" api_path = "/api/v2/channels/voice/phone_numbers/{id}.json" api_path = api_path.format(id=id) return self.call(api_path, **kwargs)
java
public int write(long pos, byte[] b, int off, int len) throws IOException { prepareForWrite(pos, len); if (len == 0) { return 0; } int remaining = len; int blockIndex = blockIndex(pos); byte[] block = blocks[blockIndex]; int offInBlock = offsetInBlock(pos); int written = put(bl...
java
private static <S, L> void updateBlockReferences(Block<S, L> block) { UnorderedCollection<State<S, L>> states = block.getStates(); for (ElementReference ref : states.references()) { State<S, L> state = states.get(ref); state.setBlockReference(ref); state.setBlock(bloc...
java
@Override public Description matchMethod(MethodTree tree, VisitorState state) { MethodSymbol methodSym = ASTHelpers.getSymbol(tree); // precondition (1) if (!methodSym.getModifiers().contains(Modifier.PRIVATE)) { return Description.NO_MATCH; } ImmutableList<Tree> params = tree.get...
python
def recursively_preempt_states(self): """ Preempt the state and all of it child states. """ super(ContainerState, self).recursively_preempt_states() # notify the transition condition variable to let the state instantaneously stop self._transitions_cv.acquire() self._trans...
python
def list_users(order_by='id'): ''' Show all users for this company. CLI Example: salt myminion bamboohr.list_users By default, the return data will be keyed by ID. However, it can be ordered by any other field. Keep in mind that if the field that is chosen contains duplicate values (i...
python
def add(self, rule: ControlRule = None, *, supply: float): """ Register a new rule above a given ``supply`` threshold Registration supports a single-argument form for use as a decorator, as well as a two-argument form for direct application. Use the former for ``def`` or ``class...
python
def annotate(data, image_column=None, annotation_column='annotations'): """ Annotate your images loaded in either an SFrame or SArray Format The annotate util is a GUI assisted application used to create labels in SArray Image data. Specifying a column, with dtype Image, in an SFrame ...
java
public static cmpaction[] get(nitro_service service, options option) throws Exception{ cmpaction obj = new cmpaction(); cmpaction[] response = (cmpaction[])obj.get_resources(service,option); return response; }
python
def do_time(self, params): """ \x1b[1mNAME\x1b[0m time - Measures elapsed seconds after running commands \x1b[1mSYNOPSIS\x1b[0m time <cmd1> <cmd2> ... <cmdN> \x1b[1mEXAMPLES\x1b[0m > time 'loop 10 0 "create /foo_ bar ephemeral=false sequence=true"' Took 0.05585 seconds ...
java
@Override public final void afterPropertiesSet() throws Exception { if (this.getLocator() != null) { this.logger.warn( "Static " + this.getClass().getName() + " reference has already been set and setInstance is being cal...
java
public boolean isReallocationRequired() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(this, tc, "isReallocationRequired"); SibTr.exit(tc, "isReallocationRequired", Boolean.valueOf(reallocateOnCommit)); } return reallocateOnCommit; }
java
public void setResourceGroupArns(java.util.Collection<String> resourceGroupArns) { if (resourceGroupArns == null) { this.resourceGroupArns = null; return; } this.resourceGroupArns = new java.util.ArrayList<String>(resourceGroupArns); }
python
def on_message(self, message): """Listens for a "websocket client ready" message. Once that message is received an asynchronous job is stated that yields messages to the client. These messages make up salt's "real time" event stream. """ log.debug('Got websocket m...
java
@Deprecated public static <T extends Comparable<?>> TimeTemplate<T> timeTemplate(Class<? extends T> cl, String template, ImmutableList<?> args) { return timeTemplate(cl, createTemplate(template), args); }
python
def entities(self, name_id): """ Returns all the entities of assertions for a subject, disregarding whether the assertion still is valid or not. :param name_id: The subject identifier, a NameID instance :return: A possibly empty list of entity identifiers """ cni = code(...
java
public InsertAllResponse insert( Iterable<InsertAllRequest.RowToInsert> rows, boolean skipInvalidRows, boolean ignoreUnknownValues) throws BigQueryException { InsertAllRequest request = InsertAllRequest.newBuilder(getTableId(), rows) .setSkipInvalidRows(skipInvalidRows) ...
python
def _removeSingleMemberGroupReferences(kerning, leftGroups, rightGroups): """ Translate group names into glyph names in pairs if the group only contains one glyph. """ new = {} for (left, right), value in kerning.items(): left = leftGroups.get(left, left) right = rightGroups.get(...
python
def update_store_credit_by_id(cls, store_credit_id, store_credit, **kwargs): """Update StoreCredit Update attributes of StoreCredit This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.update_store...
python
def calculate_ef_covar(ef_structure1, ef_structure2): """ determine the active and decoy covariance of the enrichment factors, covara, and covard, respectively. :param efstructure_1: list [(id, best_score, best_query, status, gamma), ...,] :param ef_structure2: list [(id, best_score, best_query, status,...
python
def prt_objdesc(self, prt): """Return description of this GoSubDag object.""" txt = "INITIALIZING GoSubDag: {N:3} sources in {M:3} GOs rcnt({R}). {A} alt GO IDs\n" alt2obj = {go:o for go, o in self.go2obj.items() if go != o.id} prt.write(txt.format( N=len(self.go_sources), ...
java
protected void setStream( int priority, Reliability reliability, Stream stream) throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry( tc, "setStream", new Object[] { new Integer(priority), reliability, stream }); ...
python
def im_open(self, room_id, **kwargs): """Adds the direct message back to the user’s list of direct messages.""" return self.__call_api_post('im.open', roomId=room_id, kwargs=kwargs)
python
def delete_file(f, ignore_errors=False): """ delete a single file """ try: os.remove(f) except Exception as ex: if ignore_errors: return print('ERROR deleting file ' + str(ex))
python
def add_device_callback(self, devices, callback): """Register a device callback.""" if not devices: return False if not isinstance(devices, (tuple, list)): devices = [devices] for device in devices: # Device may be a device_id device_id =...
python
def ensure_wide_weights_is_1D_or_2D_ndarray(wide_weights): """ Ensures that `wide_weights` is a 1D or 2D ndarray. Raises a helpful ValueError if otherwise. """ if not isinstance(wide_weights, np.ndarray): msg = "wide_weights MUST be a ndarray." raise ValueError(msg) ndim = wide_w...
python
def get_all_units(self, params=None): """ Get all units This will iterate over all pages until it gets all elements. So if the rate limit exceeded it will throw an Exception and you will get nothing :param params: search params :return: list """ if not pa...
java
@Nullable public static Byte parseByteObj (@Nullable final String sStr) { return parseByteObj (sStr, DEFAULT_RADIX, null); }
java
@Override public DeleteGameSessionQueueResult deleteGameSessionQueue(DeleteGameSessionQueueRequest request) { request = beforeClientExecution(request); return executeDeleteGameSessionQueue(request); }
java
public WebServiceTemplateBuilder messageSenders( WebServiceMessageSender... messageSenders) { Assert.notNull(messageSenders, "MessageSenders must not be null"); return messageSenders(Arrays.asList(messageSenders)); }
java
public java.util.List<String> getDeploymentIds() { if (deploymentIds == null) { deploymentIds = new com.amazonaws.internal.SdkInternalList<String>(); } return deploymentIds; }
python
def _get_support_sound_mode_avr(self): """ Get if sound mode is supported from device. Method queries device via HTTP. Returns "True" if sound mode supported and "False" if not. This method is for pre 2016 AVR(-X) devices """ # Set sound mode tags to be checked i...
java
private void initStreamSource(InstanceStream stream) { if (stream instanceof AbstractOptionHandler) { ((AbstractOptionHandler) (stream)).prepareForUse(); } this.streamSource = new StreamSource(stream); firstInstance = streamSource.nextInstance().getData(); }
java
public String getAction() { if (action == null) { HelpModule module = HelpModule.getModule(id); action = module == null ? "" : "groovy:" + CareWebUtil.class.getName() + ".showHelpTopic(\"" + id + "\",\"" + (topic == null ? "" : topic) + "\"...
python
def _new_cls_attr(self, clazz, name, cls=None, mult=MULT_ONE, cont=True, ref=False, bool_assignment=False, position=0): """Creates new meta attribute of this class.""" attr = MetaAttr(name, cls, mult, cont, ref, bool_assignment, position) clazz._tx_a...
java
@BetaApi public final Operation deleteSubnetwork(ProjectRegionSubnetworkName subnetwork) { DeleteSubnetworkHttpRequest request = DeleteSubnetworkHttpRequest.newBuilder() .setSubnetwork(subnetwork == null ? null : subnetwork.toString()) .build(); return deleteSubnetwork(request...
java
public static br_enable[] enable(nitro_service client, br_enable[] resources) throws Exception { if(resources == null) throw new Exception("Null resource array"); if(resources.length == 1) return ((br_enable[]) resources[0].perform_operation(client, "enable")); return ((br_enable[]) perfo...
python
def get_style_attribute(style_attribute, html_element): ''' ::param: style_directive \ The attribute value of the given style sheet. Example: display: none ::param: html_element: \ The HtmlElement to which the given style is applied ::returns: ...
java
public Observable<ServiceResponse<String>> cloneWithServiceResponseAsync(UUID appId, String versionId, String version) { if (this.client.endpoint() == null) { throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } if (appId == null) ...
java
public void close(String nodeID) { SendBuffer buffer; synchronized (buffers) { buffer = buffers.remove(nodeID); } if (buffer != null) { buffer.close(); } }
python
def _get_nds2_name(channel): """Returns the NDS2-formatted name for a channel Understands how to format NDS name strings from `gwpy.detector.Channel` and `nds2.channel` objects """ if hasattr(channel, 'ndsname'): # gwpy.detector.Channel return channel.ndsname if hasattr(channel, 'chann...
java
public void addAvailableLocale(String localeName) { Locale locale = getLocale(localeName); // add full variation (language / country / variant) if (!m_availableLocales.contains(locale)) { m_availableLocales.add(locale); if (CmsLog.INIT.isInfoEnabled()) { ...
java
public NotificationChain basicSetBooleanParameter(BooleanParameterType newBooleanParameter, NotificationChain msgs) { return ((FeatureMap.Internal)getMixed()).basicAdd(BpsimPackage.Literals.DOCUMENT_ROOT__BOOLEAN_PARAMETER, newBooleanParameter, msgs); }
python
def create_queue_wrapper(name, queue_size, fed_arrays, data_sources, *args, **kwargs): """ Arguments name: string Name of the queue queue_size: integer Size of the queue fed_arrays: list array names that will be fed by this queue data_sources: ...
python
def strip_context_items(self, a_string): """Strip Juniper-specific output. Juniper will also put a configuration context: [edit] and various chassis contexts: {master:0}, {backup:1} This method removes those lines. """ strings_to_strip = [ r...
java
@Override public ResourceSchema getSchema(String location, Job job) throws IOException { ResourceSchema rs = new ResourceSchema(); List<ResourceFieldSchema> fieldSchemaList = new ArrayList<>(); for (String fieldName : requestedFields) { ResourceFieldSchema rfs = new ResourceFiel...
python
def __setup_native_run(self): # These options are appended to mounted volume arguments # NOTE: This tells Docker to re-label the directory for compatibility # with SELinux. See `man docker-run` for more information. self.vol_opts = ['z'] # Pass variables to scubainit se...
python
def current_jobs(self): """ Returns a snapshot of the Jobs that are currently being processed by the ThreadPool. These jobs can not be found in the #pending_jobs() list. """ jobs = [] with synchronized(self.__queue): for worker in self.__threads: with synchronized(worker): ...
java
public void Intersect( CalendarPeriod pPeriod ) { if( (days != null) && (pPeriod.getDays() != null) ) { for( int i = 0; i < 7; i++ ) if( days.getDay( i ).get() + pPeriod.getDays().getDay( i ).get() >= 2 ) days.getDay( i ).set(); else days.getDay( i ).reset(); return; } // if one of the...
python
def _set_src_vtep_ip(self, v, load=False): """ Setter method for src_vtep_ip, mapped from YANG variable /overlay/access_list/type/vxlan/standard/seq/src_vtep_ip (inet:ipv4-address) If this variable is read-only (config: false) in the source YANG file, then _set_src_vtep_ip is considered as a private ...
java
private void setActiveCenters(IAtomContainer reactant) throws CDKException { Iterator<IAtom> atomis = reactant.atoms().iterator(); while (atomis.hasNext()) { IAtom atomi = atomis.next(); if (atomi.getFormalCharge() == 0 && reactant.getConnectedSingleElectronsCount(atomi) == 0 ...
python
def get_review_sh(self, revision, item): """ Add sorting hat enrichment fields for the author of the revision """ identity = self.get_sh_identity(revision) update = parser.parse(item[self.get_field_date()]) erevision = self.get_item_sh_fields(identity, update) return erevision
python
def remove_from_group(self, group, user): """ Remove a user from a group :type user: str :param user: User's email :type group: str :param group: Group name :rtype: dict :return: an empty dictionary """ data = {'group': group, 'user': us...
python
def _update_from_pb(self, instance_pb): """Refresh self from the server-provided protobuf. Helper for :meth:`from_pb` and :meth:`reload`. """ if not instance_pb.display_name: # Simple field (string) raise ValueError("Instance protobuf does not contain display_name") ...
java
public static void removeDisablingOverlay(Element element) { List<Element> overlays = CmsDomUtil.getElementsByClass( I_CmsLayoutBundle.INSTANCE.generalCss().disablingOverlay(), Tag.div, element); if (overlays == null) { return; } for (Elem...
python
def execute_command(self, command, args=None): """ Execute a command :param command: name of the command :type command: str :param args: optional named arguments for command :type args: dict :return: the result of command :raises KeyError: if command is n...
java
public static void destroy(final Resource... resources) { for (Resource r : resources) { if (r != null) { r.destroy(); } } }
python
def save(self, *args, **kwargs): """Saves changes made on model instance if ``request`` or ``track_token`` keyword are provided. """ from tracked_model.models import History, RequestInfo if self.pk: action = ActionType.UPDATE changes = None else: ...
python
def _filter_list(input_list, search_key, search_value): ''' Filters a list of dictionary by a set of key-value pair. :param input_list: is a list of dictionaries :param search_key: is the key we are looking for :param search_value: is the value we are looking for the key specified in search_ke...
python
def _is_finished_dumping_checkpoint(directory): """Recent versions of RTA (1.10 or better), write the complete file. This is the most straightforward source but as of 1.10 still does not work correctly as the file will be created at the end of Read 1 even if there are multiple reads. """ check_...
java
public CommandLine setUnmatchedOptionsArePositionalParams(boolean newValue) { getCommandSpec().parser().unmatchedOptionsArePositionalParams(newValue); for (CommandLine command : getCommandSpec().subcommands().values()) { command.setUnmatchedOptionsArePositionalParams(newValue); } ...
java
private final static int difference(int seq1, int seq2, int maxSequence) { int diff = seq1 - seq2; if (Math.abs(diff) <= maxSequence / 2) return diff; else return (-Integer.signum(diff) * maxSequence) + diff; }
python
def write_lockfile(self, content): """Write out the lockfile. """ s = self._lockfile_encoder.encode(content) open_kwargs = {"newline": self._lockfile_newlines, "encoding": "utf-8"} with vistir.contextmanagers.atomic_open_for_write( self.lockfile_location, **open_kwarg...
java
public void setListener(T listener) { Assert.notNull(listener, "Listener must not be null"); Assert.isTrue(isSupportedType(listener), "Listener is not of a supported type"); this.listener = listener; }
java
public void openCloseElement(String elementName) throws IOException { assert(elementNames.size() > 0); assert(elementNames.get(elementNames.size() - 1).equals(elementName)); writer.write("/>\n"); removeElementName(elementName); }
python
def delete(self, path, recursive=True): """ Delete ``path``. :type path: str :param path: the path of the file or directory :type recursive: bool :param recursive: if ``path`` is a directory, delete it recursively when :obj:`True` :raises: :exc:`~except...
java
public OvhOrder hosting_web_serviceName_changeMainDomain_duration_POST(String serviceName, String duration, String domain, OvhMxPlanEnum mxplan) throws IOException { String qPath = "/order/hosting/web/{serviceName}/changeMainDomain/{duration}"; StringBuilder sb = path(qPath, serviceName, duration); HashMap<String...
python
def set_points(self, pt1, pt2): """Reset the rectangle coordinates.""" (x1, y1) = pt1.as_tuple() (x2, y2) = pt2.as_tuple() self.left = min(x1, x2) self.top = min(y1, y2) self.right = max(x1, x2) self.bottom = max(y1, y2)
java
protected void processNoPrimaryReference(APMSpanBuilder builder, TraceRecorder recorder, ContextSampler sampler) { // No primary reference found, so means that all references will be treated // as equal, to provide a join construct within a separate fragment. initTopLevelState(this, recorder, sa...
python
def notice(self, target, msg): """ Sends a NOTICE to an user or channel. :param target: user or channel to send to. :type target: str :param msg: message to send. :type msg: basestring """ self.cmd(u'NOTICE', u'{0} :{1}'.format(target, msg))
java
@Override public Resource getResource(String key) { Resource resource = new ClasspathResource(key, this.getChildPath(root, key), this); return resource; }
python
def get_cases(variant_source, case_lines=None, case_type='ped', variant_type='snv', variant_mode='vcf'): """Create a cases and populate it with individuals Args: variant_source (str): Path to vcf files case_lines (Iterable): Ped like lines ...
python
def getVarianceComps(self, univariance=False): """ Return the estimated variance components Args: univariance: Boolean indicator, if True variance components are normalized to sum up to 1 for each trait Returns: variance components of all random effects on all ...
python
def supports_version_type(self, version_type=None): """Tests if the given version type is supported. arg: version_type (osid.type.Type): a version Type return: (boolean) - ``true`` if the type is supported, ``false`` otherwise raise: IllegalState - syntax is not a ``...
python
def get_word_input(data, word_dict, embed, embed_dim): ''' Get word input. ''' batch_size = len(data) max_sequence_length = max(len(d) for d in data) sequence_length = max_sequence_length word_input = np.zeros((max_sequence_length, batch_size, embed_dim), dtype=np....
python
def clear(self): """ removes all items from this manifest, and clears and removes all sub-sections """ for sub in self.sub_sections.values(): sub.clear() self.sub_sections.clear() ManifestSection.clear(self)
python
def assign_vertices(self): """ Sets .edges, .verts for node positions. X and Y positions here refer to base assumption that tree is right facing, reorient_coordinates() will handle re-translating this. """ # shortname uselen = bool(self.ttree.style.use_e...