language
stringclasses
2 values
func_code_string
stringlengths
63
466k
java
protected void subscribeEvent( List topicSpaces, List topics, String busId, Transaction transaction) throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry( tc, "subscribeEvent", new Object[] { topics, topicSpaces, bu...
python
def calc_max_min(ss): """"Calculates (x, y) (max, min) for a list of Spectrum objects. Returns (xmin, xmax, ymin, ymax, xspan, yspan) """ xmin, xmax, ymin, ymax = 1e38, -1e38, 1e38, -1e38 for s in ss: assert isinstance(s, ft.Spectrum) if len(s.x) > 0: xmin, xmax = min(mi...
python
def get_hyperpath_from_predecessors(H, Pv, source_node, destination_node, node_weights=None, attr_name="weight"): """Gives the hyperpath (DirectedHypergraph) representing the shortest B-hyperpath from the source to the destination, given a predecessor function and source ...
java
public <T> T getJsonData(Class<T> clazz, RemoteUrl remoteUrl, int retryTimes, int retrySleepSeconds) throws Exception { Exception ex = null; for (URL url : remoteUrl.getUrls()) { // 可重试的下载 UnreliableInterface unreliableImpl = new RestfulGet<T>(clazz, url); ...
python
def locate_resource(name, lang, filter=None): """Return filename that contains specific language resource name. Args: name (string): Name of the resource. lang (string): language code to be loaded. """ task_dir = resource_dir.get(name, name) package_id = u"{}.{}".format(task_dir, lang) p = path.joi...
java
protected ImageDescriptor handleImageDescriptorError(Object[] params, Throwable exception) { if (exception instanceof NullPointerException) { final Object defaultImage = getDefaultImage(); if (defaultImage instanceof ImageDescriptor) { return (ImageDescriptor) defaultImage; } if (defaultImage instance...
java
public void finishExpr(final INodeReadTrx mTransaction, final int mNum) { // all singleExpression that are on the stack will be combined in the // sequence, so the number of singleExpressions in the sequence and the // size // of the stack containing these SingleExpressions have to be t...
java
protected final String getBirthDate(final Person person) { final GetDateVisitor visitor = new GetDateVisitor("Birth"); person.accept(visitor); return visitor.getDate(); }
java
@XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "minutes") public JAXBElement<Integer> createMinutes(Integer value) { return new JAXBElement<Integer>(_Minutes_QNAME, Integer.class, null, value); }
java
public IntMomentStatistics combine(final IntMomentStatistics other) { super.combine(other); _min = Math.min(_min, other._min); _max = Math.max(_max, other._max); _sum += other._sum; return this; }
python
def make_url(self, method): """ Generate a Telegram URL for this bot. """ token = self.settings()['token'] return TELEGRAM_URL.format( token=quote(token), method=quote(method), )
python
def _create_subplots(self, layout, positions, layout_dimensions, ranges, axes={}, num=1, create=True): """ Plot all the views contained in the AdjointLayout Object using axes appropriate to the layout configuration. All the axes are supplied by LayoutPlot - the purpose of the call is to ...
java
private void writeFieldBegin(OutputStream result) throws IOException { result.write(OPEN_GROUP); result.write(FIELD); if(fieldDirty) result.write(FIELD_DIRTY); if(fieldEdit) result.write(FIELD_EDIT); if(fieldLocked) result.write(FIELD_LOCKED); if(fieldPrivate) result...
java
public int run(String[] args) { try { copy(conf, Arguments.valueOf(args, conf)); return 0; } catch (IllegalArgumentException e) { System.err.println(StringUtils.stringifyException(e) + "\n" + usage); ToolRunner.printGenericCommandUsage(System.err); return -1; } catch (InvalidIn...
python
def format_ring_double_bond(mol): """Set double bonds around the ring. """ mol.require("Topology") mol.require("ScaleAndCenter") for r in sorted(mol.rings, key=len, reverse=True): vertices = [mol.atom(n).coords for n in r] try: if geometry.is_clockwise(vertices): ...
python
def to_python(self): """The string ``'True'`` (case insensitive) will be converted to ``True``, as will any positive integers. """ if isinstance(self.data, str): return self.data.strip().lower() == 'true' if isinstance(self.data, int): return self.data > ...
python
def list_objects(self, prefix=None, delimiter=None): """ List the objects for this bucket. :param str prefix: If specified, only objects that start with this prefix are listed. :param str delimiter: If specified, return only objects whose name ...
java
public DbxDownloadStyleBuilder<R> range(long start) { if (start < 0) throw new IllegalArgumentException("start must be non-negative"); this.start = start; this.length = null; return this; }
java
void fireMemberAdded(AsteriskQueueMemberImpl member) { synchronized (listeners) { for (AsteriskQueueListener listener : listeners) { try { listener.onMemberAdded(member); } catch (Exception e)...
python
def ratio_and_percentage(current, total, time_remaining): """Returns the progress ratio and percentage.""" return "{} / {} ({}% completed)".format(current, total, int(current / total * 100))
python
def get_verse(self, v=1): """Get a specific verse.""" verse_count = len(self.verses) if v - 1 < verse_count: return self.verses[v - 1]
python
def get_number_of_messages_in_topics(self, topics): """Retrun number of messages in topics. - ``topics`` (list): list of topics. """ if not isinstance(topics, list): topics = [topics] number_of_messages = 0 for t in topics: part = self.g...
java
public Observable<List<TypeFieldInner>> listFieldsByTypeAsync(String resourceGroupName, String automationAccountName, String typeName) { return listFieldsByTypeWithServiceResponseAsync(resourceGroupName, automationAccountName, typeName).map(new Func1<ServiceResponse<List<TypeFieldInner>>, List<TypeFieldInner>>(...
python
def http_auth(self): """ Returns ``True`` if valid http auth credentials are found in the request header. """ if 'HTTP_AUTHORIZATION' in self.request.META.keys(): authmeth, auth = self.request.META['HTTP_AUTHORIZATION'].split( ' ', 1) if a...
java
public void startImpl(Result<I> result) { DeployFactory2<I> builder = builder(); if (builder == null) { result.ok(null); return; } if (! _lifecycle.toStarting()) { result.ok(_instance); return; } I deployInstance = null; boolean isActive = false; ...
java
@Nonnull public static String standardizeSlashes(@Nonnull final String pPath) { final String goodSlash = File.separator; final String badSlash = File.separatorChar == '/' ? "\\" : "/"; // The JDK also assumes there are only these two options. String result = pPath.replaceAll(Patt...
java
public CounterManagerConfigurationBuilder reliability(Reliability reliability) { attributes.attribute(CounterManagerConfiguration.RELIABILITY).set(reliability); return this; }
python
def uninstall(ctx, module_list): """ uninstall module """ modules.uninstall(ctx, module_list) ctx.log_line(u'Deprecated: use anthem.lyrics.modules.uninstall instead of ' 'anthem.lyrics.uninstaller.uninstall')
python
def visit_FunctionCall(self, node): """Visitor for `FunctionCall` AST node.""" call = self.memory[node.identifier.name]._node args = [self.visit(parameter) for parameter in node.parameters] if isinstance(call, AST): current_scope = self.memory.stack.current.current ...
java
@Override public void recoveryComplete(byte[] serviceData) throws LogClosedException, InternalLogException, LogIncompatibleException { if (tc.isEntryEnabled()) Tr.entry(tc, "recoveryComplete", new java.lang.Object[] { RLSUtils.toHexString(serviceData, RLSUtils.MAX_DISPLAY_BYTES), this }); ...
java
public static void main(String[] arg) { try { for (int i = 0; i < arg.length; i++) new XmlConfiguration(Resource.newResource(arg[i]).getURL()).newInstance(); } catch (Exception e) { log.warn(LogSupport.EXCEPTION, e); } }
java
public static LogRecord create(SitLogger logger, ElementPosition position, TestStep testStep, String messageKey, Object... params) { String msg = MessageManager.getMessage(messageKey, params); logger.infoMsg(msg); return new LogRecord(testStep.getNo(), msg, position); ...
python
def parse_sampleinfo(data: dict) -> dict: """Parse MIP sample info file. Args: data (dict): raw YAML input from MIP qc sample info file Returns: dict: parsed data """ genome_build = data['human_genome_build'] genome_build_str = f"{genome_build['source']}{genome_build['version'...
java
@CallSuper @Override protected void onDestroy() { views.onCompleted(); subscriptions.unsubscribe(); for (Map.Entry<Integer, Subscription> entry : restartableSubscriptions.entrySet()) entry.getValue().unsubscribe(); }
java
private String getLocalDownloadDirPath() throws Exception { String localUrl = localDownloadDir; if (!new File(localUrl).exists()) { new File(localUrl).mkdirs(); } return localUrl; }
python
def load_remote_molecule(url, format=None): '''Load a molecule from the remote location specified by *url*. **Example** :: load_remote_molecule('https://raw.github.com/chemlab/chemlab-testdata/master/benzene.mol') ''' filename, headers = urlretrieve(url) return load_molecule(filename...
python
def create_api_call_func(api, verb): """ From an api definition object create the related api call method that will validate the arguments for the api call and then dynamically dispatch the request to the appropriate requests module convenience method for the specific HTTP verb . """ # Scop...
python
def _get_column_for_change(self, table, fluent): """ Get the column instance for a column change. :type table: orator.dbal.table.Table :rtype: orator.dbal.column.Column """ return table.change_column( fluent.name, self._get_column_change_options(fluent) ...
java
public void setValue(String fieldName, String value) { int index = getFieldIndex(fieldName); assert(index != -1); values[index] = value; }
python
def get_illuminant_xyz(self, observer=None, illuminant=None): """ :param str observer: Get the XYZ values for another observer angle. Must be either '2' or '10'. :param str illuminant: Get the XYZ values for another illuminant. :returns: the color's illuminant's XYZ values. ...
java
private JSONArray addValue( Object value, JsonConfig jsonConfig ) { return _addValue( processValue( value, jsonConfig ), jsonConfig ); }
java
@NonNull public static Expression atan2(@NonNull Expression x, @NonNull Expression y) { if (x == null || y == null) { throw new IllegalArgumentException("x and y cannot be null."); } return new Expression.FunctionExpression("ATAN2()", Arrays.asList(x, y)); }
java
int getNumStorageDirs(NameNodeDirType dirType) { if(dirType == null) return getNumStorageDirs(); Iterator<StorageDirectory> it = dirIterator(dirType); int numDirs = 0; for(; it.hasNext(); it.next()) numDirs++; return numDirs; }
java
private JavaSerializer getJavaSerializerIfRequired (Class type) { JavaSerializer javaSerializer = getCachedSerializer(type); if (javaSerializer == null && isJavaSerializerRequired(type)) javaSerializer = new JavaSerializer(); return javaSerializer; }
python
def parse_connection_string(value): """Original Governor stores connection strings for each cluster members if a following format: postgres://{username}:{password}@{connect_address}/postgres Since each of our patroni instances provides own REST API endpoint it's good to store this information in DCS...
python
def channel_ready_future(channel): """Creates a Future that tracks when a Channel is ready. Cancelling the Future does not affect the channel's state machine. It merely decouples the Future from channel state machine. Args: channel: A Channel object. Returns: A Future object that matures when the...
python
def FSharpInstallDir(self): """ Microsoft Visual F# directory. """ path = r'%0.1f\Setup\F#' % self.vc_ver path = os.path.join(self.ri.visualstudio, path) return self.ri.lookup(path, 'productdir') or ''
java
public double interpolate(double... x) { if (x.length != this.x[0].length) { throw new IllegalArgumentException(String.format("Invalid input vector size: %d, expected: %d", x.length, this.x[0].length)); } int n = this.x.length; for (int i = 0; i < n; i++) { vstar...
python
def rules(cls, attr=None): """Iterable of rule names used by :meth:`create` Args: attr (None or str): Name of the class attribute to which to get the names. If None, one of ``'_rules'``, ``'_binary_rules'`` is automatically chosen """ try: ...
java
public synchronized ScheduledFuture scheduleTimeout(final int sequenceNumber, long time, TimeUnit unit) { if (!files.containsKey(sequenceNumber)) return null; ScheduledFuture future = timeoutExecutor.schedule(new Runnable() { public void run() { ...
python
def update_vnic_template(self, host_id, vlan_id, physnet, vnic_template_path, vnic_template): """Updates VNIC Template with the vlan_id.""" ucsm_ip = self.get_ucsm_ip_for_host(host_id) if not ucsm_ip: LOG.info('UCS Manager network driver does not have UCSM IP ' ...
java
@Override public List<Map<INode, IAtom>> getMaps(IAtomContainer target) { IState state = new VFState(query, new TargetProperties(target)); maps.clear(); mapAll(state); return new ArrayList<Map<INode, IAtom>>(maps); }
python
def p_argument_list(self, p): """argument_list : assignment_expr | argument_list COMMA assignment_expr """ if len(p) == 2: p[0] = [p[1]] else: p[1].append(p[3]) p[0] = p[1]
python
def drawCircle(page, center, radius, color=None, fill=None, morph=None, dashes=None, width=1, roundCap=False, overlay=True): """Draw a circle given its center and radius. """ img = page.newShape() Q = img.drawCircle(Point(center), radius) img.finish(color=color, fill=fi...
java
public static int getBiggestPrime(long value) { for (int i = PRIMES.length - 1; i >= 0; i--) { if (PRIMES[i] <= value) { return PRIMES[i]; } } return 2; }
python
def _fail_if_contains_errors(response, sync_uuid=None): """Raise a RequestError Exception if a given response does not denote a successful request. """ if response.status_code != _HTTP_OK: raise RequestError(response) response_json = response.json() if sync_uuid and 'sync_status' in resp...
java
private File getValidDir(final String varName, final String dirName) { if (dirName == null) { throw new RuntimeException("The system variable '" + varName + "' is not set!"); } final File dir = new File(dirName); if (!dir.exists()) { throw new IllegalArgumen...
java
private void parse(State state, final String uri, final int offset, final int end) { boolean encoded = false; int mark = offset; int path_mark = 0; for (int i = offset; i < end; i++) { char c = uri.charAt(i); switch (state) { case START: { ...
python
def read(path, loadjs=False, session=None, driver=None, timeout=60, clear_cookies=True, loadjs_wait_time=3, loadjs_wait_for_callback=None): """Reads from source and returns contents Args: path: (str) url or local path to download loadjs: (boolean) indicates whether to load js (optio...
python
def browse(self, ms_item=None): """Return the sub-elements of item or of the root if item is None :param item: Instance of sub-class of :py:class:`soco.data_structures.MusicServiceItem`. This object must have item_id, service_id and extended_id properties Note: ...
python
def output(self, kind, line): "*line* should be bytes" self.destination.write(b''.join([ self._cyan, b't=%07d' % (time.time() - self._t0), self._reset, self._kind_prefixes[kind], self.markers[kind], line, self._reset, ...
python
def scale(self, width: int, height: int) -> None: """Scale this Image to the new width and height. Args: width (int): The new width of the Image after scaling. height (int): The new height of the Image after scaling. """ lib.TCOD_image_scale(self.image_c, width, ...
python
def cmd(self, args=None, interact=True): """Process command-line arguments.""" if args is None: parsed_args = arguments.parse_args() else: parsed_args = arguments.parse_args(args) self.exit_code = 0 with self.handling_exceptions(): self.use_arg...
python
def parse_image_response(self, response): """ Parse a single object from the RETS feed :param response: The response from the RETS server :return: Object """ if 'xml' in response.headers.get('Content-Type'): # Got an XML response, likely an error code. ...
python
def runserver(hostname, port, no_reloader, debugger, no_evalex, threaded, processes): """Start a new development server.""" app = make_app() reloader = not no_reloader evalex = not no_evalex run_simple( hostname, port, app, use_reloader=reloader, use_debugger=...
java
protected void createEncoding() { if (encoding.startsWith("#")) { specialMap = new IntHashtable(); StringTokenizer tok = new StringTokenizer(encoding.substring(1), " ,\t\n\r\f"); if (tok.nextToken().equals("full")) { while (tok.hasMoreTokens()) { ...
java
@Override public boolean add(Interval<T> interval){ if (interval.isEmpty()) return false; int sizeBeforeOperation = size; root = TreeNode.addInterval(this, root, interval); return size == sizeBeforeOperation; }
python
def sections(self): """ Get the sections of the report and howto build them. :return: a dict with the method to be called to fill each section of the report """ secs = OrderedDict() secs['Overview'] = self.sec_overview secs['Communication Channels'] = self.sec_co...
python
def get_estimator(self): """return the configured estimator as string from initial parameters""" mav_type = self._ulog.initial_parameters.get('MAV_TYPE', None) if mav_type == 1: # fixed wing always uses EKF2 return 'EKF2' mc_est_group = self._ulog.initial_parameters.get('SY...
java
public int getElementId() { if (DocumentElement_Type.featOkTst && ((DocumentElement_Type)jcasType).casFeat_ElementId == null) jcasType.jcas.throwFeatMissing("ElementId", "ch.epfl.bbp.uima.types.DocumentElement"); return jcasType.ll_cas.ll_getIntValue(addr, ((DocumentElement_Type)jcasType).casFeatCode_Elem...
python
def calculate_ts_mac(ts, credentials): """Calculates a message authorization code (MAC) for a timestamp.""" normalized = ('hawk.{hawk_ver}.ts\n{ts}\n' .format(hawk_ver=HAWK_VER, ts=ts)) log.debug(u'normalized resource for ts mac calc: {norm}' .format(norm=normalized)) dig...
python
def load_rsa_public_key_file(rsakeyfile): # type: (str, str) -> # cryptography.hazmat.primitives.asymmetric.rsa.RSAPublicKey """Load an RSA Public key PEM file :param str rsakeyfile: RSA public key PEM file to load :rtype: cryptography.hazmat.primitives.asymmetric.rsa.RSAPublicKey :return...
python
def value(self, name): """get value of a track at the current time""" return self.tracks.get(name).row_value(self.controller.row)
python
def invert(dict_): """Return an inverted dictionary, where former values are keys and former keys are values. .. warning:: If more than one key maps to any given value in input dictionary, it is undefined which one will be chosen for the result. :param dict_: Dictionary to swap keys a...
python
def normalize(A, axis=None, inplace=False): """ Normalize the input array so that it sums to 1. Parameters ---------- A: array, shape (n_samples, n_features) Non-normalized input data. axis: int Dimension along which normalization is performed. Returns ------- norma...
java
public LicenseType copy() { return new LicenseTypeImpl(CopyUtil.cloneList(description), licenseRequired, CopyUtil.cloneString(id), CopyUtil.cloneString(licReqId)); }
java
public byte[] decode(byte data[], byte uncompData[], int h) { if(data[0] == (byte)0x00 && data[1] == (byte)0x01) { throw new UnsupportedOperationException("TIFF 5.0-style LZW codes are not supported."); } initializeStringTable(); this.data = data; ...
python
def get_hit(self, hitid): ''' Get HIT ''' if not self.connect_to_turk(): return False try: hitdata = self.mtc.get_hit(HITId=hitid) except Exception as e: print e return False return hitdata['HIT']
python
def get_permissions(self, grp_name, resource): """ Get permissions associated the group has with the given resource. Args: grp_name (string): Name of group. resource (intern.resource.boss.Resource): Identifies which data model object to operate on. ...
java
public ServiceFuture<FirewallRuleInner> getFirewallRuleAsync(String resourceGroupName, String accountName, String firewallRuleName, final ServiceCallback<FirewallRuleInner> serviceCallback) { return ServiceFuture.fromResponse(getFirewallRuleWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleNa...
java
public int remove(Object key) { if (key == null) key = NULL_KEY; int hash = key.hashCode() & _mask; synchronized (this) { Item prev = null; for (Item item = _entries[hash]; item != null; item = item._next) { Object itemKey = item._key; if (itemKey == key || itemK...
java
private static CSLDate merge(CSLDate d1, CSLDate d2) { if (d1 == null) { return d2; } else if (d2 == null) { return d1; } CSLDateBuilder builder = new CSLDateBuilder(); //handle date parts builder.dateParts(d1.getDateParts()[0], d2.getDateParts()[d2.getDateParts().length - 1]); //handle cir...
java
@Override public Object resolveForObjectAndContext(Object self, Context context) { return ReflectionUtils.getField(self, this.propertyName); }
java
public static <W extends Collection<Optional<T>>, T> Iterator<W> centered(int windowSize, Iterator<T> iterator, Supplier<W> supplier) { return new CenteredWindowIterator<W, T>(iterator, windowSize, supplier); }
python
def fft(ts): """ Perform a fast-fourier transform on a Trace """ t_step = ts.index[1] - ts.index[0] oc = np.abs(np.fft.fftshift(np.fft.fft(ts.values))) / len(ts.values) t = np.fft.fftshift(np.fft.fftfreq(len(oc), d=t_step)) return Trace(oc, t)
java
public HttpUrl url() { HttpUrl.Builder urlBuilder = HttpUrl.parse(baseUrl()).newBuilder() .addPathSegment("styles") .addPathSegment("v1") .addPathSegment(user()) .addPathSegment(styleId()) .addPathSegment("static") .addQueryParameter("access_token", accessToken()); List<Stri...
java
protected String getContentAsString(CmsFile file) throws CmsException { CmsProperty p = m_cms.readPropertyObject(file, CmsPropertyDefinition.PROPERTY_CONTENT_ENCODING, true); String e = p.getValue(); if (e == null) { e = OpenCms.getSystemInfo().getDefaultEncoding(); } ...
java
public static void addMember(TypeDeclaration type, BodyDeclaration decl) { List<BodyDeclaration> members = type.getMembers(); if (members == null) { members = new ArrayList<BodyDeclaration>(); type.setMembers(members); } members.add(decl); }
python
def run(self): """Sends data to the callback functions.""" while True: result = json.loads(self.ws.recv()) if result["cmd"] == "chat" and not result["nick"] == self.nick: for handler in list(self.on_message): handler(self, result["text"], resul...
python
def _configure_send(self, request, **kwargs): # type: (ClientRequest, Any) -> Dict[str, str] """Configure the kwargs to use with requests. See "send" for kwargs details. :param ClientRequest request: The request object to be sent. :returns: The requests.Session.request kwargs ...
python
def download_ncbi_associations(gene2go="gene2go", prt=sys.stdout, loading_bar=True): """Download associations from NCBI, if necessary""" # Download: ftp://ftp.ncbi.nlm.nih.gov/gene/DATA/gene2go.gz gzip_file = "{GENE2GO}.gz".format(GENE2GO=gene2go) if not os.path.isfile(gene2go): file_remote = "f...
python
def computeStatistics(tped, tfam, snps): """Computes the completion and concordance of each SNPs. :param tped: a representation of the ``tped``. :param tfam: a representation of the ``tfam`` :param snps: the position of the duplicated markers in the ``tped``. :type tped: numpy.array :type tfam...
python
def get_ve_base(self, environ): """Find a directory to look for virtualenvs in. """ # set ve_base to a path we can look for virtualenvs: # 1. .vexrc # 2. WORKON_HOME (as defined for virtualenvwrapper's benefit) # 3. $HOME/.virtualenvs # (unless we got --path, then...
python
def _build_relations_config(self, yamlconfig): """Builds a dictionary from relations configuration while maintaining compatibility """ config = {} for element in yamlconfig: if isinstance(element, str): config[element] = {'relation_name': element, 'schemas': [...
java
Rule TexText() { return ZeroOrMore( FirstOf(WSP(), CharRange('!', '$'), //exclude % which is comment ? '%', CharRange('&', '['), //exclude \ which is tex escape CharRange(']', '~'), LatinExtendedAndOtherAlphabet(), TexEscape()) ).label(TexText).suppressSubnod...
python
def _next_page(self): """Get the next page in the iterator. Returns: Optional[Page]: The next page in the iterator or :data:`None` if there are no pages left. """ if self._has_next_page(): response = self._get_next_page_response() item...
java
@RequestMapping(value = "api/group", method = RequestMethod.GET) public @ResponseBody HashMap<String, Object> getAllGroups(Model model) { return Utils.getJQGridJSON(pathOverrideService.findAllGroups(), "groups"); }
python
def _set_dscp(self, v, load=False): """ Setter method for dscp, mapped from YANG variable /ipv6_acl/ipv6/access_list/extended/seq/dscp (union) If this variable is read-only (config: false) in the source YANG file, then _set_dscp is considered as a private method. Backends looking to populate this va...
python
def get_all_children(self): """ Returns all children recursively """ my_children = self.get_children_list() children = [] children.extend(my_children) for child in my_children: children.extend(child.get_all_children()) return children
python
async def stop(self): """Stop heartbeat.""" self.stopped = True self.loop_event.set() # Waiting for shutdown of loop() await self.stopped_event.wait()