language
stringclasses
2 values
func_code_string
stringlengths
63
466k
java
private void compactLogs(long compactIndex) { raft.getThreadContext().execute(() -> { logger.debug("Compacting logs up to index {}", compactIndex); try { raft.getLog().compact(compactIndex); } catch (Exception e) { logger.error("An exception occurred during log compaction: {}", e);...
java
@Override boolean isInputMappingDefined() { return super.isInputMappingDefined() || options.mappingFile.isPresent() || options.mappingGraph.isPresent() || options.mappingReader.isPresent(); }
python
def LoadFromFile(cls, script_path): """Import a virtual tile from a file rather than an installed module script_path must point to a python file ending in .py that contains exactly one VirtualTile class definition. That class is loaded and executed as if it were installed. To ...
java
public Transition<NFAState<T>> addTransition(CharRange condition, NFAState<T> to) { Transition<NFAState<T>> t = new Transition<>(condition, this, to); Set<Transition<NFAState<T>>> set = transitions.get(t.getCondition()); if (set == null) { set = new HashSet<>(); ...
java
public static double[] multiply(double[] a, double c) { double[] result = new double[a.length]; for (int i = 0; i < a.length; i++) { result[i] = a[i] * c; } return result; }
python
def pct_encode(s, encdct): """ Return a translated version of s where each character is mapped to a string thanks to the encdct dictionary. Use the encdct parameter to construct a string from parameter s where each character k from s is replaced by the value corresponding to key k in encdct. I...
python
def calculate_simple_interest(entries, rate_pct: Decimal, interest_date: date or None=None, begin: date or None=None) -> Decimal: """ Calculates simple interest of specified entries over time. Does not accumulate interest to interest. :param entries: AccountEntry iterable (e.g. list/QuerySet) ordered by...
python
def calc_steady_state_dist(R): """Calculate the steady state dist of a 4 state markov transition matrix. Parameters ---------- R : ndarray Markov transition matrix Returns ------- p_ss : ndarray Steady state probability distribution """ #Calc steady state d...
python
def solve(self, printmat=0, sendback=0, silent=False): '''Compute solution''' # Initialize elements self.initialize() # Compute number of equations self.neq = np.sum([e.nunknowns for e in self.elementlist]) if self.neq == 0: return if silent is False: ...
python
def session(connection_string=None): """Gets a SQLAlchemy session""" global _session_makers connection_string = connection_string or oz.settings["db"] if not connection_string in _session_makers: _session_makers[connection_string] = sessionmaker(bind=engine(connection_string=connection_string))...
java
private void build(final LoadableImageData data, final ByteBuffer imageBuffer, int filter, int tileSize) { final int dataWidth = data.getTexWidth(); final int dataHeight = data.getTexHeight(); realWidth = width = data.getWidth(); realHeight = height = data.getHeight(); if ((dataWidth <= tileSize)...
python
def parse(s): """Parse the output below to create a new StopWatch.""" stopwatch = StopWatch() for line in s.splitlines(): if line.strip(): parts = line.split(None) name = parts[0] if name != "%": # ie not the header line rest = (float(v) for v in parts[2:]) ...
python
def acquire(self, blocking=True, timeout=None): """ :param blocking: Boolean value specifying whether lock should be blocking or not. :param timeout: An integer value specifying the maximum number of seconds to block. """ logger.debug("Getting %r ...", sel...
python
def article_id_list(soup): """return a list of article-id data""" id_list = [] for article_id_tag in raw_parser.article_id(soup): id_details = OrderedDict() set_if_value(id_details, "type", article_id_tag.get("pub-id-type")) set_if_value(id_details, "value", article_id_tag.text) ...
java
protected void checkFrozen() throws CmsIllegalArgumentException { if (m_frozen) { throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_MODULE_FROZEN_1, getName())); } }
python
def combinations(seq, k): """ Return j length subsequences of elements from the input iterable. This version uses Numpy/Scipy and should be preferred over itertools. It avoids the creation of all intermediate Python objects. Examples -------- >>> import numpy as np >>> from itertools impo...
java
private byte[] stripWhiteSpaces(byte[] data) { ByteArrayOutputStream bos = new ByteArrayOutputStream(); for (byte b : data) { if (!WHITESPACES.contains(b)) { bos.write(b); } } return bos.toByteArray(); }
java
public void setNetworkDestinationIpV4(java.util.Collection<IpFilter> networkDestinationIpV4) { if (networkDestinationIpV4 == null) { this.networkDestinationIpV4 = null; return; } this.networkDestinationIpV4 = new java.util.ArrayList<IpFilter>(networkDestinationIpV4); ...
java
public static <T> T withReader(Reader reader, @ClosureParams(FirstParam.class) Closure<T> closure) throws IOException { try { T result = closure.call(reader); Reader temp = reader; reader = null; temp.close(); return result; } finally { ...
java
public static IOException createCompositeException(Collection<IOException> innerExceptions) { checkArgument( innerExceptions != null && !innerExceptions.isEmpty(), "innerExceptions (%s) must be not null and contain at least one element", innerExceptions); Iterator<IOException> innerExceptionIte...
python
def ias60(msg): """Indicated airspeed Args: msg (String): 28 bytes hexadecimal message (BDS60) string Returns: int: indicated airspeed in knots """ d = hex2bin(data(msg)) if d[12] == '0': return None ias = bin2int(d[13:23]) # kts return ias
java
@Deprecated public java.util.List<String> getIpRanges() { if (ipv4Ranges == null) { ipv4Ranges = new com.amazonaws.internal.SdkInternalList<IpRange>(); } return newLegacyIpRangeList(ipv4Ranges); }
python
def shell_exec(command, **kwargs): # from gitapi.py """Excecutes the given command silently. """ proc = Popen(shlex.split(command), stdout=PIPE, stderr=PIPE, **kwargs) out, err = [x.decode("utf-8") for x in proc.communicate()] return {'out': out, 'err': err, 'code': proc.returncode}
java
private CumulativeTrainee getCumulativeTrainee( BudgetSummaryDto budgetSummaryData) { CumulativeTrainee cumulativeTrainee = CumulativeTrainee.Factory .newInstance(); cumulativeTrainee .setCumulativeTotalFundsRequestedTraineeCosts(BigDecimal.ZERO); if (budgetSummaryData != null) { cumulativeTrainee ...
java
public static Drawable getSelectableItemBackgroundBorderless(Context ctx){ int[] attrs = new int[] { R.attr.selectableItemBackgroundBorderless /* index 0 */}; TypedArray ta = ctx.obtainStyledAttributes(attrs); Drawable drawableFromTheme = ta.getDrawable(0 /* index */); ta.recycle(); ...
python
def _guess_simprocedure(self, f, hint): """ Does symbol name `f` exist as a SIM_PROCEDURE? If so, return it, else return None. Narrows down the set of libraries to search based on hint. Part of the hack to enable Binary Ninja support. Remove if _register_objects() stops using it. ...
java
public ScriptEngine getScriptEngineForName(String scriptEngineName, boolean cache) { if(processApplicationScriptEngineResolver == null) { synchronized (this) { if(processApplicationScriptEngineResolver == null) { processApplicationScriptEngineResolver = new ScriptEngineResolver(new ScriptEng...
python
def _is_word_type(token_type): """Return true if this is a word-type token.""" return token_type in [TokenType.Word, TokenType.QuotedLiteral, TokenType.UnquotedLiteral, TokenType.Number, TokenType.Deref]
java
public void setTargetGroupARNs(java.util.Collection<String> targetGroupARNs) { if (targetGroupARNs == null) { this.targetGroupARNs = null; return; } this.targetGroupARNs = new com.amazonaws.internal.SdkInternalList<String>(targetGroupARNs); }
java
@SuppressWarnings("unchecked") public Set<RateType> getRateTypes() { Set<RateType> result = get(KEY_RATE_TYPES, Set.class); if (result == null) { return Collections.emptySet(); } return result; }
java
@TargetApi(Build.VERSION_CODES.HONEYCOMB) public static int getType(Cursor cursor, String columnName) { if (cursor == null) { return Cursor.FIELD_TYPE_NULL; } return cursor.getType(cursor.getColumnIndex(columnName)); }
java
public void proxyTo(final List<? extends URI> uris) { for (URI uri : uris) { if(uri == null) { throw new NullPointerException("URI can't be null"); } if(!JainSipUtils.checkScheme(uri.toString())) { throw new IllegalArgumentException("Scheme " + uri.getScheme() + " is not supported"); } ...
java
public void addAllOfFromTo(AbstractLongList other, int from, int to) { beforeInsertAllOfFromTo(size,other,from,to); }
python
def build_request(self): """Build a prepared request object.""" clientheaders = {} if (self.parent_url and self.parent_url.lower().startswith(HTTP_SCHEMAS)): clientheaders["Referer"] = self.parent_url kwargs = dict( method='GET', url=self.u...
java
public List<Vulnerability> load(Locale locale) { List<String> filenames = getListOfVulnerabilitiesFiles(); String extension = fileExtension; if (extension.startsWith(".")) { extension = extension.substring(1); } List<Vulnerability> vulnerabilities = LocaleUtils.findResource(fileName, extension, loc...
python
def stratify(self): """ Stratifies the sample based on propensity score. By default the sample is divided into five equal-sized bins. The number of bins can be set by modifying the object attribute named blocks. Alternatively, custom-sized bins can be created by setting blocks equal to a sorted list of ...
python
def _call_geocoder( self, url, timeout=DEFAULT_SENTINEL, raw=False, requester=None, deserializer=json.loads, **kwargs ): """ For a generated query URL, get the results. """ if requester: ...
python
def get_items_as_list(items,keys,items_names='styles'): """ Returns a dict with an item per key Parameters: ----------- items : string, list or dict Items (ie line styles) keys: list List of keys items_names : string Name of items """ if type(items)!=dict: if type(items)==list: if len(items...
java
private void init(List<Mentsu> winCandidate, Toitsu toitsu) { // ζ“δ½œε€‰ζ•°γ‚’εˆζœŸεŒ– initStock(); winCandidate.clear(); //γ‚Ήγƒˆγƒƒγ‚―γ‹γ‚‰ι›€ι ­γ‚’ζΈ›γ‚‰γ™ handStocks[toitsu.getTile().getCode()] -= 2; winCandidate.add(toitsu); }
java
public void billingAccount_transferSecurityDeposit_POST(String billingAccount, Long amount, String billingAccountDestination) throws IOException { String qPath = "/telephony/{billingAccount}/transferSecurityDeposit"; StringBuilder sb = path(qPath, billingAccount); HashMap<String, Object>o = new HashMap<String, Ob...
java
public String getViewId(FacesContext context, String fromAction, String outcome) { return this.getNavigationCase(context, fromAction, outcome).getToViewId(context); }
python
def maybe_start_recording(tokens, index): """Return a new _InlineRSTRecorder when its time to record.""" if tokens[index].type == TokenType.BeginInlineRST: return _InlineRSTRecorder(index)
java
@Override public void eSet(int featureID, Object newValue) { switch (featureID) { case AfplibPackage.RESOURCE_SECTION_NUMBER__RES_SNUM: setResSNum((Integer)newValue); return; } super.eSet(featureID, newValue); }
python
def smsc(self, smscNumber): """ Set the default SMSC number to use when sending SMS messages """ if smscNumber != self._smscNumber: if self.alive: self.write('AT+CSCA="{0}"'.format(smscNumber)) self._smscNumber = smscNumber
python
def get_output_ref(self, field, index=None, metadata=None): ''' :param field: Output field name of this analysis :type field: string :param index: If the referenced field is an array, optionally specify an index (starting from 0) to indicate a particular member of the array :type...
java
private @Nullable FileInfo getShardFileInfo(File file) { FileInfo info = FileInfo.fromFile(file); if (info == null) { return null; // file with incorrect name/extension } File expectedDirectory = getSubdirectory(info.resourceId); boolean isCorrect = expectedDirectory.equals(file.getParentFile(...
java
@SuppressWarnings("unchecked") public static JobManagerProfiler loadJobManagerProfiler(String profilerClassName, InetAddress jobManagerBindAddress) { final Class<? extends JobManagerProfiler> profilerClass; try { profilerClass = (Class<? extends JobManagerProfiler>) Class.forName(profilerClassName); } catch ...
java
public static String resolveUrl(String baseUrl, String url, String defaultValue) { for(final String scheme : ALL_SCHEMES) { if(url.startsWith(scheme)) { try { return UsableURIFactory.getInstance(url).getEscapedURI(); } catch (URIException e) { LOGGER.warning(e.getLocalizedMessage() + ": " + ...
python
def map(self, mapper: Callable[[Any], Any]) -> 'List': """Map a function over a List.""" try: ret = List.from_iterable([mapper(x) for x in self]) except TypeError: ret = List.from_iterable([partial(mapper, x) for x in self]) return ret
python
def create_index(self, key, reindex=True, sparse=False): """ Creates an index if it does not exist then performs a full reindex for this collection """ warnings.warn('Index support is currently very alpha and is not guaranteed') if isinstance(key, (list, tuple)): inde...
python
def margin_logit_loss(model_logits, label, nb_classes=10, num_classes=None): """Computes difference between logit for `label` and next highest logit. The loss is high when `label` is unlikely (targeted by default). This follows the same interface as `loss_fn` for TensorOptimizer and projected_optimization, i.e...
python
def subnet_present(name, address_prefix, virtual_network, resource_group, security_group=None, route_table=None, connection_auth=None, **kwargs): ''' .. versionadded:: 2019.2.0 Ensure a subnet exists. :param name: Name of the subnet. :param address_prefix: A CID...
java
public Observable<AppInner> beginCreateOrUpdateAsync(String resourceGroupName, String resourceName, AppInner app) { return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, app).map(new Func1<ServiceResponse<AppInner>, AppInner>() { @Override public AppInner ca...
python
def is_hash_in_index(self, filehash): """ Check if there is a document using this file hash """ filehash = (u"%X" % filehash) results = self.__searcher.search( whoosh.query.Term('docfilehash', filehash)) return bool(results)
java
protected void visitChildrenSkipFirst(SuperNode node) { boolean first = true; for (Node child : node.getChildren()) { if (!first) child.accept(this); first = false; } }
python
def set_settings(self, settings): """ Set every given settings as object attributes. Args: settings (dict): Dictionnary of settings. """ for k, v in settings.items(): setattr(self, k, v)
java
public static CommercePriceEntry findByCompanyId_First(long companyId, OrderByComparator<CommercePriceEntry> orderByComparator) throws com.liferay.commerce.price.list.exception.NoSuchPriceEntryException { return getPersistence() .findByCompanyId_First(companyId, orderByComparator); }
java
@Override public java.util.concurrent.Future<UntagQueueResult> untagQueueAsync(String queueUrl, java.util.List<String> tagKeys, com.amazonaws.handlers.AsyncHandler<UntagQueueRequest, UntagQueueResult> asyncHandler) { return untagQueueAsync(new UntagQueueRequest().withQueueUrl(queueUrl).withTagK...
python
def GetFlagSuggestions(attempt, longopt_list): """Get helpful similar matches for an invalid flag.""" # Don't suggest on very short strings, or if no longopts are specified. if len(attempt) <= 2 or not longopt_list: return [] option_names = [v.split('=')[0] for v in longopt_list] # Find close approximat...
java
public void writeScript(AbstractRenderAppender sb) { assert(sb != null) : "The paramter 'sb' must not be null;"; if (_writeScript) return; _writeScript = true; IScriptReporter sr = getParentScriptReporter(); if (sr != null) { sr.writeScript(sb); ...
python
def predict(self, X): """Perform regression on test vectors X. Parameters ---------- X : array-like, shape = [n_samples, n_features] Input vectors, where n_samples is the number of samples and n_features is the number of features. Returns -------...
java
private static List<AccumuloColumnConstraint> getColumnConstraints(String rowIdName, TupleDomain<ColumnHandle> constraint) { ImmutableList.Builder<AccumuloColumnConstraint> constraintBuilder = ImmutableList.builder(); for (ColumnDomain<ColumnHandle> columnDomain : constraint.getColumnDomains().get()...
python
def stack_call(self, *args): """Stacks a redis command inside the object. The syntax is the same than the call() method a Client class. Args: *args: full redis command as variable length argument list. Examples: >>> pipeline = Pipeline() >>> pipelin...
python
def remove_instances_by_prefix(nova_api, prefix): """Remove all the instances on which their name start by a prefix.""" for server in nova_api.servers.list(): if server.name.startswith(prefix): LOG.info("Remove instance '%s'" % server.name) server.delete()
java
public final void mSERVICE() throws RecognitionException { try { int _type = SERVICE; int _channel = DEFAULT_TOKEN_CHANNEL; // com/dyuproject/protostuff/parser/ProtoLexer.g:115:5: ( 'service' ) // com/dyuproject/protostuff/parser/ProtoLexer.g:115:9: 'service' ...
python
def get_large_image_url(self, page=1): """ Returns the URL for the large sized image of a single page. The page kwarg specifies which page to return. One is the default. """ template = self.resources.page.get('image') return template.replace("{page}", str(page)).replace(...
java
@SuppressWarnings("unchecked") @Override public EList<IfcRelCoversBldgElements> getHasCoverings() { return (EList<IfcRelCoversBldgElements>) eGet(Ifc4Package.Literals.IFC_ELEMENT__HAS_COVERINGS, true); }
java
public CmsDetailPageTable copy() { List<CmsDetailPageInfo> infos = toList(); CmsDetailPageTable result = new CmsDetailPageTable(); for (CmsDetailPageInfo info : infos) { result.add(info); } return result; }
java
public static void explode (final char cSep, @Nullable final String sElements, @Nonnull final Consumer <? super String> aConsumer) { explode (cSep, sElements, -1, aConsumer); }
java
public static <T> Predicate<T> distinctByKey(Function<? super T, ?> keyExtractor) { final Map<Object, Boolean> seen = new ConcurrentHashMap<>(); return t -> seen.putIfAbsent(keyExtractor.apply(t), Boolean.TRUE) == null; }
python
def _flatterm_iter(cls, expression: Expression) -> Iterator[TermAtom]: """Generator that yields the atoms of the expressions in prefix notation with operation end markers.""" if isinstance(expression, Operation): yield type(expression) for operand in op_iter(expression): ...
python
def pub_close(self): ''' Disconnect an existing publisher socket and remove it from the local thread's cache. ''' if hasattr(self._sock_data, 'sock'): self._sock_data.sock.close() delattr(self._sock_data, 'sock')
java
public static Object[] fixVarArgs(Class<?>[] paramsWithVarArgs, Object[] arguments) { int n = paramsWithVarArgs.length; return fixVarArgs(n, paramsWithVarArgs[n-1], arguments); }
java
public void fetchUninitializedAttributes() { for (String prefixedId : getPrefixedAttributeNames()) { BeanIdentifier id = getNamingScheme().deprefix(prefixedId); if (!beanStore.contains(id)) { ContextualInstance<?> instance = (ContextualInstance<?>) getAttribute(prefixedId...
java
private static void calculateDifferences(ModelDiff diff) { Class<?> modelClass = diff.getBefore().getClass(); for (Field field : modelClass.getDeclaredFields()) { if (field.getName().equals(ModelUtils.MODEL_TAIL_FIELD_NAME)) { continue; } try { ...
python
def evaluate_conditionals_in_context (properties, context): """ Removes all conditional properties which conditions are not met For those with met conditions, removes the condition. Properies in conditions are looked up in 'context' """ if __debug__: from .property_set import Propert...
java
public FileSender sendFile(final AsyncFile file, final Handler<AsyncResult<Void>> doneHandler) { output.group("file", "file", new Handler<OutputGroup>() { @Override public void handle(OutputGroup group) { doSendFile(file, group, doneHandler); } }); return this; }
java
public static String resolveEntity(String entity) { if (entity.length() > 1 && entity.charAt(0) == '#') { if (entity.charAt(1) == 'x') { return String.valueOf((char) Integer.parseInt(entity.substring(2), 16)); } else { return String.valueOf((char) Integer....
python
def inner(self, x1, x2): """Calculate the constant-weighted inner product of two elements. Parameters ---------- x1, x2 : `ProductSpaceElement` Elements whose inner product is calculated. Returns ------- inner : float or complex The inner...
python
def add_path_part(url, regex=PATH_PART): """ replace the variables in a url template with regex named groups :param url: string of a url template :param regex: regex of the named group :returns: regex """ formatter = string.Formatter() url_var_template = "(?P<{var_name}>{regex})" fo...
python
def get_asn_http(self, retry_count=3): """ The function for retrieving ASN information for an IP address from Arin via port 80 (HTTP). Currently limited to fetching asn_registry through a Arin whois (REST) lookup. The other values are returned as None to keep a consistent dict ou...
java
public boolean add(long seqno, T element) { lock.lock(); try { return _add(seqno, element, true, null); } finally { lock.unlock(); } }
python
def close_logs(self) -> None: """ Close Python disk logs. """ if self.stdout is not None: self.stdout.close() self.stdout = None if self.stderr is not None and self.stderr != subprocess.STDOUT: self.stderr.close() self.stderr = None
java
public java.util.List<RoleUsageType> getRoleUsageList() { if (roleUsageList == null) { roleUsageList = new com.amazonaws.internal.SdkInternalList<RoleUsageType>(); } return roleUsageList; }
java
public MapWithProtoValuesFluentAssertion<M> ignoringExtraRepeatedFieldElementsOfFieldDescriptorsForValues( FieldDescriptor firstFieldDescriptor, FieldDescriptor... rest) { return usingConfig( config.ignoringExtraRepeatedFieldElementsOfFieldDescriptors( asList(firstFieldDescriptor...
python
def Deserialize(self, reader): """ Deserialize full object. Args: reader (neo.IO.BinaryReader): """ self.PrevHash = reader.ReadUInt256() self.PrevIndex = reader.ReadUInt16()
python
def txid_to_block_data(txid, bitcoind_proxy, proxy=None): """ Given a txid, get its block's data. Use SPV to verify the information we receive from the (untrusted) bitcoind host. @bitcoind_proxy must be a BitcoindConnection (from virtualchain.lib.session) Return the (block hash, block data, t...
java
public static boolean isInstantiable(Class<?> type) { return !type.isEnum() && !type.isAssignableFrom(String.class) && !Primitives.isPrimitiveWrapper(type); }
java
public String getName() { // Both getPath() and getName() are very light weight method calls return zipIterator == null ? fileIterator.getFile().getPath() : zipIterator.getEntry().getName(); }
python
def get_caller(skip=None): """ Get the caller information, it'll return: module, filename, line_no """ import inspect from fnmatch import fnmatch try: stack = inspect.stack() except: stack = [None, inspect.currentframe()] if len(stack) > 1: stack.pop(0) i...
java
public final EntityType getEntityType(String name) { GetEntityTypeRequest request = GetEntityTypeRequest.newBuilder().setName(name).build(); return getEntityType(request); }
java
public final String evaluate(final Map<String, Object> pReqVars, final IRequestData pData) throws Exception { SeSeller seSeller = this.findSeSeller.find(pReqVars, pData.getUserName()); if (seSeller == null) { throw new ExceptionWithCode(ExceptionWithCode.SOMETHING_WRONG, "It's not S.E.Seller -...
java
protected final MailConnectionFactory createMailConnectionFactoryImpl(String className) { String factoryClassName=className; if(factoryClassName==null) { factoryClassName=MailConnectionFactoryImpl.class.getName(); } //create new instance MailConnectionFac...
java
public void setStartTime(com.google.api.ads.admanager.axis.v201811.DateTime startTime) { this.startTime = startTime; }
python
def get_imageinfo(self, show=True, proxy=None, timeout=0): """ GET MediaWiki request for API:Imageinfo https://www.mediawiki.org/wiki/API:Imageinfo Required {data}: - image: <list> member (<dict>) with 'file' and not 'url' Optional arguments: - [show]: <bool> ec...
python
def via(fields): """ Define the fields (attributes) to use for instance comparison and repr. Creates ``__eq__``\ , ``__ne__`` and ``__repr__`` methods for the decorated class, along with a private ``_contents`` property which simply returns the fields provided with associated values on the inst...
java
@Override CssFormatter appendColor( double color, String hint ) { if( !inlineMode() ) { int red = ColorUtils.red( color ); if( red % 17 == 0 ) { int green = ColorUtils.green( color ); if( green % 17 == 0 ) { int blue = ColorUtils.bl...
python
def concat(cls, *args): """Returns a BinWord made from concatenating several BinWords, in LSB-first order. """ width = 0 val = 0 for arg in args: if not isinstance(arg, BinWord): raise TypeError('need BinWord in concat') val |= arg....
python
def _retry(event, attempts, delay): """ An iterator of pairs of (attempt number, event set), checking whether `event` is set up to `attempts` number of times, and delaying `delay` seconds in between. Terminates as soon as `event` is set, or until `attempts` have been made. Intended to be used ...
python
def select_window_with_click(self): """ Get a window ID by clicking on it. This function blocks until a selection is made. """ window_ret = window_t(0) _libxdo.xdo_select_window_with_click( self._xdo, ctypes.byref(window_ret)) return window_ret.value