 s1] / dispersion[d]
            }
            prior?.let { prior ->
                //Check if this one is correct
                val pi = prior(theta)
                val deriv1 = prior.derivative(symbols[s1])(theta)
                val deriv2 = prior.derivative(symbols[s2])(theta)
                base + deriv1 * deriv2 / pi / pi
            } ?: base
        }
    }

    /**
     * Quasi optimal weights equations values
     */
    private fun QoWeight.getEqValues(theta: Map<Symbol, Double>): Point<Float64> {
        val distances = Float64Buffer(data.size) { d -> distance(d, theta) }
        return Float64Buffer(size) { s ->
            val base = (0 until data.size).sumOf { d -> distances[d] * derivs[d, s] / dispersion[d] }
            //Prior probability correction
            prior?.let { prior ->
                base - prior.derivative(symbols[s]).invoke(theta) / prior(theta)
            } ?: base
        }
    }

    private fun QoWeight.newtonianStep(
        theta: Map<Symbol, Double>,
        eqValues: Point<Float64>,
    ): QoWeight = linearSpace {
        val start = theta.toPoint()
        val invJacob = solver.inverse(getEqDerivValues(theta))

        val step = invJacob.dot(eqValues)
        return QoWeight(problem, theta + (start - step).toMap())
    }

    private fun QoWeight.newtonianRun(
        maxSteps: Int = 100,
        tolerance: Double = 0.0,
        fast: Boolean = false,
    ): QoWeight {

        val logger = problem.attributes[OptimizationLog]

        var dis: Double //discrepancy value

        var par = freeParameters

        logger?.log { "Starting newtonian iteration from: \n\t$allParameters" }

        var eqvalues = getEqValues(par) //Values of the weight functions

        dis = Float64L2Norm.norm(eqvalues) // discrepancy
        logger?.log { "Starting discrepancy is $dis" }
        var i = 0
        var flag = false
        while (!flag) {
            i++
            logger?.log { "Starting step number $i" }

            val currentSolution = if (fast) {
                //Matrix values in the point of weight computation
                newtonianStep(freeParameters, eqvalues)
            } else {
                //Matrix values in a current point
                newtonianStep(par, eqvalues)
            }
            // здесь должен стоять учет границ параметров
            logger?.log { "Parameter values after step are: \n\t$currentSolution" }

            eqvalues = getEqValues(currentSolution.freeParameters)
            val currentDis = Float64L2Norm.norm(eqvalues)// discrepancy after the step

            logger?.log { "The discrepancy after step is: $currentDis." }

            if (currentDis >= dis && i > 1) {
                //Check if one step is made
                flag = true
                logger?.log { "The discrepancy does not decrease. Stopping iteration." }
            } else if (abs(dis - currentDis) <= tolerance) {
                flag = true
                par = currentSolution.freeParameters
                logger?.log { "Relative discrepancy tolerance threshold is reached. Stopping iteration." }
            } else {
                par = currentSolution.freeParameters
                dis = currentDis
            }
            if (i >= maxSteps) {
                flag = true
                logger?.log { "Maximum number of iterations reached. Stopping iteration." }
            }
        }

        return QoWeight(problem, par)
    }

    private fun QoWeight.covariance(): NamedMatrix<Float64> {
        val logger = problem.attributes[OptimizationLog]

        logger?.log {
            """
            Starting errors estimation using quasi-optimal weights


(this.fileId, this.contentType, this.size, this.expiresAt,
      this.customerId);

  factory CustomerFileResponse.fromJson(Map<String, dynamic> json) =>
      CustomerFileResponse(
        json['file_id'],
        json['content_type'],
        json['size'],
        json['expires_at'],
        json['customer_id'],
      );
}
// Copyright 2020 The Stellar Flutter SDK Authors. All rights reserved.
// Use of this source code is governed by a license that can be
// found in the LICENSE file.

import 'dart:async';
import 'dart:developer';

import 'package:http/http.dart' as http;
import 'package:toml/toml.dart';

/// Parses the stellar toml data from a given string or from a given domain.
/// See Stellar Toml
/// Supported Version: 2.5.0
class StellarToml {
  late GeneralInformation generalInformation;
  Documentation? documentation;
  List<PointOfContact>? pointsOfContact;
  List<Currency>? currencies;
  List<Validator>? validators;

  StellarToml(String toml) {
    final safeToml = safeguardTomlContent(toml);

    var document = TomlDocument.parse(safeToml).toMap();

    generalInformation = GeneralInformation();
    generalInformation.version = document['VERSION'];
    generalInformation.networkPassphrase = document['NETWORK_PASSPHRASE'];
    generalInformation.federationServer = document['FEDERATION_SERVER'];
    generalInformation.authServer = document['AUTH_SERVER'];
    generalInformation.transferServer = document['TRANSFER_SERVER'];
    generalInformation.transferServerSep24 =
        document['TRANSFER_SERVER_SEP0024'];
    generalInformation.kYCServer = document['KYC_SERVER'];
    generalInformation.webAuthEndpoint = document['WEB_AUTH_ENDPOINT'];
    generalInformation.signingKey = document['SIGNING_KEY'];
    generalInformation.horizonUrl = document['HORIZON_URL'];

    if (document['ACCOUNTS'] != null) {
      document['ACCOUNTS'].forEach((var item) {
        generalInformation.accounts.add(item);
      });
    }
    generalInformation.uriRequestSigningKey =
        document['URI_REQUEST_SIGNING_KEY'];
    generalInformation.directPaymentServer = document['DIRECT_PAYMENT_SERVER'];
    generalInformation.anchorQuoteServer = document['ANCHOR_QUOTE_SERVER'];
    generalInformation.webAuthForContractsEndpoint =
        document['WEB_AUTH_FOR_CONTRACTS_ENDPOINT'];
    generalInformation.webAuthContractId = document['WEB_AUTH_CONTRACT_ID'];

    if (document['DOCUMENTATION'] != null) {
      documentation = Documentation();
      documentation!.orgName = document['DOCUMENTATION']['ORG_NAME'];
      documentation!.orgDBA = document['DOCUMENTATION']['ORG_DBA'];
      documentation!.orgUrl = document['DOCUMENTATION']['ORG_URL'];
      documentation!.orgLogo = document['DOCUMENTATION']['ORG_LOGO'];
      documentation!.orgDescription =
          document['DOCUMENTATION']['ORG_DESCRIPTION'];
      documentation!.orgPhysicalAddress =
          document['DOCUMENTATION']['ORG_PHYSICAL_ADDRESS'];
      documentation!.orgPhysicalAddressAttestation =
          document['DOCUMENTATION']['ORG_PHYSICAL_ADDRESS_ATTESTATION'];
      documentation!.orgPhoneNumber =
          document['DOCUMENTATION']['ORG_PHONE_NUMBER'];
      documentation!.orgPhoneNumberAttestation =
          document['DOCUMENTATION']['ORG_PHONE_NUMBER_ATTESTATION'];
      documentation!.orgKeybase = document['DOCUMENTATION']['ORG_KEYBASE'];
      documentation!.orgTwitter = document['DOCUMENTATION']['ORG_TWITTER'];
      documentation!.orgGithub = document['DOCUMENTATION']['ORG_GITHUB'];


# pylint: disable=locally-disabled, multiple-statements, no-value-for-parameter, unexpected-keyword-arg, invalid-name, too-many-function-args, unused-import, missing-function-docstring
"""
TBD
"""
import json
from entangle.logging.debug import logging
from entangle.process import process
from entangle.http import request
from entangle.workflow import workflow
from entangle.scheduler import scheduler

scheduler_config = {'cpus': 3,
                    'impl': 'entangle.scheduler.DefaultScheduler'}

@scheduler(**scheduler_config)
@process
@request(url='https://datausa.io/api/data', method='GET')
def mydata(data):
    data = json.loads(data)
    print('My function got the data! ', data)
    return int(data['data'][0]['Year'])

@scheduler(**scheduler_config)
@process
def two():
    return 2

@scheduler(**scheduler_config)
@process
def add(a, b):
    v = int(a) + int(b)
    print("ADD: *"+str(v)+"*")
    return v

@scheduler(**scheduler_config)
@workflow
def workflow1():
    return add(
        mydata(drilldowns='Nation', measures='Population'),
        two()
    )

@scheduler(**scheduler_config)
@workflow
def workflow2(value):
    return add(
        value(),
        two()
    )

result = workflow2(workflow1)

print(result())


      await this.store.updatePersonAsync(event.person);
    });
    eventBus.subscribe(PersonDeletedEvent.type, async (evt: IEvent) => {
      const event = evt as PersonDeletedEvent;
      await this.store.deletePersonAsync(event.person);
    });
  }
}import * as eta from 'eta';
import type { TemplateFunction } from 'eta/dist/types/compile';
import { Configuration } from './configuration';
import { EdmInfo, Endpoint } from './shared';

eta.configure({ autoTrim: false, autoEscape: false });

const defaultEndpointsTemplate = `/**
 * This is a generated file. Please don't change this manually.
 */
<%-
  const quote = it.quote;
  const indent = it.indent;
%>
export const enum Endpoints {
<% for(const endpoint of it.endpoints) { -%>
<%= indent %><%= endpoint.name %> = <%= quote %><%= endpoint.url %><%= quote %>,
<% } -%>
}`;

export class EndpointTemplate {
  private readonly compiled: TemplateFunction;
  public constructor(
    template: string = defaultEndpointsTemplate,
  ) {
    this.compiled = eta.compile(template);
  }

  public render(endpoints: Endpoint[]): string {
    const config = Configuration.instance;
    return this.compiled(
      {
        endpoints,
        quote: config.quote,
        indent: config.indent,
      },
      eta.config);
  }
}

const defaultClassTemplateName = '$$class';
const defaultClassTemplate = `<%-
  const indent = it.indent;
-%>
<%- if (it.endpoint) { -%>
@odataEndpoint(Endpoints.<%= it.endpoint %>)
<% } -%>
<%- if (it.baseType && it.propertyInfos.length > it.baseType.propertyInfos.length) { -%>
// @ts-ignore needed to avoid this issue: https://github.com/microsoft/TypeScript/issues/4628
<% } -%>
export class <%= it.name %><% if (it.baseType) { %> extends <%= it.baseType.name %><% } %> {

<%= indent %>public static create<T<%= it.name %> extends <%= it.name %> = <%= it.name %>>(this: Class<T<%= it.name %>>, raw: Partial<T<%= it.name %>>): T<%= it.name %> {
<%= indent.repeat(2) %>if (raw === undefined || raw === null || raw instanceof this) { return raw as T<%= it.name %>; }
<%= indent.repeat(2) %>return new this(
<% for(const p of it.propertyInfos) { -%>
<%= indent.repeat(3) %><% if (typeof p.type === 'string') { %>raw.<%= p.name %><% } else { %><%= p.type.name %>.create(raw.<%= p.name %>)<% } %>,
<% } -%>
<%= indent.repeat(2) %>);
<%= indent %>}

<%= indent %>public constructor(
<% for(const p of it.propertyInfos) { -%>
<%= indent.repeat(2) %>public <%= p.name %><% if(p.isNullable){%>?<% } %>: <% if (typeof p.type === 'string') { %><%= p.type %><% } else { %><%= p.type.name %><% } %>,
<% } -%>
<%= indent %>) <%_ if (it.baseType) { %> {
<%= indent.repeat(2) %>super(
<% for(const p of it.baseType.propertyInfos) { -%>
<%= indent.repeat(3) %><%= p.name %>,
<% } -%>
<%= indent.repeat(2) %>);
<%= indent %>}
<%- } else { %> { } <%_ } -%>


 = "7681dc75373a3e50ad844a52b700af28034cfa1fa7e6d15f4b21cf491d1ffcef" },
		["/apps/UniversalApp/Workspace/Packages/_Workspace/GameDetailRodux"] = { source_hash = "37a07d821bbfee99dd8afbb02f2eb0127b616524d92bcd42603180f312534d9a", dep_hash = "bfb8fe3ad84c920f8829cf3bb5b6aa6f68689737db7d419a594d2dc2c5d62d13" },
		["/apps/UniversalApp/Workspace/Packages/_Workspace/GameFilters"] = { source_hash = "5fb1f976e478a6955d92361fe25580b54c5224a944c487a9dfa2336033f3b1ba", dep_hash = "e6993507859d900d2ad74f7947301f3f165f88e8ad551ea34e70e1d0feda2b72" },
		["/apps/UniversalApp/Workspace/Packages/_Workspace/GameIconRodux"] = { source_hash = "1d6366c40d95b06bbfcb101e2958cd45b9ad7e20f380a2a2f84bcaba29512d29", dep_hash = "06a4be64b6fcaa689ba7b4b6627679bdd6203c973e27e96e22e961cd44c24c36" },
		["/apps/UniversalApp/Workspace/Packages/_Workspace/GameInfosRodux"] = { source_hash = "dd3c1d762ffe3f2bd5f56d99bdf2b2e1b95ccef3ae3654cfc6045bb226e55e46", dep_hash = "5b7fc976b1990ab417c9cf975d88ced9598f99af63fadc073654860298d77bc4" },
		["/apps/UniversalApp/Workspace/Packages/_Workspace/GameInvite"] = { source_hash = "4ee11db632fc1d8df56bba65eb208572b540b85113a0b898245fb0c2bf6ef2f6", dep_hash = "c1ebdf4438b9aa1613df6992e8a5ae631ed1d0317c9580f90fdf54ef622b4ac6" },
		["/apps/UniversalApp/Workspace/Packages/_Workspace/GameLaunch"] = { source_hash = "a038b5e142e3f48f9e7cb26678d3dca646739180e31695db303dc760fa1f7bb0", dep_hash = "b4ce4802c3e22218b0318ff7079ab0407abb689f58ffa9d367826725cef11a3b" },
		["/apps/UniversalApp/Workspace/Packages/_Workspace/GameModels"] = { source_hash = "3ded5b11d6acea9021df5730dc602ceb9ba76b3f27fc808858a7464d02f14fab", dep_hash = "7a8ab08065dfd824faf721c5f56217c6d1afeb8fa1a5c08a626e8967ec222984" },
		["/apps/UniversalApp/Workspace/Packages/_Workspace/GamePlayButton"] = { source_hash = "2adcbff5ae7c9c008df7b9e478b2fabd39ba71884cd51afc541246540d80d3f0", dep_hash = "15b430630ea560eeb0f56858b180282701d12c9a1a0cfc079c1ec1b069cb4083" },
		["/apps/UniversalApp/Workspace/Packages/_Workspace/GameProductInfoRodux"] = { source_hash = "33f46e0f7f5e7e6b54a82694d0f935ee9e


E <=8 - 11, Edge 12 - 13
			// IE throws exception on accessing the href property if url is malformed,
			// e.g. http://example.com:80x/
			try {
				urlAnchor.href = s.url;

				// Support: IE <=8 - 11 only
				// Anchor's host property isn't correctly set when s.url is relative
				urlAnchor.href = urlAnchor.href;
				s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !==
					urlAnchor.protocol + "//" + urlAnchor.host;
			} catch ( e ) {

				// If there is an error parsing the URL, assume it is crossDomain,
				// it can be rejected by the transport if it is invalid
				s.crossDomain = true;
			}
		}

		// Convert data if not already a string
		if ( s.data && s.processData && typeof s.data !== "string" ) {
			s.data = jQuery.param( s.data, s.traditional );
		}

		// Apply prefilters
		inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );

		// If request was aborted inside a prefilter, stop there
		if ( completed ) {
			return jqXHR;
		}

		// We can fire global events as of now if asked to
		// Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
		fireGlobals = jQuery.event && s.global;

		// Watch for a new set of requests
		if ( fireGlobals && jQuery.active++ === 0 ) {
			jQuery.event.trigger( "ajaxStart" );
		}

		// Uppercase the type
		s.type = s.type.toUpperCase();

		// Determine if request has content
		s.hasContent = !rnoContent.test( s.type );

		// Save the URL in case we're toying with the If-Modified-Since
		// and/or If-None-Match header later on
		// Remove hash to simplify url manipulation
		cacheURL = s.url.replace( rhash, "" );

		// More options handling for requests with no content
		if ( !s.hasContent ) {

			// Remember the hash so we can put it back
			uncached = s.url.slice( cacheURL.length );

			// If data is available, append data to url
			if ( s.data ) {
				cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data;

				// #9682: remove data so that it's not used in an eventual retry
				delete s.data;
			}

			// Add or update anti-cache param if needed
			if ( s.cache === false ) {
				cacheURL = cacheURL.replace( rantiCache, "$1" );
				uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached;
			}

			// Put hash and anti-cache on the URL that will be requested (gh-1732)
			s.url = cacheURL + uncached;

		// Change '%20' to '+' if this is encoded form body content (gh-2658)
		} else if ( s.data && s.processData &&
			( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) {
			s.data = s.data.replace( r20, "+" );
		}

		// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
		if ( s.ifModified ) {
			if ( jQuery.lastModified[ cacheURL ] ) {
				jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
			}
			if ( jQuery.etag[ cacheURL ] ) {
				jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
			}
		}

		// Set the correct header, if data is being sent
		if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
			jqXHR.setRequestHeader( "Content-Type", s.contentType );
		}

		// Set the Accepts header for the server, depending on the dataType
		jqXHR.setRequestHeader(
			"Accept",
			s.


is set to ANSI_92");
					break;

				case 3:
					d7isupStack.setStackSpecification(IsupConstants.ISUP_PV_ANSI_1995);
					myAddress = new IsupUserAddress(DPC,Integer.parseInt(startCIC),Integer.parseInt(endCIC),
																				NetworkIndicator.NI_NATIONAL_10);
					stackSpec = IsupConstants.ISUP_PV_ANSI_1995;
					System.out.println("Protocol is set to ANSI_95");
					break;

				default:
					System.out.println("Default is set to ITU_93");
					d7isupStack.setStackSpecification(IsupConstants.ISUP_PV_ITU_1993);
					myAddress = new IsupUserAddress(DPC,Integer.parseInt(startCIC),Integer.parseInt(endCIC),
																				NetworkIndicator.NI_INTERNATIONAL_00);
					stackSpec = IsupConstants.ISUP_PV_ITU_1993;
					System.out.println("Protocol is set to ITU_93");
					break;
			}

			d7IsupProvider = d7isupStack.createProvider();
			isupListener = new JainSampleIsupListener();
			d7IsupProvider.addIsupListener(isupListener,myAddress);

			/* Set the paramater values */
			UserServiceInfo usi = new UserServiceInfo((byte)0,(byte)0,false, (byte)16, (byte)0, false,
								(byte)2, (byte)0, (byte)4,false, (byte)0, (byte)1, false, (byte)1,
								(byte)1, false, (byte)2,(byte) 2, false, (byte)6, (byte) 3, false,
								(byte) 1, false, (byte)0,
								false, false, false, false, false, false, false, (byte)0, false,
								false, false, false, false, false, false, false, (byte)0, (byte)0,
								(byte)0, false, (byte)0, false, false);

			UserServiceInfoPrime  usip = new UserServiceInfoPrime((byte)0, (byte)0,false, (byte)16, (byte)0, false,
											(byte)2, (byte)0, (byte)4,false, (byte)0, (byte)1, false, (byte)1, (byte)1,
											false, (byte)2, (byte) 2,false, (byte)6, (byte) 3, false, (byte) 1, false,
											(byte)0, false, false,
											false, false, false, false, false, (byte)0, false,
											false, false, false,
											false, false, false, false, (byte)0, (byte)0,
											(byte)0, false, (byte)0, false, false);

			byte[] status = {(byte)0};
			byte[] status2 = {(byte)255};
			byte[] status3 = {(byte)255,(byte)255};

			RangeAndStatus rns = 	new RangeAndStatus((byte)7,status2);

			RangeAndStatus rnsres = 	new RangeAndStatus((byte)22,status);

			RangeAndStatus rnsa = 	new RangeAndStatus((byte)0,null);

			RangeAndStatus rnscgb = 	new RangeAndStatus((byte)10,status3);

			BwdCallIndItu bci = new BwdCallIndItu((byte) 1,
(byte)2,(byte) 2, (byte)2, false, false, false,false, false,
(byte)0,true);

			BwdCallIndAnsi bcia = new BwdCallIndAnsi((byte)1, (byte)2, (byte)2, (byte)2, false, false, false, false, false, (byte)0, true);

			CallDiversionInfoItu calldiv = new CallDiversionInfoItu((byte)2,(byte)1);

			EventInformation evi = new EventInformation((byte)2, false);

			EchoControlInfoItu eco =


# -*- coding: UTF8 -*-

# --------------------------------------------------------------
# Copyright (c) 2015, Nicolas VERDIER (contact@n1nj4.eu)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
# --------------------------------------------------------------

from pupylib.PupyModule import *
import os
import os.path
import textwrap
import logging
import datetime
from zlib import compress, crc32
import struct
import subprocess

__class_name__="WebcamSnapModule"

def pil_save(filename, pixels, width, height):
	from PIL import Image, ImageFile
	buffer_len = (width * 3 + 3) & -4
	img = Image.frombuffer('RGB', (width, height), pixels, 'raw', 'BGR', buffer_len, 1)
	ImageFile.MAXBLOCK = width * height
	img=img.transpose(Image.FLIP_TOP_BOTTOM)
	img.save(filename, quality=95, optimize=True, progressive=True)
	logging.info('webcam snap saved to %s'%filename)

class WebcamSnapModule(PupyModule):
	""" take a webcam snap :) """
	@windows_only
	def is_compatible(self):
		pass

	def init_argparse(self):
		self.arg_parser = PupyArgumentParser(prog='webcam_snap', description=self.__doc__)
		self.arg_parser.add_argument('-d', '--device', type=int, default=0, help='take a webcam snap on a specific device (default : 0)')
		self.arg_parser.add_argument('-v', '--view', action='store_true', help='directly open eog on the snap for preview')

	def run(self, args):
		try:
			os.makedirs(os.path.join("data","webcam_snaps"))
		except Exception:
			pass
		self.client.load_package("vidcap")
		filepath=os.path.join("data","webcam_snaps","snap_"+self.client.short_name()+"_"+str(datetime.datetime.now()).replace(" ","_").replace(":","-")+".jpg")
		dev=self.client.conn.modules['vidcap'].new_Dev(args.device,0)
		self.info("device %s exists, taking a snap ..."%args.device)
		buff, width, height = dev.getbuffer()
		pil_save(filepath, buff, width, height)
		if args.view:
			subprocess.Popen(["eog",filepath])
		self.success("webcam snap saved to %s"%filepath)


n rel_indices])
        else:
            return self.rel_mappings.inv[int(rel_indices)]

    def get_ents_count(self):
        """ Get the number of entities in the dataset

        Returns
        -------
        int
            The number of entities in the dataset
        """
        return len(self.ent_mappings.keys())

    def get_rels_count(self):
        """ Get the number of relations in the dataset

        Returns
        -------
        int
            The number of relations in the dataset
        """
        return len(self.rel_mappings.keys())


raseFromParent();
    return BB;
  }
  case AMDGPU::GET_SHADERCYCLESHILO: {
    assert(MF->getSubtarget<GCNSubtarget>().hasShaderCyclesHiLoRegisters());
    MachineRegisterInfo &MRI = MF->getRegInfo();
    const DebugLoc &DL = MI.getDebugLoc();
    // The algorithm is:
    //
    // hi1 = getreg(SHADER_CYCLES_HI)
    // lo1 = getreg(SHADER_CYCLES_LO)
    // hi2 = getreg(SHADER_CYCLES_HI)
    //
    // If hi1 == hi2 then there was no overflow and the result is hi2:lo1.
    // Otherwise there was overflow and the result is hi2:0. In both cases the
    // result should represent the actual time at some point during the sequence
    // of three getregs.
    using namespace AMDGPU::Hwreg;
    Register RegHi1 = MRI.createVirtualRegister(&AMDGPU::SReg_32RegClass);
    BuildMI(*BB, MI, DL, TII->get(AMDGPU::S_GETREG_B32), RegHi1)
        .addImm(HwregEncoding::encode(ID_SHADER_CYCLES_HI, 0, 32));
    Register RegLo1 = MRI.createVirtualRegister(&AMDGPU::SReg_32RegClass);
    BuildMI(*BB, MI, DL, TII->get(AMDGPU::S_GETREG_B32), RegLo1)
        .addImm(HwregEncoding::encode(ID_SHADER_CYCLES, 0, 32));
    Register RegHi2 = MRI.createVirtualRegister(&AMDGPU::SReg_32RegClass);
    BuildMI(*BB, MI, DL, TII->get(AMDGPU::S_GETREG_B32), RegHi2)
        .addImm(HwregEncoding::encode(ID_SHADER_CYCLES_HI, 0, 32));
    BuildMI(*BB, MI, DL, TII->get(AMDGPU::S_CMP_EQ_U32))
        .addReg(RegHi1)
        .addReg(RegHi2);
    Register RegLo = MRI.createVirtualRegister(&AMDGPU::SReg_32RegClass);
    BuildMI(*BB, MI, DL, TII->get(AMDGPU::S_CSELECT_B32), RegLo)
        .addReg(RegLo1)
        .addImm(0);
    BuildMI(*BB, MI, DL, TII->get(AMDGPU::REG_SEQUENCE))
        .add(MI.getOperand(0))
        .addReg(RegLo)
        .addImm(AMDGPU::sub0)
        .addReg(RegHi2)
        .addImm(AMDGPU::sub1);
    MI.eraseFromParent();
    return BB;
  }
  case AMDGPU::SI_INDIRECT_SRC_V1:
  case AMDGPU::SI_INDIRECT_SRC_V2:
  case AMDGPU::SI_INDIRECT_SRC_V4:
  case AMDGPU::SI_INDIRECT_SRC_V8:
  case AMDGPU::SI_INDIRECT_SRC_V9:
  case AMDGPU::SI_INDIRECT_SRC_V10:
  case AMDGPU::SI_INDIRECT_SRC_V11:
  case AMDGPU::SI_INDIRECT_SRC_V12:
  case AMDGPU::SI_INDIRECT_SRC_V16:
  case AMDGPU::SI_INDIRECT_SRC_V32:
    return emitIndirectSrc(MI, *BB, *getSubtarget());
  case AMDGPU::SI_INDIRECT_DST_V1:
  case AMDGPU::SI_INDIRECT_DST_V2:
  case AMDGPU::SI_INDIRECT_DST_V4:
  case AMDGPU::SI_INDIRECT_DST_V8:
  case AMDGPU::SI_INDIRECT_DST_V9:
  case AMDGPU::SI_INDIRECT_DST_V10:
  case AMDGPU::SI_INDIRECT_DST_V11:
  case AMDGPU::


endMessage(Secrets.CHAT_ID, msg)
  }
}

export default TgBot
import { Component, OnInit } from '@angular/core';
// import Todo from todo Model
import { Todo } from '../../models/todo.model'
//(1-a) import Post service
import { TodoService } from '../../services/todo.service'

@Component({
  selector: 'app-todo-list',
  templateUrl: './todo-list.component.html',
  styleUrls: ['./todo-list.component.css']
})
export class TodoListComponent implements OnInit {

  //array to hold all todos from server
  todos: Todo[];

  //(1-b) inject TodoService
  constructor(private todoService: TodoService) { }

  //call getTodo from service to retrieve todos from server
  getTodos(): void {
    this.todoService.getTodos()
      .subscribe(todosResult => this.todos = todosResult);
  }

  //call addTodo from service to add new todo to server
  addTodo(todoName: HTMLInputElement, todoDescription: HTMLInputElement, startDate: HTMLInputElement, dueDate: HTMLInputElement) {
    // create new post from the user input
    let newTodo = new Todo (todoName.value, todoDescription.value, startDate.valueAsDate, dueDate.valueAsDate);

    this.todoService.addTodo(newTodo)
    .subscribe(todoResult => this.todos.push(todoResult));
  }

  ngOnInit() {
    //get all todos when the page loads
    this.getTodos();
  }
}
import {Graph} from './graph/graph';

const graph = new Graph(
  {
    start: { A: 5, B: 2 },
    A: { start: 1, C: 4, D: 2 },
    B: { A: 8, D: 7 },
    C: { D: 6, finish: 3 },
    D: { finish: 1 },
    finish: {},
  }
);

console.log(graph.findShortestPath('A', 'finish'));
import { Dispatch } from 'redux'
import {
  addForm,
  addTodoCreate,
  clearForm,
  completedTodoCreate,
  delTodoCreate,
  editTodoCreate,
  setTitleForm,
  setTypeForm,
  showDiagForm,
} from '../actions'

import {
  ActionType,
  IAddToFormAction,
  IEmptyFormAction,
  ISetTitleFormAction,
  ISetTypeFormAction,
  IShowFormAction,
  ITodo,
  TypeFormAction,
} from '../action-type'

export interface IAddTodoCreateAction {
  type: ActionType
  payload: ITodo
}
export interface IEditTodoCreate {
  type: ActionType
  payload: ITodo
}

export interface IDelTodoCreate {
  type: ActionType
  payload: string
}

export interface ICompletedTodoCreate {
  type: ActionType
  payload: string
}

export const addTodo = (todo: ITodo) => (
  dispatch: Dispatch<IAddTodoCreateAction>,
) => {
  dispatch(addTodoCreate(todo))
}

export const addTodoWith = (todo: ITodo) => (
  dispatch: Dispatch<IAddTodoCreateAction>,
) => {
  return dispatch(addTodoCreate(todo))
}

export const editTodo = (todo: ITodo) => (
  dispatch: Dispatch<IEditTodoCreate>,
) => {
  return dispatch(editTodoCreate(todo))
}

export const delTodo = (id: string) => (dispatch: Dispatch<IDelTodoCreate>) => {
  return dispatch(delTodoCreate(id


def test_local_driver(local_assetsmanager):
    _perform_driver_test(local_assetsmanager.storage_provider.driver)


false
    print("actor:ReceiveBeginPlay")
end

-- override event from blueprint
function LuaActor:ReceiveEndPlay(Reason)
    print("actor:ReceiveEndPlay")
end

function LuaActor:ClientRPC_SetAddressRPC(Address)
    print("LuaActor:ClientRPC_SetAddressRPC", Address)
end

function LuaActor:Tick(DeltaTime)
    print("actor:Tick",self, DeltaTime)
    -- call actor function
    local pos = self:K2_GetActorLocation()
    -- can pass self as Actor*
    local dist = self:GetHorizontalDistanceTo(self)
    print("actor pos",pos,dist)
end

return Class(nil, nil, LuaActor)


Options.Isolation.String(), in.TxOptions.ReadOnly,
		)
		if sqlTx, err = in.Db.BeginTx(ctx, &in.TxOptions); err == nil {
			tx := &TXCore{
				db:            c.db,
				tx:            sqlTx,
				ctx:           ctx,
				master:        in.Db,
				transactionId: guid.S(),
				cancelFunc:    cancelFuncForTimeout,
			}
			tx.ctx = context.WithValue(ctx, transactionKeyForContext(tx.db.GetGroup()), tx)
			tx.ctx = context.WithValue(tx.ctx, transactionIdForLoggerCtx, transactionIdGenerator.Add(1))
			out.Tx = tx
			ctx = out.Tx.GetCtx()
		}
		out.RawResult = sqlTx

	case SqlTypeTXCommit:
		if in.TxCancelFunc != nil {
			defer in.TxCancelFunc()
		}
		err = in.Tx.Commit()

	case SqlTypeTXRollback:
		if in.TxCancelFunc != nil {
			defer in.TxCancelFunc()
		}
		err = in.Tx.Rollback()

	case SqlTypeExecContext:
		ctx, cancelFuncForTimeout = c.GetCtxTimeout(ctx, ctxTimeoutTypeExec)
		defer cancelFuncForTimeout()
		if c.db.GetDryRun() {
			sqlResult = new(SqlResult)
		} else {
			sqlResult, err = in.Link.ExecContext(ctx, in.Sql, in.Args...)
		}
		out.RawResult = sqlResult

	case SqlTypeQueryContext:
		ctx, cancelFuncForTimeout = c.GetCtxTimeout(ctx, ctxTimeoutTypeQuery)
		defer cancelFuncForTimeout()
		sqlRows, err = in.Link.QueryContext(ctx, in.Sql, in.Args...)
		out.RawResult = sqlRows

	case SqlTypePrepareContext:
		ctx, cancelFuncForTimeout = c.GetCtxTimeout(ctx, ctxTimeoutTypePrepare)
		defer cancelFuncForTimeout()
		sqlStmt, err = in.Link.PrepareContext(ctx, in.Sql)
		out.RawResult = sqlStmt

	case SqlTypeStmtExecContext:
		ctx, cancelFuncForTimeout = c.GetCtxTimeout(ctx, ctxTimeoutTypeExec)
		defer cancelFuncForTimeout()
		if c.db.GetDryRun() {
			sqlResult = new(SqlResult)
		} else {
			sqlResult, err = in.Stmt.ExecContext(ctx, in.Args...)
		}
		out.RawResult = sqlResult

	case SqlTypeStmtQueryContext:
		ctx, cancelFuncForTimeout = c.GetCtxTimeout(ctx, ctxTimeoutTypeQuery)
		defer cancelFuncForTimeout()
		stmtSqlRows, err = in.Stmt.QueryContext(ctx, in.Args...)
		out.RawResult = stmtSqlRows

	case SqlTypeStmtQueryRowContext:
		ctx, cancelFuncForTimeout = c.GetCtxTimeout(ctx, ctxTimeoutTypeQuery)
		defer cancelFuncForTimeout()
		stmtSqlRow = in.Stmt.QueryRowContext(ctx, in.Args...)
		out.RawResult = stmtSqlRow

	default:
		panic(gerror.NewCodef(gcode.CodeInvalidParameter, `invalid SqlType "%s"`, in.Type))
	}
	// Result handling.
	switch {
	case sqlResult != nil && !c.GetIgnoreResultFromCtx(ctx):
		rowsAffected, err = sqlResult.RowsAffected()
		out.Result = sqlResult

	case sqlRows != nil:
		out.Records, err = c.RowsToResult(ctx, sqlRows)
		rowsAffected = int64(len(out.Records))

	case sqlStmt != nil:
		out.Stmt = &Stmt{
			Stmt: sqlStmt,
			core: c,
			link: in.Link,
			sql:  in.Sql,
		}
	}
	var (
		timestampMilli2 = gtime.TimestampMilli()
		sqlObj          = &Sql{
			Sql:           in.Sql,
			Type:          in.Type,
			Args:          in.Args,
			Format:        formattedSql,
			Error:         err,
			Start:


	override fun matchBytes(content: @CifMarker (MatchingDataScope.() -> Unit)): DataMaskDefinition {
		val builder = MatchingDataBuilder()
		content.invoke(builder)
		match = builder.build()
		return build()
	}

	override fun matchData(
		tag: ULong,
		content: @CifMarker (ResponseDataMaskScope.() -> DataMaskDefinition),
	): DataMaskDefinition.DataObject {
		val builder = ResponseDataMaskBuilder(tag)
		content.invoke(builder)
		match = builder.build()
		return build()
	}

	override fun build(): DataMaskDefinition.DataObject {
		if (built == null) {
			built =
				DataMaskDefinition.DataObject(
					tag = tag,
					match = requireNotNull(match),
				)
		}
		return built!!
	}
}
package org.openecard.cif.bundled

import org.openecard.cif.bundled.GematikBuildingBlocks.alwaysAcl
import org.openecard.cif.bundled.GematikBuildingBlocks.basePinParams
import org.openecard.cif.bundled.GematikBuildingBlocks.basePukParams
import org.openecard.cif.bundled.GematikBuildingBlocks.cmsCupProtectedAcl
import org.openecard.cif.bundled.GematikBuildingBlocks.cmsProtectedAcl
import org.openecard.cif.bundled.GematikBuildingBlocks.neverAcl
import org.openecard.cif.bundled.GematikBuildingBlocks.paceCmsCupProtectedAcl
import org.openecard.cif.bundled.GematikBuildingBlocks.paceCmsProtectedAcl
import org.openecard.cif.bundled.GematikBuildingBlocks.paceProtectedAcl
import org.openecard.cif.bundled.GematikBuildingBlocks.pinChPaceProtectedAcl
import org.openecard.cif.bundled.GematikBuildingBlocks.pinProtectedPaceAcl
import org.openecard.cif.bundled.HbaDefinitions.Apps.Auto
import org.openecard.cif.bundled.HbaDefinitions.Apps.Auto.Datasets.ef_c_hp_auto1_r3072
import org.openecard.cif.bundled.HbaDefinitions.Apps.Auto.Datasets.ef_c_hp_auto2_r3072
import org.openecard.cif.bundled.HbaDefinitions.Apps.Auto.Dids.pinAuto
import org.openecard.cif.bundled.HbaDefinitions.Apps.Auto.Dids.pinSo
import org.openecard.cif.bundled.HbaDefinitions.Apps.Auto.Dids.prk_hp_auto_r3072_signPKCS1_V1_5
import org.openecard.cif.bundled.HbaDefinitions.Apps.Auto.Dids.prk_hp_auto_r3072_signPSS
import org.openecard.cif.bundled.HbaDefinitions.Apps.CiaEsign
import org.openecard.cif.bundled.HbaDefinitions.Apps.CiaEsign.Datasets.cia_esign_efAod
import org.openecard.cif.bundled.HbaDefinitions.Apps.CiaEsign.Datasets.cia_esign_efCd
import org.openecard.cif.bundled.HbaDefinitions.Apps.CiaEsign.Datasets.cia_esign_efOd
import org.openecard.cif.bundled.HbaDefinitions.Apps.CiaEsign.Datasets.cia_esign_efPrkd
import org.openecard.cif.bundled.HbaDefinitions.Apps.CiaEsign.Datasets.cia_esign_ef_cia_ciaInfo
import org.openecard.cif.bundled.HbaDefinitions.Apps.CiaQes
import org.openecard.cif.bundled.HbaDefinitions.Apps.CiaQes.Datasets.cia_qes_efAod
import org.openecard.cif.bundled.HbaDefinitions.Apps.CiaQes.Datasets.cia_qes_efCd
import org.openecard.cif.bundled.HbaDefinitions.Apps.CiaQes.Datasets.cia_qes_efOd
import org.openecard.cif.bundled.HbaDefinitions


addle::framework::TransDataType(kernel_bf16, kernel_int32, in, &out);
    int* out_data_int = out.data<int>();
    for (int i = 0; i < data_number; ++i) {
      EXPECT_EQ(out_data_int[i], static_cast<int>(ptr[i]));
    }

    paddle::framework::TransDataType(kernel_bf16, kernel_int64, in, &out);
    int64_t* out_data_int64 = out.data<int64_t>();
    for (int i = 0; i < data_number; ++i) {
      EXPECT_EQ(out_data_int64[i], static_cast<int64_t>(ptr[i]));
    }

    paddle::framework::TransDataType(kernel_bf16, kernel_bool, in, &out);
    bool* out_data_bool = out.data<bool>();
    for (int i = 0; i < data_number; ++i) {
      EXPECT_EQ(out_data_bool[i], static_cast<bool>(ptr[i]));
    }

    // transform float to bfloat16
    float* in_data_float =
        in.mutable_data<float>(common::make_ddim({2, 3}), place);
    for (int i = 0; i < data_number; ++i) {
      in_data_float[i] = static_cast<float>(i);
    }

    paddle::framework::TransDataType(kernel_fp32, kernel_bf16, in, &out);
    ptr = out.data<phi::dtype::bfloat16>();
    for (int i = 0; i < data_number; ++i) {
      EXPECT_EQ(ptr[i].x,
                static_cast<phi::dtype::bfloat16>(in_data_float[i]).x);
    }

    // transform double to bfloat16
    double* in_data_double =
        in.mutable_data<double>(common::make_ddim({2, 3}), place);
    for (int i = 0; i < data_number; ++i) {
      in_data_double[i] = i;
    }

    paddle::framework::TransDataType(kernel_fp64, kernel_bf16, in, &out);
    ptr = out.data<phi::dtype::bfloat16>();
    for (int i = 0; i < data_number; ++i) {
      EXPECT_EQ(ptr[i].x,
                static_cast<phi::dtype::bfloat16>(in_data_double[i]).x);
    }

    // transform int to bfloat16
    int* in_data_int = in.mutable_data<int>(common::make_ddim({2, 3}), place);
    for (int i = 0; i < data_number; ++i) {
      in_data_int[i] = i;
    }

    paddle::framework::TransDataType(kernel_int32, kernel_bf16, in, &out);
    ptr = out.data<phi::dtype::bfloat16>();
    for (int i = 0; i < data_number; ++i) {
      EXPECT_EQ(ptr[i].x, static_cast<phi::dtype::bfloat16>(in_data_int[i]).x);
    }

    // transform int64 to bfloat16
    int64_t* in_data_int64 =
        in.mutable_data<int64_t>(common::make_ddim({2, 3}), place);
    for (int i = 0; i < data_number; ++i) {
      in_data_int64[i] = i;
    }

    paddle::framework::TransDataType(kernel_int64, kernel_bf16, in, &out);
    ptr = out.data<phi::dtype::bfloat16>();
    for (int i = 0; i < data_number; ++i) {
      EXPECT_EQ(ptr[i].x,
                static_cast<phi::dtype::bfloat16>(in_data_int64[i]).x);


ore';

@Pipe({
  name: 'condicion'
})
export class CondicionPipe implements PipeTransform {

  transform(value: string, ...args: unknown[]): unknown {
    if (value === "new"){
      return "Nuevo";
    } else if (value === "used"){
    return "Usado";
    }
  }

}
import inquirer, { QuestionCollection } from 'inquirer';

/**
 * Editor prompt example
 */
const questions: QuestionCollection = [
    {
        type: 'editor',
        name: 'bio',
        message: 'Please write a short bio of at least 3 lines.',
        validate(text) {
            if (text.split('\n').length < 3) {
                return 'Must be at least 3 lines.';
            }
            return true;
        },
    },
];

inquirer.prompt(questions).then(answers => {
    console.log(JSON.stringify(answers, null, '  '));
});
import {Employee} from "../src/Employee"

const employee3: Employee = {
  uniqueId: 4,
  name: "Mary Blue",
  subordinates: []
}

const employee6: Employee = {
  uniqueId: 7,
  name: "Will Turner",
  subordinates: []
}

const employee5: Employee = {
  uniqueId: 6,
  name: "Tina Teff",
  subordinates: [employee6]
}

const employee4: Employee = {
  uniqueId: 5,
  name: "Bob Saget",
  subordinates: [employee5]
}

const employee2: Employee = {
  uniqueId: 3,
  name: "Cassandra Reynolds",
  subordinates: [employee3, employee4]
}

const employee1: Employee = {
  uniqueId: 2,
  name: "Sarah Donald",
  subordinates: [employee2]
}

const employee9: Employee = {
  uniqueId: 10,
  name: "Thomas Brown",
  subordinates: []
}

const employee8: Employee = {
  uniqueId: 9,
  name: "Harry Tobs",
  subordinates: [employee9]
}

const employee10: Employee = {
  uniqueId: 11,
  name: "George Carrey",
  subordinates: []
}

const employee11: Employee = {
  uniqueId: 12,
  name: "Gary Styles",
  subordinates: []
}

const employee7: Employee = {
  uniqueId: 9,
  name: "Tyler Simpson",
  subordinates: [employee8, employee10, employee11]
}

const employee12: Employee = {
  uniqueId: 13,
  name: "Bruce Willis",
  subordinates: []
}

const employee14: Employee = {
  uniqueId: 15,
  name: "Sophie Turner",
  subordinates: []
}

const employee13: Employee = {
  uniqueId: 14,
  name: "Georgina Flangy",
  subordinates: [employee14]
}

export const ceo: Employee = {
  uniqueId: 1,
  name: "Mark Zuckerberg",
  subordinates: [employee1, employee7, employee12, employee13]
}
import chai = require('chai');
const should = chai.should();
import { combineTransform } from '../../../src/slimming/rules/combine-transform';
import { parse } from '../../../src/xml-parser/app';
import { createXML } from '../../../src/slimming/xml/create';

describe('rules/combine-transform', () => {
	it('rule false branch', async () => {
		const xml = '<svg><rect transform="translate(0)scale(1)"/></svg>';
		const dom = await parse(xml) as ITagNode;
		await combineTransform([false], dom);
		createXML(dom).should.equal('<svg><rect transform="translate(0)scale(1)"/></svg>');
	});

	it('合并 Transform', async () => {
		const xml = `<svg>
		<text transform="scale(2) translate(100,100) skewX(-15) skewX(15) translate(-100-100) scale(0.5)">1</text>
		<text transform="scale(1.9999999)scale(1.9999999)">2</text


(myFileSuffix, myTestDataPath)
  }

  private fun doSingleTest(suffix: String, path: String) {
    val text = FileUtil.loadFile(File(path, suffix), true)
    val result = StringBuilder()
    val firstDot = suffix.indexOf('.')
    val extension = suffix.substring(0, firstDot)
    val secondDot = suffix.indexOf('.', firstDot + 1)
    val name = if (secondDot > 0) suffix.substring(firstDot + 1, secondDot) else ""
    for (line in StringUtil.splitByLines(text)) {
      if (!result.isEmpty()) result.append("------\n")
      val psiFile = PsiFileFactory.getInstance(project)
        .createFileFromText("test.$name.$extension", templateSyntax.expressionLanguage, line)
      result.append(DebugUtil.psiToString(psiFile, true, false))
    }
    assertSameLinesWithFile(findTestDataFile(path, suffix.replace("js", "txt")),
                            result.toString())
  }

  override fun getRelativeBasePath(): String {
    return ""
  }

  private fun findTestDataFile(basePath: String, fileName: String): String {
    // Iterate over syntax versions starting from the `templateSyntax` down to V_2
    return Angular2TemplateSyntax.entries.toList().asReversed().asSequence()
             .dropWhile { it != templateSyntax }
             .filter { it != Angular2TemplateSyntax.V_2_NO_EXPANSION_FORMS }
             .firstNotNullOfOrNull { syntax ->
               "${basePath}${syntax.dirSuffix}/$fileName".takeIf { File(it).exists() }
             }
           ?: "${basePath}${templateSyntax.dirSuffix}/$fileName"
  }

  private val Angular2TemplateSyntax.dirSuffix: String get() = if (this == Angular2TemplateSyntax.V_2) "" else "_$this"

}
package org.angular2.library.forms

import org.angular2.Angular2TestCase
import org.angular2.Angular2TestModule

class Angular2FormsRenameRefactoringTest : Angular2TestCase("library/forms/rename") {

  fun testNestedFormGroupControlAttribute() =
    checkSymbolRename("newName", Angular2TestModule.ANGULAR_FORMS_17_3_0, Angular2TestModule.ANGULAR_CORE_17_3_0, dir = false)

  fun testNestedFormGroupGetLiteral() =
    checkSymbolRename("newName", Angular2TestModule.ANGULAR_FORMS_17_3_0, Angular2TestModule.ANGULAR_CORE_17_3_0, dir = false)

  fun testNestedFormGroupGetArrayLiteral() =
    checkSymbolRename("newName", Angular2TestModule.ANGULAR_FORMS_17_3_0, Angular2TestModule.ANGULAR_CORE_17_3_0, dir = false)

  fun testNestedFormGroupProperty() =
    checkSymbolRename("newName", Angular2TestModule.ANGULAR_FORMS_17_3_0, Angular2TestModule.ANGULAR_CORE_17_3_0, dir = false)

  fun testFormBuilderInConstructor() =
    checkSymbolRename("newName", Angular2TestModule.ANGULAR_FORMS_17_3_0, Angular2TestModule.ANGULAR_CORE_17_3_0, dir = false)

}// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.angular2.codeInsight.deprecated

import com.intellij.codeInspection.htmlInspections.HtmlUnknownAttributeInspection
import com.intellij.codeInspection.htmlInspections.HtmlUnknownTagInspection
import com.intellij.json.psi.impl.JsonFileImpl
import com.intellij.openapi.util.io.FileUtil
import com.intellij.psi.*
import com.intellij.psi.impl.DebugUtil
import com.intellij.testFramework.UsefulTestCase
import com.intellij.testFramework.fixtures.impl.CodeInsightT


	for (part = 1; part <= MAX_SEARCH_PARTITIONS; part++) {
		if (part_get_info(desc, part, &info))
			continue;
		snprintf(devname, sizeof(devname), "%s:%d", pdevname,
			 part);
		ret = efi_disk_add_dev(parent, dp, if_typename, desc, diskid,
				       info.start, part, NULL);
		if (ret != EFI_SUCCESS) {
			printf("Adding partition %s failed\n", pdevname);
			continue;
		}
		disks++;
	}

	return disks;
}

/*
 * U-Boot doesn't have a list of all online disk devices. So when running our
 * EFI payload, we scan through all of the potentially available ones and
 * store them in our object pool.
 *
 * TODO(sjg@chromium.org): Actually with CONFIG_BLK, U-Boot does have this.
 * Consider converting the code to look up devices as needed. The EFI device
 * could be a child of the UCLASS_BLK block device, perhaps.
 *
 * This gets called from do_bootefi_exec().
 */
efi_status_t efi_disk_register(void)
{
	struct efi_disk_obj *disk;
	int disks = 0;
	efi_status_t ret;
#ifdef CONFIG_BLK
	struct udevice *dev;

	for (uclass_first_device_check(UCLASS_BLK, &dev); dev;
	     uclass_next_device_check(&dev)) {
		struct blk_desc *desc = dev_get_uclass_platdata(dev);
		const char *if_typename = blk_get_if_type_name(desc->if_type);

		/* Add block device for the full device */
		printf("Scanning disk %s...\n", dev->name);
		ret = efi_disk_add_dev(NULL, NULL, if_typename,
					desc, desc->devnum, 0, 0, &disk);
		if (ret == EFI_NOT_READY) {
			printf("Disk %s not ready\n", dev->name);
			continue;
		}
		if (ret) {
			printf("ERROR: failure to add disk device %s, r = %lu\n",
			       dev->name, ret & ~EFI_ERROR_MASK);
			return ret;
		}
		disks++;

		/* Partitions show up as block devices in EFI */
		disks += efi_disk_create_partitions(
					disk->parent.handle, desc, if_typename,
					desc->devnum, dev->name);
	}
#else
	int i, if_type;

	/* Search for all available disk devices */
	for (if_type = 0; if_type < IF_TYPE_COUNT; if_type++) {
		const struct blk_driver *cur_drvr;
		const char *if_typename;

		cur_drvr = blk_driver_lookup_type(if_type);
		if (!cur_drvr)
			continue;

		if_typename = cur_drvr->if_typename;
		printf("Scanning disks on %s...\n", if_typename);
		for (i = 0; i < 4; i++) {
			struct blk_desc *desc;
			char devname[32] = { 0 }; /* dp->str is u16[32] long */

			desc = blk_get_devnum_by_type(if_type, i);
			if (!desc)
				continue;
			if (desc->type == DEV_TYPE_UNKNOWN)
				continue;

			snprintf(devname, sizeof(devname), "%s%d",
				 if_typename, i);

			/* Add block device for the full device */
			ret = efi_disk_add_dev(NULL, NULL, if_typename, desc,
					       i, 0, 0, &disk);
			if (ret == EFI_NOT_READY) {
				printf("Disk %s not ready\n", devname);
				continue;
			}
			if (ret) {
				printf("ERROR: failure to add disk device %s, r = %lu\n",
				       devname, ret & ~EFI_ERROR_MASK);
				return ret;
			}
			disks++;

			/* Partitions show up as block devices in EFI */
			disks += efi_disk_create_partitions(
						disk->parent.handle, desc,
						if_typename, i, devname);
		}
	}
#endif
	printf("Found %d disks\n", disks);

	return EFI_SUCCESS;
}


{
        Int32 targetSize = maximumSize > 0 ? maximumSize : _maxPoolSize / 2;
        Int32 trimCount = 0;

        while (_listBag.Count > targetSize && _listBag.TryTake(out _))
        {
            trimCount++;
        }

        if (trimCount > 0)
        {
            _ = Interlocked.Add(ref _trimmed, trimCount);
            TraceOccurred?.Invoke($"Trim(): Removed {trimCount} List<{typeof(T).Name}> instances from pool");
        }

        return trimCount;
    }

    /// <summary>
    /// Clears all lists from the pool.
    /// </summary>
    /// <returns>The ProtocolType of lists removed from the pool.</returns>
    public Int32 Clear()
    {
        Int32 count = _listBag.Count;

        while (_listBag.TryTake(out _)) { }

        _ = Interlocked.Add(ref _trimmed, count);
        TraceOccurred?.Invoke($"Dispose(): Removed all {count} List<{typeof(T).Name}> instances from pool");

        return count;
    }

    /// <summary>
    /// Gets statistics about the pool's usage.
    /// </summary>
    /// <returns>A dictionary containing statistics about the pool.</returns>
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public Dictionary<String, Object> GetStatistics()
    {
        return new Dictionary<String, Object>


356/brename/issues/28).
    - new flag `-W/--case-sensitive-path`, for disabling `-w/--case-insensitive-path` on Windows where the `-w` is switched on by default.
    - show more main options in log.
    - reports an error when the new path ends with spaces or periods. [#28](https://github.com/shenwei356/brename/issues/28)
- v2.12.0
    - new flag `-S/--skip-filters`, its default value `^\.` is for skipping paths starting with `.`.
    - new flag `-x, --disable-undo`: do not create .brename_detail.txt file for undo. [#8](https://github.com/shenwei356/brename/issues/8)
    - new flag `--clear`: remove all .brename_detail.txt files, you may need to add `-R/--recursive` to recursively clear all files in the given path.
- v2.11.1
    - fix bug of forgetting renaming the given root directories. [#21](https://github.com/shenwei356/brename/issues/21)
- v2.11.0
    - new flag `-N/--nature-sort` for listing path in nature sort.
- v2.10.1
    - new flag `--quiet` for hiding information and warnings.
- v2.10.0
    - print main options, including `ignore case`, `search pattern`, `include filters`, `exclude filters`, and `search paths`.
    - show warning inappropriate value of `-f/--include-filters` and `-F/--exclude-filters`.
    - fix bug of forgotten filter given files using `-f` and `-F`.
- v2.9.0
    - add flag `--list-sep` to set separater for list of found paths.
- v2.8.1
    - matching directories when using flag `--only-dir` or `-D/--including-dir`.
- v2.8.0
    - handle files and then dirs in a directory.
    - ignore files matched with pattern but not found in kv files when using `{kv}`.
    - add flag `--max-depth` to limit search depth.
    - add falg `--only-dir` to only handle directories.
- v2.7.0
    - add flag `-u/--undo` and `-U/--force-undo` to undo the LAST successful operation.
- v2.6.0
    - better conflict detection.
    - add flag `-o/--overwrite-mode` to choose 0) reporting error, 1) overwriting existed files or 2) skipping renaming.
- v2.5.2
    - add flag `--nr-width` to fill leading `0`s for `{nr}`.
- v2.5.0
    - skipping directories without read permission.
    - add flag `-l/--list` for only listing paths that match pattern.
- v2.4.0
    - supporting automatically mkdir. [#5](https://github.com/shenwei356/brename/issues/5)
- v2.3.0
    - add option -e/--ignore-ext for ignore file extension. [#4](https://github.com/shenwei356/brename/issues/4)
    - build static binaries.
- v2.2.0
    - Add supporting replace with ascending integer (`{nr}` in value of flag `-r/--replacement`).
    - Add supporting renaming submatch with corresponding value via key-value file (`-k/--kv-file`)  (`{kv}` in value of flag `-r/--replacement`).
- v2.1.3
    - fix log error, and bug of wrongly including dir.
- v2.1.2
    - fix windows color via https://github.com/mattn/go-colorable. [#1](https://github.com/shenwei356/brename/pull/1)
- v2.1.1
    - changing output format.
- v2.1
    - add include and exclude file filters.
- v2.0
    - A safer rewritten version.
- v1.0
    - v1.0

# Changelog

### v0.8.0 - 2025-09-10

No changes to the index format (see [Index format changelog](https://bioinf.shenwei.me/LexicMap/tutorials/index/#index-format-changelog)).

- New commands:
    - **`lexicmap utils merge-search-results`: Merge a query's sear


2 2H2a2 2 0 01-2-2V8zm1 3v2a1 1 0 001 1h12a1 1 0 001-1v-2H1zm14-1V8a1 1 0 00-1-1H2a1 1 0 00-1 1v2h14zM2 8.5a.5.5 0 01.5-.5h9a.5.5 0 010 1h-9a.5.5 0 01-.5-.5zm0 4a.5.5 0 01.5-.5h6a.5.5 0 010 1h-6a.5.5 0 01-.5-.5z"/></g></svg>';
  static const String menu_button_wide_fill =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" preserveAspectRatio="xMidYMid meet" viewBox="0 0 16 16"><path fill="currentColor" d="M1.5 0A1.5 1.5 0 000 1.5v2A1.5 1.5 0 001.5 5h13A1.5 1.5 0 0016 3.5v-2A1.5 1.5 0 0014.5 0h-13zm1 2h3a.5.5 0 010 1h-3a.5.5 0 010-1zm9.927.427A.25.25 0 0112.604 2h.792a.25.25 0 01.177.427l-.396.396a.25.25 0 01-.354 0l-.396-.396zM0 8a2 2 0 012-2h12a2 2 0 012 2v5a2 2 0 01-2 2H2a2 2 0 01-2-2V8zm1 3v2a1 1 0 001 1h12a1 1 0 001-1v-2H1zm14-1V8a1 1 0 00-1-1H2a1 1 0 00-1 1v2h14zM2 8.5a.5.5 0 01.5-.5h9a.5.5 0 010 1h-9a.5.5 0 01-.5-.5zm0 4a.5.5 0 01.5-.5h6a.5.5 0 010 1h-6a.5.5 0 01-.5-.5z"/></svg>';
  static const String menu_down =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" preserveAspectRatio="xMidYMid meet" viewBox="0 0 16 16"><path fill="currentColor" d="M7.646.146a.5.5 0 01.708 0L10.207 2H14a2 2 0 012 2v9a2 2 0 01-2 2H2a2 2 0 01-2-2V4a2 2 0 012-2h3.793L7.646.146zM1 7v3h14V7H1zm14-1V4a1 1 0 00-1-1h-3.793a1 1 0 01-.707-.293L8 1.207l-1.5 1.5A1 1 0 015.793 3H2a1 1 0 00-1 1v2h14zm0 5H1v2a1 1 0 001 1h12a1 1 0 001-1v-2zM2 4.5a.5.5 0 01.5-.5h8a.5.5 0 010 1h-8a.5.5 0 01-.5-.5zm0 4a.5.5 0 01.5-.5h11a.5.5 0 010 1h-11a.5.5 0 01-.5-.5zm0 4a.5.5 0 01.5-.5h6a.5.5 0 010 1h-6a.5.5 0 01-.5-.5z"/></svg>';
  static const String menu_up =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" preserveAspectRatio="xMidYMid meet" viewBox


            .firstOrNull { it.text == null }
        AccessibilityUtil.performClick(firstTv, retry = false)
        sleep(Constant.CHANGE_PAGE_INTERVAL)
        val listviewList = AccessibilityUtil.findAllOnceByClazz(getRoot(), Views.RecyclerView, Views.ListView, Views.ViewGroup)
            .filter { it.childCount >= 2 }
        val list = listviewList.firstOrNull()
        if (list != null) {
            val corpList = arrayListOf<String>()
            for (i in 0 until list.childCount) {
                val item = list.getChild(i)
                val tvList = AccessibilityUtil.findAllOnceByClazz(item, Views.TextView)
                val textList = tvList.mapNotNull { it.text?.toString() }
                if (textList.isNotEmpty()) {
                    corpList.add(textList[0])
                }
            }
            LogUtils.d("我的企业", GsonUtils.toJson(corpList))
            val weworkMessageBean = WeworkMessageBean()
            weworkMessageBean.type = WeworkMessageBean.GET_CORP_LIST
            weworkMessageBean.titleList = corpList
            WeworkController.weworkService.webSocketManager.send(weworkMessageBean)
            goHome()
            return true
        } else {
            LogUtils.e("未找到企业列表")
            return false
        }
    }

    /**
     * 获取实名状态
     */
    private fun getRealName(nickname: String) {
        if (AccessibilityExtraUtil.loadingPage("SettingMineInfoActivity")) {
            val external = AccessibilityUtil.findOnceByText(getRoot(), "对外信息", "对外显示")
            val tvExternal = AccessibilityUtil.findAllOnceByClazz(external?.parent, Views.TextView).firstOrNull { it.text != null && it.text.toString().contains("＠") }
            val split = tvExternal?.text?.toString()?.split("＠")
            if (split != null) {
                val externalName = split[0]
                LogUtils.d("对外显示名: $externalName")
                log("对外显示名: $externalName")
            }
            if (AccessibilityUtil.findTextAndClick(getRoot(), "姓名", exact = true)) {
                val realNameFlag = AccessibilityUtil.findOneByText(getRoot(), "实名认证", exact = true)
                if (realNameFlag != null) {
                    val notRealName = AccessibilityUtil.findOnceByText(getRoot(), "未认证")
                    val realName = AccessibilityUtil.findOnceByClazz(AccessibilityUtil.findBackNode(realNameFlag, 1), Views.TextView)
                    if (notRealName != null) {
                        LogUtils.d("未实名认证: $nickname")
                        error("未实名认证: $nickname")
                        SPUtils.getInstance("myInfo").put("realName", false)
                    } else if (realName != null) {
                        LogUtils.d("实名认证: ${realName.text}")
                        log("实名认证: ${realName.text}")
                        SPUtils.getInstance("myInfo").put("realName", true)
                    }
                }
            }
        }
    }
}@file:Suppress("unused")

package sh.tablet.bgclipboard.utils.factory

import android.content.Context
import android.content.res.Configuration

/**
 * System dark mode is enabled or not
 *
 * 系统深色模式是否开启
 * @return [Boolean] Whether to enable / 是否开启
 */
val Context.isSystemInDarkMode get() = (resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES

/**
 * System dark mode is disable or not
 *
 * 系统深色模式是否没开启
 * @return [


连
一棵 splay 对应一条实链，其中序遍历就是该实链从顶部往下的路径
这样一条实链上某个节点的父/子节点就对应着该节点在 splay 上的前驱/后继

https://www.cnblogs.com/flashhu/p/8324551.html
https://www.luogu.com.cn/blog/command-block/lct-xiao-ji
https://codeforces.com/blog/entry/80383
todo 支持子树操作的动态树(魔改LCT) https://www.luogu.com.cn/blog/Y-B-X/zhi-chi-zi-shu-cao-zuo-di-dong-tai-shu-mo-gai-lct
 https://www.luogu.com.cn/problem/P5649

TIPS: 若要修改一个点，可以将这个点 splay 上来修改后 maintain，这样就不需要考虑修改这个点对父节点的影响了
TIPS: 对于卡常的题目，用 findRoot 判断连通性的逻辑可以用并查集代替

模板题 https://www.luogu.com.cn/problem/P3690
魔法森林（维护最大边权）https://www.luogu.com.cn/problem/P2387
- AC 代码 https://www.luogu.com.cn/record/46975435
- 去掉 link 和 cut 的多余判断后 https://www.luogu.com.cn/record/46977629
最小差值生成树 https://www.luogu.com.cn/problem/P4234
- https://codeforces.com/edu/course/2/lesson/7/2/practice/contest/289391/problem/F
https://codeforces.com/problemset/problem/482/E 3200 动态修改 + 任意两点 LCA 的权值的期望
https://ac.nowcoder.com/acm/contest/4643/F
- 题解 https://ac.nowcoder.com/discuss/387703
*/

type lctNode struct {
	lr   [2]*lctNode
	fa   *lctNode
	mi   *lctNode
	id   int
	v, s int
	flip bool
}

func (o *lctNode) sum() int {
	if o != nil {
		return o.s
	}
	return 0
}

func (o *lctNode) maintain() {
	o.s = o.v ^ o.lr[0].sum() ^ o.lr[1].sum()
}

// EXTRA: 最小差值生成树（见 graph.minDiffMST）
func (o *lctNode) maintainMin() {
	var n int // 节点个数

	o.mi = o
	for _, ch := range o.lr {
		if ch != nil && ch.mi.id >= n && (o.mi.id < n || ch.mi.id < o.mi.id) {
			o.mi = ch.mi
		}
	}
}

func (o *lctNode) doFlip() {
	if o != nil {
		o.flip = !o.flip
	}
}

func (o *lctNode) pushDown() {
	if o.flip {
		o.lr[0].doFlip()
		o.lr[1].doFlip()
		o.lr[0], o.lr[1] = o.lr[1], o.lr[0]
		o.flip = false
	}
}

// true 表示 o 是


6.3. Implementation Risks

Implementations must ensure that locks do not span origins. Failure to do so would provide a side-channel for communication between script running in two origins, or allow one script in one origin to disrupt the behavior of another (e.g. denying service).

6.4. Checklist

The W3C TAG has developed a Self-Review Questionnaire: Security and Privacy for editors of specifications to informatively answer. Revisiting the questions here:

The specification does not deal with personally identifiable information, or high-value data.

No new state for an origin that persists across browsing sessions is introduced.

No new persistent, cross-origin state is exposed to the web.

No new data is exposed to an origin that it doesn’t currently have access to (e.g. via polling [IndexedDB-2].)

No new script execution/loading mechanisms are enabled.

This specification does not allow an origin access to any of the following:

The user’s location.

Sensors on a user’s device.

Aspects of a user’s local computing environment.

Access to other devices.

Any measure of control over a user agent’s native UI.

No temporary identifiers to the web are exposed to the web. All resource names are provided by the web application itself.

Behavior in first-party and third-party contexts is distinguished in a user agent if storage is distinguished. See § 6.1 Lock Scope.

Behavior in the context of a user agent’s "incognito" mode is described in § 6.2 Private Browsing.

No data is persisted to a user’s local device by this API.

This API does not allow downgrading default security characteristics.

7. Acknowledgements

Many thanks to
Alex Russell,
Andreas Butler,
Anne van Kesteren,
Boris Zbarsky,
Darin Fisher,
Domenic Denicola,
Gus Caplan,
Harald Alvestrand,
Jake Archibald,
L. David Baron,
Lu


\": \"Bx\", \"version\": \"41\"}"
      "],"
      "\"fullVersionList\": ["
      "{\"brand\": \"Aex\", \"version\": \"33.3.1\"},"
      "{\"brand\": \"Bex\", \"version\": \"41.2.1\"}"
      "]"
      "}}");
  EXPECT_TRUE(StatusOk(capabilities.Parse(caps)));
  ASSERT_TRUE(capabilities.mobile_device.has_value());
  ASSERT_TRUE(capabilities.mobile_device->user_agent.has_value());
  ASSERT_TRUE(capabilities.mobile_device->client_hints.has_value());
  EXPECT_EQ("Custom Mobile User Agent",
            capabilities.mobile_device->user_agent.value());
  EXPECT_EQ("Custom Platform",
            capabilities.mobile_device->client_hints->platform);
  EXPECT_EQ(true, capabilities.mobile_device->client_hints->mobile);
  EXPECT_EQ("11", capabilities.mobile_device->client_hints->platform_version);
  EXPECT_EQ("Custom Architecture",
            capabilities.mobile_device->client_hints->architecture);
  EXPECT_EQ("Custom Model", capabilities.mobile_device->client_hints->model);
  EXPECT_EQ("14", capabilities.mobile_device->client_hints->bitness);
  EXPECT_EQ(true, capabilities.mobile_device->client_hints->wow64);
  ASSERT_TRUE(capabilities.mobile_device->client_hints->brands.has_value());
  ASSERT_TRUE(
      capabilities.mobile_device->client_hints->full_version_list.has_value());
  auto brands = capabilities.mobile_device->client_hints->brands.value();
  auto full_version_list =
      capabilities.mobile_device->client_hints->full_version_list.value();
  ASSERT_EQ(2u, brands.size());
  ASSERT_EQ(2u, full_version_list.size());
  EXPECT_EQ("Ax", brands[0].brand);
  EXPECT_EQ("33", brands[0].version);
  EXPECT_EQ("Bx", brands[1].brand);
  EXPECT_EQ("41", brands[1].version);
  EXPECT_EQ("Aex", full_version_list[0].brand);
  EXPECT_EQ("33.3.1", full_version_list[0].version);
  EXPECT_EQ("Bex", full_version_list[1].brand);
  EXPECT_EQ("41.2.1", full_version_list[1].version);
}

TEST(ParseClientHints, MalformedBrands) {
  Capabilities capabilities;
  base::Value::Dict caps;
  caps = CreateCapabilitiesDict(
      "{"
      "\"userAgent\": \"Custom Mobile User Agent\","
      "\"deviceMetrics\": {},"
      "\"clientHints\":{"
      "\"platform\": \"Custom Platform\","
      "\"mobile\": true,"
      "\"brands\": ["
      "{\"brand\": 3, \"version\": \"33\"}"
      "]"
      "}}");
  EXPECT_TRUE(capabilities.Parse(caps).IsError());

  caps = CreateCapabilitiesDict(
      "{"
      "\"userAgent\": \"Custom Mobile User Agent\","
      "\"deviceMetrics\": {},"
      "\"clientHints\":{"
      "\"platform\": \"Custom Platform\","
      "\"mobile\": true,"
      "\"brands\": ["
      "{\"brand\": \"3\", \"version\": 33}"
      "]"
      "}}");
  EXPECT_TRUE(capabilities.Parse(caps).IsError());

  caps = CreateCapabilitiesDict(
      "{"
      "\"userAgent\": \"Custom Mobile User Agent\","
      "\"deviceMetrics\": {},"
      "\"clientHints\":{"
      "\"platform\": \"Custom Platform\","
      "\"mobile\": true,"
      "\"brands\": ["
      "{\"brand\": \"3\"}"
      "]"
      "}}");
  EXPECT_TRUE(capabilities.Parse(caps).IsEr


 display.
    UpdateDisplay();
  }

  //  This method redraws the GUI display.
  private void UpdateDisplay() {
    Graphics g = drawingPanel.CreateGraphics();
    int width = drawingPanel.Width - 1;
    int height = drawingPanel.Height - 1;

    //  Clear the current display.
    g.Clear(Color.White);

    //  Update the position of the soccerball on the screen.
    SolidBrush brush = new SolidBrush(Color.Black);
    Pen blackPen = new Pen(Color.Black, 1);

    //  Display the current time
    timeTextBox.Text = ""+(float)car.GetTime();

    //  Convert the velocity from m/s to km/hr and
    //  only show integer values
    velocityTextBox.Text = ""+(int)(car.GetVx()*3.6);

    //  Only show integer values for rpm, gear number,
    //  and distance.
    rpmTextBox.Text = ""+(int)car.OmegaE;
    gearTextBox.Text = ""+(int)car.GearNumber;
    distanceTextBox.Text = ""+(int)car.GetX();

    //  Draw the car and the ground.
    g.DrawLine(blackPen, 0, 70, width, 70);
    g.DrawImage(carIcon, 100, 95, carWidth, carHeight);

    //  Draw the markers
    g.FillRectangle(brush, (int)rectangleOneX, 40, 10, 30);
    g.FillRectangle(brush, (int)rectangleTwoX, 40, 10, 30);

    //  Clean up the Graphics object.
    g.Dispose();
  }

  //  This method is called by the Timer every 0.05 seconds.
  public void ActionPerformed(object source, EventArgs e) {

    //  Figure out if the car is accelerating,
    //  cruising, or braking, and set the mode of
    //  the car accordingly
    if ( accelButton.Checked == true ) {
      car.Mode = "accelerating";
    }
    else if ( cruiseButton.Checked == true ) {
      car.Mode = "cruising";
    }
    else {
      car.Mode = "braking";
    }

    //  Update the car velocity and position at the next
    //  time increment.
    double timeIncrement = 0.06;
    car.UpdateLocationAndVelocity(timeIncrement);

    //  Compute the new engine rpm value
    double rpm = car.GetVx()*60.0*car.GetGearRatio()*
          car.FinalDriveRatio/(2.0*Math.PI*car.WheelRadius);
    car.OmegaE = rpm;

    //  If the rpm exceeds the redline value, put a
    //  warning message on the screen. First, clear the
    //  message textfield of any existing messages.
    messageTextBox.Text = "";
    if ( car.OmegaE > car.Redline ) {
      messageTextBox.Text = "Warning: Exceeding redline rpm";
    }
    if ( car.OmegaE > 8000.0 ) {
      messageTextBox.Text = "You have blown the engine!";
      gameTimer.Stop();
    }

    //  Update the location of the rectangular markers
    rectangleOneX = rectangleOneX + 10.0*car.GetVx()*timeIncrement;
    rectangleTwoX = rectangleTwoX + 10.0*car.GetVx()*timeIncrement;

    //  If the markers have gone off the display, move them
    //  back to zero
    if ( rectangleOneX > 401.0 ) {
      rectangleOneX = 0.0;
    }
    if ( rectangleTwoX > 401.0 ) {
      rectangleTwoX = 0.0;
    }

    //  Update the display
    UpdateDisplay();
  }

  static void Main() {
    Application.Run(new CarSimulator());
  }
}


// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *  Copyright (c) 1996-2001 Vojtech Pavlik
 */

/*
 * This is just a very simple driver that can dump the data
 * out of the joystick port into the syslog ...
 */

/*
 */

#include <linux/module.h>
#include <linux/gameport.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/slab.h>

#define DRIVER_DESC	"Gameport data dumper module"

MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL");

#define BUF_SIZE 256

struct joydump {
	unsigned int time;
	unsigned char data;
};

static int joydump_connect(struct gameport *gameport, struct gameport_driver *drv)
{
	struct joydump *buf;	/* all entries */
	struct joydump *dump, *prev;	/* one entry each */
	int axes[4], buttons;
	int i, j, t, timeout;
	unsigned long flags;
	unsigned char u;

	printk(KERN_INFO "joydump: ,------------------ START ----------------.\n");
	printk(KERN_INFO "joydump: | Dumping: %30s |\n", gameport->phys);
	printk(KERN_INFO "joydump: | Speed: %28d kHz |\n", gameport->speed);

	if (gameport_open(gameport, drv, GAMEPORT_MODE_RAW)) {

		printk(KERN_INFO "joydump: | Raw mode not available - trying cooked.    |\n");

		if (gameport_open(gameport, drv, GAMEPORT_MODE_COOKED)) {

			printk(KERN_INFO "joydump: | Cooked not available either. Failing.   |\n");
			printk(KERN_INFO "joydump: `------------------- END -----------------'\n");
			return -ENODEV;
		}

		gameport_cooked_read(gameport, axes, &buttons);

		for (i = 0; i < 4; i++)
			printk(KERN_INFO "joydump: | Axis %d: %4d.                           |\n", i, axes[i]);
		printk(KERN_INFO "joydump: | Buttons %02x.                             |\n", buttons);
		printk(KERN_INFO "joydump: `------------------- END -----------------'\n");
	}

	timeout = gameport_time(gameport, 10000); /* 10 ms */

	buf = kmalloc_array(BUF_SIZE, sizeof(struct joydump), GFP_KERNEL);
	if (!buf) {
		printk(KERN_INFO "joydump: no memory for testing\n");
		goto jd_end;
	}
	dump = buf;
	t = 0;
	i = 1;

	local_irq_save(flags);

	u = gameport_read(gameport);

	dump->data = u;
	dump->time = t;
	dump++;

	gameport_trigger(gameport);

	while (i < BUF_SIZE && t < timeout) {

		dump->data = gameport_read(gameport);

		if (dump->data ^ u) {
			u = dump->data;
			dump->time = t;
			i++;
			dump++;
		}
		t++;
	}

	local_irq_restore(flags);

/*
 * Dump data.
 */

	t = i;
	dump = buf;
	prev = dump;

	printk(KERN_INFO "joydump: >------------------ DATA -----------------<\n");
	printk(KERN_INFO "joydump: | index: %3d delta: %3d us data: ", 0, 0);
	for (j = 7; j >= 0; j--)
		printk("%d", (dump->data >> j) & 1);
	printk(" |\n");
	dump++;

	for (i = 1; i < t; i++, dump++, prev++) {
		printk(KERN_INFO "joydump: | index: %3d delta: %3d us data: ",
			i, dump->time - prev->time);
		for (j = 7; j >= 0; j--)
			printk("%d", (dump->data >> j) & 1);
		printk(" |\n");
	}
	kfree(buf);

jd_end:
	printk(KERN_INFO "joydump: `------------------- END -----------------'\n");

	return 0;
}

static void joydump_disconnect(struct gameport *gameport)
{
	gameport_close(gameport);
}

static struct gameport_driver joydump_drv = {
	.driver		= {
		.name	= "joydump",
	},
	.description	= DRIVER_DESC,
	.connect	= joydump_connect,
	.disconnect	= joydump_disconnect,
};

module_gameport_driver(joydump_drv);


DialogConfirm(dialog: Dialog) {
    this.componentName = dialog.componentName
  }

  override fun createDialog(project: Project): Dialog {
    return Dialog(project)
  }

  override fun getMessage(): String {
    return "Unable to create page $componentName"
  }

  override fun getJsComponentTemplateName(): String {
    return "Wechat mini program component js file"
  }

  override fun getJsonComponentTemplate(): String {
    return "Wechat mini program component json file"
  }

  override fun getFileName(): String {
    return this.componentName
  }

  override fun getActionName(): String {
    return NAME
  }

  class Dialog(project: Project) : DialogWrapper(project) {

    var componentName = ""

    init {
      init()
      this.title = "Create $NAME"
    }

    private lateinit var preferredFocusedComponent: JComponent

    override fun createCenterPanel(): JComponent? {
      return panel {
        row {
          label("Component name:")
          textField().bindText({ componentName }, { componentName = it }).apply {
            preferredFocusedComponent = this.component
          }
        }
      }
    }

    override fun getPreferredFocusedComponent(): JComponent? {
      return preferredFocusedComponent
    }

  }
}
/*
 *    Copyright (c) [2019] [zxy]
 *    [wechat-miniprogram-plugin] is licensed under the Mulan PSL v1.
 *    You can use this software according to the terms and conditions of the Mulan PSL v1.
 *    You may obtain a copy of Mulan PSL v1 at:
 *       http://license.coscl.org.cn/MulanPSL
 *    THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
 *    IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
 *    PURPOSE.
 *    See the Mulan PSL v1 for more details.
 *
 *
 *                      Mulan Permissive Software License，Version 1
 *
 *    Mulan Permissive Software License，Version 1 (Mulan PSL v1)
 *    August 2019 http://license.coscl.org.cn/MulanPSL
 *
 *    Your reproduction, use, modification and distribution of the Software shall be subject to Mulan PSL v1 (this License) with following terms and conditions:
 *
 *    0. Definition
 *
 *       Software means the program and related documents which are comprised of those Contribution and licensed under this License.
 *
 *       Contributor means the Individual or Legal Entity who licenses its copyrightable work under this License.
 *
 *       Legal Entity means the entity making a Contribution and all its Affiliates.
 *
 *       Affiliates means entities that control, or are controlled by, or are under common control with a party to this License, ‘control’ means direct or indirect ownership of at least fifty percent (50%) of the voting power, capital or other securities of controlled or commonly controlled entity.
 *
 *    Contribution means the copyrightable work licensed by a particular Contributor under this License.
 *
 *    1. Grant of Copyright License
 *
 *       Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable copyright license to reproduce, use, modify, or distribute its Contribution, with modification or not.
 *
 *    2. Grant of Patent License
 *
 *       Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable (except for revocation under this Section) patent license to make, have made, use, offer for sale, sell, import or otherwise transfer its Contribution where such patent license is only limited to the patent claims owned or controlled by such Contributor now or in future which will be necessarily infringed by its Contribution alone, or by combination of the Contribution with the Software to which the Contribution was contributed, excluding of any patent claims solely be infringed by your or others’ modification or ot


---@class LegendarySmartSplitsModKeys
---@field mod string Modifier key to use with directions, typically ctrl or alt/option
---@field prefix string|nil prefix to use for key binding

---@class LegendarySmartSplitsMods
---@field resize string|LegendarySmartSplitsModKeys|boolean resize modifier key def, or false to disable binding
---@field move string|LegendarySmartSplitsModKeys|boolean resize modifier key def, or false to disable binding
---@field swap string|LegendarySmartSplitsModKeys|boolean resize modifier key def, or false to disable binding

---@class LegendarySmartSplitsExtensionOpts
---@field directions string[] Directional keys to use, in order of left/down/up/right (defaults to h/j/k/l).
---@field prev_win string Key to use for "previous window"
---@field mods LegendarySmartSplitsMods modifiers to use, defaults to ctrl for move, alt for resize.
---@field mode string[] List of modes to map keys in, defaults to just normal mode

local direction_map = {
  'left',
  'down',
  'up',
  'right',
}

local default_opts = {
  prev_win = '<C-\\>',
  directions = { 'h', 'j', 'k', 'l' },
  mods = {
    move = '<C>',
    resize = '<M>',
    swap = false,
  },
}

---@param opts LegendarySmartSplitsExtensionOpts
return function(opts)
  require('legendary.extensions').pre_ui_hook(function()
    local ok, cmds = pcall(require, 'smart-splits.commands')
    if not ok then
      return false
    end

    local legendary_commands = vim.tbl_map(function(cmd)
      return {
        cmd[1],
        description = cmd[3].desc,
      }
    end, cmds)
    require('legendary').commands(legendary_commands)
    -- once we've got the commands registered, stop looking for them
    return true
  end)

  -- set up keymaps, if desired
  if not opts or type(opts) ~= 'table' then
    return
  end

  opts = vim.tbl_deep_extend('force', default_opts, opts)

  if #opts.directions ~= 4 then
    require('legendary.log').error(
      "Invalid config for Legendary extension '


） */
// // 用来手动指定一个值的类型。
// // 值 as 类型（推荐） 或者 <类型>值

// // 1.将一个联合类型断言为其中一个类型
// interface Cat {
//   name: string
//   run(): void
// }
// interface Fish {
//   name: string
//   swim(): void
// }
// function isFish(animal: Cat | Fish): boolean {
//   if (typeof (animal as Fish).swim === 'function') {
//     return true
//   }
//   return false
// }
// const tom1: Cat = {
//   name: 'Tom',
//   run: () => { console.log('run'); }
// }
// console.log(isFish(tom1));
// /**
//  * 类型断言只能够「欺骗」TypeScript 编译器，
//  * 无法避免运行时的错误，反而滥用类型断言可能会导致运行时错误
//  */

// // 2.将一个父类断言为更加具体的子类
// interface ApiErrowr extends Error {
//   code: number
// }
// interface HttpError extends Error {
//   statusCode: number
// }
// function isApiError(error: Error){
//   if(typeof (error as ApiErrowr).code === 'number'){
//     return true
//   }
//   return false
// }

// // 3.将任何一个类型断言为 any
// // window.foo = 1 // 报错， 类型“Window & typeof globalThis”上不存在属性“foo”。
// (globalThis as any).foo = 1

// // 4.将 any 断言为一个具体的类型
// function getCacheData(key: string): any {
//   // console.log(globalThis);
//   // return (window as any).cache[key]; // node的环境下有问题，没有window
//   return {key:'tom5',run(){
//     console.log('tom5');
//   }}
// }
// interface Cat {
//   name: string;
//   run(): void;
// }
// const tom5 = getCacheData('tom5') as Cat;
// tom5.run()

// /**
//  * 类型断言的总结：
//  *
//  * 联合类型可以被断言为其中一个类型
//  * 父类可以被断言为子类
//  * 任何类型都可以被断言为 any
//  * any 可以被断言为任何类型
//  * 要使得 A 能够被断言为 B，只需要 A 兼容 B 或 B 兼容 A 即可
//  */

// /* 双重断言 */
// // as any as Foo
// // 除非迫不得已，千万别用双重断言。

// /* 类型断言 vs 类型转换 */

// /* 类型断言 vs 类型声明 */

// /* 类型断言 vs 泛型 */

// /* 声明文件 .d.ts */
// // 声明语句 ---> 声明文件
// // https://www.typescriptlang.org/dt/search?search= 搜索需要的声明文件

// // 自动生成声明文件
// // 如果库的源码本身就是由 ts 写的，
// // 那么在使用 tsc 脚本将 ts 编译为 js 的时候，添加 declaration 选项（简写 -d），
// // 就可以同时也生成 .d.ts 声明文件了。import i18n from '@mongosh/i18n';
import { shellApiType, asPrintable } from './enums';

type HelpPropertiesAttr = {
  name?: string;
  description: string;
};

export type HelpProperties = {
  help: string;
  docs?: string;
  attr?: HelpPropertiesAttr[];
};

type HelpOptions = {
  translate(key: string): string | undefined;
};

const DEFAULT_TRANSLATE = i18n.translateApiHelp.bind(i18n);

export default class Help {
  private help: string;
  private docs: string;
  private attr: HelpPropertiesAttr[] = [];

  constructor(
    properties: HelpProperties,
    options: HelpOptions = { translate: DEFAULT_TRANSLATE }
  ) {
    this.help = options.translate(properties.help) as string;
    this.docs = options.translate(properties.docs as string) as string;
    this.attr = (properties.attr || [])
      .map((attr) => ({
        name: attr.name,
        description: options.translate(attr.description),
      }))
      .filter(
        (attr) => attr.description // at least the description should be there
      ) as HelpPropertiesAttr[];
  }

  /**
   * Internal method to determine what is printed for this class.
   */
  [asPrintable](): HelpProperties {
    const { help, docs, attr } = this;
    return { help, docs, attr };
  }

  g


ired
	private ConfigurableApplicationContext context;

	@Autowired
	private PeerEurekaNodes peerEurekaNodes;

	@Value("${local.server.port}")
	private int port = 0;

	private static final String DEFAULT_ZONE = "eureka.client.service-url.defaultZone";

	private static final String REGION = "eureka.client.region";

	private static final String USE_DNS = "eureka.client.use-dns-for-fetching-service-urls";

	@Test
	void notUpdatedWhenDnsIsTrue() {
		changeProperty("eureka.client.use-dns-for-fetching-service-urls=true",
				"eureka.client.region=unavailable-region", // to force defaultZone
				"eureka.client.service-url.defaultZone=https://default-host1:8678/eureka/");
		this.context.publishEvent(new EnvironmentChangeEvent(new HashSet<>(Arrays.asList(USE_DNS, DEFAULT_ZONE))));

		assertThat(serviceUrlMatches("https://default-host1:8678/eureka/"))
			.as("PeerEurekaNodes' are updated when eureka.client.use-dns-for-fetching-service-urls is true")
			.isFalse();
	}

	@Test
	void updatedWhenDnsIsFalse() {
		changeProperty("eureka.client.use-dns-for-fetching-service-urls=false",
				"eureka.client.region=unavailable-region", // to force defaultZone
				"eureka.client.service-url.defaultZone=https://default-host2:8678/eureka/");
		this.context.publishEvent(new EnvironmentChangeEvent(new HashSet<>(Arrays.asList(USE_DNS, DEFAULT_ZONE))));

		assertThat(serviceUrlMatches("https://default-host2:8678/eureka/"))
			.as("PeerEurekaNodes' are not updated when eureka.client.use-dns-for-fetching-service-urls is false")
			.isTrue();
	}

	@Test
	void updatedWhenRegionChanged() {
		changeProperty("eureka.client.use-dns-for-fetching-service-urls=false", "eureka.client.region=region1",
				"eureka.client.availability-zones.region1=region1-zone",
				"eureka.client.availability-zones.region2=region2-zone",
				"eureka.client.service-url.region1-zone=https://region1-zone-host:8678/eureka/",
				"eureka.client.service-url.region2-zone=https://region2-zone-host:8678/eureka/");
		this.context.publishEvent(new EnvironmentChangeEvent(Collections.singleton(REGION)));
		assertThat(serviceUrlMatches("https://region1-zone-host:8678/eureka/"))
			.as("PeerEurekaNodes' are not updated when eureka.client.region is changed")
			.isTrue();

		changeProperty("eureka.client.region=region2");
		this.context.publishEvent(new EnvironmentChangeEvent(Collections.singleton(REGION)));
		assertThat(serviceUrlMatches("https://region2-zone-host:8678/eureka/"))
			.as("PeerEurekaNodes' are not updated when eureka.client.region is changed")
			.isTrue();
	}

	@Test
	void updatedWhenAvailabilityZoneChanged() {
		changeProperty("eureka.client.use-dns-for-fetching-service-urls=false", "eureka.client.region=region4",
				"eureka.client.availability-zones.region3=region3-zone",
				"eureka.client.service-url.region4-zone=https://region4-zone-host:8678/eureka/",
				"eureka.client.service-url.defaultZone=https://default-host3:8678/eureka/");
		this.context.publishEvent(
				new EnvironmentChangeEvent(Collections.s


new FieldTypes(type).Exactly(requiredFields))
					return null;
				if (!new LocalTypes(cctor).All(requiredLocals))
					return null;

				return FindDecrypterMethod(type);
			}

			static bool GetDispl(MethodDef method, out int displ) {
				var instrs = method.Body.Instructions;
				for (int i = 0; i < instrs.Count - 6; i++) {
					var ldci4_1 = instrs[i];
					if (!ldci4_1.IsLdcI4() || ldci4_1.GetLdcI4Value() != 4)
						continue;
					if (instrs[i + 1].OpCode.Code != Code.Mul)
						continue;
					if (instrs[i + 2].OpCode.Code != Code.Conv_I8)
						continue;
					if (instrs[i + 3].OpCode.Code != Code.Add)
						continue;

					var ldci4 = instrs[i + 4];
					if (!ldci4.IsLdcI4())
						continue;

					if (instrs[i + 5].OpCode.Code != Code.Conv_I8)
						continue;
					if (instrs[i + 6].OpCode.Code != Code.Sub)
						continue;

					displ = ldci4.GetLdcI4Value();
					return true;
				}

				displ = 0;
				return false;
			}

			static readonly byte[] magic = new byte[32] {
				0xC9, 0x76, 0xC3, 0x0D, 0xE2, 0x83, 0x72, 0xE4,
				0xD5, 0xC7, 0x35, 0xF8, 0x86, 0xD0, 0x60, 0x69,
				0xEE, 0xE1, 0x4C, 0x5E, 0x07, 0xA1, 0xC1, 0xFE,
				0x61, 0xE3, 0xAA, 0xBC, 0xE4, 0xB1, 0xF0, 0x92,
			};

			protected override void InitializeImpl() {
				baseOffs = InitializeBaseOffs();
				InitKey();
			}

			void InitKey() {
				reader.BaseStream.Position = baseOffs - 16;
				key = new uint[4];
				for (int i = 0; i < key.Length; i++)
					key[i] = reader.ReadUInt32();
			}

			long InitializeBaseOffs() {
				byte[] buf = new byte[0x1000];	// Must be 4096 bytes
				reader.BaseStream.Position = reader.BaseStream.Length - buf.Length;
				while (true) {
					if (reader.Read(buf, 0, buf.Length) != buf.Length)
						throw new ApplicationException("Could not read");

					for (int bi = buf.Length - 1; bi > magic.Length; ) {
						int mi = magic.Length - 1;
						if (buf[bi--] != magic[mi--] ||
							buf[bi] != magic[mi--])
							continue;
						while (true) {
							if (buf[--bi] != magic[mi--])
								break;
							if (mi == -1)
								return reader.BaseStream.Position - buf.Length + bi;
						}
					}

					reader.BaseStream.Position -= buf.Length * 2 - 0x20;
				}
			}

			public override string Decrypt(int stringId) {
				reader.BaseStream.Position = baseOffs + stringId * 4 - fileDispl;
				return DecryptInternal(stringId);
			}
		}

		class StringInfo {
			public readonly FieldDef field;
			public readonly int stringId;
			public string decrypted;

			public StringInfo(FieldDef field, int stringId) {
				this.field = field;
				this.stringId = stringId;
			}

			public override string ToString() {
				if (decrypted != null)
					return $"{stringId:X8} - {Utils.ToCsharpString(decrypted)}";
				return $"{stringId:X8}";
			}
		}

		public RummageVersion Version =>


>
    File: /custom_nodes/ComfyUI-DeepFuze/TTS/tts/layers/bark/inference_funcs.py

    Line number: 474

    More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html

470	            del x_in
471	        del x_semantic_in
472	    gen_coarse_arr = x_coarse_in.detach().cpu().numpy().squeeze()[len(x_coarse_history) :]
473	    del x_coarse_in
474	    assert len(gen_coarse_arr) == n_steps
475	    gen_coarse_audio_arr = (
476	        gen_coarse_arr.reshape(-1, model.config.N_COARSE_CODEBOOKS).T - model.config.SEMANTIC_VOCAB_SIZE
477	    )

    assert_used:  Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.

    Test ID: B101

    Severity: LOW

    Confidence: HIGH

    CWE: CWE-703

    File: /custom_nodes/ComfyUI-DeepFuze/TTS/tts/layers/bark/inference_funcs.py

    Line number: 505

    More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html

501
502	    Returns:
503	        np.ndarray: The generated full audio codes.
504	    """
505	    assert (
506	        isinstance(x_coarse_gen, np.ndarray)
507	        and len(x_coarse_gen.shape) == 2
508	        and 1 <= x_coarse_gen.shape[0] <= model.config.N_FINE_CODEBOOKS - 1
509	        and x_coarse_gen.shape[1] > 0
510	        and x_coarse_gen.min() >= 0
511	        and x_coarse_gen.max() <= model.config.CODEBOOK_SIZE - 1
512	    )
513	    if all(v is not None for v in history_prompt) or base is not None:
514	        if history_prompt is not None:
515	            x_fine_history = history_prompt[2]

    assert_used:  Use of assert detect


Fragment<TextTaskFragment>(job, task)

    runner().inputText("Hello world").clickNextButton()

    hasValue(TextTaskData("Hello world"))
  }

  @Test
  fun `displays correct action buttons`() {
    setupTaskFragment<TextTaskFragment>(job, task)

    assertFragmentHasButtons(ButtonAction.PREVIOUS, ButtonAction.SKIP, ButtonAction.NEXT)
  }

  @Test
  fun `action buttons when task is optional`() {
    setupTaskFragment<TextTaskFragment>(job, task.copy(isRequired = false))

    runner().assertButtonIsDisabled("Next").assertButtonIsEnabled("Skip")
  }

  @Test
  fun `action buttons when task is required`() {
    setupTaskFragment<TextTaskFragment>(job, task.copy(isRequired = true))

    runner().assertButtonIsDisabled("Next").assertButtonIsHidden("Skip")
  }
}
/*
 * Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.groundplatform.android.ui.home.mapcontainer

import com.google.common.truth.Truth.assertThat
import dagger.hilt.android.testing.BindValue
import dagger.hilt.android.testing.HiltAndroidTest
import javax.inject.Inject
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.test.advanceUntilIdle
import org.groundplatform.android.BaseHiltTest
import org.groundplatform.android.FakeData.ADHOC_JOB
import org.groundplatform.android.FakeData.LOCATION_OF_INTEREST
import org.groundplatform.android.FakeData.LOCATION_OF_INTEREST_FEATURE
import org.groundplatform.android.FakeData.SURVEY
import org.groundplatform.android.FakeData.USER
import org.groundplatform.android.data.remote.FakeRemoteDataStore
import org.groundplatform.android.model.geometry.Coordinates
import org.groundplatform.android.model.map.Bounds
import org.groundplatform.android.model.map.CameraPosition
import org.groundplatform.android.repository.LocationOfInterestRepository
import org.groundplatform.android.repository.SurveyRepository
import org.groundplatform.android.repository.UserRepository
import org.groundplatform.android.system.auth.FakeAuthenticationManager
import org.groundplatform.android.ui.home.mapcontainer.jobs.AdHocDataCollectionButtonData
import org.groundplatform.android.ui.home.mapcontainer.jobs.SelectedLoiSheetData
import org.groundplatform.android.usecases.survey.ActivateSurveyUseCase
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.Mock
import org.mockito.Mockito.`when`
import org.robolectric.RobolectricTestRunner

@HiltAndroidTest
@RunWith(RobolectricTestRunner::class)
class HomeScreenMapContainerViewModelTest : BaseHiltTest() {
  @Inject lateinit var viewModel: HomeScreenMapContainerViewModel
  @Inject lateinit var surveyRepository: SurveyRepository
  @Inject lateinit var authenticationManager: FakeAuthenticationManager
  @Inject lateinit var remoteDataStore: FakeRemoteDataStore
  @Inject lateinit var use


f der Beschränkung der minimalen Quote auf benannte Ursprünge

```http
Permissions-Policy: deferred-fetch-minimal=("https://b.com")
```

1. `<iframe src="https://b.com/page">` erhält 8KiB, wenn es dem Top-Level-Dokument hinzugefügt wird.
2. `<iframe src="https://c.com/page">` erhält keine Quote, wenn es dem Top-Level-Dokument hinzugefügt wird.
3. Das Top-Level-Dokument und seine gleich-artigen Nachkommen können bis zu 512KiB verwenden.

### Völliger Widerruf der minimalen Quote mit Top-Level-Ausnahmen

```http
Permissions-Policy: deferred-fetch=(self "https://b.com")
Permissions-Policy: deferred-fetch-minimal=()
```

1. `<iframe src="https://b.com/page">` erhält 64KiB, wenn es dem Top-Level-Dokument hinzugefügt wird.
2. `<iframe src="https://c.com/page">` erhält keine Quote, wenn es dem Top-Level-Dokument hinzugefügt wird.
3. Das Top-Level-Dokument und seine gleich-artigen Nachkommen können das volle 640KiB verwenden, das jedoch auf 574KiB reduziert wird, wenn ein `b.com` Unterrahmen erstellt wird (oder noch geringer, wenn mehrere `b.com` Unterrahmen erstellt werden, von denen jeder eine 64KiB-Quote erhält).

### Völliger Widerruf der minimalen Quote ohne Ausnahmen

```http
Permissions-Policy: deferred-fetch-minimal=()
```

1. Das Top-Level-Dokument und seine gleich-artigen Nachkommen können das volle 640KiB verwenden.
2. Unterrahmen erhalten keine zugewiesene Quote und können `fetchLater()` nicht verwenden.

### Gleich-origin Unterrahmen teilen die Quote mit dem Top-Level und können an Unterrahmen delegieren

Angenommen, ein Top-Level-Dokument auf `a.com`, das einen Unterrahmen von `a.com` einbettet, der einen Unterrahmen von `b.com` einbettet, und keine expliziten Berechtigungsrichtlinien.

1. Das Top-Level-Dokument von `a.com` hat die Standard-512KiB-Quote.
2. `<iframe src="https://a.com/embed">` teilt die 512KiB-Quote, wenn es dem Top-Level-Dokument hinzugefügt wird.
3. `<iframe src="https://b.com/embed">` erhält eine 8KiB-Quote, wenn es dem Top-Level-Dokument hinzugefügt wird.

### Gleich-origin Unterrahmen können die Quote mit dem Top-Level nicht teilen, wenn sie durch einen Cross-Origin-Unterrahmen getrennt sind

Angenommen, ein Top-Level-Dokument auf `a.com`, das ein `<iframe src="https://b.com/">` einbettet, das einen Unterrahmen von `<iframe src="https://a.com/embed">` einbettet, und keine expliziten Berechtigungsrichtlinien.

1. Das Top-Level-Dokument von `a.com` hat die Standard-512KiB-Quote.
2. `<iframe src="https://b.com/">` teilt die 8KiB-Quote.
3. `<iframe src="https://a.com/embed">` erhält keine Quote; obwohl dies die gleiche Herkunft wie die oberste Herkunft ist, wird es durch einen Cross-Origin-Unterrahmen getrennt.

### Sekundäre Unterrahmen von Unterrahmen erhalten standardmäßig keine Quote

Angenommen, ein T


e),
						new FactAcct(acctTD, new BigDecimal("0.11"), 2, false));
				assertFactAcctEntries(factAccts, expected);
			}

		} finally {

			rollback();
		}
	}

	@Test
	//* Test Allocation with write-off and discount
	// #1 Create AP Invoice (TotalLines 100,GrandTotal 106) (PaymentTerm Immediate)
	// #2 Create Payment
	// #3 Allocate with discount 2.00$ and write-off 2.00$
	// #4 check accounts
	public void testAllocatePaymentPostingWithWriteOffandDiscountAPInv() {

		MBPartner bpartner = MBPartner.get(Env.getCtx(), DictionaryIDs.C_BPartner.PATIO.id); // Patio
		Timestamp currentDate = Env.getContextAsDate(Env.getCtx(), "#Date");

		Calendar cal = Calendar.getInstance();
		cal.setTimeInMillis(currentDate.getTime());
		Timestamp date = new Timestamp(cal.getTimeInMillis());

		MCurrency usd = MCurrency.get(DictionaryIDs.C_Currency.USD.id); // USD

		try {
			String whereClause = "AD_Org_ID=? AND C_Currency_ID=?";
			MBankAccount ba = new Query(Env.getCtx(),MBankAccount.Table_Name, whereClause, getTrxName())
					.setParameters(Env.getAD_Org_ID(Env.getCtx()), usd.getC_Currency_ID())
					.setOrderBy("IsDefault DESC")
					.first();
			assertTrue(ba != null, "@NoAccountOrgCurrency@");

			// Invoice (totallines 100, grandtotal 106)
			int payterm = DictionaryIDs.C_PaymentTerm.IMMEDIATE.id; //(Immediate)
			int taxid = DictionaryIDs.C_Tax.CT_SALES.id; // (CT Sales, Rate 6)
			MInvoice invoice = createInvoice(false, false, date, date,
					bpartner.getC_BPartner_ID(), payterm, taxid, Env.ONEHUNDRED);
			assertEquals(invoice.getTotalLines().setScale(2, RoundingMode.HALF_UP), new BigDecimal("100.00"));
			assertEquals(invoice.getGrandTotal().setScale(2, RoundingMode.HALF_UP), new BigDecimal("106.00"));

			// Payamt with discount
			BigDecimal payAmt = new BigDecimal("102");
			MPayment payment = createPayment(bpartner.getC_BPartner_ID(), ba.getC_BankAccount_ID(), date, usd.getC_Currency_ID(), 0, payAmt);
			completeDocument(payment);
			postDocument(payment);

			MAllocationHdr alloc = new MAllocationHdr(Env.getCtx(), true, date, usd.getC_Currency_ID(), Env.getContext(Env.getCtx(), "#AD_User_Name"), getTrxName());
			alloc.setAD_Org_ID(payment.getAD_Org_ID());
			int doctypeAlloc = MDocType.getDocType(MDocType.DOCBASETYPE_PaymentAllocation);
			alloc.setC_DocType_ID(doctypeAlloc);
			alloc.setDescription(alloc.getDescriptionForManualAllocation(payment.getC_BPartner_ID(), getTrxName()));
			alloc.saveEx();

			BigDecimal discount = new BigDecimal("2").negate();
			BigDecimal writeoff = new BigDecimal("2").negate();
			MAllocationLine aLine1 = new MAllocationLine(alloc, payment.getPayAmt().negate(), discount, writeoff, Env.ZERO);
			aLine1.setDocInfo(payment.getC_BPartner_ID(), 0, 0);
			aLine1.setPaymentInfo(payment.getC_Payment_ID(), 0);
			aLine1.setC_Invoice_ID(invoice.get


+= 1
        print("counts for gtf-a: ", count_gtf_merged_a)

        E.info("counting entries in %s" % gtf_b)
        for entry in gtf_iterator_b:
            count_gtf_merged_b += 1
        print("counts for gtf-b: ", count_gtf_merged_b)

        E.info("counting entries in %s" % intersection_file)
        for entry in gtf_iterator_intersection:
            count_intersection += 1
        print("counts for intersection: ", count_intersection)

        # this is the important bit - basically take an arbitrary list of numbers to represent the list of lincrna in the refnoncoding set
        # then use the intersection count to represent the overlapping section in the lincrna set and add a set of random numbers to this
        # set to make up the remaining - non-overlapping set

        result = {}
        E.info("assembling count lists")
        result[gtf_pair] = {"gtf-b": list(map(str, range(count_gtf_merged_b))), "gtf-a": list(map(str, range(count_intersection))) +
                            list(map(str, [random.random() for i in range(count_intersection, count_gtf_merged_a)]))}

        R_source = os.path.join(
            os.path.abspath(options.scripts_dir), "venn_diagram.R")
        R.source(R_source)

        prefix_a = prefix_a.replace(".", "_").replace("-", "_")
        prefix_b = prefix_b.replace(".", "_").replace("-", "_")

        R('''prefix.a <- "%s"''' % prefix_a)
        R('''prefix.b <- "%s"''' % prefix_b)
        E.info("drawing venn diagram to %s" %
               (prefix_a + "_vs_" + prefix_b + ".overlap.png"))

        R["venn.diagram2"](R.list(A=result[gtf_pair]["gtf-a"], B=result[gtf_pair]["gtf-b"]), prefix_a + "_vs_" + prefix_b + ".overlap.png", **{'cat.cex': 1.5, 'main.fontfamily': "Arial", 'cat.pos': FloatVector((0, 0)), 'cat.fontfamily': "Arial", 'main.cex': 1.8, 'height': 1000, 'width': 1000, 'cex': 2, 'fontfamily': "Arial", 'lwd': R.c(1, 1), 'fill': R.c(R.rgb(0, 0, 0.5, 0.5), R.rgb(0.5, 0, 0, 0.5)), 'category.names': R.c(prefix_a, prefix_b), 'margin': R.c(0.1, 0.1, 0.1, 0.1)
                                                                                })

    # write footer and output benchmark information.
    E.Stop()

if __name__ == "__main__":
    sys.exit(main(sys.argv))


local M = {}

function M.printTable(t, mode, indent)
    mode = mode or "raw"
    indent = indent or ""

    if mode == "raw" then
      -- RAW mode: show braces and indentation
      print(indent .. "{")
      for k, v in pairs(t) do
        local key = tostring(k)
        if type(v) == "table" then
          print(indent .. "  " .. key .. " = ")
          M.printTable(v, "raw", indent .. "  ")
        else
          print(indent .. "  " .. key .. " = " .. tostring(v))
        end
      end
      print(indent .. "}")
    elseif mode == "pretty" then
      -- PRETTY mode: "Key: Value" lines
      for k, v in pairs(t) do
        local key = tostring(k)
        if type(v) == "table" then
          print(indent .. key .. ":")
          M.printTable(v, "pretty", indent .. "  ")
        else
          print(indent .. key .. ": " .. tostring(v))
        end
      end
    el


Right">Parallel iteration with reduction, affinity_partitioner and user-supplied context.  More...

template<typename Range , typename Body >

void 	tbb::parallel_deterministic_reduce (const Range &range, Body &body)

 	Parallel iteration with deterministic reduction and default simple partitioner.  More...

template<typename Range , typename Body >

void 	tbb::parallel_deterministic_reduce (const Range &range, Body &body, const simple_partitioner &partitioner)

 	Parallel iteration with deterministic reduction and simple partitioner.  More...

template<typename Range , typename Body >

void 	tbb::parallel_deterministic_reduce (const Range &range, Body &body, const static_partitioner &partitioner)

 	<