func GetNationalSignificantNumber(number *PhoneNumber) string {
	// If leading zero(s) have been set, we prefix this now. Note this
	// is not a national prefix.
	nationalNumber := builder.NewBuilder(nil)
	if number.GetItalianLeadingZero() {
		zeros := make([]byte, number.GetNumberOfLeadingZeros())
		for i := range zeros {
			zeros[i] = '0'
		}
		nationalNumber.Write(zeros)
	}
	asStr := strconv.FormatUint(number.GetNationalNumber(), 10)
	nationalNumber.WriteString(asStr)

	return nationalNumber.String()
}

// A helper function that is used by format and formatByPattern.
func prefixNumberWithCountryCallingCode(
	countryCallingCode int,
	numberFormat PhoneNumberFormat,
	formattedNumber *builder.Builder) {

	// TODO(ttacon): add some sort of BulkWrite builder to builder.Builder
	// also that name isn't too awesome...:)
	newBuf := builder.NewBuilder(nil)
	switch numberFormat {
	case E164:
		newBuf.WriteString(string(PLUS_SIGN))
		newBuf.Write(strconv.AppendInt([]byte{}, int64(countryCallingCode), 10))
		newBuf.Write(formattedNumber.Bytes())
	case INTERNATIONAL:
		newBuf.WriteString(string(PLUS_SIGN))
		newBuf.Write(strconv.AppendInt([]byte{}, int64(countryCallingCode), 10))
		newBuf.WriteString(" ")
		newBuf.Write(formattedNumber.Bytes())
	case RFC3966:
		newBuf.WriteString(RFC3966_PREFIX)
		newBuf.WriteString(string(PLUS_SIGN))
		newBuf.Write(strconv.AppendInt([]byte{}, int64(countryCallingCode), 10))
		newBuf.WriteString("-")
		newBuf.Write(formattedNumber.Bytes())
	case NATIONAL:
		fallthrough
	default:
		newBuf.Write(formattedNumber.Bytes())
	}
	formattedNumber.ResetWith(newBuf.Bytes())
}

// Simple wrapper of formatNsn for the common case of no carrier code.
func formatNsn(
	number string, metadata *PhoneMetadata, numberFormat PhoneNumberFormat) string {
	return formatNsnWithCarrier(number, metadata, numberFormat, "")
}

// Note in some regions, the national number can be written in two
// completely different ways depending on whether it forms part of the
// NATIONAL format or INTERNATIONAL format. The numberFormat parameter
// here is used to specify which format to use for those cases. If a
// carrierCode is specified, this will be inserted into the formatted
// string to replace $CC.
func formatNsnWithCarrier(
	number string,
	metadata *PhoneMetadata,
	numberFormat PhoneNumberFormat,
	carrierCode string) string {
	var intlNumberFormats []*NumberFormat = metadata.GetIntlNumberFormat()
	// When the intlNumberFormats exists, we use that to format national
	// number for the INTERNATIONAL format instead of using the
	// numberDesc.numberFormats.
	var availableFormats []*NumberFormat = metadata.GetIntlNumberFormat()
	if len(intlNumberFormats) == 0 || numberFormat == NATIONAL {
		availableFormats = metadata.GetNumberFormat()
	}
	var formattingPattern *NumberFormat = chooseFormattingPatternForNumber(
		availableFormats, number)
	if formattingPattern == nil {
		return number
	}
	return formatNsnUsingPatternWithCarrier(
		number, formattingPattern, numberFormat, carrierCode)
}

func chooseFormattingPatternForNumber(
	availableFormats []*NumberFormat,
	nationalNumber string) *NumberFormat {

	for _, numFormat := range availableFormats {
		leadingDigitsPattern := numFormat.GetLeadingDigitsPattern()
		size := len(leadingDigitsPattern)

		patP := `^(?:` + numFormat.GetPattern() + `)$` // Strictly match
		m, ok := readFrom


ce
	a.Log.Log("info", "releasing device, all DEP enrollment commands and profiles have completed", "host_uuid", args.HostUUID)
	if err := a.Commander.DeviceConfigured(ctx, args.HostUUID, uuid.NewString()); err != nil {
		return ctxerr.Wrap(ctx, err, "failed to enqueue DeviceConfigured command")
	}
	return nil
}

func (a *AppleMDM) installFleetd(ctx context.Context, hostUUID string) (string, error) {
	manifestURL := fleetdbase.GetPKGManifestURL()
	cmdUUID := uuid.New().String()
	if err := a.Commander.InstallEnterpriseApplication(ctx, []string{hostUUID}, cmdUUID, manifestURL); err != nil {
		return "", err
	}
	a.Log.Log("info", "sent command to install fleetd", "host_uuid", hostUUID)
	return cmdUUID, nil
}

func (a *AppleMDM) installSetupExperienceVPPAppsOnIosIpadOS(ctx context.Context, hostUUID string) ([]string, error) {
	statuses, err := a.Datastore.ListSetupExperienceResultsByHostUUID(ctx, hostUUID)
	if err != nil {
		return nil, ctxerr.Wrap(ctx, err, "retrieving setup experience status results for next step")
	}

	var appsPending []*fleet.SetupExperienceStatusResult
	commandUUIDs := []string{}
	for _, status := range statuses {
		if err := status.IsValid(); err != nil {
			return nil, ctxerr.Wrap(ctx, err, "invalid row")
		}

		switch {
		case status.VPPAppTeamID != nil:
			if status.Status == fleet.SetupExperienceStatusPending {
				appsPending = append(appsPending, status)
			}
		case status.SetupExperienceScriptID != nil, status.SoftwareInstallerID != nil:
			status.Status = fleet.SetupExperienceStatusFailure
			err = a.Datastore.UpdateSetupExperienceStatusResult(ctx, status)
			if err != nil {
				return nil, ctxerr.Wrap(ctx, err, "updating setup experience status result to failure")
			}
			// If we enqueued a non-VPP item for an iOS/iPadOS device, it likely a code bug
			level.Error(a.Log).Log("msg", "unexpected setup experience item for iOS/iPadOS device, only VPP apps are supported", "host_uuid", hostUUID, "status_id", status.ID)
		}
	}

	if len(appsPending) > 0 {
		// enqueue vpp apps
		// TODO Is there a better way to get a host by UUID? This is a somewhat "wide" search which feels unnecessary
		host, err := a.Datastore.HostByIdentifier(ctx, hostUUID)
		if err != nil {
			return nil, ctxerr.Wrap(ctx, err, "retrieving host by UUID")
		}
		for _, app := range appsPending {
			vppAppID, err := app.VPPAppID()
			if err != nil {
				return nil, ctxerr.Wrap(ctx, err, "constructing vpp app details for installation")
			}

			if app.SoftwareTitleID == nil {
				return nil, ctxerr.Errorf(ctx, "setup experience software title id missing from vpp app install request: %d", app.ID)
			}

			vppApp := &fleet.VPPApp{
				TitleID: *app.SoftwareTitleID,
				VPPAppTeam: fleet.VPPAppTeam{
					VPPAppID: *vppAppID,
				},
			}

			opts := fleet.HostSoftwareInstallOptions{
				SelfService:        false,
				ForSetupExperience: true,
			}

			cmdUUID, err := a.installSoftwareFromVPP(ctx, host, vppApp, true, opts)

			app.NanoCommandUUID = &cmdUUID
			app.Status = fleet.SetupExperienceStatusRunning

			if err != nil {
				// if we get an error (e.g. no available licenses) while attempting to enqueue the


ror: invalid operand
#CHECK: sac	4096
#CHECK: error: invalid use of indexed addressing
#CHECK: sac	0(%r1,%r2)

	sac	-1
	sac	4096
	sac	0(%r1,%r2)

#CHECK: error: invalid operand
#CHECK: sacf	-1
#CHECK: error: invalid operand
#CHECK: sacf	4096
#CHECK: error: invalid use of indexed addressing
#CHECK: sacf	0(%r1,%r2)

	sacf	-1
	sacf	4096
	sacf	0(%r1,%r2)

#CHECK: error: invalid operand
#CHECK: sck	-1
#CHECK: error: invalid operand
#CHECK: sck	4096
#CHECK: error: invalid use of indexed addressing
#CHECK: sck	0(%r1,%r2)

	sck	-1
	sck	4096
	sck	0(%r1,%r2)

#CHECK: error: invalid operand
#CHECK: sckc	-1
#CHECK: error: invalid operand
#CHECK: sckc	4096
#CHECK: error: invalid use of indexed addressing
#CHECK: sckc	0(%r1,%r2)

	sckc	-1
	sckc	4096
	sckc	0(%r1,%r2)

#CHECK: error: invalid operand
#CHECK: sd	%f0, -1
#CHECK: error: invalid operand
#CHECK: sd	%f0, 4096

	sd	%f0, -1
	sd	%f0, 4096

#CHECK: error: invalid operand
#CHECK: sdb	%f0, -1
#CHECK: error: invalid operand
#CHECK: sdb	%f0, 4096

	sdb	%f0, -1
	sdb	%f0, 4096

#CHECK: error: instruction requires: fp-extension
#CHECK: sdtra	%f0, %f0, %f0, 0

	sdtra	%f0, %f0, %f0, 0

#CHECK: error: invalid operand
#CHECK: se	%f0, -1
#CHECK: error: invalid operand
#CHECK: se	%f0, 4096

	se	%f0, -1
	se	%f0, 4096

#CHECK: error: invalid operand
#CHECK: seb	%f0, -1
#CHECK: error: invalid operand
#CHECK: seb	%f0, 4096

	seb	%f0, -1
	seb	%f0, 4096

#CHECK: error: invalid operand
#CHECK: sg	%r0, -524289
#CHECK: error: invalid operand
#CHECK: sg	%r0, 524288

	sg	%r0, -524289
	sg	%r0, 524288

#CHECK: error: invalid operand
#CHECK: sgf	%r0, -524289
#CHECK: error: invalid operand
#CHECK: sgf	%r0, 524288

	sgf	%r0, -524289
	sgf	%r0, 524288

#CHECK: error: instruction requires: distinct-ops
#CHECK: sgrk	%r2,%r3,%r4

	sgrk	%r2,%r3,%r4

#CHECK: error: invalid operand
#CHECK: sh	%r0, -1
#CHECK: error: invalid operand
#CHECK: sh	%r0, 4096

	sh	%r0, -1
	sh	%r0, 4096

#CHECK: error: instruction requires: high-word
#CHECK: shhhr	%r0, %r0, %r0

	shhhr


ver, TranslationMetadata<AppLocale, Translations>? meta})
		: assert(overrides == null, 'Set "translation_overrides: true" in order to enable this feature.'),
		  $meta = meta ?? TranslationMetadata(
		    locale: AppLocale.loLa,
		    overrides: overrides ?? {},
		    cardinalResolver: cardinalResolver,
		    ordinalResolver: ordinalResolver,
		  ),
		  super(cardinalResolver: cardinalResolver, ordinalResolver: ordinalResolver);

	/// Metadata for the translations of <lo-LA>.
	@override final TranslationMetadata<AppLocale, Translations> $meta;

	late final TranslationsLoLa _root = this; // ignore: unused_field

	@override
	TranslationsLoLa $copyWith({TranslationMetadata<AppLocale, Translations>? meta}) => TranslationsLoLa(meta: meta ?? this.$meta);

	// Translations
	@override late final _TranslationsAriaLoLa aria = _TranslationsAriaLoLa._(_root);
	@override late final _TranslationsMisskeyLoLa misskey = _TranslationsMisskeyLoLa._(_root);
}

// Path: aria
class _TranslationsAriaLoLa extends TranslationsAriaEnUs {
	_TranslationsAriaLoLa._(TranslationsLoLa root) : this._root = root, super.internal(root);

	final TranslationsLoLa _root; // ignore: unused_field

	// Translations
	@override TextSpan renotedBy({required InlineSpan user}) => TextSpan(children: [
		const TextSpan(text: 'Renoted ໂດຍ '),
		user,
	]);
	@override TextSpan unfollowConfirm({required InlineSpan name}) => TextSpan(children: [
		const TextSpan(text: 'ຕ້ອງການເລີກຕິດຕາມ '),
		name,
		const TextSpan(text: ' ແມ່ນບໍ່?'),
	]);
}

// Path: misskey
class _TranslationsMisskeyLoLa extends TranslationsMisskeyEnUs {
	_TranslationsMisskeyLoLa._(TranslationsLoLa root) : this._root = root, super.internal(root);

	final TranslationsLoLa _root; // ignore: unused_field

	// Translations
	@override String get lang__ => 'ພາສາລາວ';
	@override String get headlineMisskey => 'ເຊື່ອມຕໍ່ເຄືອຂ່າຍໂດຍ note';
	@override String get introMisskey => 'ຍິນດີຕ້ອນຮັບ! Misskey ເປັນຊອຟແວopensource, ສຳລັບບໍລິການ microblogging ແບບ decentralized\nສ້າງ “note” ເພື່ອແບ່ງປັນຄວາມຄິດຂອງທ່ານກັບທຸກໆ ຄົນທີ່ຢູ່ອ້ອມຮອບທ່ານ 📡\nຢ່າລືມ “reaction” ໂນຕຂອງລາວເພື່ອສະແດງຄວາມຮູ້ສຶກ 👍\nມາສຳຫຼວດໂລກໃໝ່ແນ! 🚀';
	@override String poweredByMisskeyDescription({required Object name}) => '${name} ແມ່ນສ່ວນໜຶ່ງຂອງການບໍລິການທີ່ຂັບເຄື່ອນໂດຍແພລດຟອມ open source. <b>Misskey</b> (ເອີ້ນວ່າ "Misskey instance")';
	@override String monthAndDay({required Object month, required Object day}) => 'ເດືອນ${month} / ວັນ${day}';
	@override String get search => 'ຄົ�


t filtroTipo:JQuery<HTMLElement> = $("#filtroTipo");
        filtroTipo.addClass("form-control-inline col-sm-4");
        filtroTipo.append("<option id=opcionTodos>");
        filtroTipo.on("change", App.traerPersonajes);
        $("#opcionTodos").text("Todos");

        for(let unSexo in ESexo)
        {
            if(isNaN(Number(unSexo))) //Para que no traiga los índices
            {
                filtroTipo.append("<option id=opcion" + unSexo + ">");
                $("#opcion" + unSexo).text(unSexo);
            }
        }

        //Promedio de Edad
        divFilaFiltros2.append("
");
        let divPromedioEdad:JQuery<HTMLElement> = $("#divPromedioEdad");
        divPromedioEdad.addClass("col-sm-4");

        divPromedioEdad.append("");
        let labelPromedioEdad:JQuery<HTMLElement> = $("#labelPromedioEdad");
        labelPromedioEdad.attr("for", "promedioEdad");
        labelPromedioEdad.text("Promedio de Edad");

        divPromedioEdad.append("<input id=promedioEdad>");
        let promedioEdad:JQuery<HTMLElement> = $("#promedioEdad");
        promedioEdad.attr("type", "text");
        //promedioEdad.addClass("form-control-inline");
        promedioEdad.prop("readonly", true);
        promedioEdad.append("<option id=opcionTodos>");

        //Gender Mix
        divFilaFiltros2.append("
");
        let divGenderMix:JQuery<HTMLElement> = $("#divGenderMix");
        divGenderMix.addClass("col-sm-4");

        divGenderMix.append("");
        let labelGenderMix:JQuery<HTMLElement> = $("#labelGenderMix");
        labelGenderMix.attr("for", "genderMix");
        labelGenderMix.text("Gender Mix");

        divGenderMix.append("<input id=genderMix>");
        let genderMix:JQuery<HTMLElement> = $("#genderMix");
        genderMix.attr("type", "text");
        //genderMix.addClass("form-control-inline");
        genderMix.prop("readonly", true);
        genderMix.append("<option id=opcionTodos>");

        //Titulo Filtro Campos
        divFiltroPersonajes.append("
");
        let divFilaCampos1:JQuery<HTMLElement> = $("#divFilaCampos1");
        divFilaCampos1.addClass("row bg-warning");
        divFilaCampos1.append("
");
        $("#TituloCampos").addClass("col-sm-12 text-center");
        $("#TituloCampos").text("Campos mostrados (tildar los campos a mostrar)");

        divFiltroPersonajes.append("
");
        let divFilaCampos2:JQuery<HTMLElement> = $("#divFilaCampos2");
        divFilaCampos2.addClass("row bg-warning");

        //Filtro de Campos
        personajes[0].getAtributos().forEach(function(value:string):void
        {
            divFilaCampos2.append("
");
            let divCampo:JQuery<HTMLElement> = $("#divCampo" + value);
            divCampo.addClass("col-sm-1")

            divCampo.append("<input id=campo" + value +


Func[i](check, vcd, vdc, updatedOrgVdcNet.OpenApiOrgVdcNetwork.ID)
	}
	// Delete
	err = orgVdcNet.Delete()
	check.Assert(err, IsNil)

	// Test again if it was deleted and expect it to contain ErrorEntityNotFound
	_, err = vdcGroup.GetOpenApiOrgVdcNetworkByName(orgVdcNet.OpenApiOrgVdcNetwork.Name)
	check.Assert(ContainsNotFound(err), Equals, true)

	_, err = vdcGroup.GetOpenApiOrgVdcNetworkById(orgVdcNet.OpenApiOrgVdcNetwork.ID)
	check.Assert(ContainsNotFound(err), Equals, true)

	//cleanup
	err = movedGateway.Delete()
	check.Assert(err, IsNil)

	// Remove VDC group and VDC
	err = vdcGroup.Delete()
	check.Assert(err, IsNil)
	task, err := vdc.Delete(true, true)
	check.Assert(err, IsNil)
	err = task.WaitTaskCompletion()
	check.Assert(err, IsNil)
}

func testNsxtDhcpBinding(check *C, vcd *TestVCD, orgNet *OpenApiOrgVdcNetwork) {
	// define DHCP binding configuration
	dhcpBindingConfig := &types.OpenApiOrgVdcNetworkDhcpBinding{
		Name:        check.TestName() + "-dhcp-binding",
		Description: "dhcp binding description",
		IpAddress:   "2.1.1.231",
		MacAddress:  "00:11:22:33:44:55",
		BindingType: types.NsxtDhcpBindingTypeIpv4,
		DhcpV4BindingConfig: &types.DhcpV4BindingConfig{
			HostName:         "dhcp-binding-hostname",
			GatewayIPAddress: "2.1.1.244",
		},
	}

	// create DHCP binding
	createdDhcpBinding, err := orgNet.CreateOpenApiOrgVdcNetworkDhcpBinding(dhcpBindingConfig)
	check.Assert(err, IsNil)
	check.Assert(createdDhcpBinding, NotNil)

	// Add binding to cleanup list
	openApiEndpoint := fmt.Sprintf(types.OpenApiPathVersion1_0_0+types.OpenApiEndpointOrgVdcNetworksDhcpBindings+"%s",
		orgNet.OpenApiOrgVdcNetwork.ID, createdDhcpBinding.OpenApiOrgVdcNetworkDhcpBinding.ID)
	PrependToCleanupListOpenApi(createdDhcpBinding.OpenApiOrgVdcNetworkDhcpBinding.Name, check.TestName(), openApiEndpoint)

	// Validate DHCP binding fields
	check.Assert(createdDhcpBinding.OpenApiOrgVdcNetworkDhcpBinding.Name, Equals, dhcpBindingConfig.Name)
	check.Assert(createdDhcpBinding.OpenApiOrgVdcNetworkDhcpBinding.Description, Equals, dhcpBindingConfig.Description)
	check.Assert(createdDhcpBinding.OpenApiOrgVdcNetworkDhcpBinding.IpAddress, Equals, dhcpBindingConfig.IpAddress)
	check.Assert(createdDhcpBinding.OpenApiOrgVdcNetworkDhcpBinding.MacAddress, Equals, dhcpBindingConfig.MacAddress)
	check.Assert(createdDhcpBinding.OpenApiOrgVdcNetworkDhcpBinding.BindingType, Equals, dhcpBindingConfig.BindingType)

	// Get DHCP binding by ID
	getDhcpBinding, err := orgNet.GetOpenApiOrgVdcNetworkDhcpBindingById(createdDhcpBinding.OpenApiOrgVdcNetworkDhcpBinding.ID)
	check.Assert(err, IsNil)
	check.Assert(getDhcpBinding, NotNil)
	check.Assert(getDhcpBinding.OpenApiOrgVdcNetworkDhcpBinding.Name, Equals, dhcpBindingConfig.Name)

	// Get DHCP binding by Name
	getDhcpBindingByName, err := orgNet.GetOpenApiOrgVdcNetworkDhcpBindingByName(createdDhcpBinding.OpenApiOrgVdcNetworkDhcpBinding.Name)
	check.Assert


f, 5.6f, 7.8f);
        CONST_OR_CONSTEXPR dquat q3(1.2f, 3.4f, 5.6f, 0.0f);
        CONST_OR_CONSTEXPR dquat q4(1.2f, 3.4f, 0.0f, 7.8f);
        CONST_OR_CONSTEXPR dquat q5(1.2f, 0.0f, 5.6f, 7.8f);
        CONST_OR_CONSTEXPR dquat q6(0.0f, 3.4f, 5.6f, 7.8f);
        CONST_OR_CONSTEXPR auto result1 = (q1 == q2);
        CONST_OR_CONSTEXPR auto result2 = (q1 == q3);
        CONST_OR_CONSTEXPR auto result3 = (q1 == q4);
        CONST_OR_CONSTEXPR auto result4 = (q1 == q5);
        CONST_OR_CONSTEXPR auto result5 = (q1 == q6);
        test_assert(result1 == true);
        test_assert(result2 == false);
        test_assert(result3 == false);
        test_assert(result4 == false);
        test_assert(result5 == false);
    }

    TEST_CASE(inequality_operator)
    {
        CONST_OR_CONSTEXPR fquat q1(1.2f, 3.4f, 5.6f, 7.8f);
        CONST_OR_CONSTEXPR dquat q2(1.2f, 3.4f, 5.6f, 7.8f);
        CONST_OR_CONSTEXPR dquat q3(1.2f, 3.4f, 5.6f, 0.0f);
        CONST_OR_CONSTEXPR dquat q4(1.2f, 3.4f, 0.0f, 7.8f);
        CONST_OR_CONSTEXPR dquat q5(1.2f, 0.0f, 5.6f, 7.8f);
        CONST_OR_CONSTEXPR dquat q6(0.0f, 3.4f, 5.6f, 7.8f);
        CONST_OR_CONSTEXPR auto result1 = (q1 != q2);
        CONST_OR_CONSTEXPR auto result2 = (q1 != q3);
        CONST_OR_CONSTEXPR auto result3 = (q1 != q4);
        CONST_OR_CONSTEXPR auto result4 = (q1 != q5);
        CONST_OR_CONSTEXPR auto result5 = (q1 != q6);
        test_assert(result1 == false);
        test_assert(result2 == true);
        test_assert(result3 == true);
        test_assert(result4 == true);
        test_assert(result5 == true);
    }

    TEST_CASE(normalize)
    {
        const auto q = math::normalize(dquat(1.2, 3.4, 5.6, 7.8));
        test_assert(q == dquat(math::normalize(q.xyzw())));
    }

    TEST_CASE(conjugate)
    {
        CONST_OR_CONSTEXPR auto q = math::conjugate(dquat(1.2, 3.4, 5.6, 7.8));
        test_assert(q == dquat(-1.2, -3.4, -5.6, 7.8));
    }
}
//                Copyright Jo Bates 2015.
// Distributed under the Boost Software License, Version 1.0.
//    (See accompanying file LICENSE_1_0.txt or copy at
//          http://www.boost.org/LICENSE_1_0.txt)
//
//     Please report any bugs, typos, or suggestions to
//         https://github.com/Cincinesh/tue/issues

#include <tue/sized_bool.hpp>
#include "tue.tests.hpp"

#include <type_traits>

namespace
{
    using namespace tue;

    TEST_CASE(bool8)
    {
        test_assert(sizeof(bool8) == 1);
        test_assert(sizeof(true8) == 1);
        test_assert(sizeof(false8) == 1);
        test_assert(true8 == static_cast<bool8>(~0LL));
        test_assert(false8 == static_cast<bool8>(0LL));
    }

    TEST_CASE(bool16)
    {
        test_assert(sizeof(boo


ddweighted">org.opencv.core.Core.addWeighted
 * @see org.opencv.core.Core#add
 * @see org.opencv.core.Core#scaleAdd
 * @see org.opencv.core.Core#subtract
 * @see org.opencv.core.Mat#convertTo
 * @see MatrixExpressions
 */
    public static void addWeighted(Mat src1, double alpha, Mat src2, double beta, double gamma, Mat dst)
    {

        addWeighted_1(src1.nativeObj, alpha, src2.nativeObj, beta, gamma, dst.nativeObj);

        return;
    }

    //
    // C++:  void batchDistance(Mat src1, Mat src2, Mat& dist, int dtype, Mat& nidx, int normType = NORM_L2, int K = 0, Mat mask = Mat(), int update = 0, bool crosscheck = false)
    //

    public static void batchDistance(Mat src1, Mat src2, Mat dist, int dtype, Mat nidx, int normType, int K, Mat mask, int update, boolean crosscheck)
    {

        batchDistance_0(src1.nativeObj, src2.nativeObj, dist.nativeObj, dtype, nidx.nativeObj, normType, K, mask.nativeObj, update, crosscheck);

        return;
    }

    public static void batchDistance(Mat src1, Mat src2, Mat dist, int dtype, Mat nidx, int normType, int K)
    {

        batchDistance_1(src1.nativeObj, src2.nativeObj, dist.nativeObj, dtype, nidx.nativeObj, normType, K);

        return;
    }

    public static void batchDistance(Mat src1, Mat src2, Mat dist, int dtype, Mat nidx)
    {

        batchDistance_2(src1.nativeObj, src2.nativeObj, dist.nativeObj, dtype, nidx.nativeObj);

        return;
    }

    //
    // C++:  void bitwise_and(Mat src1, Mat src2, Mat& dst, Mat mask = Mat())
    //

/**
 *
Calculates the per-element bit-wise conjunction of two arrays or an array and
 * a scalar.

 *
 *
The function computes the per-element bit-wise logical conjunction for:

 *

 *
 Two arrays when src1 and src2 have the same
 * size:
 *

 *
 *
dst(I) = src1(I) / src2(I) if mask(I) != 0

 *
 *

 *
 An array and a scalar when src2 is constructed from
 * Scalar or has the same number of elements as src1.channels():
 *

 *
 *
dst(I) = src1(I) / src2 if mask(I) != 0

 *
 *

 *
 A scalar and an array when src1 is constructed from
 * Scalar or has the same number of elements as src2.channels():
 *

 *
 *
dst(I) = src1 / src2(I) if mask(I) != 0

 *
 *
In case of floating-point arrays, their machine-specific bit representations
 * (usually IEEE754-compliant) are used for the operation. In case of
 * multi-channel arrays, each channel is processed independently. In the second
 * and third cases above, the scalar is first converted to the array type.

 *
 * @param src1 First source array or a scalar.
 * @param src2 Second source array or a scalar.
 * @param dst Destination array that has the same size and type as the input
 * array(s).
 * @param mask Optional operation mask, 8-bit single channel array, that
 * specifies elements of the destination array to be changed.
 *
 * @see <a href="http://docs.opencv.org/modules/core/doc/operations_on_arrays.html#bitwise-


-a2Uq1 styles-module-ellipsis_oneLine-swQCL styles-module-weight_bold-jDthB styles-module-size_dense-TQdU6 stylesMarningNormal-module-root-S7NIr stylesMarningNormal-module-header-xm-B8hvz" style="--module-max-lines-size:1">Состояние

<input class="style-module-input-bLFkf" type="radio" checked="" value="all"/>Любое<input class="style-module-input-bLFkf" type="radio" value="431243"/>Новое<input class="style-module-input-bLFkf" type="radio" value="431244"/>Б/у

<h5 class="styles-module-root-GKtmM styles-module-root-YczkZ styles-module-size_xm-_mgHz styles-module-size_xm_dense-tHPMa styles-module-size_xm_compens


;
      par->SetRndSeed(gRandom->GetSeed());
      par->setChanged();
      par->setInputVersion(fRunId, 1);
    }
    if (geopar) {
      geopar->setChanged();
      geopar->setInputVersion(fRunId, 1);
    }

    fSimSetup();
    fApp->InitMC("foo", "bar");
    fRootManager->WriteFileHeader(fFileHeader);
  }

  void Run(int n = 0, int b = 0) final
  {
    FairRunSim::Run(n, b);
  }

 private:
  bool mDeviceMode{false};
  bool mEvalMat{false};

  ClassDefOverride(O2RunSim, 0);
};
} // namespace steer
} // namespace o2

#endif //O2_O2RUNANA_H


mmitDepth),
			"commitExpression":      githubv4.String(commitExpression),
			"checksToAnalyze":       githubv4.Int(checksToAnalyze),
		}
		// TODO(#2224):
		// sast and ci checks causes cache miss if commits dont match number of check runs.
		// paging for this needs to be implemented if using higher than 100 --number-of-commits
		if handler.commitDepth > 99 {
			vars["commitsToAnalyze"] = githubv4.Int(99)
		}
		if err := handler.graphClient.Query(handler.ctx, handler.checkData, vars); err != nil {
			// quit early without setting crsErrSetup for "Resource not accessible by integration" error
			// for whatever reason, this check doesn't work with a GITHUB_TOKEN, only a PAT
			if strings.Contains(err.Error(), "Resource not accessible by integration") {
				return
			}
			handler.errSetup = err
			return
		}
		handler.checkRunsByRef = parseCheckRuns(handler.checkData)
	})
	return handler.errSetup
}

func (handler *checkrunsHandler) listCheckRunsForRef(ref string) ([]clients.CheckRun, error) {
	if err := handler.setup(); err != nil {
		return nil, fmt.Errorf("error during graphqlHandler.setupCheckRuns: %w", err)
	}
	if crs, ok := handler.checkRunsByRef[ref]; ok {
		return crs, nil
	}
	msg := fmt.Sprintf("listCheckRunsForRef cache miss: %s/%s:%s", handler.repourl.owner, handler.repourl.repo, ref)
	handler.logger.Info(msg)

	checkRuns, _, err := handler.client.Checks.ListCheckRunsForRef(
		handler.ctx, handler.repourl.owner, handler.repourl.repo, ref, &github.ListCheckRunsOptions{})
	if err != nil {
		return nil, sce.WithMessage(sce.ErrScorecardInternal, fmt.Sprintf("ListCheckRunsForRef: %v", err))
	}
	handler.checkRunsByRef[ref] = checkRunsFrom(checkRuns)
	return handler.checkRunsByRef[ref], nil
}

func parseCheckRuns(data *checkRunsGraphqlData) checkRunsByRef {
	checkCache := checkRunsByRef{}
	for _, commit := range data.Repository.Object.Commit.History.Nodes {
		for _, pr := range commit.AssociatedPullRequests.Nodes {
			var crs []clients.CheckRun
			for _, c := range pr.Commits.Nodes {
				for _, checkRun := range c.Commit.CheckSuites.Nodes {
					crs = append(crs, clients.CheckRun{
						// the REST API returns lowercase. the graphQL API returns upper
						Status:     strings.ToLower(string(checkRun.Status)),
						Conclusion: strings.ToLower(string(checkRun.Conclusion)),
						App: clients.CheckRunApp{
							Slug: string(checkRun.App.Slug),
						},
					})
				}
			}
			headRef := string(pr.HeadRefOid)
			checkCache[headRef] = crs
		}
	}
	return checkCache
}

func checkRunsFrom(data *github.ListCheckRunsResults) []clients.CheckRun {
	var checkRuns []clients.CheckRun
	for _, checkRun := range data.CheckRuns {
		checkRuns = append(checkRuns, clients.CheckRun{
			Status:     checkRun.GetStatus(),
			Conclusion: checkRun.GetConclusion(),
			URL:        checkRun.GetURL(),
			App: clients.CheckRunApp{
				Slug: checkRun.GetApp().GetSlug(),
			},
		})
	}
	return checkRuns
}
// Copyright 2021 OpenSSF Scorecard Authors
//
// 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
//


local hw = inherithw(hwdir .. 'vpet_base.lua')

local api = inherithw(hwdir .. 'base.lua')

hw.info = {
	name = 'VV8',
	version = {0, 0, 1},
}

local basedir = 'vpet/'
local buttondir = basedir .. 'buttons/'

local lcd = api.newDotMatrixLCD(0, -16, 64, 64, 2)

lcd.vram.font = 'font.png'

lcd.backlight = {
	color = {0x55, 0xaa, 0xff, 0x55},
}

-- VV8 color
lcd.bgcolor = {0xff, 0xff, 0xee}

lcd.colors = {}

for r = 0, 1 do
	for g = 0, 1 do
		for b = 0, 1 do
			lcd.colors[7 - (r * 4 + g * 2 + b)] = {
				0x11 + r * 0x77 + g * 0x66 + b * 0x44,
				0x11 + r * 0x33 + g * 0x77 + b * 0x33,
				0x11


-- chunkname: @scripts/settings/stats/session_stats.lua

local BackendTypes = require("scripts/settings/stats/backend_stat_types")
local StatDefinitions = require("scripts/managers/stats/stat_definitions")
local SessionStats = {}

SessionStats.team_kills = {
	always_push = true,
	type = BackendTypes.statistic_by,
	stats = {
		none = "session_team_kills",
	},
}
SessionStats.team_deaths = {
	always_push = true,
	type = BackendTypes.statistic_by,
	stats = {
		none = "team_deaths",
	},
}

do
	local stats = {}

	for _, value in pairs({
		"plasteel",
		"diamantine",
	}) do
		local stat_id = string.format("seen_%s_collected", value)
		local specifier = string.format("type:%s", value)

		stats[specifier] = stat_id
	end

	SessionStats.collect_resource = {
		type = BackendTypes.ephemeral,
		stats = stats,
	}
end

SessionStats.blocked_damage = {
	type = BackendTypes.ephemeral,
	stats = {
		none = "session_my_blocked_damage",
	},
}
SessionStats.contract_team_blocked_damage = {
	type = BackendTypes.ephemeral,
	stats = {
		none = "session_team_blocked_damage",
	},
}

do
	local stats = {}

	for


dupeInfo.closetime = self.closetime;
	dupeInfo.autoclose = self.autoclose;
	dupeInfo.donotautoopen = self.donotautoopen;
	dupeInfo.LockedIris = self.LockedIris:EntIndex();
	dupeInfo.LockedGate = self.LockedGate:EntIndex();

    duplicator.StoreEntityModifier(self, "StarGateIrisCompInfo", dupeInfo)
	StarGate.WireRD.PreEntityCopy(self);
end

function ENT:PostEntityPaste(ply, Ent, CreatedEntities)
	if (StarGate.NotSpawnable(Ent:GetClass(),ply)) then self.Entity:Remove(); return end

	if (IsValid(ply)) then
		local PropLimit = GetConVar("CAP_iris_comp_max"):GetInt()
		if(ply:GetCount("CAP_iris_comp")+1 > PropLimit) then
			ply:SendLua("GAMEMODE:AddNotify(SGLanguage.GetMessage(\"entity_limit_iris_pc\"), NOTIFY_ERROR, 5); surface.PlaySound( \"buttons/button2.wav\" )");
			Ent:Remove();
			return
		end
		ply:AddCount("CAP_iris_comp", Ent);
	end

	local dupeInfo = Ent.EntityMods.StarGateIrisCompInfo
	if (dupeInfo.Codes) then
		self.Codes = dupeInfo.Codes;
	end
	if (dupeInfo.closetime) then
		self.closetime = dupeInfo.closetime;
	end
	if (dupeInfo.autoclose) then
		self.autoclose = dupeInfo.autoclose;
	end
	if (dupeInfo.donotautoopen) then
		self.donotautoopen = dupeInfo.donotautoopen;
	end
	if (dupeInfo.LockedIris) then
		self.LockedIris = CreatedEntities[dupeInfo.LockedIris];
	end
	if (dupeInfo.LockedGate and CreatedEntities[dupeInfo.LockedGate]) then
		self.LockedGate = CreatedEntities[dupeInfo.LockedGate];
		CreatedEntities[dupeInfo.LockedGate].LockedIrisComp = self;
	end
	if (IsValid(ply)) then
		self.Owner = ply;
	end

	StarGate.WireRD.PostEntityPaste(self,ply,Ent,CreatedEntities)
end

if (StarGate and StarGate.CAP_GmodDuplicator) then
	duplicator.RegisterEntityClass( "iris_computer", StarGate.CAP_GmodDuplicator, "Data" )
end

end

if CLIENT then

if (SGLanguage!=nil and SGLanguage.GetMessage!=nil) then
ENT.Category = SGLanguage.GetMessage("entity_main_cat");
ENT.PrintName = SGLanguage.GetMessage("entity_iris_comp");
end

local function gdopc_menuhook(len)

	local ent = net.ReadEntity();
	if (not IsValid(ent)) then return end
	local closetimeval = net.ReadInt(8);
	local autocloseval = util.tobool(net.ReadBit())
	local donotautoopen = util.tobool(net.ReadBit())
	local codes = {};
	local count = net.ReadInt(8)
	for i=1,count do
		codes[net.ReadString()] = net.ReadString()
	end

	local DermaPanel = vgui.Create( "DFrame" )
   	//DermaPanel:SetPos(ScrW()/2-175, ScrH()/2-100)
   	DermaPanel:SetSize(400, 305)
	DermaPanel:Center()
	--DermaPanel:SetTitle( SGLanguage.GetMessage("iriscomp_title") )
	DermaPanel:SetTitle("")
   	DermaPanel:SetVisible( true )
   	DermaPanel:SetDraggable( false )
   	DermaPanel


OF(buf_);
  }

  buf[ 0 ] = '\0';
  snprintf(buf, len, "%02d:%02d:%02d.%03d: ", log_hrs, log_mins, log_secs, log_msec);

  if (buf) {
    return buf;
  }

  return buf_;
}

const char *timestamp(char *buf, int len)
{
  int log_msec = time_ms();
  int log_secs = log_msec / ONESEC;
  int log_mins = log_secs / 60;
  int log_hrs  = log_mins / 60;

  log_msec = log_msec % ONESEC;
  log_secs = log_secs % 60;
  log_mins = log_mins % 60;

  if (! buf) {
    buf = buf_;
    len = SIZEOF(buf_);
  }

  buf[ 0 ] = '\0';
  snprintf(buf, len, "%02d:%02d:%02d.%03d: ", log_hrs, log_mins, log_secs, log_msec);

  if (buf) {
    return buf;
  }

  return buf_;
}

bool time_have_x_hundredths_passed_since(ts_t val, ts_t since)
{
  time_ms();

  //
  // Cater for negative future times.
  //
  ts_t delay = time_now - since;

  return ((ts_t) (delay / 10) > (ts_t) val);
}

bool time_have_x_ms_passed_since(ts_t val, ts_t since)
{
  time_ms();

  //
  // Cater for negative future times.
  //
  ts_t delay = time_now - since;

  return ((ts_t) (delay) >= (ts_t) val);
}

bool time_have_x_tenths_passed_since(ts_t val, ts_t since)
{
  time_ms();

  //
  // Cater for negative future times.
  //
  ts_t delay = time_now - since;

  return ((ts_t) (delay / 100) >= (ts_t) val);
}

bool time_have_x_secs_passed_since(ts_t val, ts_t since)
{
  time_ms();

  //
  // Cater for negative future times.
  //
  ts_t delay = time_now - since;

  return ((ts_t) (delay / ONESEC) >= (ts_t) val);
}

ts_t time_get_elapsed_secs(ts_t val, ts_t since)
{
  time_ms();

  ts_t delay = val - since;

  return ((ts_t) (delay / ONESEC));
}

ts_t time_get_elapsed_tenths(ts_t val, ts_t since)
{
  time_ms();

  ts_t delay = val - since;

  return ((ts_t) (delay / (ONESEC / 10)));
}

void get_timestamp(char *buf, int len)
{
#ifdef ENABLE_LOG_TIMESTAMPS
  char tmp[ MAXSTR ];
  string_timestamp(tmp, len);
  snprintf(buf, len, "%s %s", timestamp().c_str(), tmp);
#else
  timestamp(buf, len);
#endif
}

std::string current_date(void)
{
  struct tm *timeinfo;
  time_t     rawtime;
  char       buffer[ MAXSTR ];

  time(&rawtime);
  timeinfo = localtime(&rawtime);

  // Code    Example Description
  //  %a  Sun Weekday as locale’s abbreviated name.
  //  %A  Sunday  Weekday as locale’s full name.
  //  %w  0   Weekday as a decimal number, where 0 is Sunday and 6 is Saturday.
  //  %d  08  Day of the month as a zero-padded decimal number.
  //  %-d 8   Day of the month as a decimal number. (Platform specific)
  //  %b  Sep Month as locale’s abbreviated name.
  //  %B  September   Month as locale’s full name.
  //  %m  09  Month as a zero-padded decimal number.
  //  %-m 9   Month as a decimal number. (Platform specific)
  //


);
$c-grey-dark: color.adjust($c-grey, $lightness: -25%, $space: hsl);
$c-active-feature: orange;
$c-black: #444444;
$c-type-0: #c03b22;
$c-type-1: #d9534f;
$c-type-2: #e91e63;
$c-type-3: #a03ab1;
$c-type-4: #6f46b8;
$c-type-5: #3f51b5;
$c-type-6: #2196f3;
$c-type-7: #37bdcf;
$c-type-8: #359990;
$c-type-9: #5cb85c;
$c-type-10: #8bc34a;
$c-type-11: #cddc39;
$c-type-12: #ccbc2f;
$c-type-13: #f0ad4e;
$c-type-14: #ec9920;
$c-type-15: #e46841;
$c-type-16: #795548;
$c-type-17: #9e9e9e;
$c-type-18: #607d8b;
$c-type-19: #449d44;

$c-background: #fcfcfc;

$c-primary: #2b56c1;
$c-primary-lighten: color.adjust($c-primary, $lightness: 50%, $space: hsl);
$c-primary-light: color.adjust($c-primary, $lightness: 40%, $space: hsl);
$c-primary-dark: color.adjust($c-primary, $lightness: -10%, $space: hsl);
$c-info: $c-type-7;
$c-info-light: color.adjust($c-info, $lightness: 40%, $space: hsl);
$c-info-dark: color.adjust($c-info, $lightness: -10%, $space: hsl);
$c-success: $c-type-9;
$c-success-light: color.adjust($c-type-10, $lightness: 30%, $space: hsl);
$c-success-dark: color.adjust($c-type-10, $lightness: -15%, $space: hsl);
$c-danger: $c-type-1;
$c-danger-light: color.adjust($c-type-1, $lightness: 30%, $space: hsl);
$c-danger-dark: color.adjust($c-type-1, $lightness: -10%, $space: hsl);
$c-warning: $c-type-13;
$c-warning-light: color.adjust($c-type-14, $lightness: 30%, $space: hsl);
$c-warning-dark: color.adjust($c-type-14, $lightness: -10%, $space: hsl);

$c-shadow: color.adjust($c-black, $alpha: -0.9);
$c-shadow-dark: color.adjust($c-black, $alpha: -0.8);
$c-shadow-darker: color.adjust($c-black, $alpha: -0.5);

$c-card-highlight: #dee7ff4d;
$c-language-highlight: #cff0cf;

$c-filter-film: #c2c2c2;

$c-gray-900: #101828;
$c-gray-600: #475467;
@use '../../scss/config/_colors.scss';
@use '../../scss/config/_materials.scss';
@use '../../scss/config/_typography.scss';

.modal-dialog {
  max-height: 90%;
  overflow-y: auto;
  margin-left: auto;
  margin-right: auto;

  .btn-default {
    opacity: 0.5;
  }

  &:focus {
    outline: none;
  }
}

.modal-tip-dim {
  width:  900px;
}

.modal-content {
  border-radius: 0;
  border: 0;
  box-shadow: materials.$box-shadow;
}

.modal-success {
  border-left: 5px solid #8bc74c;
}
.modal-info {
  border-left: 5px solid #cc


{
				// this hide request is for the currently displayed tooltip
				this.fadeIn.stop();
				this.isShowingNow = false;
				this.aroundNode = null;
				this.fadeOut.play();
			}else{
				// just ignore the call, it's for a tooltip that has already been erased
			}
		},

		_onHide: function(){
			// summary:
			//		Called at end of fade-out operation
			// tags:
			//		protected

			this.domNode.style.cssText="";	// to position offscreen again
			this.containerNode.innerHTML="";
			if(this._onDeck){
				// a show request has been queued up; do it now
				this.show.apply(this, this._onDeck);
				this._onDeck=null;
			}
		}

	}
);

dijit.showTooltip = function(/*String*/ innerHTML, /*DomNode*/ aroundNode, /*String[]?*/ position, /*Boolean*/ rtl){
	// summary:
	//		Display tooltip w/specified contents in specified position.
	//		See description of dijit.Tooltip.defaultPosition for details on position parameter.
	//		If position is not specified then dijit.Tooltip.defaultPosition is used.
	if(!dijit._masterTT){ dijit._masterTT = new dijit._MasterTooltip(); }
	return dijit._masterTT.show(innerHTML, aroundNode, position, rtl);
};

dijit.hideTooltip = function(aroundNode){
	// summary:
	//		Hide the tooltip
	if(!dijit._masterTT){ dijit._masterTT = new dijit._MasterTooltip(); }
	return dijit._masterTT.hide(aroundNode);
};

dojo.declare(
	"dijit.Tooltip",
	dijit._Widget,
	{
		// summary:
		//		Pops up a tooltip (a help message) when you hover over a node.

		// label: String
		//		Text to display in the tooltip.
		//		Specified as innerHTML when creating the widget from markup.
		label: "",

		// showDelay: Integer
		//		Number of milliseconds to wait after hovering over/focusing on the object, before
		//		the tooltip is displayed.
		showDelay: 400,

		// connectId: [const] String[]
		//		Id's of domNodes to attach the tooltip to.
		//		When user hovers over any of the specified dom nodes, the tooltip will appear.
		//
		//		Note: Currently connectId can only be specified on initialization, it cannot
		//		be changed via attr('connectId', ...)
		//
		//		Note: in 2.0 this will be renamed to connectIds for less confusion.
		connectId: [],

		// position: String[]
		//		See description of `dijit.Tooltip.defaultPosition` for details on position parameter.
		position: [],

		constructor: function(){
			// Map id's of nodes I'm connected to to a list of the this.connect() handles
			this._nodeConnectionsById = {};
		},

		_setConnectIdAttr: function(newIds){
			for(var oldId in this._nodeConnectionsById){
				this.removeTarget(oldId);
			}
			dojo.forEach(dojo.isArrayLike(newIds) ? newIds : [newIds], this.addTarget, this);
		},

		_getConnectIdAttr: function(){
			var ary = [];
			for(var id in this._nodeConnectionsById){
				ary.push(id);
			}
			return ary;
		},

		addTarget: function(/*DOMNODE || String*/ id){
			// summary:
			//		Attach tooltip to specified node, if it's not already connected
			var node = dojo.byId(id);
			if(!node){ return; }
			if(node.id in this._nodeConnectionsById){


#! -*- coding:utf-8 -*-
# 事件抽取任务，基于GPLinker
# DuEE v1.0数据集：https://aistudio.baidu.com/aistudio/competition/detail/46/0/datasets
# 文章介绍：https://kexue.fm/archives/8926

import json
import numpy as np
from itertools import groupby
from bert4keras.backend import keras, K
from bert4keras.backend import sparse_multilabel_categorical_crossentropy
from bert4keras.tokenizers import Tokenizer
from bert4keras.layers import EfficientGlobalPointer as GlobalPointer
from bert4keras.models import build_transformer_model
from bert4keras.optimizers import Adam
from bert4keras.snippets import sequence_padding, DataGenerator
from bert4keras.snippets import open, to_array
from tqdm import tqdm

maxlen = 128
batch_size = 28
epochs = 5
learning_rate = 2e-5
config_path = '../model_hub/chinese_L-12_H-768_A-12/bert_config.json'
checkpoint_path = '../model_hub/chinese_L-12_H-768_A-12/bert_model.ckpt'
dict_path = '../model_hub/chinese_L-12_H-768_A-12/vocab.txt'

# 读取schema
labels = []
with open('../data/ee/duee/duee_event_schema.json') as f:
    for l in f:
        l = json.loads(l)
        t = l['event_type']
        for r in [u'触发词'] + [s['role'] for s in l['role_list']]:
            labels.append((t, r))

def load_data(filename):
    """加载数据
    单条格式：{'text': text, 'events': [[(type, role, argument, start_index)]]}
    """
    D = []
    with open(filename, encoding='utf-8') as f:
        for l in f:
            l = json.loads(l)
            d = {'text': l['text'], 'events': []}
            for e in l['event_list']:
                d['events'].append([(
                    e['event_type'], u'触发词', e['trigger'],
                    e['trigger_start_index']
                )])
                for a in e['arguments']:
                    d['events'][-1].append((
                        e['event_type'], a['role'], a['argument'],
                        a['argument_start_index']
                    ))
            D.append(d)
    return D

# 加载数据集
train_data = load_data('../data/ee/duee/duee_train.json')
valid_data = load_data('../data/ee/duee/duee_dev.json')

# 建立分词器
tokenizer = Tokenizer(dict_path, do_lower_case=True)

class data_generator(DataGenerator):
    """数据生成器
    """
    def __iter__(self, random=False):
        batch_token_ids, batch_segment_ids = [], []
        batch_argu_labels, batch_head_labels, batch_tail_labels = [], [], []
        for is_end, d in self.sample(random):
            tokens = tokenizer.tokenize(d['text'], maxlen=maxlen)
            mapping = tokenizer.rematch(d['text'], tokens)
            start_mapping = {j[0]: i for i, j in enumerate(mapping) if j}
            end_mapping = {j[-1]: i for i, j in enumerate(mapping) if j}
            token_ids = tokenizer.tokens_to_ids(tokens)
            segment_ids = [0] * len(token_ids)
            # 整理事件
            events = []
            for e in d['events']:
                events.append([])
                for t, r, a, i in e:
                    label = labels.index((t, r))
                    start, end = i, i + len(a) - 1
                    if start in start_mapping and end in end_mapping:
                        start, end = start_mapping[start], end_mapping[end]
                        events[-1].append((label, start, end))
            # 构建标签
            argu_labels = [set() for _ in range(len(labels))]
            head_labels, tail_labels = set(), set()
            for e in events:
                for l, h, t in e:
                    argu_labels[l].add((h, t))
                for i1, (_, h1, t1) in enumerate(e):
                    for i2, (_, h2, t2) in enumerate(e):
                        if i2 > i1:
                            head_labels.add((min(h1, h2), max(h1, h2)))
                            tail_labels.add((min(t1, t2), max(t1, t2)))
            for label in argu_labels + [head_labels, tail_labels]:
                if not label:  # 至少要有一个标签
                    label.add((0, 0))  # 如果没有则用0填充
            argu_labels = sequence_padding([list(l) for l in argu_labels])
            head_labels = sequence_padding([list(head_labels)])
            tail_labels = sequence_padding([list(tail_labels)])
            # 构建batch
            batch_token_ids.append(token_ids)
            batch_segment_ids.append(segment_ids)
            batch_argu_labels.append(argu_labels)
            batch_head_labels.append(head_labels)
            batch_tail_labels.append(tail_labels)
            if len(batch_token_ids) == self.batch_size or is_end:
                batch_token_ids = se


and the equation needs to be preceded by an equals sign (=) in order for it to be parsed as an equation.
     * 													See CIQ.formatEquation and CIQ.computeEquationChart for more details on allowed equations syntax.
     * @param 	[parameters] Data & configuration settings to initialize the chart.
     * 													The masterData array may be provided as the second argument assuming no other parameters need to be specified.
     * @param [parameters.masterData] An array of [properly formatted objects]{@tutorial InputDataFormat} to create a chart.
     * 													Each element should at a minimum contain a "Close" or "Value" field (capitalized) and a 'Date' or 'DT' field.
     *													If the charting engine has been configured to use a [QuoteFeed]CIQ.ChartEngine#attachQuoteFeed
     *													then masterData does not need to be passed in, and the quote feed will be used instead.
     * @param [parameters.chart] Which chart to load. Defaults to this.chart.
     * @param [parameters.range] Default range to be used upon initial rendering. If both `range` and `span` parameters are passed in, range takes precedence. If periodicity is not set, the range will be displayed at the most optimal periodicity. See CIQ.ChartEngine#setRange for complete list of parameters this object will accept.
     * @param [parameters.span] Default span to display upon initial rendering. If both `range` and `span` parameters are passed in, range takes precedence. If periodicity is not set, the span will be displayed at the most optimal periodicity. See CIQ.ChartEngine#setSpan for complete list of parameters this object will accept.
     * @param [parameters.periodicity] Periodicity to be used upon initial rendering. See CIQ.ChartEngine#setPeriodicity for complete list of parameters this object will accept. If no periodicity has been set, it will default to `1 day`.
     * @param [parameters.stretchToFillScreen] Increase the candleWidth to fill the left-side gap created by a small dataSet. Respects CIQ.ChartEngine.preferences.whitespace. Ignored when params `span` or `range` are used.  See CIQ.ChartEngine#fillScreen
     * @param [callback] Called when loadChart is complete. See {@tutorial Adding additional content on chart} for a tutorial on how to use this callback function.
     * @example
Using a symbol string

     * stxx.loadChart('IBM');
     *
     * @example
Using a symbol object and embedded span and periodicity requirements

     * stxx.loadChart({symbol: newSymbol, other: 'stuff'}, {
     * 	span: {
     * 		base: 'day',
     * 		multiplier: 2
     * 	},
     * 	periodicity: {
     * 		period: 1,
     * 		interval: 5,
     * 		timeUnit: 'minute'
     * 	},
     * 	stretchToFillScreen: true
     * });
     *
     * @example
Using an equation string

     * stxx.loadChart('=2*IBM-GM');
     *
     * @example
Provide data as the second argument

     * stxx.loadChart('YUM', [
     * 	{Date: '2018-12-03', Close: 2.0034},
     * 	{Date: '2018-12-04', Close: 2.0067},
     * 	{Date: '2018-12-05', Close: 2.0112},
     * 	{Date: '2018-12-06', Close: 2.0091},
     * 	{Date: '2018-12-07', Close: 1.9979}
     * ]);
     *
     * @example
Provide data as a parameter

     * stxx.loadChart('BGS', {
     * 	masterData: [
     * 		{DT: 1542384420000, Close: 1.00},
     * 		{DT: 1542384480000, Close: 1.01},
     * 		{DT: 1542384540000, Close: 1.04},
     * 		{DT: 1542384600000, Close: 1.02}
     * 	],


EAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//

//  NETGENPlugin : C++ implementation
// File      : NETGENPlugin_NETGEN_2D.hxx
// Author    : Michael Sazonov (OCN)
// Date      : 20/03/2006
// Project   : SALOME
//=============================================================================
//
#ifndef _NETGENPlugin_NETGEN_2D_HXX_
#define _NETGENPlugin_NETGEN_2D_HXX_

#include "NETGENPlugin_Defs.hxx"

#include "SMESH_Algo.hxx"
#include "SMESH_Mesh.hxx"

class NETGENPlugin_Mesher;

class NETGENPLUGIN_EXPORT NETGENPlugin_NETGEN_2D: public SMESH_2D_Algo
{
public:
  NETGENPlugin_NETGEN_2D(int hypId, int studyId, SMESH_Gen* gen);
  virtual ~NETGENPlugin_NETGEN_2D();

  virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
                               const TopoDS_Shape& aShape,
                               SMESH_Hypothesis::Hypothesis_Status& aStatus);

  virtual bool Compute(SMESH_Mesh& aMesh,
                       const TopoDS_Shape& aShape);

  virtual void CancelCompute();

  virtual double GetProgress() const;

  virtual bool Evaluate(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape,
                        MapShapeNbElems& aResMap);

protected:
  const SMESHDS_Hypothesis* _hypothesis;
  bool                      _isViscousLayers2D;
  NETGENPlugin_Mesher *     _mesher;
};

#endif
// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//

//  File   : StdMeshers_CartesianParameters3D.hxx
//  Author : Edward AGAPOV
//  Module : SMESH
//
#ifndef _SMESH_CartesianParameters3D_HXX_
#define _SMESH_CartesianParameters3D_HXX_

#include "SMESH_StdMeshers.hxx"

#include "SMESH_


de.com/sota/dense-contact-estimation-on-mow?p=2505-11152)

ArXiv 2025

_**HACO** is a framework for **dense hand contact estimation** that addresses **class and spatial imbalance issues** in training on large-scale datasets. Based on **14 datasets** that span **hand-object**, **hand-hand**, **hand-scene**, and **hand-body interaction**, we build a powerful model that learns dense hand contact in diverse scenarios._

## Installation
* We recommend you to use an [Anaconda](https://www.anaconda.com/) virtual environment. Install PyTorch >=1.11.0 and Python >= 3.8.0. Our latest HACO model is tested on Python 3.8.20, PyTorch 1.11.0, CUDA 11.3.
* Setup the environment.
```
# Initialize conda environment
conda create -n haco python=3.8 -y
conda activate haco

# Install PyTorch
conda install pytorch==1.11.0 torchvision==0.12.0 torchaudio==0.11.0 cudatoolkit=11.3 -c pytorch

# Install all remaining packages
pip install -r requirements.txt
```

## Data
You need to follow our directory structure of the `data`.
* For quick demo: See [`docs/data_demo.md`](docs/data_demo.md).
* For evaluation: See [`docs/data_eval.md`](docs/data_eval.md).
* For training: See [`docs/data_train.md`](docs/data_train.md).

Then, download the official checkpoints and place them in the `release_checkpoint` from [HuggingFace](https://huggingface.co/datasets/dqj5182/haco-checkpoints/tree/main) by running (if not working, try [OneDrive](https://1drv.ms/u/c/bf7e2a9a100f1dba/Ef18aU5ItbFDgW1sSv3P0l0BGTzN6PlsCnm0q5ecpTWIfQ?e=Y40qsN)):
```
bash scripts/download_haco_checkpoints.sh
```

## Quick demo (Image)
To run HACO on demo images using the [WiLoR](https://github.com/rolpotamias/WiLoR) or [Mediapipe](https://ai.google.dev/edge/mediapipe/solutions/guide) hand detector, please run:
```
python demo.py --backbone {BACKBONE_TYPE} --detector {DETECTOR_TYPE} --checkpoint {CKPT_PATH} --input_path {INPUT_PATH}
```

For example,
```
# ViT-H (Default, HaMeR initialized) backbone
python demo.py --backbone hamer --detector wilor --checkpoint release_checkpoint/haco_final_hamer_checkpoint.ckpt --input_path asset/example_images

# ViT-B (ImageNet initialized) backbone
python demo.py --backbone vit-b-16 --detector wilor --checkpoint release_checkpoint/haco_final_vit_b_checkpoint.ckpt --input_path asset/example_images
```

> Note: The demo includes post-processing to reduce noise in small or sparse contact areas.

## Quick demo (Video)
Before the video demo, please download example videos from [HuggingFace](https://huggingface.co/datasets/dqj5182/haco-data/blob/main/demo/asset/example_videos.zip) and save at `asset/example_videos` by running (if not working, try [OneDrive](https://1drv.ms/u/c/bf7e2a9a100f1dba/ERsk_D-


5sKef2mBhPGwyx";
        sout << "pnudRmwMFKk1D8UXtuoEHYQX03cvYEDmWberg887C1ca4UdAg7b5/mysr2g5Md+vGHrqRtJE5Zhx";
        sout << "p2BFSzeFV83Zpe7PYf2uTLffLleJSKV5l6ohKDh4V2P4ztKvNwTKZYnYFdWlfMPUz3svuvihxG2h";
        sout << "OXNZJ9+Byx7v6RrU/42lLyY6p2078QYHif06BBp2267VkKcRN4pP9LlS2JECoex4vg43X/dE/48f";
        sout << "DbRfW8KeR5kSOnH9dDWcwdoco8MBwOV47KIkte6i3vj0BpAQZD+GFuR5EfIBxXuklMYFr7KRS9xK";
        sout << "oHMGA00uxrV5VWrzCm5lV4l4oMQcv9/hqFTLKo7nlQP5yu/TyoF+OSXP/qKX7N+CASLfNtwL1Ux5";
        sout << "fweiUkaKnLZh8f+bxh4x0/UO3H0LWyq07/1evSYUBQhHkzSYPhkTq2msJ+eFBc0+gpbOWntK37JY";
        sout << "udFJvL50jNoZf9clWcqzxnK5M/rqMjVCi1zzboiC1vyxWPhR8QMvEMRZ8XpVW/cAdLz5R+M3DGms";
        sout << "KCJtIpxrduXr5+Bq09jn/1oi4qro2/ikBRTVTLj4js+yaI2t0uE6XQX1PO2JwSHW3V9krhJ/7JJh";
        sout << "sLH3xidX1mf+O/hgu6NU1p4yrsGjz6qTYOQSjU7cVsCMRxW8y9vCWh2PcumONvuWeApgNKkkQj5d";
        sout << "c+8ftbo70YFtVWhKjTG4BHpNh6fXDC+0ZmkhTFEyHAwx0hF5k7217oTa7aKEQp2qGEROYxe/wBMO";
        sout << "Kq/lLPLQpVEldVSoOzmFNxGTkOo0j/bjAtwqwEd6mA87f8PvCiAWLTRpPFla4UbU8X0t82Ur943f";
        sout << "m+hm5CdEBtyV9P1uxMO6ez1SI5YezMPfMCkhpFqozJsPrjkPMIUSDc+WtF8frIfNsWWmjukFwFyB";
        sout << "3UU7r1AHWLJlEo4g9XPsMks3LkFeQ30cwm8Lnlj4wAistdLd3HNBydGSxO48Uaya2M6dfm3Xeu8Z";
        sout << "77+7God1knNpAnL7GFhTTTV7XcFxEr76Mfdt+KJTXHIf1M8ofe67hLrsT9FunpPmopFrNp69v2TD";
        sout << "H0/SQbseKjykzwvJkK46UeJFxYabRHSgL67prx6jwl2Cp9JnNIco/hWNPGbFVaEcMbZx5lkinzvT";
        sout << "KgwrJbVJ3oKnY2EJAnNDC2f1F8UpC1qQyEvh


3 5.8 35.5 4.6 54.7zm-122-95.6c-10.8 0-19.9 1.9-26.9 5.6-7 3.7-12.8 8.3-17.2 13.6a48.4 48.4 0 0 0-9.1 17.4c-1.6 5.3-2.7 10.7-3.1 16.2H723c-1.6-17.3-7.6-30.1-15.6-39.1-8.4-8.9-21.9-13.7-38.6-13.7zm-248.5-10.1c8.7-6.3 12.9-16.7 12.9-31 .3-6.8-1.1-13.5-4.1-19.6-2.7-4.9-6.7-9-11.6-11.9a44.8 44.8 0 0 0-16.6-6c-6.4-1.2-12.9-1.8-19.3-1.7h-70.3v79.7h76.1c13.1.1 24.2-3.1 32.9-9.5zm11.8 72c-9.8-7.5-22.9-11.2-39.2-11.2h-81.8v94h80.2c7.5 0 14.4-.7 21.1-2.1s12.7-3.8 17.8-7.2c5.1-3.3 9.2-7.8 12.3-13.6 3-5.8 4.5-13.2 4.5-22.1 0-17.7-5-30.2-14.9-37.8z")),t.BookFill=l("book",a,c(r,"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zM668 345.9L621.5 312 572 347.4V124h96v221.9z")),t.BoxPlotFill=l("box-plot",a,c(r,"M952 224h-52c-4.4 0-8 3.6-8 8v248h-92V304c0-4.4-3.6-8-8-8H448v432h344c4.4 0 8-3.6 8-8V548h92v244c0 4.4 3.6 8 8 8h52c4.4 0 8-3.6 8-8V232c0-4.4-3.6-8-8-8zm-728 80v176h-92V232c0-4.4-3.6-8-8-8H72c-4.4 0-8 3.6-8 8v560c0 4.4 3.6 8 8 8h52c4.4 0 8-3.6 8-8V548h92v172c0 4.4 3.6 8 8 8h152V296H232c-4.4 0-8 3.6-8 8z")),t.BugFill=l("bug",a,c(r,"M304 280h416c4.4 0 8-3.6 8-8 0-40-8.8-76.7-25.9-108.1a184.31 184.31 0 0 0-74-74C596.7 72.8 560 64 520 64h-16c-40 0-76.7 8.8-108.1 25.9a184.31 184.31 0 0 0-74 74C304.8 195.3 296 232 296 272c0 4.4 3.6 8 8 8z","M940 512H792V412c76.8 0 139-62.2 139-139 0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8a63 63 0 0 1-63 63H232a63 63 0 0


                foreach (string alias in imageResolutions.Keys) {
                        pci.transformedSrc(
                            maxWidth : imageResolutions[alias],
                            maxHeight : imageResolutions[alias],
                            alias : alias
                        );
                    }
                })
                .title()
                .description()
                .descriptionHtml()
                .updatedAt()
                .products(pc => ProductConnection(pc),
                    first : DefaultQueries.MaxPageSize
                );
        }

        public void ProductConnection(ProductConnectionQuery productConnection) {
            productConnection
                .edges(e => e
                    .node(p => Product(p))
                    .cursor()
                )
                .pageInfo(pi => pi
                    .hasNextPage()
                );
        }

        public void Product(ProductQuery product) {
            product
                .id();
        }
    }
}


fa-notes-medical"> Get Started

Sign Up

                <form onsubmit="signup(event)">
                Enter Your Name
                <input type="text" placeholder="Enter Name" id="signupName" minlength="3" maxlength="20" required>
                Create Username
                <input type="text" placeholder="Create Username" id="signupUsername" minlength="3" maxlength="20" required>

                Create Password

                    <input type="password" placeholder="Create Password" id="signupPass" required>

                <button>Sign Up</button>
            </form>
            <button onclick="loginasGuest()" class="guest-btn">Login as Guest</button>

Already a User? LogIn!

                BBalanz.io

            Built with  by Rajveer Singh, the mind behind AtmoSonic.


  color: var(--color-critical-strong) !important;
}

.text-color,
.text-body {
  color: var(--color-interface-stronger) !important;
}

.text-muted {
  opacity: 0.8;
}

.text-black-50 {
  color: fade(#000, 50%) !important;
}

.text-white-50 {
  color: fade(#fff, 50%) !important;
}

.text-decoration-none {
  text-decoration: none !important;
}

.text-linethrough {
  text-decoration: line-through !important;
}

.text-reset {
  color: inherit !important;
}

.text-shadow-light {
  text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff;
}

.text-shadow {
  text-shadow: -1px -1px 0 #777, 1px -1px 0 #777, -1px 1px 0 #777, 1px 1px 0 #777;
}

.text-shadow-dark {
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

.leading-tight {
  line-height: 0.9 !important;
}

.leading-snug {
  line-height: 1 !important;
}

.leading-normal {
  line-height: 1.5 !important;
}

.leading-relaxed {
  line-height: 1.75 !important;
}

.leading-loose {
  line-height: 2 !important;
}

.line-clamp-1 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  line-clamp: 1;
}

.line-clamp-2 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.line-clamp-3 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.line-clamp-4 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
}

.line-clamp-5 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  line-clamp: 5;
}

.line-clamp-6 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
  line-clamp: 6;
}

.ordinal {
  font-variant-numeric: ordinal;
}

.diagonal-fractions {
  font-variant-numeric: diagonal-fractions;
}

.stacked-fractions {
  font-variant-numeric: stacked-fractions;
}

.slashed-zero {
  font-variant-numeric: slashed-zero;
}

.lining-nums {
  font-variant-numeric: lining-nums;
}

.oldstyle-nums {
  font-variant-numeric: oldstyle-nums;
}

.proportional-nums {
  font-variant-numeric: proportional-nums;
}


('returns false if the value does not have a Symbol.iterator property', () => {
      assert.isFalse(isIterable({}));
    });
  });

  suite('isObject()', () => {
    test('returns true if the value is an object type and is not null', () => {
      // type definition compilation tests:
      function c () { return 'foo'; }
      const d = function () { return 'foo'; };
      const a = 'foo', b = { foo: 'bar' };
      isObject(a) && a.length;
      !isObject(a) && a.length;
      isObject(b) && b.foo;
      isObject(c) && c.name;
      !isObject(c) && c.name;
      isObject(d) && d.name;
      !isObject(d) && d.name;

      // functional tests:
      assert.isTrue(isObject(new Set()));
      assert.isTrue(isObject({}));
    });

    test('returns false if the value is not an object type or is null', () => {
      assert.isFalse(isObject(null));
      assert.isFalse(isObject(123));
    });
  });

  suite('isPlain()', () => {
    test('returns true if the value\'s constructor is Object', () => {
      assert.isTrue(isPlain({ a: 1 }));
    });

    test('returns false if the value\'s constructor is not Object', () => {
      assert.isFalse(isPlain(new Set()));
    });
  });

  suite('identity()', () => {
    test('returns the same value as the input argument', () => {
      assert.strictEqual(identity(void 0), void 0);
      assert.strictEqual(identity(identity), identity);
      assert.strictEqual(identity(null), null);
      assert.strictEqual(identity(false), false);
      assert.strictEqual(identity('test'), 'test');
    });
  });

  suite('error()', () => {
    test('throws an error with the specified error message', () => {
      var message = 'test error';
      assert.throws(() => error(message), /^test error$/);
    });
  });

  suite('notImplemented()', () => {
    test('throws a "Not implemented" error', () => {
      assert.throws(() => notImplemented(), /not implemented/i);
    });
  });

  suite('abs()', () => {
    test('returns the absolute value of the argument', () => {
      assert.strictEqual(abs(123), 123);
      assert.strictEqual(abs(-123), 123);
      assert.strictEqual(abs(123.456), 123.456);
      assert.strictEqual(abs(-123.456), 123.456);
    });
  });

  suite('min()', () => {
    test('returns the minimum value out of the two input arguments', () => {
      assert.strictEqual(min(5, 5), 5);
      assert.strictEqual(min(-5, 5), -5);
      assert.strictEqual(min(5, -5), -5);
      assert.strictEqual(min(5, 15), 5);
      assert.strictEqual(min(15, 5), 5);
      assert.strictEqual(min(123.456, 123.789), 123.456);
      assert.strictEqual(min(123.789, 123.456), 123.456);
    });
  });

  suite('max()', () => {
    test('returns the maximum value out of the two input arguments', () => {
      assert.strictEqual(max(5, 5), 5);
      assert.strictEqual(max(-5, 5), 5);
      assert.strictEqual(max(5, -5), 5);
      assert.strictEqual(max(5, 15), 15);
      assert.strictEqual(max(15, 5), 15);
      assert.strictEqual(max(123.456, 123.789), 123.789);
      assert.strictEqual(max(123.789, 123.456), 123.789);
    });
  });
});import { TCoordinates, TPosition


3设定温度
	 ["week3timer3SetTemperature"] = 0,
	--周三定时3设定模式
	 ["week3timer3ModeValue"] = 0,

	--周三定时4设定温度
	 ["week3timer4SetTemperature"] = 0,
	--周三定时4设定模式
	 ["week3timer4ModeValue"] = 0,

	--周三定时5设定温度
	 ["week3timer5SetTemperature"] = 0,
	--周三定时5设定模式
	 ["week3timer5ModeValue"] = 0,

	--周三定时6设定温度
	 ["week3timer6SetTemperature"] = 0,
	--周三定时6设定模式
	 ["week3timer6ModeValue"] = 0,

	--周四定时1设定温度
	 ["week4timer1SetTemperature"] = 0,
	--周四定时1设定模式
	 ["week4timer1ModeValue"] = 0,

	--周四定时2设定温度
	 ["week4timer2SetTemperature"] = 0,
	--周四定时2设定模式
	 ["week4timer2ModeValue"] = 0,

	--周四定时3设定温度
	 ["week4timer3SetTemperature"] = 0,
	--周四定时3设定模式
	 ["week4timer3ModeValue"] = 0,

	--周四定时4设定温度
	 ["week4timer4SetTemperature"] = 0,
	--周四定时4设定模式
	 ["week4timer4ModeValue"] = 0,

	--周四定时5设定温度
	 ["week4timer5SetTemperature"] = 0,
	--周四定时5设定模式
	 ["week4timer5ModeValue"] = 0,

	--周四定时6设定温度
	 ["week4timer6SetTemperature"] = 0,
	--周四定时6设定模式
	 ["week4timer6ModeValue"] = 0,

	--周五定时1设定温度
	 ["week5timer1SetTemperature"] = 0,
	--周五定时1设定模式
	 ["week5timer1ModeValue"] = 0,

	--周五定时2设定温度
	 ["week5timer2SetTemperature"] = 0,
	--周五定时2设定模式
	 ["week5timer2ModeValue"] = 0,

	--周五定时3设定温度
	 ["week5timer3SetTemperature"] = 0,
	--周五定时3设定模式
	 ["week5timer3ModeValue"] = 0,

	--周五定时4设定温度
	 ["week5timer4SetTemperature"] = 0,
	--周五定时4设定模式
	 ["week5timer4ModeValue"] = 0,

	--周五定时5设定温度
	 ["week5timer5SetTemperature"] = 0,
	--周五定时5设定模式
	 ["week5timer5ModeValue"] = 0,

	--周五定时6设定温度
	 ["week5timer6SetTemperature"] = 0,
	--周五定时6设定模式
	 ["week5timer6ModeValue"] = 0,

	--周六定时1设定温度
	 ["week6timer1SetTemperature"] = 0,
	--周六定时1设定模式
	 ["week6timer1ModeValue"] = 0,

	--周六定时2设定温度
	 ["week6timer2SetTemperature"] = 0,
	--周六定时2设定模式
	 ["week6timer2ModeValue"] = 0,

	--周六定时3设定温度
	 ["week6timer3SetTemperature"] = 0,
	--周六定时3设定模式
	 ["week6timer3ModeValue"] = 0,

	--周


p+0x18]
  0x01eab2ab: mov    DWORD PTR [esp+0x4],edi
  0x01eab2af: mov    edi,DWORD PTR [esp+0x1c]
  0x01eab2b3: mov    DWORD PTR [esp],edi
  0x01eab2b6: mov    ecx,DWORD PTR [ebx+0x24]
  0x01eab2b9: push   eax
  0x01eab2ba: jmp    ecx

AHE@0x0422ba8c: 0xaabebea0 i2c: 0x01eab330 c2i: 0x01eab3e5 c2iUV: 0x01eab3c4
i2c argument handler #8 for: receiver (Ljava/lang/Object;JJB)V (298 bytes generated)
c2i argument handler starts at 01EAB3E5
  0x01eab330: mov    eax,DWORD PTR [esp]
  ;; verify_i2c {
  0x01eab333: mov    edi,0x1dc2940
  0x01eab338: cmp    eax,edi
  0x01eab33a: jbe    0x01eab34d
  0x01eab340: mov    edi,0x1ea2940
  0x01eab345: cmp    eax,edi
  0x01eab347: jb     0x01eab378
  0x01eab34d: mov    edi,0x1dc0340
  0x01eab352: cmp    eax,edi
  0x01eab354: jbe    0x01eab367
  0x01eab35a: mov    edi,0x1dc2668
  0x01eab35f: cmp    eax,edi
  0x01eab361: jb     0x01eab378
  ;; i2c adapter must return to an interpreter frame
  0x01eab367: push   0x5531723c
  0x01eab36c: call   0x01eab371
  0x01eab371: pusha
  0x01eab372: call   0x54dedbf0
  0x01eab377: hlt
  ;; } verify_i2ce
  0x01eab378: mov    edi,esp
  0x01eab37a: sub    esp,0x18
  0x01eab37d: and    esp,0xfffffff0
  0x01eab380: push   eax
  0x01eab381: mov    eax,edi
  0x01eab383: mov    edi,DWORD PTR [ebx+0x2c]
  0x01eab386: mov    ecx,DWORD PTR [eax+0x1c]
  0x01eab389: mov    edx,DWORD PTR [eax+0x18]
  0x01eab38c: mov    esi,DWORD PTR [eax+0x10]
  0x01eab38f: mov    DWORD PTR [esp+0x4],esi
  0x01eab393: mov    esi,DWORD PTR [eax+0x14]
  0x01eab396: mov    DWORD PTR [esp+0x8],esi
  0x01eab39a: mov    esi,DWORD PTR [eax+0x8]
  0x01eab39d: mov    DWORD PTR [esp+0xc],esi
  0x01eab3a1: mov    esi,DWORD PTR [eax+0xc]
  0x01eab3a4: mov    DWORD PTR [esp+0x10],esi
  0x01eab3a8: mov    esi,DWORD PTR [eax+0x4]
  0x01eab3ab: mov    DWORD PTR [esp+0x14],esi
  0x01eab3af: mov    eax,DWORD PTR fs:[e


;
              }
            }
          },
        );
      },
    );
  }

  ///展示底部按钮为多个的dialog 如果设置的是文字按钮那么，每个按钮的点击通过indexedActionClickCallback处理
  ///如果底部按钮的数量小于等于2 ，会以横排展示，否则会议竖排展示
  ///如果数量超过了三个 会滑动展示
  static void showMoreButtonDialog(
    BuildContext context, {
    required List<String> actions,
    bool showIcon = false,
    Image? iconWidget,
    String? title,
    Widget? titleWidget,
    String? message,
    Widget? messageWidget,
    String? warning,
    Widget? warningWidget,
    List<Widget>? actionsWidget,
    bool barrierDismissible = true,
    int titleMaxLines = cTitleMaxLines,
    BrnDialogConfig? themeData,
    DialogIndexedActionClickCallback? indexedActionClickCallback,
  }) {
    showDialog<void>(
      context: context,
      barrierDismissible: barrierDismissible,
      builder: (BuildContext dialogContext) {
        return BrnDialog(
            iconImage: iconWidget,
            showIcon: showIcon,
            titleText: title,
            titleWidget: titleWidget,
            messageText: message,
            contentWidget: messageWidget,
            warningWidget: warningWidget,
            warningText: warning,
            actionsText: actions,
            actionsWidget: actionsWidget,
            themeData: themeData,
            titleMaxLines: titleMaxLines,
            indexedActionCallback: indexedActionClickCallback);
      },
    );
  }
}import 'package:bruno/src/components/button/brn_small_main_button.dart';
import 'package:bruno/src/components/button/brn_small_outline_button.dart';
import 'package:bruno/src/components/popup/brn_popup_window.dart';
import 'package:bruno/src/constants/brn_asset_constants.dart';
import 'package:bruno/src/theme/brn_theme_configurator.dart';
import 'package:bruno/src/utils/brn_tools.dart';
import 'package:flutter/material.dart';

/// 描述: 主次按钮组成的横向面板
/// 主按钮和边框按钮组成的集合
/// 展示规则：
///
///  * 一个主按钮 和 多个次级按钮
///  * 次按钮不多于两个时，优先显示主按钮，剩下的地方平分给次按钮
///  * 次按钮两个以上时，所有按钮等分，显示更多
///  * 按钮之间的间距是 8

class BrnButtonPanel extends StatefulWidget {
  /// 主按钮的文案
  final String mainButtonName;

  /// 主按钮点击的回调
  final VoidCallback mainButtonOnTap;

  /// 主按enable状态
  /// 默认值为true
  final bool isMainBtnEnable;

  /// 默认状态下，次按钮的文案集合。如果需要改变按钮的可用状态，请使用 [secondaryButtonList] 初始化。
  final List<String>? secondaryButtonNameList;

  /// 包含config状态的次按钮，默认状态的话直接传[secondaryButtonNameList]即可
  final List<BrnButtonPanelConfig>? secondaryButtonList;

  /// 次按钮的点击回调
  final void Function(int)? secondaryButtonOnTap;

  /// 控件的左右的padding
  /// 默认值为20
  final double horizontalPadding;

  /// popUpWindow位于targetView的方向,默认在下面
  final BrnPopupDirection popDirection;

  /// create BrnButtonPanel
  const BrnButtonPanel(
      {Key? key,
      required this.mainButtonName,
      required this.mainButtonOnTap,
      this.isMainBtnEnable = true,
      this.secondaryButtonNameList,
      this.secondaryButton


 = function(bufnr)
  bufnr = util.get_buffers(bufnr or 0)
  if not data.has_symbols(bufnr) then
    return
  end
  data.get_or_create(bufnr):clear_collapsed()
  M.set_collapse_level(bufnr, 99)
end

---Collapse all nodes in the symbol tree
---@param bufnr nil|integer
M.close_all = function(bufnr)
  bufnr = util.get_buffers(bufnr or 0)
  if not data.has_symbols(bufnr) then
    return
  end
  data.get_or_create(bufnr):clear_collapsed()
  M.set_collapse_level(bufnr, 0)
end

return M


("0");
    this.tempAutomata.addToAlphabet("1");
    this.tempAutomata.addTransition("q0", "q0", "1");
    this.tempAutomata.addTransition("q0", "q1", "0");
    this.tempAutomata.addTransition("q1", "q1", "0");
    this.tempAutomata.addTransition("q1", "q2", "1");
    this.tempAutomata.addTransition("q2", "q2", "1");
    this.tempAutomata.addTransition("q2", "q2", "0");
    console.log(this.tempAutomata.evaluate(expression))
  }

  onRegex(regex:string, name:string) {
    this.tempAutomata = new Automata(name);
    this.tempAutomata.createFromRegex(regex);
    this.automata.emit(this.tempAutomata);
  }

  onToNFA() {
    this.tempAutomata = new Automata("new");
    this.tempAutomata.addState("0", false);
    this.tempAutomata.addState("1", false);
    this.tempAutomata.addState("2", true);
    this.tempAutomata.addState("3", false);
    this.tempAutomata.addState("4", false);
    this.tempAutomata.addState("5", false);
    this.tempAutomata.addToAlphabet("a");
    this.tempAutomata.addToAlphabet("b");
    this.tempAutomata.addToAlphabet("E");
    this.tempAutomata.addTransition("0","1","E");
    this.tempAutomata.addTransition("0","3","a");
    this.tempAutomata.addTransition("1","2","b");
    this.tempAutomata.addTransition("1","4","a");
    this.tempAutomata.addTransition("3","1","E");
    this.tempAutomata.addTransition("3","4","b");
    this.tempAutomata.addTransition("4","5","E");

    var t = this.tempAutomata.toNFA();
    if(t.name != "Invalid"){
      this.tempAutomata = t;
    }
    this.automata.emit(this.tempAutomata);
  }

  onToDFA() {
    var t = this.tempAutomata.toDFA();
    if(t.name != "Invalid"){
      this.tempAutomata = t;
    }
    this.automata.emit(this.tempAutomata);
  }

  ngOnInit() {
  }
}console.log('starting of main modules');

// import { addition, subtraction as sub, multiply, division } from "./basic-math"; // normal imports for few imports
import * as MathObj from './basic-math';
import SyneEmployee from './employee'; // default import
console.log(`Addtiotion is - ${MathObj.addition(100,200)}`);
// console.log(`subtraction is - ${sub(600,200)}`); // alias as sub in many exports in a file rather than default
console.log(`subtraction is - ${MathObj.subtraction(600,200)}`); // alias as sub in many exports in a file rather than default
console.log(`multiply is - ${MathObj.multiply(600,200)}`);
console.log(`division is - ${MathObj.division(600,200)}`);

let emp1 = new SyneEmployee();

console.log('ending of main modules');
import { Component } from '@angular/core';
import { NavController, AlertController } from 'ionic-angular';

import { ApiCepProvider } from '../../providers/api-cep/api-cep';
import { HistoricoDbProvider } from '../../providers/historico-db/historico-db';
import {FormGroup, FormBuilder, Validators} from "@angular/forms";

@Component({
  selector: 'page-home',
  templateUrl: 'home.html',
  providers:[
    ApiCepProvider,
    HistoricoDbProvider
  ]
})
export class HomePage
{
  cep: any;
  constructor(p


15 1.94-.46s.85-.7 1.18-1.19zM106.42 14a8 8 0 0 0 2.14-2.15c.5-.79.88-1.55 1.12-2.27.23-.73.38-1.38.42-1.96.05-.58.07-.98.07-1.22 0-1.87-.35-3.3-1.05-4.27a3.23 3.23 0 0 0-4.1-1.16c-.47.2-.88.51-1.23.91-.36.4-.65.9-.87 1.47a5.3 5.3 0 0 0-.34 1.94c0 .83.16 1.7.5 2.6a22.4 22.4 0 0 0 3.34 6.11m4.42 12.15a56 56 0 0 1-4.49-5.18c-1.23-1.64-2.2-2.95-2.88-3.93-.32.2-.71.48-1.16.8a6.7 6.7 0 0 0-2.3 3.07 6.75 6.75 0 0 0 1 6.52q.69.81 1.62 1.32c.62.35 1.3.52 2.05.52.62 0 1.24-.1 1.85-.3s1.18-.43 1.72-.72a8.4 8.4 0 0 0 2.59-2.1" fill="@{lavender}"/><path d="M145.66 30.95a87 87 0 0 0-5.27-.09 153 153 0 0 1-4.73.11v-.44c.47 0 .73-.04 1.17-.12.43-.07.8-.21 1.13-.42.33-.2.6-.5.78-.87q.3-.555.3-1.5V4.33c0-.62-.1-1.12-.3-1.49q-.285-.555-.78-.87c-.32-.2-.7-.35-1.13-.42a8 8 0 0 0-1.37-.12V.98c.9 0 1.8 0 2.34.02s1 .04 1.38.07a34 34 0 0 0 2.33.09 29 29 0 0 0 2.32-.1L145.2 1c.54-.02 1.43-.02 2.32-.02v.44c-.48 0-.93.04-1.36.11-.43.08-.81.22-1.14.43-.33.2-.59.5-.78.87-.2.37-.29.87-.29 1.49v22.02c0 .92.16 1.64.5 2.16.32.52.78.91 1.37 1.18.6.27 1.3.43 2.1.49s1.5.09 2.46.09c1.07 0 2.04-.08 2.92-.25a6.2 6.2 0 0 0 2.3-.88 4.9 4.9 0 0 0 1.6-1.77 8 8 0 0 0 .85-2.86h.45l-.45 6.47a267 267 0 0 1-6.96.1c-2.05 0-3.87-.05-5.44-.12zm24.26-.42v.45a56 56 0 0 1-2.97-.07l-.96-.04a21 21 0 0 0-2.1 0l-.95.04a93 93 0 0 1-2.93.07v-.45c1.01 0 1.77-.16 2.26-.5.49-.32.73-1 .73-2.04v-15c0-1.04-.24-1.73-.73-2.06-.5-.32-1.25-.49-2.26-.49V10a53 53 0 0 1 3.88.1 23 23 0 0 0 3.06-.04 88 88 0 0 1 2.97-.06v.44c-1.01.03-1.76.2-2.25.52-.5.3-.74.99-.74 2.03v15c0 1.04.25 1.72.74 2.03.49.3 1.24.48 2.25.51m1.15-


s.config:
        raise SystemExit("알고리즘(--config) 또는 실험 설정(algo)이 필요합니다.")

    env_from_cfg = exp_cfg.get("env_config")
    if args.env_config and env_from_cfg and args.env_config != env_from_cfg:
        print(f"경고: --env-config({args.env_config}) != 실험 설정({env_from_cfg}). --env-config 우선 적용")
    args.env_config = args.env_config or env_from_cfg
    if not args.env_config:
        raise SystemExit("환경 설정(--env-config) 또는 실험 설정(env_config)이 필요합니다.")

    wandb_from_cfg = exp_cfg.get("wandb_config")
    if args.wandb_config and wandb_from_cfg and args.wandb_config != wandb_from_cfg:
        print(f"경고: --wandb-config({args.wandb_config}) != 실험 설정({wandb_from_cfg}). --wandb-config 우선 적용")
    args.wandb_config = args.wandb_config or wandb_from_cfg or "default"

    exp_with_args: List[str] = []
    if isinstance(exp_cfg.get("with"), dict):
        exp_with_args.extend(format_with_arg(k, v) for k, v in exp_cfg["with"].items())
    if isinstance(exp_cfg.get("with_args"), Iterable):
        exp_with_args.extend(token for token in exp_cfg["with_args"] if isinstance(token, str))
    args.exp_with_args = exp_with_args

    ensure_patches()

    wandb_settings, wandb_overrides = load_wandb_config(args.wandb_config)
    apply_wandb_env(wandb_settings)

    login_to_wandb_if_possible()

    forwardable_keys = {
        "save_model",
        "save_model_interval",
        "use_tensorboard",
        "log_interval",
        "test_interval",
        "test_nepisode",
        "t_max",
        "batch_size_run",
        "buffer_cpu_only",
        "use_cuda",
        "local_results_path",
    }

    combined_with_args = merge_with_arguments(
        format_overrides(wandb_overrides, forwardable_keys),
        args.exp_with_args,
    )
    combined_with_args = merge_with_arguments(
        combined_with_args,
        args.extra_args,
    )

    command = build_pymarl2_command(args, combined_with_args)

    if wandb_settings.project:
        ent = wandb_settings.entity or os.getenv("WANDB_ENTITY", "(unset)")
        mode = wandb_settings.mode or os.getenv("WANDB_MODE", "online")
        print(f"W&B 설정  : {ent}/{wandb_settings.project} (mode={mode})")

    print("실행할 명령어:\n", " ".join(command), "\n")
    os.execvp(command[0], command)

if __name__ == "__main__":
    main()


本题的意思是：当秋天来临的时候，树上的叶子开始变成红色。所以选择“on the tree”。

8. keep 的意思是“保持”。固定搭配：keep + (adj.)/keep + sb./sth. + (adj.)
A 选项 open 既可以作动词（打开），也可以作形容词（开着的），所以选 A。
keep the window open 把窗开着
keep the window closed 把窗关着（这里的 closed 也是一个形容词，表示“关闭的”）

10. both 和 neither 均指两者之间。both 表示肯定，“两者都”；neither 表示否定，“两者都不”。
all 和 none 均指三者及三者以上。all 表示肯定，意为“全部”；none 表示否定，意为“没有一个”。
这句话的意思是“根据校规，所有学生都必须戴红领巾，没有人可以违反规则”。学校的学生数量肯定大于二，所以选择 all 和 none。

13. put on 强调状态的变化，即从没穿到穿上；wear 强调状态，意为“穿着，戴着”。这句话的意思是“里面很热。你为什么还戴着一顶帽子？”

VII. 1. air-conditioned 2. Air-conditioners 3. seasonal 4. More 5. Leaves 6. baking 7. snowmen
``````markdown
# 法治时空

## 妻子自导自演的抢劫案

为了考验丈夫对自己的感情，荒唐妻子雇人抢劫丈夫被判10年徒刑

---

## 民工被灼伤获赔三万

---

## 打击非法捕猎

让候鸟安全过冬

---

## “偷逃过路费被判无期”的法律之惑

---

## 方圆传真

做好事被当贼打

索要赔偿获支持

---

## 假离婚弄假成真

赔了夫人又折财

---

## 贪小利耳环被调包

为得现金险失真

---

## 法治视角

张贵峰
```# 第一单元 扇形统计图

## 第一课时 认识扇形统计图

### 基础训练

#### 一、看图填空。

1. 右边是六(2)班同学最喜欢的球类活动统计图，请根据统计图回答问题。

   (1) 六(2)班同学最喜欢的球类活动是（ ），占班级总人数的（ ）%；最喜欢篮球的人数占班级总人数的（ ）%。

   (2) 最喜欢（ ）的人数占班级总人数的（ ）%。

   (3) 如果你是体育委员，为了吸引尽可能多的同学参与体育活动，你会组织（ ）比赛。

2. 下图是一件毛衣各种成分所占百分比统计图，根据下图回答问题。

   (1) 这是一幅（ ）统计图；

   (2) 棉的含量占这件毛衣总质量的（ ）%；

   (3)（ ）的含量最多，（ ）的含量最少；

   (4) 兔毛含量比涤纶少占总量的（ ）%；

   (5) 这件毛衣重400克，羊毛有（ ）克，兔毛有（ ）克


  .pipe(
    map(x => `당첨!! (${x})`),
    take(10),
  )
  .subscribe(res => console.log(res))

loseSource$
  .pipe(
    map(x => `꽝!! (${x})`),
    take(10),
  )
  .subscribe(res => console.log(res))
/**
  result:
  소스 옵저버블을 각각 구독하므로 어떨땐 같은 숫자가 나오고 어떨땐 숫자가 출력되지 않는다.
  take(10)으로 10개를 먼저 발행한 당첨!!은 구독이 완료된다.

  당첨!! (0)
  당첨!! (2)
  꽝!! (2)
  당첨!! (3)
  당첨!! (4)
  꽝!! (4)
  당첨!! (5)
  꽝!! (5)
  당첨!! (7)
  꽝!! (7)
  당첨!! (10)
  당첨!! (11)
  꽝!! (11)
  당첨!! (12)
  당첨!! (13)
  꽝!! (13)
  꽝!! (17)
  꽝!! (21)
  꽝!! (22)
  꽝!! (24)
 */
import { Message, MessageReaction } from 'discord.js';
import { MessageHandler } from './message-handler';
import { QuoteBuilder, QuoteManager } from '../quotes';
import { injectable, inject } from 'inversify';
import { TYPES } from '../types';

@injectable()
export class QuoteItHandler implements MessageHandler {
  private quoteManager: QuoteManager;

  constructor(@inject(TYPES.QuoteManager) quoteManager: QuoteManager) {
    this.quoteManager = quoteManager;
  }

  getIdentifier(): string {
    return 'quoteit';
  }

  getUsage(): string {
    return `${this.getIdentifier()} : Reply to a message with this command to add it as a quote`;
  }

  handle(content: string, message: Message): Promise<Message | Message[] | MessageReaction> {
    const repliedToReference = message.reference;
    if (repliedToReference === null || typeof repliedToReference === 'undefined') {
      return message.react('👎');
    }

    const repliedToMessageId = repliedToReference.messageID;
    if (repliedToMessageId === null || typeof repliedToMessageId === 'undefined') {
      return message.react('👎');
    }

    return message.channel.messages.fetch(repliedToMessageId).then((repliedToMessage) => {
      const quote = new QuoteBuilder()
        .withQuote(repliedToMessage.content)
        .withAuthor(repliedToMessage.author.username)
        .withBlamer(message.author.username)
        .build();

      return this.quoteManager
        .add(quote)
        .catch((err) => {
          console.error(err);
        })
        .then(() => {
          return message.react('👍');
        });
    });
  }
}
import { Component, OnInit, Inject, Input } from '@angular/core';
import { DOCUMENT } from '@angular/common';

@Component({
  selector: 'theme-switch-component',
  templateUrl: './theme-switch-component.component.html',
  styleUrls: ['./theme-switch-component.component.scss']
})
export class ThemeSwitchComponent  {

  @Input() color!: string;

  private static readonly DARK_THEME_CLASS = 'dark-theme';
  private static readonly DARK_THEME_LIGHT = 'light';
  private static readonly DARK_THEME_DARK  = 'dark';

  styles?: Array<string> = ['Modo Oscuro', 'Modo Claro'];

  public theme: string;

  constructor(@Inject(DOCUMENT) private document: Document) {
      this.theme = this.document.documentElement.classList.contains(ThemeSwitchComponent.DARK_THEME_CLASS) ? ThemeSwit


.draw(island);
        }

#ifndef NDEBUG
        std::fstream out(objname + std::to_string(cntr) + ".png", std::ios::out);
        out << rst.encode(sla::PNGRasterEncoder{});
        out.close();
#endif

        ExPolygons layer_ = sla::raster_to_polygons(rst);
//        float delta = scaled(std::min(rst.pixel_dimensions().h_mm,
//                                      rst.pixel_dimensions().w_mm)) / 2;

//        layer_ = expolygons_simplify(layer_, delta);

#ifndef NDEBUG
        SVG svg(objname +  std::to_string(cntr) + ".svg", BoundingBox(Point{0, 0}, Point{scaled(disp_w), scaled(disp_h)}));
        svg.draw(layer_);
        svg.draw(layer, "green");
        svg.Close();
#endif

        double layera = 0., layera_ = 0.;
        for (auto &p : layer) layera += p.area();
        for (auto &p : layer_) layera_ += p.area();
#ifndef NDEBUG
        std::cout << cntr++ << std::endl;
#endif
        double diff = std::abs(layera_ - layera);
        REQUIRE((diff <= 0.1 * layera || diff < scaled<double>(1.) * scaled<double>(1.)));

        layer = std::move(layer_);
    }

    indexed_triangle_set out = slices_to_mesh(layers, bb.min.z(), double(lh), double(lh));

    its_write_obj(out, "out_from_rasters.obj");
}

TEST_CASE("Recreate object from rasters", "[SL1Import]") {
    recreate_object_from_rasters("frog_legs.obj", 0.05f);
}
#include <catch2/catch.hpp>

#include <iostream>
#include <boost/filesystem.hpp>

#include "libslic3r/ClipperUtils.hpp"
#include "libslic3r/ExPolygon.hpp"
#include "libslic3r/SVG.hpp"

using namespace Slic3r;

// #define TESTS_EXPORT_SVGS

SCENARIO("Constant offset", "[ClipperUtils]") {
	coord_t s = 1000000;
	GIVEN("20mm box") {
		ExPolygon box20mm;
		box20mm.contour.points = { Vec2crd{ 0, 0 }, Vec2crd{ 20 * s, 0 }, Vec2crd{ 20 * s, 20 * s}, Vec2crd{ 0, 20 * s} };
		std::vector<float> deltas_plus(box20mm.contour.points.size(), 1. * s);
		std::vector<float> deltas_minus(box20mm.contour.points.size(), - 1. * s);
		Polygons output;
		WHEN("Slic3r::offset()") {
			for (double miter : { 2.0, 1.5, 1.2 }) {
				DYNAMIC_SECTION("plus 1mm, miter " << miter << "x") {
					output = Slic3r::offset(box20mm, 1. * s, ClipperLib::jtMiter, miter);
#ifdef TESTS_EXPORT_SVGS
					{
						SVG svg(debug_out_path("constant_offset_box20mm_plus1mm_miter%lf.svg", miter).c_str(), get_extents(output));
						svg.draw(box20mm, "blue");
						svg.draw_outline(output, "black", coord_t(scale_(0.01)));
					}
#endif
					THEN("Area is 22^2mm2"


local gitsigns = require('gitsigns')

-- Setup
gitsigns.setup({
    signcolumn = false, -- disable by default
    watch_gitdir = {
        interval = 600,
    },
    current_line_blame_opts = {
        delay = 0,
    },
})

-- Mappings
vim.keymap.set('n', '<Leader>gg', gitsigns.toggle_signs, { desc = 'Toggle gitsigns' })

vim.keymap.set('n', ']h', function()
    if vim.wo.diff then
        return ']c'
    end
    vim.schedule(function()
        gitsigns.nav_hunk('next', { navigation_message = false, foldopen = true })
    end)
    return '<Ignore>'
end, { expr = true, desc = 'Next git hunk' })

vim.keymap.set('


: # pragma: no cover
    socketpair = _fallback_socketpair

__all__ = __implements__ + __extensions__ + __imports__
if _fallback_socketpair.__name__ in __all__:
    __all__.remove(_fallback_socketpair.__name__)

__version_specific__ = (
    # Python 3.7b1+
    'close',
    # Python 3.10rc1+
    'TCP_KEEPALIVE',
    'TCP_KEEPCNT',
)
for _x in __version_specific__:
    if hasattr(__socket__, _x):
        vars()[_x] = getattr(__socket__, _x)
        if _x not in __all__:
            __all__.append(_x)
del _x


 ++c) {
        for (var i = 0; i < numC; ++i) {
          colorMap[ci++] = p.get(i, c).toInt() << 8;
        }
      }
      ifd0['ColorMap'] = colorMap;
    }

    exif.write(out);

    return out.getBytes();
  }

  TiffFormat _getSampleFormat(Image image) {
    switch (image.formatType) {
      case FormatType.uint:
        return TiffFormat.uint;
      case FormatType.int:
        return TiffFormat.int;
      case FormatType.float:
        return TiffFormat.float;
    }
  }
}
import 'dart:convert';
import 'dart:typed_data';

import 'package:archive/archive.dart';

import '../color/format.dart';
import '../image/icc_profile.dart';
import '../image/image.dart';
import '../image/palette.dart';
import '../util/neural_quantizer.dart';
import '../util/output_buffer.dart';
import '../util/quantizer.dart';
import 'encoder.dart';
import 'png/png_info.dart';

enum PngFilter { none, sub, up, average, paeth }

/// Encode an image to the PNG format.
class PngEncoder extends Encoder {
  Quantizer? _globalQuantizer;

  PngEncoder({this.filter = PngFilter.paeth, this.level, this.pixelDimensions});

  int _numChannels(Image image) => image.hasPalette ? 1 : image.numChannels;

  void addFrame(Image image) {
    // PNG can't encode HDR formats, and can only encode formats with fewer
    // than 8 bits if they have a palette. In the case of incompatible
    // formats, convert them to uint8.
    if ((image.isHdrFormat && image.format != Format.uint16) ||
        (image.bitsPerChannel < 8 &&
            !image.hasPalette &&
            image.numChannels > 1)) {
      image = image.convert(format: Format.uint8);
    }

    if (output == null) {
      output = OutputBuffer(bigEndian: true);

      _writeHeader(image);

      if (image.iccProfile != null) {
        _writeICCPChunk(output, image.iccProfile!);
      }

      if (image.hasPalette) {
        if (_globalQuantizer != null) {
          _writePalette(_globalQuantizer!.palette);
        } else {
          _writePalette(image.palette!);
        }
      }

      if (isAnimated) {
        _writeAnimationControlChunk();
      }
    }

    final nc = _numChannels(image);

    final channelBytes = image.format == Format.uint16 ? 2 : 1;

    // Include room for the filter bytes (1 byte per row).
    final filteredImage = Uint8List(
        (image.width * image.height * nc * channelBytes) + image.height);

    _filter(image, filteredImage);

    final compressed = const ZLibEncoder().encode(filteredImage, level: level);

    if (image.textData != null) {
      for (var key in image.textData!.keys) {
        _writeTextChunk(key, image.textData![key]!);
      }
    }

    if (pixelDimensions != null) {
      final phys = OutputBuffer(bigEndian: true)
        ..writeUint32(pixelDimensions!.xPxPerUnit)
        ..writeUint32(pixelDimensions!.yPxPerUnit)
        ..writeByte(pixelDimensions!.unitSpecifier);
      _writeChunk(output!, 'pHYs', phys.getBytes());
    }

    if (isAnimated) {
      _writeFrameControlChunk(image);
      sequenceNumber++;
    }

    if (sequenceNumber <= 1) {
      _writeChunk(output


ditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
 * the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
 * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 * IN THE SOFTWARE.
 */

package com.tencent.bk.job.execute.model.esb.v2;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.tencent.bk.job.common.esb.model.EsbAppScopeDTO;
import com.tencent.bk.job.common.util.json.LongTimestampSerializer;
import com.tencent.bk.job.common.util.json.LongToDecimalJsonSerializer;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

@Data
public class EsbJobInstanceStatusDTO {

    @JsonProperty("is_finished")
    private Boolean isFinished;

    @JsonProperty("job_instance")
    private JobInstance jobInstance;

    private List<Block> blocks;

    @Setter
    @Getter
    public static class JobInstance extends EsbAppScopeDTO {
        @JsonProperty("job_instance_id")
        private Long id;
        /**
         * task id
         */
        @JsonProperty("bk_job_id")
        private Long taskId;
        /**
         * 状态： 1.未执行、2.正在执行、3.执行完成且成功、4.执行失败
         */
        @JsonProperty("status")
        private Integer status;
        /**
         * 作业实例名称
         */
        @JsonProperty("name")
        private String name;
        /**
         * 执行人
         */
        @JsonProperty("operator")
        private String operator;
        /**
         * 脚本创建时间
         */
        @JsonProperty("create_time")
        @JsonSerialize(using = LongTimestampSerializer.class)
        private Long createTime;
        /**
         * 开始时间
         */
        @JsonProperty("start_time")
        @JsonSerialize(using = LongTimestampSerializer.class)
        private Long startTime;
        /**
         * 结束时间
         */
        @JsonProperty("end_time")
        @JsonSerialize(using = LongTimestampSerializer.class)
        private Long endTime;
        /**
         * 总耗时，单位：秒
         */
        @JsonProperty("total_time")
        @JsonSerialize(using = LongToDecimalJsonSerializer.class)
        private Long totalTime;

        /**
         * 启动方式： 1.页面执行、2.API调用、3.定时执行
         */
        @JsonProperty("start_way")
        private Integer startWay;
        /**
         * 操作列表
         */
        @JsonProperty("current_step_instance_id")
        private Long currentStepId;
    }

    @Setter
    @Getter
    public static class Block {
        /**
         * 步骤块中包含的各个步骤对象
         */
        @JsonProperty("step_instances")
        private List<StepInst> stepInstances;
    }

    @Setter
    @Getter
    public static class StepInst {
        /**
         * id
         */
        @JsonProperty("step_instance_id")
        private Long id;
        /**
         * 执行步骤id
         */
        @JsonProperty("step_id")
        private Long stepId;


AddFlowId(FlatBufferBuilder builder, int flowId) { builder.AddInt(15, flowId, 0); }
  public static void AddStateId(FlatBufferBuilder builder, int stateId) { builder.AddInt(16, stateId, 0); }
  public static void AddTriggerEntityId(FlatBufferBuilder builder, int triggerEntityId) { builder.AddInt(17, triggerEntityId, 0); }
  public static Offset<WWParser.Defs.Building> EndBuilding(FlatBufferBuilder builder) {
    int o = builder.EndTable();
    return new Offset<WWParser.Defs.Building>(o);
  }
  public BuildingT UnPack() {
    var _o = new BuildingT();
    this.UnPackTo(_o);
    return _o;
  }
  public void UnPackTo(BuildingT _o) {
    _o.Id = this.Id;
    _o.Name = this.Name;
    _o.Sort = this.Sort;
    _o.Desc = this.Desc;
    _o.AssociateRole = this.AssociateRole;
    _o.RoleTips = this.RoleTips;
    _o.BuildingTexture = this.BuildingTexture;
    _o.TipsSprite = this.TipsSprite;
    _o.MapMarkId = this.MapMarkId;
    _o.UnLockPrice = this.UnLockPrice;
    _o.UnlockCondition = this.UnlockCondition;
    _o.JumpType = this.JumpType;
    _o.JumpParam = this.JumpParam;
    _o.UpGradeCurve = this.UpGradeCurve;
    _o.FlowListName = this.FlowListName;
    _o.FlowId = this.FlowId;
    _o.StateId = this.StateId;
    _o.TriggerEntityId = this.TriggerEntityId;
  }
  public static Offset<WWParser.Defs.Building> Pack(FlatBufferBuilder builder, BuildingT _o) {
    if (_o == null) return default(Offset<WWParser.Defs.Building>);
    var _name = _o.Name == null ? default(StringOffset) : builder.CreateString(_o.Name);
    var _desc = _o.Desc == null ? default(StringOffset) : builder.CreateString(_o.Desc);
    var _role_tips = _o.RoleTips == null ? default(StringOffset) : builder.CreateString(_o.RoleTips);
    var _building_texture = _o.BuildingTexture == null ? default(StringOffset) : builder.CreateString(_o.BuildingTexture);
    var _tips_sprite = _o.TipsSprite == null ? default(StringOffset) : builder.CreateString(_o.TipsSprite);
    var _flow_list_name = _o.FlowListName == null ? default(StringOffset) : builder.CreateString(_o.FlowListName);
    return CreateBuilding(
      builder,
      _o.Id,
      _name,
      _o.Sort,
      _desc,
      _o.AssociateRole,
      _role_tips,
      _building_texture,
      _tips_sprite,
      _o.MapMarkId,
      _o.UnLockPrice,
      _o.UnlockCondition,
      _o.JumpType,
      _o.JumpParam,
      _o.UpGradeCurve,
      _flow_list_name,
      _o.FlowId,
      _o.StateId,
      _o.TriggerEntityId);
  }
}

public class BuildingT
{
  [Newtonsoft.Json.JsonProperty("id")]
  public int Id { get; set; }
  [Newtonsoft.Json.JsonProperty("name")]
  public string Name { get; set; }
  [Newtonsoft.Json.JsonProperty("sort")]
  public int Sort { get; set; }
  [Newtonsoft.Json.JsonProperty("desc")]
  public string Desc { get; set; }
  [Newtonsoft.Json.JsonProperty("associate_role")]
  public int AssociateRole { get; set; }
  [Newtonsoft.Json.JsonProperty("role_tips")]
  public string RoleTips { get; set; }
  [Newtonsoft.Json.JsonProperty("building_texture")]
  public string BuildingTexture { get; set; }
  [Newtonsoft.Json.JsonProperty("tips_sprite")]
  public string TipsSprite { get; set; }


f) {
    return AnimatedAsyncValueWidget(
      value: ref.watch(provider.asyncSelect(select)),
      duration: duration,
      builder: builder,
      loading: loading,
      data: data,
      error: error,
    );
  }
}
import 'dart:async';
import 'dart:developer';
import 'dart:io';
import 'dart:ui';

import 'package:path/path.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
import 'package:tsukuyomi/core/core.dart';
import 'package:tsukuyomi/database/database.dart';
import 'package:tsukuyomi/extension/extension.dart';
import 'package:tsukuyomi/pages/chapter/chapter_service.dart';
import 'package:tsukuyomi/pages/download/download_service.dart';
import 'package:tsukuyomi/pages/source/source_service.dart';
import 'package:tsukuyomi_sources/tsukuyomi_sources.dart';

part 'download_manager_provider.g.dart';

@Riverpod(keepAlive: true)
class DownloadQueue extends _$DownloadQueue {
  @override
  List<DownloadTask> build() {
    ref.onDispose(() {
      for (final task in state) {
        task.cancel();
      }
    });
    return [];
  }

  void addTask(DownloadTask downloadTask) {
    state = [...state, downloadTask];
  }

  bool remove(DownloadTask downloadTask) {
    final removed = state.remove(downloadTask);
    if (removed) {
      state = [...state];
    }
    return removed;
  }
}

class DownloadTask {
  DownloadTask({required this.ref, required this.source, required this.manga, required this.chapter, required this.download});

  final DownloadManagerRef ref;

  final DioHttpSource source;

  final DatabaseManga manga;

  final DatabaseChapter chapter;

  DatabaseDownload download;

  bool _canceled = false;

  /// 保存漫画章节图片
  Future<void> _saveImageFile(HttpSourceImage image, Directory dir, String name) async {
    final fileFromCache = await source.getImageCacheManager(image)?.getFileFromCache(image.url);
    final cachedImage = fileFromCache?.file;
    if (cachedImage != null) {
      final path = join(dir.path, '$name${extension(cachedImage.path)}');
      await cachedImage.copy(path);
    } else {
      final bytes = await source.getImageBytes(image);
      final repaint = await source.getRepaintBytes(bytes);
      final path = join(dir.path, '$name.${repaint.type}');
      await File(path).writeAsBytes(repaint.data, flush: true);
    }
  }

  /// 获取漫画章节图片列表
  Future<List<HttpSourceImage>> _getChapterImages() async {
    // 检查任务是否已取消
    if (_canceled) throw const TsukuyomiDownloadException.canceled();
    // 获取章节图片列表数据
    final images = await ref.read(chapterImagesProvider(source, manga, chapter).future);
    // 转换图片的类型并返回
    return images.cast<HttpSourceImage>();
  }

  /// 更新下载信息
  Future<void> _updateDownload(DatabaseDownload download, {bool check = true}) async {
    // 检查任务是否已取消
    if (check && _canceled) throw const TsukuyomiDownloadException.canceled();
    // 更新数据库下载信息
    final updated = await ref.read(downloadServiceProvider).updateDownload(this.download = download);
    // 检查数据库更新结果
    if (check && !updated) throw const TsukuyomiDownloadException.databaseError('UPDATE');
  }

  /// 开始下载任务
  void start(VoidCallback callback) async {
    // TODO 设置最小要求的磁盘空间大小，如：200MB