language
stringclasses
2 values
func_code_string
stringlengths
63
466k
java
private boolean contains(Line line) { return contains(line.getX1(), line.getY1()) && contains(line.getX2(), line.getY2()); }
python
def table_creator(func): """ Decorator for table creating method """ def method(self, table_name, **kwargs): if self.odps.exist_table(table_name): return if kwargs.get('project', self.odps.project) != self.odps.project: tunnel = TableTunnel(self.odps, project=kwar...
python
def _init_optional_attrs(optional_attrs): """Create OboOptionalAttrs or return None.""" if optional_attrs is None: return None opts = OboOptionalAttrs.get_optional_attrs(optional_attrs) if opts: return OboOptionalAttrs(opts)
java
public void clearField(final FieldDescriptorType descriptor) { fields.remove(descriptor); if (fields.isEmpty()) { hasLazyField = false; } }
python
def _use_framework(module): """ Internal helper, to set this modules methods to a specified framework helper-methods. """ import txaio for method_name in __all__: if method_name in ['use_twisted', 'use_asyncio']: continue setattr(txaio, method_name, ge...
java
private void _processMissingDataNotification(Alert alert, History history, Set<Trigger> triggers, Notification notification, boolean isDataMissing, Long alertEnqueueTimestamp) { //refocus notifier does not need cool down logic, and every evaluation needs to send notification boolean isRefocusNotifier = SupportedNo...
java
@Override public void cacheResult(CPRuleAssetCategoryRel cpRuleAssetCategoryRel) { entityCache.putResult(CPRuleAssetCategoryRelModelImpl.ENTITY_CACHE_ENABLED, CPRuleAssetCategoryRelImpl.class, cpRuleAssetCategoryRel.getPrimaryKey(), cpRuleAssetCategoryRel); cpRuleAssetCategoryRel.resetOriginalValues(); }
python
def setColumnHidden( self, column, state ): """ Sets the hidden state for the inputed column. :param column | <int> state | <bool> """ super(XTreeWidget, self).setColumnHidden(column, state) if ( not self.signalsBlocked...
python
def list_kadastrale_afdelingen(self): ''' List all `kadastrale afdelingen` in Flanders. :param integer sort: Field to sort on. :rtype: A :class:`list` of :class:`Afdeling`. ''' def creator(): gemeentes = self.list_gemeenten() res = [] ...
java
@Override public LightweightTypeReference getReturnType(XExpression expression, boolean onlyExplicitReturns) { LightweightTypeReference result = doGetReturnType(expression, onlyExplicitReturns); return toOwnedReference(result); }
java
public void close() { // clean up collections if (consumers != null) { consumers.clear(); consumers = null; } if (providers != null) { providers.clear(); providers = null; } if (listeners != null) { listeners.cle...
python
def user_create(auth=None, **kwargs): ''' Create a user CLI Example: .. code-block:: bash salt '*' keystoneng.user_create name=user1 salt '*' keystoneng.user_create name=user2 password=1234 enabled=False salt '*' keystoneng.user_create name=user3 domain_id=b62e76fbeeff4e8fb770...
java
@CheckReturnValue public GuildManager setName(String name) { Checks.notNull(name, "Name"); Checks.check(name.length() >= 2 && name.length() <= 100, "Name must be between 2-100 characters long"); this.name = name; set |= NAME; return this; }
java
private static boolean extendsSuperMetaModel(Element superClassElement, boolean entityMetaComplete, Context context) { // if we processed the superclass in the same run we definitely need to extend String superClassName = ( (TypeElement) superClassElement ).getQualifiedName().toString(); if ( context.containsMeta...
java
public Configuration getRandomConfiguration() { List<Integer> tmp = new ArrayList<Integer>(this.dimension); for (int i = 0; i < this.dimension; ++i) tmp.add(JcopRandom.nextBoolean() ? 1 : 0); return new Configuration(tmp, "Empty knapsack created (random)"); }
python
def rdfs_classes(rdf): """Perform RDFS subclass inference. Mark all resources with a subclass type with the upper class.""" # find out the subclass mappings upperclasses = {} # key: class val: set([superclass1, superclass2..]) for s, o in rdf.subject_objects(RDFS.subClassOf): upperclasses...
python
def _apply_features_filter(self, station_codes): """ If the features filter is set, this will return the intersection of those filter items and the given station codes. """ # apply features filter if hasattr(self, "features") and self.features is not None: sta...
java
public List<PluginInfo> getUpdates() { List<PluginInfo> updates = new ArrayList<>(); for (PluginWrapper installed : pluginManager.getPlugins()) { String pluginId = installed.getPluginId(); if (hasPluginUpdate(pluginId)) { updates.add(getPluginsMap().get(pluginId))...
python
def search_artists_by_name(self, artist_name: str, limit: int = 5) -> List[NameExternalIDPair]: """ Returns zero or more artist name - external ID pairs that match the specified artist name. Arguments: artist_name (str): The artist name to search in the Spotify API. limi...
python
def jsbuild_prompt(): ''' Prompt users whether to build a new BokehJS or install an existing one. Returns: bool : True, if a new build is requested, False otherwise ''' print(BOKEHJS_BUILD_PROMPT) mapping = {"1": True, "2": False} value = input("Choice? ") while value not in mappin...
java
private void flush(boolean endOfRecord) throws IOException { if (buffer == null) { if (!endOfRecord || eorSent) { return; } ensureBufferAvailable(); } if (buffer.position() == 0 && (!endOfRecord || eorSent)) { // Nothing to flush ...
java
public View getScrollOrListParent(View view) { if (!(view instanceof android.widget.AbsListView) && !(view instanceof android.widget.ScrollView) && !(view instanceof WebView)) { try{ return getScrollOrListParent((View) view.getParent()); }catch(Exception e){ return null; } } else { return view;...
python
def clear_commentarea_cache(comment): """ Clean the plugin output cache of a rendered plugin. """ parent = comment.content_object for instance in CommentsAreaItem.objects.parent(parent): instance.clear_cache()
python
def parse_gpx(gpx_element, gpx_extensions_parser=None, metadata_extensions_parser=None, waypoint_extensions_parser=None, route_extensions_parser=None, track_extensions_parser=None, segment_extensions_parser=None, ...
java
protected boolean scheduleNewTask(String taskId) { // Put it to the pending start queue LOG.info(String.format("We are to schedule task: [%s]", taskId)); // Update the tasksId int containerIndex = TaskUtils.getContainerIndexForTaskId(taskId); tasksId.put(containerIndex, taskId); // Re-schedule...
java
public void synchronizeGroup(final LDAPGroup group) throws IOException, LdapException, CursorException, FrameworkException { final String scope = getScope(); final String secret = getSecret(); final String bindDn = getBindDN(); final ...
java
public static void ensureServiceSsoAccessIsAllowed(final RegisteredService registeredService, final Service service, final TicketGrantingTicket ticketGrantingTicket) { ensureServiceSsoAccessIsAllowed(registeredService, service, ticketGrantingTicket, false);...
java
public static String format(String pattern, Object args) { return format(pattern, args, false); }
python
def f1_curve(self, delta_tau=0.01): """ Computes the relationship between probability threshold and classification F1 score. """ # compute thresholds based on the sorted probabilities orig_thresh = self.threshold sorted_labels, sorted_probs = self.sorted_values scores = ...
java
public LdapRdnComponent getComponent(int idx) { if(idx >= components.size()) { throw new IndexOutOfBoundsException(); } return (LdapRdnComponent) new ArrayList(components.values()).get(idx); }
python
def timeFormat(time_from, time_to=None, prefix="", infix=None): """ Format the times time_from and optionally time_to, e.g. 10am """ retval = "" if time_from != "" and time_from is not None: retval += prefix retval += dateformat.time_format(time_from, "fA").lower() if time_to != ...
java
public SIBUuid8 getUuid() { if (_uuid == null) { String s = "B0CEFAD4D3454A2E"; _uuid = new SIBUuid8(s); } return _uuid; }
java
protected TypeConverter createTypeConverter(Properties properties) { Class<?> clazz = load(TypeConverter.class, properties); if (clazz == null) { return TypeConverter.DEFAULT; } try { return TypeConverter.class.cast(clazz.newInstance()); } catch (Exception e) { throw new ELException("TypeConverter " ...
java
private RequestMetricCollector findRequestMetricCollector(RequestConfig requestConfig) { RequestMetricCollector reqLevelMetricsCollector = requestConfig .getRequestMetricsCollector(); if (reqLevelMetricsCollector != null) { return reqLevelMetricsCollector; } else if (...
java
public void init() throws IOException { File path = resolveIndexDirectoryPath(); indexTracker = new IndexTracker(path); indexDirectory = FSDirectory.open(path); tika = new Tika(null, new HtmlParser()); Analyzer analyzer = new StandardAnalyzer(); IndexWriterConfig config =...
python
def derivative(self, t, n=1): """returns the nth derivative of the segment at t.""" angle = radians(self.theta + t*self.delta) phi = radians(self.rotation) rx = self.radius.real ry = self.radius.imag k = (self.delta*2*pi/360)**n # ((d/dt)angle)**n if n % 4 == 0 ...
python
def _qt_set_leaf_data(self, qvar): """ Sets backend data using QVariants """ if VERBOSE_PREF: print('') print('+--- [pref.qt_set_leaf_data]') print('[pref.qt_set_leaf_data] qvar = %r' % qvar) print('[pref.qt_set_leaf_data] _intern.name=%r' % self._intern.name) print('[pre...
java
private synchronized Identity getNodeFromCache(final String uuid) { if (nodeUuidMap == null) { nodeUuidMap = new FixedSizeCache<>(Settings.UuidCacheSize.getValue()); } return nodeUuidMap.get(uuid); }
java
@SuppressWarnings("all") public static List<URL> filterFiles(final File baseDir, final List<String> sources, final List<String> standardDirectories, final Log log, ...
java
public ServiceFuture<OperationResultInner> getAsync(String locationName, String operationName, final ServiceCallback<OperationResultInner> serviceCallback) { return ServiceFuture.fromResponse(getWithServiceResponseAsync(locationName, operationName), serviceCallback); }
python
def validate(data): """ Validate data against the schema. Args: data(dict): data structure to validate. Returns: dict: data as provided and defaults where defined in schema. """ try: return Schema(Validator.SCHEMA).validate(data) ...
java
@Override public int getInt(int columnIndex) throws SQLException { checkColumnBounds(columnIndex); try { Long longValue = getPrivateInteger(columnIndex); if (longValue > Integer.MAX_VALUE || longValue < Integer.MIN_VALUE) { throw new SQLException("Value out of...
java
public static String convertToKubernetesName(String text, boolean allowDots) { String lower = text.toLowerCase(); StringBuilder builder = new StringBuilder(); boolean started = false; char lastCh = ' '; for (int i = 0, last = lower.length() - 1; i <= last; i++) { char...
java
public static void removeLastOverlay() { if (!m_overlays.isEmpty()) { CmsInlineEditOverlay last = m_overlays.remove(m_overlays.size() - 1); last.removeFromParent(); } if (!m_overlays.isEmpty()) { m_overlays.get(m_overlays.size() - 1).setVisible(true); ...
java
public void register(String correlationId, ConnectionParams connection) throws ApplicationException { boolean result = registerInDiscovery(correlationId, connection); if (result) _connections.add(connection); }
python
def calc_lz_v1(self): """Update the lower zone layer in accordance with percolation from upper groundwater to lower groundwater and/or in accordance with lake precipitation. Required control parameters: |NmbZones| |ZoneType| Required derived parameters: |RelLandArea| |RelZo...
python
def get_aliases(self, lang='en'): """ Retrieve the aliases in a certain language :param lang: The Wikidata language the description should be retrieved for :return: Returns a list of aliases, an empty list if none exist for the specified language """ if self.fast_run: ...
python
def find_bind_module(name, verbose=False): """Find the bind module matching the given name. Args: name (str): Name of package to find bind module for. verbose (bool): If True, print extra output. Returns: str: Filepath to bind module .py file, or None if not found. """ bind...
python
def conv_layer(ni:int, nf:int, ks:int=3, stride:int=1, padding:int=None, bias:bool=None, is_1d:bool=False, norm_type:Optional[NormType]=NormType.Batch, use_activ:bool=True, leaky:float=None, transpose:bool=False, init:Callable=nn.init.kaiming_normal_, self_attention:bool=False): "Crea...
java
@Override public void serializeInstance(SerializationStreamWriter streamWriter, OWLDataExactCardinalityImpl instance) throws SerializationException { serialize(streamWriter, instance); }
java
public static File copy(InputStream stream) throws IOException { File file = createTempFile(); copy(stream, new FileOutputStream(file)); return file; }
java
public GVRSkeleton createSkeleton(List<String> boneNames) { int numBones = boneNames.size(); GVRSceneObject root = (GVRSceneObject) mTarget; mSkeleton = new GVRSkeleton(root, boneNames); for (int boneId = 0; boneId < numBones; ++boneId) { mSkeleton.setBoneOptions(...
python
def spline_interpolate_by_datetime(datetime_axis, y_axis, datetime_new_axis): """A datetime-version that takes datetime object list as x_axis """ numeric_datetime_axis = [ totimestamp(a_datetime) for a_datetime in datetime_axis ] numeric_datetime_new_axis = [ totimestamp(a_datetime)...
python
def lazyread(f, delimiter): """ Generator which continually reads ``f`` to the next instance of ``delimiter``. This allows you to do batch processing on the contents of ``f`` without loading the entire file into memory. :param f: Any file-like object which has a ``.read()`` method. :param ...
java
private void menuEditMenuSelected(javax.swing.event.MenuEvent evt) {//GEN-FIRST:event_menuEditMenuSelected final TabTitle title = this.getFocusedTab(); updateMenuItemsForProvider(title == null ? null : title.getProvider()); this.menuEditShowTreeContextMenu.setEnabled(this.explorerTree.hasSelectedItem()); ...
java
public int setValue(double value, boolean bDisplayOption, int iMoveMode) { // Set this field's value double dRoundAt = Math.pow(10, m_ibScale); Double tempdouble = new Double(Math.floor(value * dRoundAt + 0.5) / dRoundAt); int errorCode = this.setData(tempdouble, bDisplayOption, iM...
python
def register(self, callback_id: str, handler: Any, name: str = "*") -> None: """ Register a new handler for a specific :class:`slack.actions.Action` `callback_id`. Optional routing based on the action name too. The name argument is useful for actions of type `interactive_message` to pro...
java
public Observable<Page<VirtualMachineScaleSetSkuInner>> listSkusAsync(final String resourceGroupName, final String vmScaleSetName) { return listSkusWithServiceResponseAsync(resourceGroupName, vmScaleSetName) .map(new Func1<ServiceResponse<Page<VirtualMachineScaleSetSkuInner>>, Page<VirtualMachineSca...
java
public void setFieldNames(List<String> fieldNames) { this.fieldNames = fieldNames; if (fields.length != fieldNames.size()) { Object[] oldFields = fields; fields = new Object[fieldNames.size()]; System.arraycopy(oldFields, 0, fields, 0, Math.min(oldFields.length, fieldNames.size())); ...
python
def parents(self, vertex): """ Return the list of immediate parents of this vertex. """ return [self.tail(edge) for edge in self.in_edges(vertex)]
python
def __get_type_args(for_type=None, for_types=None): """Parse the arguments and return a tuple of types to implement for. Raises: ValueError or TypeError as appropriate. """ if for_type: if for_types: raise ValueError("Cannot pass both for_type and...
python
def iter_statuses(self, number=-1, etag=None): """Iterate over the deployment statuses for this deployment. :param int number: (optional), the number of statuses to return. Default: -1, returns all statuses. :param str etag: (optional), the ETag header value from the last time ...
java
protected void addToQueue(double closestDistanceSq , KdTree.Node node , P target ) { if( !node.isLeaf() ) { Helper h; if( unused.isEmpty() ) { h = new Helper(); } else { h = unused.remove( unused.size()-1 ); } h.closestPossibleSq = closestDistanceSq; h.node = node; queue.add(h); } el...
python
def get_path_completion_type(cwords, cword, opts): """Get the type of path completion (``file``, ``dir``, ``path`` or None) :param cwords: same as the environmental variable ``COMP_WORDS`` :param cword: same as the environmental variable ``COMP_CWORD`` :param opts: The available options to check :r...
python
def run(self): """ start component """ loop = asyncio.get_event_loop() if loop.is_closed(): asyncio.set_event_loop(asyncio.new_event_loop()) loop = asyncio.get_event_loop() txaio.start_logging() loop.run_until_complete(self.onConnect())
python
def single_from_classes(path:Union[Path, str], classes:Collection[str], ds_tfms:TfmList=None, **kwargs): "Create an empty `ImageDataBunch` in `path` with `classes`. Typically used for inference." warn("""This method is deprecated and will be removed in a future version, use `load_learner` after ...
java
public static <I, O> ListenableFuture<O> transformAsync( final ListenableFuture<I> inFuture, final Function<I, ListenableFuture<O>> transform ) { final SettableFuture<O> finalFuture = SettableFuture.create(); Futures.addCallback(inFuture, new FutureCallback<I>() { @Override publi...
java
private TransactionBroadcaster getAnnouncePeerGroup() { try { return announcePeerGroupFuture.get(MAX_SECONDS_TO_WAIT_FOR_BROADCASTER_TO_BE_SET, TimeUnit.SECONDS); } catch (InterruptedException e) { throw new RuntimeException(e); } catch (ExecutionException e) { ...
java
String rrToString() { StringBuffer sb = new StringBuffer(); /* Latitude */ sb.append(positionToString(latitude, 'N', 'S')); sb.append(" "); /* Latitude */ sb.append(positionToString(longitude, 'E', 'W')); sb.append(" "); /* Altitude */ renderFixedPoint(sb, w2, altitude - 10000000, 100); sb.append("m "); ...
python
def run_box_to_gaussian(logdir, verbose=False): """Run a box-blur-to-Gaussian-blur demonstration. See the summary description for more details. Arguments: logdir: Directory into which to write event logs. verbose: Boolean; whether to log any output. """ if verbose: logger.info('--- Starting run:...
python
def info(self): """Execute an HTTP request to get details on a queue, and return it. """ url = "queues/%s" % (self.name,) result = self.client.get(url) return result['body']['queue']
java
public void show(FragmentTransaction transaction, String tag){ mActiveMail = generateDialogFragment(); mActiveMail.show(transaction, tag); }
python
def remove_synchronous(self, resource, force=False, timeout=-1): """ Deletes the resource specified by {id} synchronously. Args: resource: dict object to remove force: If set to true, the operation completes despite any problems with net...
java
@Override public CreateChannelResult createChannel(CreateChannelRequest request) { request = beforeClientExecution(request); return executeCreateChannel(request); }
python
def add_ref(self, ref): """ Add a reference to a memory data object. :param CodeReference ref: The reference. :return: None """ self.refs[ref.insn_addr].append(ref) self.data_addr_to_ref[ref.memory_data.addr].append(ref)
python
def _req_fix(self, line): """Fix slacky and salix requirements because many dependencies splitting with "," and others with "|" """ deps = [] for dep in line[18:].strip().split(","): dep = dep.split("|") if self.repo == "slacky": if len(dep...
java
public String lookupPrefix(String uri) { String foundPrefix = null; Enumeration prefixes = m_namespaces.keys(); while (prefixes.hasMoreElements()) { String prefix = (String) prefixes.nextElement(); String uri2 = lookupNamespace(prefix); if (uri2 !=...
java
public static void indent(int num, StringBuilder out) { if (num <= SIXTY_FOUR) { out.append(SIXTY_FOUR_SPACES, 0, num); return; } else if (num <= 128){ // avoid initializing loop counters if only one iteration out.append(SIXTY_FOUR_SPACES, 0, SIXTY_FOUR); ...
java
@Override @Transactional(enabled = false) public CommerceDiscountUsageEntry createCommerceDiscountUsageEntry( long commerceDiscountUsageEntryId) { return commerceDiscountUsageEntryPersistence.create(commerceDiscountUsageEntryId); }
java
public static boolean areObjectsEqual(Object a, Object b) { return (a == b) || (a != null && a.equals(b)); }
python
def copyfile(source, dest, backup_mode='', cachedir=''): ''' Copy files from a source to a destination in an atomic way, and if specified cache the file. ''' if not os.path.isfile(source): raise IOError( '[Errno 2] No such file or directory: {0}'.format(source) ) if n...
python
def get_metadata(filename, scan, paramfile='', **kwargs): """ Function to scan data (a small read) and define parameters used elsewhere. filename needs full path. Examples include, read/bgsub windows, image grid, memory profile. If pickle file doesn't exist, it creates one. Either way, dictionary i...
java
public void updateImpl(List<Metric> metrics) { observations[next] = metrics; next = (next + 1) % observations.length; }
python
def label_from_bin(buf): """ Converts binary representation label to integer. :param buf: Binary representation of label. :return: MPLS Label and BoS bit. """ mpls_label = type_desc.Int3.to_user(six.binary_type(buf)) return mpls_label >> 4, mpls_label & 1
java
@Override public double[] getRow() { if (_fr.numRows() != 1) throw new IllegalArgumentException("Trying to get a single row from a multirow frame: " + _fr.numRows() + "!=1"); double res[] = new double[_fr.numCols()]; for (int i = 0; i < _fr.numCols(); ++i) res[i] = _fr.vec(i).at(0); return ...
java
@CrossOrigin(allowedHeaders = {"*"}, origins = {"*"}) @RequestMapping(value = {"{identifier}/manifest", "{identifier}"}, method = RequestMethod.GET, produces = "application/json") @ResponseBody public Manifest getManifest(@PathVariable String identifier, HttpServletRequest request) throws NotFoundExcept...
java
public static String getLeft(String key) { if (key.contains("|") && !key.endsWith("|")) { return key.substring(0, key.indexOf("|")); } else { return key; } }
java
public void apply(HSSFCell cell, HSSFCellStyle cellStyle, Map<String, String> style) { int height = Math.round(CssUtils.getInt(style.get(HEIGHT)) * 255 / 12.75F); HSSFRow row = cell.getRow(); if (height > row.getHeight()) { row.setHeight((short) height); } }
java
final public TsurgeonPattern NodeSelection() throws ParseException { /*@bgen(jjtree) NodeSelection */ SimpleNode jjtn000 = new SimpleNode(JJTNODESELECTION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000);TsurgeonPattern result; try { result = NodeName(); jjtree.closeNodeScope(jjtn000,...
java
@NonNull public IconicsDrawable iconOffsetXRes(@DimenRes int sizeResId) { return iconOffsetXPx(mContext.getResources().getDimensionPixelSize(sizeResId)); }
java
public final Cache2kBuilder<K, V> resilienceDuration(long v, TimeUnit u) { config().setResilienceDuration(u.toMillis(v)); return this; }
python
def Ergun(dp, voidage, vs, rho, mu, L=1): r'''Calculates pressure drop across a packed bed of spheres using a correlation developed in [1]_, as shown in [2]_ and [3]_. Eighteenth most accurate correlation overall in the review of [2]_. Most often presented in the following form: .. math:: ...
python
def refresh(self, url=CONST.DEVICE_URL): """Refresh the devices json object data. Only needed if you're not using the notification service. """ url = url.replace('$DEVID$', self.device_id) response = self._abode.send_request(method="get", url=url) response_object = json...
java
@Override public long getContentSize() { try { if (hasDescriptionProperty(CONTENT_SIZE)) { return getDescriptionProperty(CONTENT_SIZE).getLong(); } } catch (final RepositoryException e) { LOGGER.warn("Could not get contentSize(): {}", e.getMessage(...
python
def WriteSymlink(self, src_arcname, dst_arcname): """Writes a symlink into the archive.""" # Inspired by: # http://www.mail-archive.com/python-list@python.org/msg34223.html if not self._stream: raise ArchiveAlreadyClosedError( "Attempting to write to a ZIP archive that was already close...
java
public OutputStream getNamedPipeOutputStream() throws IOException { if( pipeOut == null ) { if(( pipeType & PIPE_TYPE_CALL ) == PIPE_TYPE_CALL || ( pipeType & PIPE_TYPE_TRANSACT ) == PIPE_TYPE_TRANSACT ) { pipeOut = new TransactNamedPipeOutputStream( this ); ...
python
def deserialize(self, value, **kwargs): """Deserialize the amount. :param value: Amount in CURRENCYAMOUNT or {"currency": CURRENCY, "amount": AMOUNT} format. For example EUR35.50 or {"currency": "EUR", "amount": "35.50"} :return: A paylogic Amount object. :raises Validation...
java
@Override protected void doInitialize() throws ComponentInitializationException { log.debug("Initialized {}", this.getClass().getSimpleName()); if (getMessageContext() == null) { throw new ComponentInitializationException("Message context cannot be null"); } if (getVeloci...
python
def delete_location(self): """Deletes all the `geo:lat` and `geo:long` metadata properties on your Thing """ # normally this should only remove one triple each for s, p, o in self._graph.triples((None, GEO_NS.lat, None)): self._graph.remove((s, p, o)) for s, p, o in s...
python
def format_bar(self): """ Builds the progress bar """ pct = floor(round(self.progress/self.size, 2)*100) pr = floor(pct*.33) bar = "".join( ["‒" for x in range(pr)] + ["↦"] + [" " for o in range(self._barsize-pr-1)]) subprogress = self.format_parent_bar() ...