final float PULL_DISTANCE_ALPHA_GLOW_FACTOR = 1.1f;
//
//    private static final int VELOCITY_EDGE_FACTOR = 8;
//    private static final int VELOCITY_GLOW_FACTOR = 12;

    private int mState = STATE_IDLE;

    private float mPullDistance;

//    private final Rect mBounds = new Rect();

//    private final int mEdgeHeight;
//    private final int mGlowHeight;
//    private final int mGlowWidth;
//    private final int mMaxEffectHeight;

    /**
     * Construct a new EdgeEffect with a theme appropriate for the provided context.
     * @param context Context used to provide theming and resource information for the EdgeEffect
     */
    public MxxEdgeEffect(Context context) {
//        final Resources res = context.getResources();
//        final float density = res.getDisplayMetrics().density;
//        mEdgeHeight = (int) (10 * density + 0.5f);// mEdge.getIntrinsicHeight();
//        mGlowHeight = (int) (114 * density + 0.5f); //gf mGlow.getIntrinsicHeight();
//        mGlowWidth = (int) (522 * density + 0.5f);//mGlow.getIntrinsicWidth();

//        mMaxEffectHeight = (int) ( mGlowHeight * MAX_GLOW_HEIGHT);
//        mMinWidth = (int) (res.getDisplayMetrics().density * MIN_WIDTH + 0.5f);
        mInterpolator = new DecelerateInterpolator();
    }

    public boolean isFinished() {
        return mState == STATE_IDLE;
    }

    /**
     * Immediately finish the current animation.
     * After this call {@link #isFinished()} will return true.
     */
    public void finish() {
        mState = STATE_IDLE;
    }

    /**
     * A view should call this when content is pulled away from an edge by the user.
     * This will update the state of the current visual effect and its associated animation.
     * The host view should always {@link android.view.View#invalidate()} after this
     * and draw the results accordingly.
     *
     * @param deltaDistance Change in distance since the last call. Values may be 0 (no change) to
     *                      1.f (full length of the view) or negative values to express change
     *                      back toward the edge reached to initiate the effect.
     */
    public boolean onPull(float deltaDistance) {
        final long now = AnimationUtils.currentAnimationTimeMillis();
        if (mState == STATE_PULL_DECAY && now - mStartTime < mDuration) {
            return true;
        }
        if (mState != STATE_PULL) {
            mGlowScaleY = PULL_GLOW_BEGIN;
        }
        mState = STATE_PULL;

        mStartTime = now;
        mDuration = PULL_TIME;

        mPullDistance += deltaDistance;

        float glowChange = Math.abs(deltaDistance);
        if (deltaDistance > 0 && mPullDistance < 0) {
            glowChange = -glowChange;
        }
        if (mPullDistance == 0) {
            mGlowScaleY = 0;
        }

        // Do not allow glow to get larger than MAX_GLOW_HEIGHT.
        mGlowScaleYFinish = mGlowScaleY = mGlowScaleYStart =  Math.max( 0, mGlowScaleY + glowChange * PULL_DISTANCE_GLOW_FACTOR);

//        mEdgeAlphaFinish = mEdgeAlpha;
//        mEdgeScaleYFinish = mEdgeScaleY;
//        mGlowAlphaFinish = mGlowAlpha;

        return true;
    }

    /**
     * Call when the object is released after being pulled.
     * This will begin the "decay" phase of the effect. After calling this method
     * the host view should {@link android.view.View#invalidate()} and thereby
     * draw the results accordingly.
     */
    public boolean on


, notificationPresent)
	})

	t.Run("remove non-notification label from OBC", func(t *testing.T) {
		obc, err := k8sh.BucketClientset.ObjectbucketV1alpha1().ObjectBucketClaims(obcNamespace).Get(ctx, obcName, metav1.GetOptions{})
		assert.Nil(t, err)
		delete(obc.Labels, "test-label")
		_, err = k8sh.BucketClientset.ObjectbucketV1alpha1().ObjectBucketClaims(obcNamespace).Update(ctx, obc, metav1.UpdateOptions{})
		assert.Nil(t, err)
		// check whether existing bucket notification unaffected
		notificationPresent := utils.Retry(12, 2*time.Second, "notification is created for bucket", func() bool {
			// TODO : add api to fetch all the notification from backend to see if it is unaffected
			t.Skipped()
			return helper.BucketClient.CheckBucketNotificationSetonRGW(namespace, storeName, obcName, bucketname, notificationName, helper, objectStore.Spec.IsTLSEnabled())
		})
		assert.True(t, notificationPresent)
	})

	t.Run("remove notification label from OBC", func(t *testing.T) {
		// TODO: add remove notification label support in OBC
		t.Skipped()
		obc, err := k8sh.BucketClientset.ObjectbucketV1alpha1().ObjectBucketClaims(obcNamespace).Get(ctx, obcName, metav1.GetOptions{})
		assert.Nil(t, err)
		delete(obc.Labels, bucketNotificationLabelPrefix+notificationName)
		_, err = k8sh.BucketClientset.ObjectbucketV1alpha1().ObjectBucketClaims(obcNamespace).Update(ctx, obc, metav1.UpdateOptions{})
		assert.Nil(t, err)
		// check whether existing bucket notification uneffected
		var notificationPresent bool
		for i := 0; i < 4; i++ {
			notificationPresent = helper.BucketClient.CheckBucketNotificationSetonRGW(namespace, storeName, obcName, bucketname, notificationName, helper, objectStore.Spec.IsTLSEnabled())
			if !notificationPresent {
				break
			}
			time.Sleep(5 * time.Second)
		}
		assert.False(t, notificationPresent)
	})

	t.Run("perform s3 operations and confirm notifications are no longer received", func(t *testing.T) {
		var s3client *rgw.S3Agent
		s3endpoint, _ := helper.ObjectClient.GetEndPointUrl(namespace, storeName)
		s3AccessKey, _ := helper.BucketClient.GetAccessKey(obcName)
		s3SecretKey, _ := helper.BucketClient.GetSecretKey(obcName)
		insecure := objectStore.Spec.IsTLSEnabled()
		s3client, err = rgw.NewS3Agent(s3AccessKey, s3SecretKey, s3endpoint, true, nil, insecure, nil)

		assert.Nil(t, err)
		logger.Infof("endpoint (%s) Accesskey (%s) secret (%s)", s3endpoint, s3AccessKey, s3SecretKey)

		t.Run("put object", func(t *testing.T) {
			_, err := s3client.PutObjectInBucket(bucketname, ObjBody, ObjectKey2, contentType)
			assert.Nil(t, err)
		})

		t.Run("check for put bucket notification", func(t *testing.T) {
			notificationReceived, err := helper.NotificationClient.CheckNotificationFromHTTPEndPoint(appLabel, putEvent, ObjectKey2)
			assert.False(t, notificationReceived)
			assert.Nil(t, err)
		})

		t.Run("delete objects", func(t *testing.T) {
			_, err := s3client.DeleteObjectInBucket(bucketname, ObjectKey1)
			assert.Nil(t, err)
		})

		t.Run("check for delete bucket notification", func(t *testing.T) {
			notificationReceived, err := helper.NotificationClient.CheckNotificationFromHTTPEndPoint(appLabel, deleteEven


0.5 0c-23 0-41.6 18.6-41.6 41.6z"],
    "h": [384, 512, [104], "48", "M320 256l0 192c0 17.7 14.3 32 32 32s32-14.3 32-32l0-224 0-160c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 128L64 192 64 64c0-17.7-14.3-32-32-32S0 46.3 0 64L0 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-192 256 0z"],
    "tarp": [576, 512, [], "e57b", "M576 128c0-35.3-28.7-64-64-64L64 64C28.7 64 0 92.7 0 128L0 384c0 35.3 28.7 64 64 64l352 0 0-128c0-17.7 14.3-32 32-32l128 0 0-160zM448 448L576 320l-128 0 0 128zM96 128a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"],
    "screwdriver-wrench": [512, 512, ["tools"], "f7d9", "M78.6 5C69.1-2.4 55.6-1.5 47 7L7 47c-8.5 8.5-9.4 22-2.1 31.6l80 104c4.5 5.9 11.6 9.4 19 9.4l54.1 0 109 109c-14.7 29-10 65.4 14.3 89.6l112 112c12.5 12.5 32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3l-112-112c-24.2-24.2-60.6-29-89.6-14.3l-109-109 0-54.1c0-7.5-3.5-14.5-9.4-19L78.6 5zM19.9 396.1C7.2 408.8 0 426.1 0 444.1C0 481.6 30.4 512 67.9 512c18 0 35.3-7.2 48-19.9L233.7 374.3c-7.8-20.9-9-43.6-3.6-65.1l-61.7-61.7L19.9 396.1zM512 144c0-10.5-1.1-20.7-3.2-30.5c-2.4-11.2-16.1-14.1-24.2-6l-63.9 63.9c-3 3-7.1 4.7-11.3 4.7L352 176c-8.8 0-16-7.2-16-16l0-57.4c0-4.2 1.7-8.3 4.7-11.3l63.9-63.9c8.1-8.1 5.2-21.8-6-24.2C388.7 1.1 378.5 0 368 0C288.5 0 224 64.5 224 144l0 .8 85.3 85.3c36-9.1 75.8 .5 104 28.7L429 274.5c49-23 83-72.8 83-130.5zM56 432a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z"],
    "arrows-to-eye": [640, 512, [], "e4bf", "M15 15C24.4 5.7 39.6 5.7 49 15l63 63L112 40c0-13.3 10.7-24 24-24s24 10.7 24 24l0 96c0 13.3-10.7 24-24 24l-96 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l38.1 0L15 49C5.7 39.6 5.7 24.4 15 15zM133.5 243.9C158.6 193.6 222.7 112 320 112s161.4 81.6 186.5 131.


/*
 * CF IDE addon card code
 *
 * Enter bugs at http://blackfin.uclinux.org/
 *
 * Copyright (c) 2005-2009 Analog Devices Inc.
 *
 * Licensed under the GPL-2 or later.
 */

#include <common.h>
#include <config.h>
#include <command.h>
#include <asm/blackfin.h>

void cf_outb(unsigned char val, volatile unsigned char *addr)
{
	*(addr) = val;
	SSYNC();
}

unsigned char cf_inb(volatile unsigned char *addr)
{
	volatile unsigned char c;

	c = *(addr);
	SSYNC();

	return c;
}

void cf_insw(unsigned short *sect_buf, unsigned short *addr, int words)
{
	int i;

	for (i = 0; i < words; i++)
		*(sect_buf + i) = *(addr);
	SSYNC();
}

void cf_outsw(unsigned short *addr, unsigned short *sect_buf, int words)
{
	int i;

	for (i = 0; i < words; i++)
		*(addr) = *(sect_buf + i);
	SSYNC();
}

void cf_ide_init(void)
{
#if defined(CONFIG_BFIN_TRUE_IDE)
	/* Enable ATASEL when in True IDE mode */
	printf("Using CF True IDE Mode\n");
	cf_outb(0, (unsigned char *)CONFIG_CF_ATASEL_ENA);
	udelay(1000);
#elif defined(CONFIG_BFIN_CF_IDE)
	/* Disable ATASEL when we're in Common Memory Mode */
	printf("Using CF Common Memory Mode\n");
	cf_outb(0, (unsigned char *)CONFIG_CF_ATASEL_DIS);
	udelay(1000);
#elif defined(CONFIG_BFIN_HDD_IDE)
	printf("Using HDD IDE Mode\n");
#endif
	ide_init();
}


ce and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
- Neither the name of Intel Corporation nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

File Name: mfx_function_table.cpp

\* ****************************************************************************** */

#include "mfx_dispatcher.h"

//
// implement a table with functions names
//

#undef FUNCTION
#define FUNCTION(return_value, func_name, formal_param_list, actual_param_list) \
    {#func_name, API_VERSION},

const
FUNCTION_DESCRIPTION APIFunc[eVideoFuncTotal] =
{
    {"MFXInit", {{0, 1}}},
    {"MFXClose", {{0, 1}}},
    {"MFXQueryIMPL", {{0, 1}}},
    {"MFXQueryVersion", {{0, 1}}},

    {"MFXJoinSession", {{1, 1}}},
    {"MFXDisjoinSession", {{1, 1}}},
    {"MFXCloneSession", {{1, 1}}},
    {"MFXSetPriority", {{1, 1}}},
    {"MFXGetPriority", {{1, 1}}},

    {"MFXInitEx", {{1, 14}}},

#include "mfx_exposed_functions_list.h"
};

const
FUNCTION_DESCRIPTION APIAudioFunc[eAudioFuncTotal] =
{
    {"MFXInit", {{8, 1}}},
    {"MFXClose", {{8, 1}}},
    {"MFXQueryIMPL", {{8, 1}}},
    {"MFXQueryVersion", {{8, 1}}},

    {"MFXJoinSession", {{8, 1}}},
    {"MFXDisjoinSession", {{8, 1}}},
    {"MFXCloneSession", {{8, 1}}},
    {"MFXSetPriority", {{8, 1}}},
    {"MFXGetPriority", {{8, 1}}},

#include "mfxaudio_exposed_functions_list.h"
};

// static section of the file
namespace
{

//
// declare pseudo-functions.
// they are used as default values for call-tables.
//

mfxStatus pseudoMFXInit(mfxIMPL impl, mfxVersion *ver, mfxSession *session)
{
    // touch unreferenced parameters
    impl = impl;
    ver = ver;
    session = session;

    return MFX_ERR_UNKNOWN;

} // mfxStatus pseudoMFXInit(mfxIMPL impl, mfxVersion *ver, mfxSession *session)

mfxStatus pseudoMFXClose(mfxSession session)
{
    // touch unreferenced parameters
    session = session;

    return MFX_ERR_UNKNOWN;

} // mfxStatus pseudoMFXClose(mfxSession session)

mfxStatus pseudoMFXJoinSession(mfxSession session, mfxSession child


rn: 0.001 }
        ];
        testValues.map(tv => {
            expect(UnitConverter(tv.inputValue, UnitSystemNames.Energy).from(tv.startUnit).to(tv.returnUnit).calculate()).toBeCloseTo(tv.expectedReturn, 4);
        });
    });

    it("Should convert kilojoule correctly", () => {
        const testValues = [
            { inputValue: 3600, startUnit: "kJ", returnUnit: "Wh", expectedReturn: 1000 },
            { inputValue: 3600, startUnit: "kJ", returnUnit: "kWh", expectedReturn: 1 },
            { inputValue: 1, startUnit: "kJ", returnUnit: "J", expectedReturn: 1000 }
        ];
        testValues.map(tv => {
            expect(UnitConverter(tv.inputValue, UnitSystemNames.Energy).from(tv.startUnit).to(tv.returnUnit).calculate()).toBeCloseTo(tv.expectedReturn, 4);
        });
    });
});import { iconDirectory } from '../config';
import { readdirSync, readFileSync } from 'fs';

export interface Icon {
	name: string;
	source: string;
	theme: string;
	category: string;
}

export default class BaseProcessor {
	iconDirectory: string;
	iconFileExtension: string;

	constructor() {
		this.iconDirectory = iconDirectory;
	}

	filterIconFilenames(filenames: string[]): string[] {
		return filenames.filter(
			(filename: string) => filename.indexOf('.') !== 0,
		);
	}

	getIconNames(): string[] {
		if (!this.iconDirectory) {
			throw new Error('Please implement `this.iconDirectory` property');
		}

		if (!this.iconFileExtension) {
			throw new Error(
				'Please implement `this.iconFileExtension` property',
			);
		}

		const filenames = readdirSync(this.iconDirectory);
		const iconFilenames: string[] = this.filterIconFilenames(filenames);

		return iconFilenames.map(filename =>
			filename.replace(new RegExp(`.${this.iconFileExtension}$`), ''),
		);
	}

	getIcons(): Icon[] {
		const iconNames: string[] = this.getIconNames();
		const icons: Icon[] = [];

		iconNames.forEach((iconName: string) => {
			const fileContent = readFileSync(
				`${this.iconDirectory}/${iconName}.${this.iconFileExtension}`,
				{
					encoding: 'utf-8',
				},
			);
			const iconNameChunks: string[] = iconName.split('.');
			const icon: Icon = {
				source: fileContent,
				category: iconNameChunks[0],
				theme: iconNameChunks[1],
				name: iconNameChunks[2],
			};
			icon.source = this.processIconContent(icon);
			icons.push(icon);
		});

		return icons;
	}

	processIconContent(icon: Icon) {
		return icon.source;
	}

	run() {
		throw new Error(
			'Please implement run() method as override of this one in your class',
		);
	}
}
// Type definitions for the ElementLoc FMObject
// Definitions by: Dan Reed <http://danreed.dev>

/** ElementLoc specifies a location within the structure of a document or book. */
interface ElementLoc {
  /** The parent element. */

  parent: Element;

  /** The child element. */

  child: Element;

  /** Offset within the parent or child element. */
  offset: number;
}

interface ElementLocConstructor {
  new (): ElementLoc;

  new (parent: Element, child: Element, offset: number): ElementLoc;
  readonly prototype: ElementLoc;
}

declare const ElementLoc: ElementLocConstructor;

import { CollectionCache, CollectionKey } from "../../../common";
import { FeatureSets } from "./FeatureSets";
import { FactionFeatures } from "./FactionFeatures";

export namespace FeatureSetToFactionFeatureJunctions {


    List<Variant> variants,
      List<Rendition> videos,
      List<Rendition> audios,
      List<Rendition> subtitles,
      List<Rendition> closedCaptions) {
    ArrayList<Uri> mediaPlaylistUrls = new ArrayList<>();
    for (int i = 0; i < variants.size(); i++) {
      Uri uri = variants.get(i).url;
      if (!mediaPlaylistUrls.contains(uri)) {
        mediaPlaylistUrls.add(uri);
      }
    }
    addMediaPlaylistUrls(videos, mediaPlaylistUrls);
    addMediaPlaylistUrls(audios, mediaPlaylistUrls);
    addMediaPlaylistUrls(subtitles, mediaPlaylistUrls);
    addMediaPlaylistUrls(closedCaptions, mediaPlaylistUrls);
    return mediaPlaylistUrls;
  }

  private static void addMediaPlaylistUrls(List<Rendition> renditions, List<Uri> out) {
    for (int i = 0; i < renditions.size(); i++) {
      Uri uri = renditions.get(i).url;
      if (uri != null && !out.contains(uri)) {
        out.add(uri);
      }
    }
  }

  private static <T> List<T> copyStreams(
      List<T> streams, int groupIndex, List<StreamKey> streamKeys) {
    List<T> copiedStreams = new ArrayList<>(streamKeys.size());
    // TODO:
    // 1. When variants with the same URL are not de-duplicated, duplicates must not increment
    //    trackIndex so as to avoid breaking stream keys that have been persisted for offline. All
    //    duplicates should be copied if the first variant is copied, or discarded otherwise.
    // 2. When renditions with null URLs are permitted, they must not increment trackIndex so as to
    //    avoid breaking stream keys that have been persisted for offline. All renitions with null
    //    URLs should be copied. They may become unreachable if all variants that reference them are
    //    removed, but this is OK.
    // 3. Renditions with URLs matching copied variants should always themselves be copied, even if
    //    the corresponding stream key is omitted. Else we're throwing away information for no gain.
    for (int i = 0; i < streams.size(); i++) {
      T stream = streams.get(i);
      for (int j = 0; j < streamKeys.size(); j++) {
        StreamKey streamKey = streamKeys.get(j);
        if (streamKey.groupIndex == groupIndex && streamKey.streamIndex == i) {
          copiedStreams.add(stream);
          break;
        }
      }
    }
    return copiedStreams;
  }
}
/*
 * Copyright 2021 The Android Open Source Project
 *
 * 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
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.google.android.exoplayer2.source.dash.manifest;

import androidx.annotation.Nullable;
import com.google.common.base.Objects;

/** A base URL, as defined by ISO 23009-1, 2nd edition, 5.6. and ETSI TS 103 285 V1.2.1, 10.8.2.1 */
public final class BaseUrl {

  /** The default weight. */
  public static final int DEFAULT_WEIGHT = 1;
  /** The default priority. */
  public static final int DEFAULT_DVB_PRIORITY = 1;
  /** Constant representing an unset priority in a manifest that does not declare a DVB profile. */
  public static final int PRIORITY_UNSET = Integer.MIN_VALUE;

  /** The URL


@return possible error of this command.
 */
static CommandCost CheckNewTrain(Train *original_dst, Train *dst, Train *original_src, Train *src)
{
	/* Just add 'new' engines and subtract the original ones.
	 * If that's less than or equal to 0 we can be sure we did
	 * not add any engines (read: trains) along the way. */
	if ((src          != nullptr && src->IsEngine()          ? 1 : 0) +
			(dst          != nullptr && dst->IsEngine()          ? 1 : 0) -
			(original_src != nullptr && original_src->IsEngine() ? 1 : 0) -
			(original_dst != nullptr && original_dst->IsEngine() ? 1 : 0) <= 0) {
		return CommandCost();
	}

	/* Get a free unit number and check whether it's within the bounds.
	 * There will always be a maximum of one new train. */
	if (GetFreeUnitNumber(VEH_TRAIN) <= _settings_game.vehicle.max_trains) return CommandCost();

	return CommandCost(STR_ERROR_TOO_MANY_VEHICLES_IN_GAME);
}

/**
 * Check whether the train parts can be attached.
 * @param t the train to check
 * @return possible error of this command.
 */
static CommandCost CheckTrainAttachment(Train *t)
{
	/* No multi-part train, no need to check. */
	if (t == nullptr || t->Next() == nullptr) return CommandCost();

	/* The maximum length for a train. For each part we decrease this by one
	 * and if the result is negative the train is simply too long. */
	int allowed_len = _settings_game.vehicle.max_train_length * TILE_SIZE - t->gcache.cached_veh_length;

	/* For free-wagon chains, check if they are within the max_train_length limit. */
	if (!t->IsEngine()) {
		t = t->Next();
		while (t != nullptr) {
			allowed_len -= t->gcache.cached_veh_length;

			t = t->Next();
		}

		if (allowed_len < 0) return CommandCost(STR_ERROR_TRAIN_TOO_LONG);
		return CommandCost();
	}

	Train *head = t;
	Train *prev = t;

	/* Break the prev -> t link so it always holds within the loop. */
	t = t->Next();
	prev->SetNext(nullptr);

	/* Make sure the cache is cleared. */
	head->InvalidateNewGRFCache();

	while (t != nullptr) {
		allowed_len -= t->gcache.cached_veh_length;

		Train *next = t->Next();

		/* Unlink the to-be-added piece; it is already unlinked from the previous
		 * part due to the fact that the prev -> t link is broken. */
		t->SetNext(nullptr);

		/* Don't check callback for articulated or rear dual headed parts */
		if (!t->IsArticulatedPart() && !t->IsRearDualheaded()) {
			/* Back up and clear the first_engine data to avoid using wagon override group */
			EngineID first_engine = t->gcache.first_engine;
			t->gcache.first_engine = EngineID::Invalid();

			/* We don't want the cache to interfere. head's cache is cleared before
			 * the loop and after each callback does not need to be cleared here. */
			t->InvalidateNewGRFCache();

			uint16_t callback = GetVehicleCallbackParent(CBID_TRAIN_ALLOW_WAGON_ATTACH, 0, 0, head->engine_type, t, head);

			/* Restore original first_engine data */
			t->gcache.first_engine = first_engine;

			/* We do not want to remember any cached variables from the test run */
			t->InvalidateNewGRFCache();
			head->InvalidateNewGRFCache();

			if (callback != CALLBACK_FAILED) {
				/* A failing callback means everything is okay */
				StringID error = STR_NULL;

				if (head->GetGRF()->


_MSG.
TEST(gtest_extra_test, expect_throw_msg) {
  EXPECT_THROW_MSG(throw_exception(), std::exception, "test");
  EXPECT_NONFATAL_FAILURE(
      EXPECT_THROW_MSG(throw_exception(), std::logic_error, "test"),
      "Expected: throw_exception() throws an exception of "
      "type std::logic_error.\n  Actual: it throws a different type.");
  EXPECT_NONFATAL_FAILURE(
      EXPECT_THROW_MSG(do_nothing(), std::exception, "test"),
      "Expected: do_nothing() throws an exception of type std::exception.\n"
      "  Actual: it throws nothing.");
  EXPECT_NONFATAL_FAILURE(
      EXPECT_THROW_MSG(throw_exception(), std::exception, "other"),
      "throw_exception() throws an exception with a different message.\n"
      "Expected: other\n"
      "  Actual: test");
}

// Tests EXPECT_SYSTEM_ERROR.
TEST(gtest_extra_test, expect_system_error) {
  EXPECT_SYSTEM_ERROR(throw_system_error(), EDOM, "test");
  EXPECT_NONFATAL_FAILURE(
      EXPECT_SYSTEM_ERROR(throw_exception(), EDOM, "test"),
      "Expected: throw_exception() throws an exception of "
      "type std::system_error.\n  Actual: it throws a different type.");
  EXPECT_NONFATAL_FAILURE(
      EXPECT_SYSTEM_ERROR(do_nothing(), EDOM, "test"),
      "Expected: do_nothing() throws an exception of type std::system_error.\n"
      "  Actual: it throws nothing.");
  EXPECT_NONFATAL_FAILURE(
      EXPECT_SYSTEM_ERROR(throw_system_error(), EDOM, "other"),
      fmt::format(
          "throw_system_error() throws an exception with a different message.\n"
          "Expected: {}\n"
          "  Actual: {}",
          system_error_message(EDOM, "other"),
          system_error_message(EDOM, "test")));
}

TEST(gtest_extra_test, expect_throw_msg_streaming) {
  EXPECT_THROW_MSG(throw_exception(), std::exception, "test")
      << "unexpected failure";
  EXPECT_NONFATAL_FAILURE(
      EXPECT_THROW_MSG(throw_exception(), std::exception, "other")
          << "expected failure",
      "expected failure");
}

TEST(gtest_extra_test, expect_system_error_streaming) {
  EXPECT_SYSTEM_ERROR(throw_system_error(), EDOM, "test")
      << "unexpected failure";
  EXPECT_NONFATAL_FAILURE(
      EXPECT_SYSTEM_ERROR(throw_system_error(), EDOM, "other")
          << "expected failure",
      "expected failure");
}

#if FMT_USE_FCNTL

using fmt::buffered_file;
using fmt::file;

TEST(output_redirect_test, scoped_redirect) {
  file read_end, write_end;
  file::pipe(read_end, write_end);
  {
    buffered_file file(write_end.fdopen("w"));
    std::fprintf(file.get(), "[[[");
    {
      output_redirect redir(file.get());
      std::fprintf(file.get(), "censored");
    }
    std::fprintf(file.get(), "]]]");
  }
  EXPECT_READ(read_end, "[[[]]]");
}

// Test that output_redirect handles errors in flush correctly.
TEST(output_redirect_test, flush_error_in_ctor) {
  file read_end, write_end;
  file::pipe(read_end, write_end);
  int write_fd = write_end.descriptor();
  file write_cop


test.h>

#include "config.h"

namespace google {
namespace protobuf {
namespace {

// TODO(kenton):  More tests.

#ifdef PACKAGE_VERSION  // only defined when using automake, not MSVC

TEST(VersionTest, VersionMatchesConfig) {
  // Verify that the version string specified in config.h matches the one
  // in common.h.  The config.h version is a string which may have a suffix
  // like "beta" or "rc1", so we remove that.
  string version = PACKAGE_VERSION;
  int pos = 0;
  while (pos < version.size() &&
         (ascii_isdigit(version[pos]) || version[pos] == '.')) {
    ++pos;
  }
  version.erase(pos);

  EXPECT_EQ(version, internal::VersionString(GOOGLE_PROTOBUF_VERSION));
}

#endif  // PACKAGE_VERSION

TEST(CommonTest, IntMinMaxConstants) {
  // kint32min was declared incorrectly in the first release of protobufs.
  // Ugh.
  EXPECT_LT(kint32min, kint32max);
  EXPECT_EQ(static_cast<uint32>(kint32min), static_cast<uint32>(kint32max) + 1);
  EXPECT_LT(kint64min, kint64max);
  EXPECT_EQ(static_cast<uint64>(kint64min), static_cast<uint64>(kint64max) + 1);
  EXPECT_EQ(0, kuint32max + 1);
  EXPECT_EQ(0, kuint64max + 1);
}

vector<string> captured_messages_;

void CaptureLog(LogLevel level, const char* filename, int line,
                const string& message) {
  captured_messages_.push_back(
    strings::Substitute("$0 $1:$2: $3",
      implicit_cast<int>(level), filename, line, message));
}

TEST(LoggingTest, DefaultLogging) {
  CaptureTestStderr();
  int line = __LINE__;
  GOOGLE_LOG(INFO   ) << "A message.";
  GOOGLE_LOG(WARNING) << "A warning.";
  GOOGLE_LOG(ERROR  ) << "An error.";

  string text = GetCapturedTestStderr();
  EXPECT_EQ(
    "[libprotobuf INFO "__FILE__":" + SimpleItoa(line + 1) + "] A message.\n"
    "[libprotobuf WARNING "__FILE__":" + SimpleItoa(line + 2) + "] A warning.\n"
    "[libprotobuf ERROR "__FILE__":" + SimpleItoa(line + 3) + "] An error.\n",
    text);
}

TEST(LoggingTest, NullLogging) {
  LogHandler* old_handler = SetLogHandler(NULL);

  CaptureTestStderr();
  GOOGLE_LOG(INFO   ) << "A message.";
  GOOGLE_LOG(WARNING) << "A warning.";
  GOOGLE_LOG(ERROR  ) << "An error.";

  EXPECT_TRUE(SetLogHandler(old_handler) == NULL);

  string text = GetCapturedTestStderr();
  EXPECT_EQ("", text);
}

TEST(LoggingTest, CaptureLogging) {
  captured_messages_.clear();

  LogHandler* old_handler = SetLogHandler(&CaptureLog);

  int start_line = __LINE__;
  GOOGLE_LOG(ERROR) << "An error.";
  GOOGLE_LOG(WARNING) << "A warning.";

  EXPECT_TRUE(SetLogHandler(old_handler) == &CaptureLog);

  ASSERT_EQ(2, captured_messages_.size());
  EXPECT_EQ(
    "2 "__FILE__":" + SimpleItoa(start_line + 1) + ": An error.",
    captured_messages_[0]);
  EXPECT_EQ(
    "1 "__FILE__":" + SimpleItoa(start_line + 2) + ": A warning.",
    captured_messages_[1]);
}

TEST(LoggingTest, SilenceLoggin


private lateinit var connection: MessageBusConnection

  override fun setUp() {
    super.setUp()
    connection = project.messageBus.connect(testRootDisposable)
  }

  @Test
  fun `test all solved`() {
    courseWithFiles(courseMode = CourseMode.EDUCATOR) {
      lesson {
        eduTask {
          checkResultFile(CheckStatus.Solved)
        }
      }
    }

    val dataContext = dataContext(arrayOf(getCourseDir()))

    doTestWithNotification(dataContext) {
      assertEquals(EduCoreBundle.message("notification.content.all.tasks.solved.correctly"), it.content)
    }
  }

  @Test
  fun `test failed tasks`() {
    val taskName = "Failed Task"
    courseWithFiles(courseMode = CourseMode.EDUCATOR) {
      lesson {
        eduTask(name = taskName) {
          checkResultFile(CheckStatus.Failed)
        }
      }
    }

    val dataContext = dataContext(arrayOf(getCourseDir()))

    doTestWithNotification(dataContext) {
      assertEquals("1 of 1 tasks failed", it.subtitle)
      assertEquals("lesson1/$taskName", it.content)
    }
  }

  @Test
  fun `test tasks with different statuses`() {
    courseWithFiles(courseMode = CourseMode.EDUCATOR) {
      lesson {
        eduTask {
          checkResultFile(CheckStatus.Unchecked)
        }
        eduTask {
          checkResultFile(CheckStatus.Solved)
        }
      }
      lesson {
        eduTask {
          checkResultFile(CheckStatus.Failed)
        }
      }
    }

    val dataContext = dataContext(arrayOf(getCourseDir()))

    doTestWithNotification(dataContext) {
      assertEquals("2 of 3 tasks failed", it.subtitle)
      assertEquals("lesson1/task1
lesson2/task1", it.content)
    }
  }

  @Test
  fun `test disabled in student mode`() {
    courseWithFiles {
      lesson {
        eduTask {
          checkResultFile(CheckStatus.Solved)
        }
      }
    }
    testAction(CCCheckAllTasksAction.ACTION_ID, dataContext(emptyArray()), shouldBeEnabled = false)
  }

  @Test
  fun `test check tasks with one data context`() {
    courseWithFiles(courseMode = CourseMode.EDUCATOR) {
      lesson { createLessonContent() }   // 2 tasks
      section { createSectionContent() } // 4 tasks
      section { createSectionContent() } // 4 tasks
    }

    val dataContext = dataContext(arrayOf(getCourseDir()))

    doTestWithNotification(dataContext) {
      assertEquals("10 of 10 tasks failed", it.subtitle)
      val expectedStr = listOf(
        "lesson1/task1",
        "lesson1/task2",
        "section2/lesson1/task1",
        "section2/lesson1/task2",
        "section2/lesson2/task1",
        "section2/lesson2/task2",
        "section3/lesson1/task1",
        "section3/lesson1/task2",
        "section3/lesson2/task1",
        "section3/lesson2/task2",
        ).joinToString("
")
      assertEquals(expectedStr, it.content)
    }
  }

  @Test
  fun `test check tasks with multiple data context`() {
    courseWithFiles(courseMode = CourseMode.EDUCATOR) {
      section { createSectionContent() }  // 4 tasks
      section { createSectionContent() } // 4 tasks
      section { createSectionContent()


 verbose output")
@click.option("--enum-name-protection", "-np", is_flag=True, help="Test server name protection status. Note: This option will cause DDSpoof to create DNS records on the server")
def shell_init(ctx, iface: str, retry: int, config_file: str, verbose: bool, enum_name_protection: bool):
    spoofer = DDSpoof(verbose, enum_name_protection)

    if config_file:
        config_initialized = spoofer.load_config_from_file(config_file)
    else:
        config_initialized = spoofer.initialize_new_config(iface, retry)

    if not config_initialized:
        click.echo("[*] Failed initializing spoofer config. Quitting.")
        os._exit(1)

    ctx.obj = spoofer
    commands = [
        spoofer.delete_record,
        spoofer.write_record,
        spoofer.set_server,
        spoofer.set_cid,
        spoofer.set_ip,
        spoofer.start_dhcp,
        spoofer.start_llmnr,
        spoofer.stop_dhcp,
        spoofer.stop_llmnr,
        spoofer.show_config,
        spoofer.save_config,
        spoofer.exit,
        spoofer.quit,
        spoofer.test_ip,
    ]

    for command in commands:
        shell_init.add_command(command)

shell_init()


   // print("rx data $data $_rxStreamCtrl ${_rxStreamCtrl.sink}");
      var packet = MidiPacket(data, DateTime.now().millisecondsSinceEpoch, this);
      _rxStreamCtrl.add(packet);
    });

    return true;
  }

  send(Pointer<Uint8> buffer, int length) {
    if (outPort != null) {
      final voidBuffer = buffer.cast<Void>();

      int status;
      if ((status = alsa.snd_rawmidi_write(outPort!.value, voidBuffer, length)) < 0) {
        print('failed to write ${alsa.snd_strerror(status).cast<Utf8>().toDartString()}');
      }
    } else {
      print('outport is null');
    }
  }

  disconnect() {
    receivePort?.close();
    errorPort?.close();
    _isolate?.kill(priority: Isolate.immediate);
    _isolate = null;

    int status = 0;
    if (outPort != null) {
      if ((status = alsa.snd_rawmidi_drain(outPort!.value)) < 0) {
        print('error: cannot drain out port $this ${FlutterMidiCommandLinux.stringFromNative(alsa.snd_strerror(status))}');
      }
      if ((status = alsa.snd_rawmidi_close(outPort!.value)) < 0) {
        print('error: cannot close out port $this ${FlutterMidiCommandLinux.stringFromNative(alsa.snd_strerror(status))}');
      }
    }

    if (inPort != null) {
      if ((status = alsa.snd_rawmidi_drain(inPort!.value)) < 0) {
        print('error: cannot drain in port $this ${FlutterMidiCommandLinux.stringFromNative(alsa.snd_strerror(status))}');
      }
      if ((status = alsa.snd_rawmidi_close(inPort!.value)) < 0) {
        print('error: cannot close in port $this ${FlutterMidiCommandLinux.stringFromNative(alsa.snd_strerror(status))}');
      }
    }
    connected = false;
  }
}

class FlutterMidiCommandLinux extends MidiCommandPlatform {
  StreamController<MidiPacket> _rxStreamController = StreamController<MidiPacket>.broadcast();
  late Stream<MidiPacket> _rxStream;
  StreamController<String> _setupStreamController = StreamController<String>.broadcast();
  late Stream<String> _setupStream;

  Map<String, LinuxMidiDevice> _connectedDevices = Map<String, LinuxMidiDevice>();

  /// A constructor that allows tests to override the window object used by the plugin.
  FlutterMidiCommandLinux() {
    _setupStream = _setupStreamController.stream;
    _rxStream = _rxStreamController.stream;
  }

  static String stringFromNative(Pointer<Int8> pointer) {
    return pointer.cast<Utf8>().toDartString();
  }

  /// The linux implementation of [MidiCommandPlatform]
  ///
  /// This class implements the `package:flutter_midi_command_platform_interface` functionality for linux
  static void registerWith() {
    print("register FlutterMidiCommandLinux");
    MidiCommandPlatform.instance = FlutterMidiCommandLinux();
  }

  @override
  Future<List<MidiDevice>> get devices async {
    return Future.value(_printCardList());
  }

  List<MidiDevice>? _printCardList() {
    int status;
    var card = calloc<Int32>();
    card.elementAt(0).value = -1;
    // Pointer<Pointer<Int8>> longname = calloc<Pointer<Int8>>();
    Pointer<


      ))
            }
            Some(values) => {
                let mut builder = ListBuilder::new($VALUE_BUILDER_TY::new(values.len()));

                for _ in 0..$SIZE {
                    for scalar_value in values {
                        match scalar_value {
                            DataValue::$SCALAR_TY(Some(v)) => {
                                builder.values().append_value(v.clone()).unwrap()
                            }
                            DataValue::$SCALAR_TY(None) => {
                                builder.values().append_null().unwrap();
                            }
                            _ => {
                                return Result::Err(ErrorCodes::BadDataValueType(
                                    "Incompatible DataValue for list"
                                ))
                            }
                        };
                    }
                    builder.append(true).unwrap();
                }
                builder.finish()
            }
        }
    }};
}

macro_rules! try_build_array {
    ($VALUE_BUILDER_TY:ident, $SCALAR_TY:ident, $VALUES:expr) => {{
        let len = $VALUES.len();
        let mut builder = $VALUE_BUILDER_TY::new(len);
        for scalar_value in $VALUES {
            match scalar_value {
                DataValue::$SCALAR_TY(Some(v)) => {
                    builder.append_value(v.clone()).map_err(ErrorCodes::from)?
                }
                DataValue::$SCALAR_TY(None) => {
                    builder.append_null().map_err(ErrorCodes::from)?;
                }
                _ => {
                    return Result::Err(ErrorCodes::BadDataValueType(
                        "Incompatible DataValue for list"
                    ))
                }
            };
        }
        Ok(builder.finish().slice(0, len))
    }};
}
<filename>src/solution/s0004_median_of_two_sorted_arrays.rs
/**
 * [4] Median of Two Sorted Arrays
 *
 * Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays.
 * Follow up: The overall run time complexity should be O(log (m+n)).
 *
 * Example 1:
 *
 * Input: nums1 = [1,3], nums2 = [2]
 * Output: 2.00000
 * Explanation: merged array = [1,2,3] and median is 2.
 *
 * Example 2:
 *
 * Input: nums1 = [1,2], nums2 = [3,4]
 * Output: 2.50000
 * Explanation: merged array = [1,2,3,4] and median is (2 + 3) / 2 = 2.5.
 *
 * Example 3:
 *
 * Input: nums1 = [0,0], nums2 = [0,0]
 * Output: 0.00000
 *
 * Example 4:
 *
 * Input: nums1 = [], nums2 = [1]
 * Output: 1.00000
 *
 * Example 5:
 *
 * Input: nums1 = [2], nums2 = []
 * Output: 2.00000
 *
 *
 * Constraints:
 *
 * 	nums1.length == m
 * 	nums2.length == n
 * 	0 <= m <= 1000
 * 	0 <= n <= 1000
 * 	1 <= m + n <= 2000
 * 	-10^6 <= nums1[i], nums2[i] <= 10^6
 *
 */
pub struct Solution {}

// problem: https://leetcode.com/problems/median-of-two-sorted-arrays/
// discuss: https://leetcode.com/problems/median-of-two-sorted-arrays/discuss/?currentPage=1&orderBy=most_votes&query=

// submission codes start here

impl Solution {
    pub fn find_median_sorted_arrays(


[11162] = {
    ["D"] = "Brogg relishes the thought of taking his revenge on the black dragonkin of the marsh. $N, you have been very helpful in preparing for this moment. Will you help?$B$BTake Brogg\'s clan banner and travel east until you see a cave like a dragon\'s mouth. At the entrance to that cave, plant Stonemaul banner and issue Brogg\'s challenge to Onyxia.$B$BBrogg and the Stonemaul will have their lands back!",
    ["O"] = "Plant the Stonemaul Banner near the entrance to Onyxia\'s Lair, then return to Brogg at Mudsprocket.",
    ["T"] = "Challenge to the Black Flight",
  },
  [11163] = {
    ["D"] = "<Donna looks around and then whispers to you.>$b$b$n, what I\'m about to tell you must remain confidential, understood?$b$bI\'ve been sent by the Shattrath Peacekeepers to infiltrate Budd\'s gang here. Truth be told, since you first arrived you\'ve been a key person of interest in my investigation. $b$bBut your deeds have since cleared you of any suspicion. In fact, for your slaying of the crazed warlord, Zul\'Jin, I\'m compelled to reward you for your efforts.",
    ["O"] = "Report to Donna Brascoe to collect a reward for your heroism in Zul\'Aman. Donna is currently stationed in the Ghostlands, just outside Zul\'aman.",
    ["T"] = "Undercover Sister",
  },
  [11164] = {
    ["D"] = "\'Ey mon! You be new around \'ere, eh? Lemme ask a favor of ya.$b$bBudd\'s been refinin\' his forest troll disguise. Says that he be close now - just be needin\' one last touch. Tusks.$b$bMy skinnin\' talents be wasted \'ere. Somethin\' about yankin\' troll tusks be makin me queasy. $b$bBring me back 10 troll tusks, eh mon?",
    ["O"] = "Prigmon needs you to collect 10 Forest Troll Tusks from the trolls in Zul\'Aman. Bring them to him at Budd\'s camp in the Ghostlands.",
    ["T"] = "Tuskin\' Raiders",
  },
  [11165] = {
    ["D"] = "Lissen mon, there be sumthin\' else needs doin fer ol\' Prigmon.$b$bZungam, my good-fer-nuthin\' cousin, be stuck inside Zul\'Aman. He still be alive too - I seen his signal flare just last night!$b$bI should be lettin\' him rot fer gettin\' me tied up in this mess, but he be owin\' me big money.$b$bDo what ya can to help him out, then leave the collectin\' to me!",
    ["O"] = "Prigmon has tasked you with locating and assisting his cousin Zungam, somewhere within Zul\'Aman.",
    ["T"] = "A Troll Among Trolls",
  },
  [11166] = {
    ["D"] = "How did those fools fail? I told them to be careful - even gave them disguises to help them blend in. Ahh, well. The bright side of their failure is that this opportunity falls to you.$b$bSucceed, and you\'ll be well on your way to joining my crew and sharing in the immeasurable fame that will soon be mine. Not that I need any more, mind you.$b$bThere are yet a few portions of my map that require further exploration before our excavation can be initiated....",
    ["O"] = "Enter Zul\'Aman and visit Halazzi\'s Chamber, Jan\'alai\'s Platform, and Akil\'zon\'s Platform. Report the details of those areas to Budd, at his camp in the Ghostlands.",
    ["T"] = "X Marks... Your Doom!",
  },
  [11169] = {
    ["D"] = "During the last Grimtotem attack, I was wounded, but not before I managed to capture a curious totem our enemies were using against us.$B$BIt seemed to be emitting raw bolts of energy during the battle, but in all my experiments, I haven\'t managed to f


/**
 * Recognize certain values from the `imgData` passed in, using Tesseract with `tessData` as training data.
 *
 * If you're experiencing type errors, ensure the object passed in looks similar to this:
 * ```typescript
 * type LolOcrProps = {
 *		 tessData: Buffer,
 *		 imgData: Buffer,
 *		 goldValues: boolean,
 *		 timeValue: boolean,
 *		 towerValues: boolean,
 *		 killValues: boolean
 * };
 * ``` */
export function recognize(
	args: LolOcrRequiredProps &
		LolOcrGoldProp<true> &
		LolOcrTimeProp<false> &
		LolOcrTowerProp<true> &
		LolOcrKillProp<true>
): LolOcrGoldValues & LolOcrTowerValues & LolOcrKillValues;
/**
 * Recognize certain values from the `imgData` passed in, using Tesseract with `tessData` as training data.
 *
 * If you're experiencing type errors, ensure the object passed in looks similar to this:
 * ```typescript
 * type LolOcrProps = {
 *		 tessData: Buffer,
 *		 imgData: Buffer,
 *		 goldValues: boolean,
 *		 timeValue: boolean,
 *		 towerValues: boolean,
 *		 killValues: boolean
 * };
 * ```
 */
export function recognize(
	args: LolOcrRequiredProps &
		LolOcrGoldProp<boolean> &
		LolOcrTimeProp<boolean> &
		LolOcrTowerProp<boolean> &
		LolOcrKillProp<boolean>
): Partial<
	LolOcrGoldValues & LolOcrTimeValue & LolOcrTowerValues & LolOcrKillValues
> {
	return addon.recognize(args);
}
export class MoveTranslation {
    private _xAxis: number;
    private _yAxis: number;
    private _reverted: boolean;

    constructor(xAxis: number, yAxis: number, reverted: boolean) {
        this._xAxis = xAxis;
        this._yAxis = yAxis;
        this._reverted = reverted;
    }

    get xAxis(): number {
        return this._xAxis;
    }

    set xAxis(value: number) {
        this._xAxis = value;
    }

    get yAxis(): number {
        return this._yAxis;
    }

    set yAxis(value: number) {
        this._yAxis = value;
    }

    get reverted(): boolean {
        return this._reverted;
    }

    set reverted(value: boolean) {
        this._reverted = value;
    }
}
/* Copyright (c) 2018-2019 Environmental Systems Research Institute, Inc.
 * Apache-2.0 */

import { processParams, requiresFormData } from "../../src/index.js";

describe("processParams", () => {
  it("should pass non Date, Function, Array and Object params through", () => {
    const params = {
      foo: "foo",
      bar: 1
    };

    const expected = {
      foo: "foo",
      bar: 1
    };
    expect(processParams(params)).toEqual(expected);
  });

  it("should encode Dates as timestamps", () => {
    const date = new Date();

    const params = {
      foo: date
    };

    const expected = {
      foo: date.getTime()
    };
    expect(processParams(params)).toEqual(expected);
  });

  it("should not encode a function", () => {
    const params = {
      foo() {} // tslint:disable-line no-empty
    };

    expect(processParams(params)).toEqual({});
  });

  it("should stringify objects", () => {
    const params = {
      foo: {
        bar: "bar"
      }
    };

    const expected = {
      foo: '{"bar":"bar"}'
    };

    expect(processParams(params)).toEqual(expected);
  });

  it("should stringify arrays of objects", () => {
    const params = {
      foo: [
        {


 graph's X and Y-axes,
        // so that both their ranges are big enough to encompass every X and Y-value of every series.
        Assert.assertTrue(chart.getAxisX().getScaling().getMinimum().isAuto());

        // We can define our own axis bounds.
        // In this case, we will make both the X and Y-axis rulers show a range of 0 to 10.
        chart.getAxisX().getScaling().setMinimum(new AxisBound(0.0));
        chart.getAxisX().getScaling().setMaximum(new AxisBound(10.0));
        chart.getAxisY().getScaling().setMinimum(new AxisBound(0.0));
        chart.getAxisY().getScaling().setMaximum(new AxisBound(10.0));

        Assert.assertFalse(chart.getAxisX().getScaling().getMinimum().isAuto());
        Assert.assertFalse(chart.getAxisY().getScaling().getMinimum().isAuto());

        // Create a line chart with a series requiring a range of dates on the X-axis, and decimal values for the Y-axis.
        chartShape = builder.insertChart(ChartType.LINE, 450.0, 300.0);
        chart = chartShape.getChart();
        chart.getSeries().clear();

        DateTime[] dates = { new DateTime(1973, 5, 11),
            new DateTime(1981, 2, 4),
            new DateTime(1985, 9, 23),
            new DateTime(1989, 6, 28),
            new DateTime(1994, 12, 15)
        };

        chart.getSeries().addInternal("Series 1", dates, new double[] { 3.0, 4.7, 5.9, 7.1, 8.9 });

        // We can set axis bounds in the form of dates as well, limiting the chart to a period.
        // Setting the range to 1980-1990 will omit the two of the series values
        // that are outside of the range from the graph.
        chart.getAxisX().getScaling().setMinimum(new AxisBound(new DateTime(1980, 1, 1)));
        chart.getAxisX().getScaling().setMaximum(new AxisBound(new DateTime(1990, 1, 1)));

        doc.save(getArtifactsDir() + "Charts.AxisBound.docx");
        //ExEnd

        doc = new Document(getArtifactsDir() + "Charts.AxisBound.docx");
        chart = ((Shape)doc.getChild(NodeType.SHAPE, 0, true)).getChart();

        Assert.assertFalse(chart.getAxisX().getScaling().getMinimum().isAuto());
        Assert.assertEquals(0.0d, chart.getAxisX().getScaling().getMinimum().getValue());
        Assert.assertEquals(10.0d, chart.getAxisX().getScaling().getMaximum().getValue());

        Assert.assertFalse(chart.getAxisY().getScaling().getMinimum().isAuto());
        Assert.assertEquals(0.0d, chart.getAxisY().getScaling().getMinimum().getValue());
        Assert.assertEquals(10.0d, chart.getAxisY().getScaling().getMaximum().getValue());

        chart = ((Shape)doc.getChild(NodeType.SHAPE, 1, true)).getChart();

        Assert.assertFalse(chart.getAxisX().getScaling().getMinimum().isAuto());
        Assert.assertEquals(new AxisBound(new DateTime(1980, 1, 1)), chart.getAxisX().getScaling().getMinimum());
        Assert.assertEquals(new AxisBound(new DateTime(1990, 1, 1)), chart.getAxisX().getScaling().getMaximum());

        Assert.assertTrue(chart.getAxisY().getScaling().getMinimum().isAuto());
    }

    @Test
    public void chartLegend() throws Exception
    {
        //ExStart
        //ExFor:Chart.Legend
        //ExFor:ChartLegend
        //ExFor:ChartLegend.Overlay
        //ExFor:ChartLegend.Position
        //ExFor:LegendPosition
        //ExSummary:Shows how to edit the appearance of a chart's legend.
        Document doc = new Document();
        DocumentBuilder builder = new DocumentBuilder(doc);

        Shape shape = builder.insertChart(ChartType.LINE, 450


// Copyright (c) Alexandre Mutel. All rights reserved.
// This file is licensed under the BSD-Clause 2 license.
// See the license.txt file in the project root for more information.

using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Reflection;
using System.Text;
using NUglify.Html;
using NUnit.Framework;

namespace NUglify.Tests.Html
{
    [TestFixture]
    public class TestHtmlParser
    {
        [Test]
        public void TestSimple()
        {
            AssertHtml("<!DOCTYPE html><![CDATA[boo]]>Test",
                "[0001] !doc: <!DOCTYPE html>",
                "[0001] [tag: ",
                "[0002] !com: ",
                "[0002] !cda: <![CDATA[boo]]>",
                "[0002] [tag: ",
                "[0003] #txt: Test",
                "[0002] ]tag: ",
                "[0001] ]tag: "
                );
        }

        [Test]
        public void TestText()
        {
            AssertHtml("This is a test",
                "[0001] #txt: This is a test"
                );
        }

        [Test]
        public void TestOpenTagWithSpaces()
        {
            AssertHtml("",
                "[0001] [tag: ",
                "[0001] ]tag: "
                );
        }

        [Test]
        public void TestSelfClosingTags()
        {
            AssertHtml("

test1
test2
",
                "[0001] [tag: ",
                "[0002] [tag: ",
                "[0003] [tag:
",
                "[0004] [tag:
",
                "[0005] #txt: test1",
                "[0004] ]tag:
",
                "[0004] [tag:
",
                "[0005] #txt: test2",
                "[0004] ]tag:
",
                "[0003] ]tag:
",
                "[0002] ]tag: ",
                "[0001] ]tag: "
                );

            AssertHtml("

test1
",
                "[0001] [tag: ",
                "[0002] [tag: ",
                "[0003] [tag:
",
                "[0004] [tag:
",
                "[0005] #txt: test1",
                "[0004] ]tag:
",
                "[0003] ]tag:
",
                "[0002] ]tag: ",
                "[0001] ]tag: "
                );
        }

        [Test]
        public void TestInvalidNestedTag()
        {
            // Try to use a
 tag inside a
 tag
            // the parser will give a warning
            AssertHtml("

test1
",
                "[0001] [tag: ",
                "[0002] [tag: ",
                "[0003] [tag:
",
                "[0004] [tag:
",
                "[0005] #txt: test1",
                "[0004] ]tag:
",
                "[0003] ]tag:
",
                "[0002] ]tag: ",
                "[0001] ]tag: ",
                "(1,5): warning : The tag
 is not a valid tag within the parent tag
"
                );
        }

        [Test]
        public void TestOpenTagInvalidAttributes()
        {
            // We are still recovering with an invalid character in a tag
            // but we get an error
            AssertHtml("",
                "[0001] [tag: ",
                "[0001] ]tag: ",
                "(1,7): error : Invalid character '@' found while parsing "
                );
        }

        [Test]
        public void TestOpenTagInvalidAttributes2()
        {
            // We are still recovering with an invalid character in a tag
            // but we get an error
            AssertHtml("",
                "[0001] [tag: ",


 * CLK resource internal to the driver.
		 */
		res = &corepll_params[priv->hw_version];
	}

	priv->clk_io = devm_ioremap(dev, res->start, resource_size(res));
	if (!priv->clk_io)
		return -ENOMEM;

	priv->mdio_gw = &mlxbf_gige_mdio_gw_t[priv->hw_version];

	mlxbf_gige_mdio_cfg(priv);

	priv->mdiobus = devm_mdiobus_alloc(dev);
	if (!priv->mdiobus) {
		dev_err(dev, "Failed to alloc MDIO bus\n");
		return -ENOMEM;
	}

	priv->mdiobus->name = "mlxbf-mdio";
	priv->mdiobus->read = mlxbf_gige_mdio_read;
	priv->mdiobus->write = mlxbf_gige_mdio_write;
	priv->mdiobus->parent = dev;
	priv->mdiobus->priv = priv;
	snprintf(priv->mdiobus->id, MII_BUS_ID_SIZE, "%s",
		 dev_name(dev));

	ret = mdiobus_register(priv->mdiobus);
	if (ret)
		dev_err(dev, "Failed to register MDIO bus\n");

	return ret;
}

void mlxbf_gige_mdio_remove(struct mlxbf_gige *priv)
{
	mdiobus_unregister(priv->mdiobus);
}


tState.NOT_READY", ee.InitState.NOT_READY);
goog.exportSymbol("ee.InitState.LOADING", ee.InitState.LOADING);
goog.exportSymbol("ee.InitState.READY", ee.InitState.READY);
ee.ready_ = ee.InitState.NOT_READY;
ee.successCallbacks_ = [];
ee.errorCallbacks_ = [];
ee.TILE_SIZE = 256;
ee.generatedClasses_ = [];
ee.Algorithms = {};
ee.ready = function() {
  return ee.ready_;
};
ee.call = function(func, var_args) {
  "string" === typeof func && (func = new ee.ApiFunction(func));
  var args = Array.prototype.slice.call(arguments, 1);
  return ee.Function.prototype.call.apply(func, args);
};
ee.apply = function(func, namedArgs) {
  "string" === typeof func && (func = new ee.ApiFunction(func));
  return func.apply(namedArgs);
};
ee.initializationSuccess_ = function() {
  if (ee.ready_ == ee.InitState.LOADING) {
    try {
      ee.Date.initialize(), ee.Dictionary.initialize(), ee.Element.initialize(), ee.Image.initialize(), ee.Feature.initialize(), ee.Collection.initialize(), ee.ImageCollection.initialize(), ee.FeatureCollection.initialize(), ee.Filter.initialize(), ee.Geometry.initialize(), ee.List.initialize(), ee.Number.initialize(), ee.String.initialize(), ee.Terrain.initialize(), ee.initializeGeneratedClasses_(), ee.initializeUnboundMethods_();
    } catch (e) {
      ee.initializationFailure_(e);
      return;
    }
    ee.ready_ = ee.InitState.READY;
    for (ee.errorCallbacks_ = []; 0 < ee.successCallbacks_.length;) {
      ee.successCallbacks_.shift()();
    }
  }
};
ee.initializationFailure_ = function(e) {
  if (ee.ready_ == ee.InitState.LOADING) {
    for (ee.ready_ = ee.InitState.NOT_READY, ee.successCallbacks_ = []; 0 < ee.errorCallbacks_.length;) {
      ee.errorCallbacks_.shift()(e);
    }
  }
};
ee.promote_ = function(arg, klass) {
  if (null === arg) {
    return null;
  }
  if (void 0 !== arg) {
    var exportedEE = goog.global.ee;
    switch(klass) {
      case "Image":
        return new ee.Image(arg);
      case "Feature":
        return arg instanceof ee.Collection ? ee.ApiFunction._call("Feature", ee.ApiFunction._call("Collection.geometry", arg)) : new ee.Feature(arg);
      case "Element":
        if (arg instanceof ee.Element) {
          return arg;
        }
        if (arg instanceof ee.Geometry) {
          return new ee.Feature(arg);
        }
        if (arg instanceof ee.ComputedObject) {
          return new ee.Element(arg.func, arg.args, arg.varName);
        }
        throw Error("Cannot convert " + arg + " to Element.");
      case "Geometry":
        return arg instanceof ee.FeatureCollection ? ee.ApiFunction._call("Collection.geometry", arg) : new ee.Geometry(arg);
      case "FeatureCollection":
      case "Collection":
        return arg instanceof ee.Collection ? arg : new ee.FeatureCollection(arg);
      case "ImageCollection":
        return new ee.ImageCollection(arg);
      case "Filter":
        return new ee.Filter(arg);
      case "Algorithm":
        if ("string" === typeof arg) {
          return new ee.ApiFunction(arg);
        }
        if ("function" === typeof arg) {


愿以最大努力来帮助政府贯彻严厉镇压反革命政策的执行。

   徐永祚

   严厉镇压反革命，是本市二届二次市代表会主要决议，是非常必要的。昨天晚上公安机关执行这个决议，大批的逮捕反革命罪犯，包括了美帝的特务、蒋匪武装特务、恶霸把头、及反动道会斗头子，真是大快人心的事情，而且做得如此迅速缜密鸡犬不惊实在令人钦佩。希望上海市民明白反革命分子是人民的公敌，认清敌我界限。因为人民政府的眼睛，是雪亮的，我们应该信任政府，决不会杀错一个人、冤枉一个人，必定可以做到该杀的杀、该关的关、该管制的管制。

   谢仁冰

   昨晚本市公安局逮捕大批反革命罪犯，匕首不惊，人心安定，系遵照中华人民共和国惩治反革命条例、上海市第二届第二次人民代表之决议及一般人民之请求。惟因被捕之人较多，牵涉之范围较广，其家族或其亲友不免有所恐慌，以致一部分人不免有所惶惑，此则全然不必要者。政府决不冤枉一个好人，所以我们民主党派的人、应该坚定立场，不要为浮言所惑，不要为感情所动。

   胡厥文 过去政府对于反革命分子有宽大无边的偏向，经中央颁布了惩治反革命条例，上海市二届二次市代会作出严厉镇压反革命的决议。所以昨天晚上吾们政府已经很缜密地将反革命分子加以逮捕，以实际行动来执行人民的要求，人民一定非常快活。希望广大的人民知道反革命分子是吾们人民的敌人，应当忠实正确地尽量检举，达到不杀错一个好人，不漏掉一个坏人。

   吴蕴初

   反革命分子进行破坏活动向人民进攻，罪大恶极，应予以严厉的镇压。昨夜公安局执行上海市二届二次人民代表会议之决议，大批的予以逮捕，这是接受人民的意见。

   这种重大的措施，竟办得鸡犬不惊，更不得不钦佩公安局人员执行职务之才能。

   吾的工业机构中，亦有职工被捕者，然大家均觉得公安局必有根据，决不乱捉人，且大家也知道将来判罪之时，市和区的反革命案件审查委员会以及基层单位肃清反革命委员会，均能陈述意见，既有多数人的意见，可以参加，决不致有冤枉的事，故我们工厂同人，对昨夜的大批逮捕，均表拥护，均无震惊的态度。

   来源：《文汇报》1951年4月29日

    [返回索引页面]

   Copyright (C)  2024  Marxist-Leninist-Maoist.

   Permission is granted to copy, di


s whether an element matches a given text hinting filter
 * @hidden
 */
export function hintByTextFilter(match: string | RegExp): HintSelectedCallback {
    return hint => {
        let text
        if (hint instanceof HTMLInputElement) {
            text = hint.value
        } else {
            text = hint.textContent
        }
        if (match instanceof RegExp) {
            return text.match(match) !== null
        } else {
            return text.toUpperCase().includes(match.toUpperCase())
        }
    }
}

/** Array of items that can be killed with hint kill
@hidden
 */
export function killables(includeInvisible = false) {
    return DOM.getElemsBySelector(DOM.HINTTAGS_killable_selectors, [
        DOM.isVisibleFilter(includeInvisible),
    ])
}

// Multiple dispatch? who needs it
/** Returns an array of hintable objects from an array of elements
 * @hidden
 * */
export function toHintablesArray(
    hintablesOrElements: Element[] | Hintables[],
): Hintables[] {
    if (!hintablesOrElements.length) return []
    if ("className" in hintablesOrElements[0])
        return [{ elements: hintablesOrElements } as Hintables]
    if ("elements" in hintablesOrElements[0])
        return hintablesOrElements as Hintables[]
    return []
}

function selectFocusedHint(delay = false) {
    logger.debug("Selecting hint.", contentState.mode)
    const focused = modeState.focusedHint
    const selectFocusedHintInternal = () => {
        modeState.filter = ""
        modeState.hints.forEach(h => (h.hidden = false))
        focused.select()
    }
    if (delay) setTimeout(selectFocusedHintInternal, config.get("hintdelay"))
    else selectFocusedHintInternal()
}

function focusNextHint() {
    logger.debug("Focusing next hint")
    modeState.changeFocusedHintIndex(1)
}

function focusPreviousHint() {
    logger.debug("Focusing previous hint")
    modeState.changeFocusedHintIndex(-1)
}

function focusTopHint() {
    logger.debug("Focusing top hint")
    modeState.changeFocusedHintTop()
}

function focusBottomHint() {
    logger.debug("Focusing bottom hint")
    modeState.changeFocusedHintBottom()
}

function focusLeftHint() {
    logger.debug("Focusing left hint")
    modeState.changeFocusedHintLeft()
}

function focusRightHint() {
    logger.debug("Focusing right hint")
    modeState.changeFocusedHintRight()
}

/** @hidden */
export function parser(keys: keyseq.MinimalKey[]) {
    const parsed = keyseq.parse(
        keys,
        keyseq.mapstrMapToKeyMap(
            new Map(
                (Object.entries(config.get("hintmaps")) as any).filter(
                    ([_key, value]) => value != "",
                ),
            ),
        ),
    )
    if (parsed.isMatch === true) {
        return parsed
    }
    // Ignore modifiers since they can't match text
    const simplekeys = keys.filter(key => !keyseq.hasModifiers(key))
    let exstr
    if (simplekeys.length > 1) {
        exstr = simplekeys.reduce(
            (acc, key) => `hint.pushKey ${key.key};`,
            "composite ",
        )
    } else if (simplekeys.length === 1) {
        exstr = `hint.pushKeyCodePoint ${simplekeys[0].key.codePointAt(0)}`
    } else {
        return { keys: [], isMatch: false }
    }
    return { exstr, value: exstr, isMatch: true }
}

/** @hidden*/
export function getHintCommands() {
    return {
        reset,
        focusPreviousHint,
        focusNextHint,
        focusTopHint,
        focusBottomHint,
        focusLeftHint,
        focusRightHint,
        selectFocusedHint


              discard.NewGauge(),
		TxSizeBytes:               discard.NewHistogram(),
		FailedTxs:                 discard.NewCounter(),
		RejectedTxs:               discard.NewCounter(),
		EvictedTxs:                discard.NewCounter(),
		RecheckTimes:              discard.NewCounter(),
		ActiveOutboundConnections: discard.NewGauge(),
		AlreadyReceivedTxs:        discard.NewCounter(),
	}
}
package light_test

import (
	"time"

	"github.com/cometbft/cometbft/crypto"
	"github.com/cometbft/cometbft/crypto/ed25519"
	"github.com/cometbft/cometbft/crypto/tmhash"
	cmtproto "github.com/cometbft/cometbft/proto/tendermint/types"
	cmtversion "github.com/cometbft/cometbft/proto/tendermint/version"
	"github.com/cometbft/cometbft/types"
	cmttime "github.com/cometbft/cometbft/types/time"
	"github.com/cometbft/cometbft/version"
)

// privKeys is a helper type for testing.
//
// It lets us simulate signing with many keys.  The main use case is to create
// a set, and call GenSignedHeader to get properly signed header for testing.
//
// You can set different weights of validators each time you call ToValidators,
// and can optionally extend the validator set later with Extend.
type privKeys []crypto.PrivKey

// genPrivKeys produces an array of private keys to generate commits.
func genPrivKeys(n int) privKeys {
	res := make(privKeys, n)
	for i := range res {
		res[i] = ed25519.GenPrivKey()
	}
	return res
}

// // Change replaces the key at index i.
// func (pkz privKeys) Change(i int) privKeys {
// 	res := make(privKeys, len(pkz))
// 	copy(res, pkz)
// 	res[i] = ed25519.GenPrivKey()
// 	return res
// }

// Extend adds n more keys (to remove, just take a slice).
func (pkz privKeys) Extend(n int) privKeys {
	extra := genPrivKeys(n)
	return append(pkz, extra...)
}

// // GenSecpPrivKeys produces an array of secp256k1 private keys to generate commits.
// func GenSecpPrivKeys(n int) privKeys {
// 	res := make(privKeys, n)
// 	for i := range res {
// 		res[i] = secp256k1.GenPrivKey()
// 	}
// 	return res
// }

// // ExtendSecp adds n more secp256k1 keys (to remove, just take a slice).
// func (pkz privKeys) ExtendSecp(n int) privKeys {
// 	extra := GenSecpPrivKeys(n)
// 	return append(pkz, extra...)
// }

// ToValidators produces a valset from the set of keys.
// The first key has weight `init` and it increases by `inc` every step
// so we can have all the same weight, or a simple linear distribution
// (should be enough for testing).
func (pkz privKeys) ToValidators(init, inc int64) *types.ValidatorSet {
	res := make([]*types.Validator, len(pkz))
	for i, k := range pkz {
		res[i] = types.NewValidator(k.PubKey(), init+int64(i)*inc)
	}
	return types.NewValidatorSet(res)
}

// signHeader properly signs the header with all keys from first to last exclusive.
func (pkz privKeys) signHeader(header *types.Header, valSet *types.ValidatorSet, first, last int) *types.Commit {
	commitSigs := make([]types.CommitSig, len(pkz))
	for i := 0; i < len(pkz); i++ {
		commitSigs[i] = types.NewCommitSigAbsent()
	}

	blockID := types.BlockID{
		Hash:          header.Hash(),
		PartSetHeader: types.PartSetHeader{Total: 1, Hash: crypto.CRandBytes(32)},


ap();
        let addr = p2pkh.script[3..23].to_vec();
        let tx = generate_raw_tx(addr, vec![]).await; // TODO: Add op_return
        let payment = Payment {
            merchant_data: payment_details.merchant_data,
            memo: None,
            refund_to: vec![],
            transactions: vec![tx],
        };
        let mut payment_raw = Vec::with_capacity(payment.encoded_len());
        payment.encode(&mut payment_raw).unwrap();

        // Check content-type header is enforced
        let payment_url = payment_details.payment_url.unwrap();
        let req = test::TestRequest::post()
            .uri(&payment_url)
            .set_payload(payment_raw.clone())
            .header(ACCEPT, "application/bitcoincash-paymentack")
            .to_request();
        let resp = test::call_service(&mut app, req).await;
        assert_eq!(resp.status(), StatusCode::NOT_ACCEPTABLE);

        // Check accept header is enforced
        let req = test::TestRequest::post()
            .uri(&payment_url)
            .set_payload(payment_raw.clone())
            .header(CONTENT_TYPE, "application/bitcoincash-payment")
            .to_request();
        let resp = test::call_service(&mut app, req).await;
        assert_eq!(resp.status(), StatusCode::UNSUPPORTED_MEDIA_TYPE);

        // Check payment ack and a token
        let req = test::TestRequest::post()
            .uri(&payment_url)
            .set_payload(payment_raw.clone())
            .header(CONTENT_TYPE, "application/bitcoincash-payment")
            .header(ACCEPT, "application/bitcoincash-paymentack")
            .to_request();
        let mut resp = test::call_service(&mut app, req).await;
        assert_eq!(resp.status(), StatusCode::ACCEPTED);
        let mut payload = resp.take_body();
        let mut payment_ack_raw = BytesMut::new();
        while let Some(item) = payload.next().await {
            payment_ack_raw.extend_from_slice(&item.unwrap());
        }
        let payment_ack = PaymentAck::decode(&payment_ack_raw[..]).unwrap();
        assert_eq!(payment, payment_ack.payment);

        // Check token
        let auth = resp.headers().get(AUTHORIZATION).unwrap();
        let loc = Url::parse(resp.headers().get(LOCATION).unwrap().to_str().unwrap()).unwrap();
        let loc_noquery = format!(
            "{}://{}:{}{}",
            loc.scheme(),
            loc.host().unwrap(),
            loc.port().unwrap(),
            loc.path()
        );
        assert_eq!(&loc_noquery, key_url);

        // TODO: More detail here
        // Check token works with code
        let req = test::TestRequest::put()
            .uri(loc.as_str())
            .header(AUTHORIZATION, auth.clone())
            .set_payload(metadata_raw)
            .to_request();
        let resp = test::call_service(&mut app, req).await;
        assert_eq!(resp.status(), StatusCode::OK);
    }
}
//! # interpol
//! String interpolation macros for rust
//!
//! # Usage
//!
//! Macros provided by this crate correspond to std's formatting macros (`format`,`print`, `println`, `eprint`, `eprintln`, ...).
//!
//! You can use these macros just same as std's ones.
//!
//! ```rust
//! use interpol::println;
//!
//! let a = 3;
//! let b = 4;
//! println!("{a} times {b} is {a * b}."); // => "3 times 4 is 12."
//! ```
//!
//! It is also able to specify formatting option:
//!
//! ```rust
//! use interpol::println;
//!
//! let pi = 3.14;
//! println!("{pi:.10}"); // => "3.1400000000"
//! println!("{123:x}");  // => "7b"
//!
//! let v = vec![1


--------------------------------------------------------------------------------
--------------------------------------------------------------------------------

function widget:GetInfo()
	return {
		name      = "Integer Selector Window",
		desc      = "Displays an integer selector window popup.",
		author    = "Beherith",
		date      = "2020.11",
		license   = "GNU LGPL, v2.1 or later",
		layer     = 0,
		enabled   = true  --  loaded by default?
	}
end

local function CreateIntegerSelectorWindow(opts)
	opts = opts or {}

	local integerTrackBarValue = opts.defaultValue or 0
	local Configuration = WG.Chobby.Configuration

	local IntegerSelectorWindow = Window:New {
		caption = opts.caption or "",
		name = "IntegerSelectorWindow",
		parent = screen0,
		width = opts.width or 280,
		height = opts.height or 330,
		resizable = false,
		draggable = opts.draggable or false,
		classname = "main_window",
	}

	local function ChangeAccepted()
		if opts.OnAccepted then
			opts.OnAccepted(integerTrackBarValue)
		end
	end

	local function CloseFunction()
		IntegerSelectorWindow:Dispose()
		IntegerSelectorWindow = nil
	end

	local function CancelFunction()
		if opts.OnCancelled then
			opts.OnCancelled()
		end
		CloseFunction()
	end

	local lblTitle = TextBox:New {
		x = "0%",
		y = "5%",
		width = "90%",
		height = (opts.height or 330) /2,
		align = "center",
		multiline = true,
		objectOverrideFont = WG.Chobby.Configuration:GetFont(2),
		objectOverrideHintFont = WG.Chobby.Configuration:GetFont(2),
		text = opts.labelCaption or "",
		parent = IntegerSelectorWindow,
	}
	if opts.imageFile then
		local wideimg = Image:New{
			name = "IntegerSelectorWindowImage",
			x = "5%",
			y = "33%",
			width = opts.imageWidth or "90%",
			height = opts.imageHeight or "33%",
			parent = In


                                int transX, int transY,
                                Path2D.Float p2df);

    public GraphicsPrimitive makePrimitive(SurfaceType srctype,
                                           CompositeType comptype,
                                           SurfaceType dsttype)
    {
        throw new InternalError("DrawPath not implemented for "+
                                srctype+" with "+comptype);
    }

    public GraphicsPrimitive traceWrap() {
        return new TraceDrawPath(this);
    }

    private static class TraceDrawPath extends DrawPath {
        DrawPath target;

        public TraceDrawPath(DrawPath target) {
            super(target.getSourceType(),
                  target.getCompositeType(),
                  target.getDestType());
            this.target = target;
        }

        public GraphicsPrimitive traceWrap() {
            return this;
        }

        public void DrawPath(SunGraphics2D sg2d, SurfaceData sData,
                             int transX, int transY,
                             Path2D.Float p2df)
        {
            tracePrimitive(target);
            target.DrawPath(sg2d, sData, transX, transY, p2df);
        }
    }
}
/*
 * Copyright 2007 Sun Microsystems, Inc.  All Rights Reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.  Sun designates this
 * particular file as subject to the "Classpath" exception as provided
 * by Sun in the LICENSE file that accompanied this code.
 *
 * This code 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 General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 * CA 95054 USA or visit www.sun.com if you need additional information or
 * have any questions.
 */

package sun.java2d.pisces;

/**
 * An object used to cache pre-rendered complex paths.
 *
 * @see PiscesRenderer#render
 */
public final class PiscesCache {

    int bboxX0, bboxY0, bboxX1, bboxY1;

    byte[] rowAARLE;
    int alphaRLELength;

    int[] rowOffsetsRLE;
    int[] minTouched;
    int alphaRows;

    private PiscesCache() {}

    public static PiscesCache createInstance() {
        return new PiscesCache();
    }

    private static final float ROWAA_RLE_FACTOR = 1.5f;
    private static final float TOUCHED_FACTOR = 1.5f;
    private static final int MIN_TOUCHED_LEN = 64;

    private void reallocRowAARLE(int newLength) {
        if (rowAARLE == null) {
            rowAARLE = new byte[newLength];
        } else if (rowAARLE.length < newLength) {
            int len = Math.max(newLength,
                               (int)(rowAARLE.length*ROWAA_RLE_FACTOR));
            byte[] newRowAARLE = new byte[len];
            System.arraycopy(rowAARLE, 0, newRowAARLE, 0, rowAARLE.length);
            rowAARLE = newRowAARLE;
        }
    }

    private void rea


[fromInd].length;
      fromInd++;
    }
    // In case of words group ength < answer length - do nothing, fromInd remains the same
  }
  return wordsGroups;
};

const isWordLengthAllowAnagrams = (clues: Definition) => {
  const solutionLength = getSentenceLength(clues.wordsLength);
  return solutionLength <= maxLengthForAnagrams;
};

const createSortedSegment = (words: string[]) =>
  getCharacters(removeSpaces(words))
    .map(letter => getRegularFormOfLetter(letter))
    .sort()
    .join('');

/*
Create division with a part containing potential anagram matching words (= second part),
  and another part containing all other words (= first part).
  Words groups - indecies representation of possible anagram divisions in the definition
*/
const createPotentialAnagramsDivisions = (
  clueWords: string[],
  wordsGroups: SubString[],
) => {
  return wordsGroups.map(words => {
    // First part - the non anagram part of the definition
    // Second part - the words in the anagrams part
    const firstPart = clueWords
      .slice(0, words.start)
      .concat(clueWords.slice(words.end + 1, clueWords.length));
    const secondPart = clueWords.slice(words.start, words.end + 1);
    const sortedAnagramLetters = createSortedSegment(secondPart);
    return {
      firstPart,
      secondPart,
      sortedAnagramLetters,
    } as AnagramDivision;
  });
};

const extendDivisionsWithAnagrams = (
  initialDivisions: RegularDivision[],
  wordsLength: number[],
): AnagramDivision[] => {
  return initialDivisions.map(division => {
    return {
      ...division,
      anagrams: createHebrewAnagrams(division.secondPart, wordsLength),
    } as AnagramDivision;
  });
};

export const buildAnagramsDivisions = (definition: Definition) => {
  const clueWords = buildVerbalClueWords(definition.verbalClue);
  const solutionLength = getSentenceLength(definition.wordsLength);

  // Indexes representing positions of potential anagrams to the solution in the definition
  const wordsGroups = findPotentialAnagramsWordGroupsInVerbalClue(
    clueWords,
    solutionLength,
  );

  const initialDivisions = createPotentialAnagramsDivisions(
    clueWords,
    wordsGroups,
  );

  // For segment with n letters, the number of anagrams is n!, so create anagrams only if the solution is short
  // If the length of the solution is longer from the threshold,
  // the CRCR candidates suggestor will use only anagrams that are based on pre-made dicitionary

  if (isWordLengthAllowAnagrams(definition)) {
    // Find all matching anagrams in each divisions
    const anagramDivisions = extendDivisionsWithAnagrams(
      initialDivisions,
      definition.wordsLength.map(Number),
    );
    return anagramDivisions;
  }

  return initialDivisions;
};
import Criteria from "../criteria";
import Model from "../model";
import DataObject from "../data-object";
import Gateway from "../gateway";
import Interpreter from "./mem-interpreter";

let dbs: {
  [key: string]: InMemoryDatabase
} = {};

function useDB(name: string): InMemoryDatabase {
  if (!dbs[name]) {
    dbs[name] = new InMemoryDatabase;
  }

  return dbs[name];
}

export class InMemoryDatabase {
  public tables: {
    [key: string]: {
      ai: number,


: httttstgcttg
5-6 q: qqbqqqq
7-8 h: vhhhhhhgh
5-12 x: dqkllgbtbrnqxgxvmj
1-2 d: rzrdl
6-7 k: jvkkkvkkk
2-3 q: qdjqqqqq
10-12 k: xkkkgkkrvpkkzkkkl
2-4 g: srgmw
6-7 j: jjjjjzjv
13-14 s: sssssvsssssspk
4-9 x: smcxncxdxvjx
18-19 w: pwwpwwbxzwkrmxdwttkb
1-13 t: xbjctvkqqpwjkfdwmqq
4-9 r: rrrxrrrrrr
7-11 c: ncccclcccckc
15-16 p: hppgpnpdpwpppppp
7-12 m: bmvmmmrmpvmckmm
4-6 n: nznzqm
1-7 x: klxxpxjxnxxxslxx
5-6 t: ttttpz
5-12 k: kncktrgkkkkskxfkw
3-4 x: xdvd
4-5 m: mmmmm
11-12 x: xxcfxxfxxxhrxfxr
17-18 j: jjjjjjjjjjjjjjjjjjjj
5-8 d: ddddddddd
5-6 h: hmhhhhgp
5-10 b: bggkjlbrbstb
3-4 g: ggql
4-6 k: bkkkkk
12-15 v: vvkcvvvvvvvvvvk
7-9 h: hhhhhnlhb
7-8 d: sfxdddrzddd
2-3 m: jmcb
6-7 q: qqqqqqqqpq
3-17 g: kwgggjsgldglhgvggqx
17-19 r: rrrrrrrrrrrrrrrrxrjr
5-11 w: wxvhwtwwwwwxw
6-7 g: gggggggggggg
3-4 w: wbfrw
3-10 m: mmmmmmmltmmmm
4-6 q: gqbgwddqqqrqqbqq
4-5 b: bmbzm
4-6 r: trmrrrr
3-5 k: kkkkk
9-13 k: sxvklkbkqfktk
4-8 t: jxjtttttxvv
1-4 x: twzxxx
3-8 q: nfqqqqpqmqq
11-12 q: qqqqqqqqqqqqqqq
9-16 l: llllllllllllllll
8-12 n: vrwwxnnnnnnr
12-18 t: tttttttttltzttstrt
2-6 q: bqmgqqq
2-11 j: tjjjjjjjjjjjjjjx
7-10 g: ggggggggfqg
3-11 m: mmtmpmffmmpmmmrmpm
11-15 c: cmzcccchxcdccccc
1-14 j: jxvptjlcjvphxj
4-5 m: zmvmmzmxkm
3-4 m: zxtr
13-14 w: fmbwhmwfsdknvv
5-8 s: sswsssls
7-12 d: dddfddddzdddddddhdd
4-15 t: tnttntthtttttctt
14-17 v: gtcvvvsvgwvvhllvszn
15-17 z: zzzzzzzzzzzzzzgzzzz
2-3 p: wpptpkclprpnmqzrb
8-10 p: tppkcpgjppprpp
3-6 j: jjjjdjj
4-8 h: gbhckclnpm
17-18 j: jjjjjbjjjjjwjjjjfwj
12-13 f: ffffffffffzfq
2-7 b: lbcwbwbbbx
11-17 h: hzhhzghfhhxhhch


{"eckity.fitness.fitness.Fitness": {"tf": 1}, "eckity.fitness.gp_fitness.GPFitness": {"tf": 1}, "eckity.fitness.simple_fitness.SimpleFitness": {"tf": 1}, "eckity.multi_objective_evolution.nsga2_fitness.NSGA2Fitness": {"tf": 1}}, "df": 4, "c": {"docs": {"eckity": {"tf": 1}}, "df": 1, "k": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "y": {"docs": {"eckity.population.Population": {"tf": 1}, "eckity.subpopulation.Subpopulation": {"tf": 1.4142135623730951}}, "df": 2}}}}}, "v": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "l": {"docs": {}, "df": 0, "u": {"docs": {}, "df": 0, "t": {"docs": {}, "df": 0, "i": {"docs": {}, "df": 0, "o": {"docs": {}, "df": 0, "n": {"docs": {"eckity.algorithms.algorithm.Algorithm": {"tf": 1.7320508075688772}, "eckity.algorithms.algorithm.Algorithm.evolve": {"tf": 1}, "eckity.algorithms.algorithm.Algorithm.execute": {"tf": 1}, "eckity.algorithms.algorithm.Algorithm.initialize": {"tf": 1}, "eckity.algorithms.simple_evolution.SimpleEvolution": {"tf": 1.7320508075688772}, "eckity.fitness.fitness.Fitness": {"tf": 1.4142135623730951}, "eckity.multi_objective_evolution.nsga2_evolution.NSGA2Evolution": {"tf": 1.7320508075688772}, "eckity.multi_objective_evolution.nsga2_fitness.NSGA2Fitness": {"tf": 1.4142135623730951}, "eckity.sklearn_compatible.classification_evaluator.ClassificationEvaluator.set_context": {"tf": 1}, "eckity.sklearn_compatible.regression_evaluator.RegressionEvaluator.set_context": {"tf": 1}, "eckity.sklearn_compatible.sk_classifier.SKClassifier": {"tf": 1}, "eckity.sklearn_compatible.sk_regressor.SKRegressor": {"tf": 1}, "eckity.sklearn_compatible.sklearn_wrapper.SklearnWrapper": {"tf": 1}, "eckity.statistics.best_avg_worst_size_tree_statistics.BestAverageWorstSizeTreeStatistics": {"tf": 1}, "eckity.statistics.statistics.Statistics": {"tf": 1}}, "df": 15, "a": {"docs": {}, "df": 0, "r": {"docs": {}, "df": 0, "y": {"docs": {"eckity": {"tf": 1}, "eckity.algorithms.algorithm.Algorithm": {"tf": 1.7320508075688772}, "eckity.algorithms.algorithm.Algorithm.apply_operator": {"tf": 1}, "eckity.algorithms.algorithm.Algorithm.evolve": {"tf": 1.4142135623730951}, "eckity.algorithms.algorithm.Algorithm.evolve_main_loop": {"tf": 1}, "eckity.algorithms.algorithm.Algorithm.generation_iteration": {"tf": 1}, "eckity.algorithms.algorithm.Algorithm.finish": {"tf": 1}, "eckity.algorithms.algorithm.Algorithm.create_population": {"tf": 1}, "eckity.algorithms.simple_evolution.SimpleEvolution": {"tf": 2.23606797749979}, "eckity.algorithms.simple_evolution.SimpleEvolution.initialize": {"tf": 1}, "eckity.algorithms.simple_evolution.SimpleEvolution.generation_iteration": {"tf": 1}, "eckity.algorithms.simple_evolution.SimpleEvolution.execute": {"tf": 1}, "eckity.algorithms.simple_evolution.SimpleEvolutio


 setx  0x94128244b5d6f253, %g1, %r14
        setx  0x87314a57a20bfb28, %g1, %r15
        setx  0x3ed52966f47af43d, %g1, %r18
        setx  0xe1765edc8b3caea5, %g1, %r19
        setx  0x207e0bb7b35d2537, %g1, %r20
        setx  0x2677290cb478ab35, %g1, %r21
        setx  0x71f404e6f7cf12b3, %g1, %r22
        setx  0x7f9d6dc134b4d76a, %g1, %r23
        setx  0x53ed39899cea4046, %g1, %r24
        setx  0xcf9e755377d7fa78, %g1, %r25
        setx  0xbc26ba08fe84a92f, %g1, %r26
        setx  0x2a636d7d2adfe772, %g1, %r27
        setx  0xcd996e7bccc24bca, %g1, %r28
        setx  0xb5733f97ea7f90f2, %g1, %r29
        setx  0x3729b39d51a88264, %g1, %r30
        setx  0xa9273a69533fa6ec, %g1, %r31
	save %r0, %r0, %r31
thr3_nuke_intr_0:
!$EV trig_pc_d(3,expr(@VA(.MAIN.thr3_nuke_intr_0), 16, 16)) -> intp(0, 2, 1)
	.word 0x84940011  ! 1: ORcc_R	orcc 	%r16, %r17, %r2
	.word 0x872c0011  ! 1: SLL_R	sll 	%r16, %r17, %r3
thr3_resum_intr_1:
!$EV trig_pc_d(3,expr(@VA(.MAIN.thr3_resum_intr_1), 16, 16)) -> intp(0, 3, 1)
	.word 0x8e442183  ! 1: ADDC_I	addc 	%r16, 0x0183, %r7
	.word 0x98040011  ! 1: ADD_R	add 	%r16, %r17, %r12
thr3_hw_intr_2:
!$EV trig_pc_d(3,expr(@VA(.MAIN.thr3_hw_intr_2), 16, 16)) -> intp(2, 0, 1)
	.word 0x9d7c0411  ! 1: MOVR_R	movre	%r16, %r17, %r14
	.word 0x88ac2fa5  ! 1: ANDNcc_I	andncc 	%r16, 0x0fa5, %r4
thr3_hw_intr_3:
!$EV trig_pc_d(3,expr(@VA(.MAIN.thr3_hw_intr_3), 16, 16)) -> intp(0, 0, 1)
	.word 0x852c2001  ! 1: SLL_I	sll 	%r16, 0x0001, %r2
thr3_hw_intr_4:
!$EV trig_pc_d(3,expr(@VA(.MAIN.thr3_hw_intr_4), 16, 16)) -> intp(2, 0, 1)
	.word 0xb20c29d6  ! 1: AND_I	and 	%r16, 0x09d6, %r25
	.word 0x892c0011  ! 1: SLL_R	sll 	%r16, %r17, %r4
	.word 0xa72c0011  ! 1: SLL_R	sll 	%r16, %r17, %r19
	.word 0x98b40011  ! 1: ORNcc_R	orn


e Param.Type.Int:
                        param.intValue = UnityEditor.EditorGUILayout.IntField(param.key, param.intValue);
                        break;

                    case Param.Type.Float:
                        param.floatValue = UnityEditor.EditorGUILayout.FloatField(param.key, param.floatValue);
                        break;

                    case Param.Type.Enum:
                        if (param.enumValue.GetType().GetCustomAttributes(typeof(System.FlagsAttribute), true).Length > 0)
                            param.enumValue = UnityEditor.EditorGUILayout.EnumFlagsField(param.key, param.enumValue);
                        else
                            param.enumValue = UnityEditor.EditorGUILayout.EnumPopup(param.key, param.enumValue);
                        break;
                }
                UnityEditor.EditorGUI.indentLevel--;

                s_Cached[n] = param;
            }

            UnityEditor.EditorGUILayout.Space();

            // The raw text that was passed to CommandLine to parse
            UnityEditor.EditorGUILayout.LabelField("RAW (Read only)", UnityEditor.EditorStyles.boldLabel);
            UnityEditor.EditorGUI.indentLevel++;
            UnityEditor.EditorGUILayout.TextArea(s_Text);
            UnityEditor.EditorGUI.indentLevel--;

            UnityEditor.EditorGUILayout.Space();

            // Display parsed paramters. We don't know the type, thus we just display each one as text.
            UnityEditor.EditorGUILayout.LabelField("Parsed (Read only)", UnityEditor.EditorStyles.boldLabel);
            UnityEditor.EditorGUI.indentLevel++;
            for (var n = 0; n < s_Parsed.Count; ++n)
                UnityEditor.EditorGUILayout.TextField(s_Parsed[n]);
            UnityEditor.EditorGUI.indentLevel--;
        }
#endif // PLAYMODEINSPECTOR_PRESENT
    }
}


stackeditems/building.glb/mesh.prefab",
    item_description = "贮藏物品的容器",
}

prototype "无人机平台I" {
    type = {"item"},
    item_category = "物流",
    station_limit = 8,
    chest_limit = 15,
    backpack_limit = 20,
    item_order = 40,
    pollution = 5000,
    item_icon = "/pkg/vaststars.resources/textures/icons/item/drone-depot.texture",
    item_model = "/pkg/vaststars.resources/glbs/stackeditems/building.glb/mesh.prefab",
    item_description = "使用无人机运输并储存货物的仓库",
}

prototype "无人机平台II" {
    type = {"item"},
    item_category = "物流",
    station_limit = 8,
    chest_limit = 15,
    backpack_limit = 20,
    item_order = 42,
    pollution = 5000,
    item_icon = "/pkg/vaststars.resources/textures/icons/item/drone-depot.texture",
    item_model = "/pkg/vaststars.resources/glbs/stackeditems/building.glb/mesh.prefab",
    item_description = "使用无人机运输并储存货物的平台",
}

prototype "无人机平台III" {
    type = {"item"},
    item_category = "物流",
    station_limit = 8,
    chest_limit = 15,
    backpack_limit = 20,
    item_order = 44,
    pollution = 5000,
    item_icon = "/pkg/vaststars.resources/textures/icons/item/drone-depot.texture",
    item_model = "/pkg/vaststars.resources/glbs/stackeditems/building.glb/mesh.prefab",
    item_description = "使用无人机运输并储存货物的平台",
}

prototype "采矿机I" {
    type = {"item"},
    item_category = "加工",
    station_limit = 8,
    chest_limit = 15,
    backpack_limit = 20,
    item_order = 30,
    pollution = 5000,
    item_icon = "/pkg/vaststars.resources/textures/icons/item/miner.texture",
    item_model = "/pkg/vaststars.resources/glbs/stackeditems/building.glb/mesh.prefab",
    item_description = "挖掘或钻探地下矿物资源的设备",
}

prototype "采矿机II" {
    type = {"item"},
    item_category = "加工",
    station_limit = 8,
    chest_limit = 15,
    backpack_limit = 20,
    item_order = 32,
    pollution = 5000,
    item_icon = "/pkg/vaststars.resources/textures/icons/item/miner.texture",
    item_model = "/pkg/vaststars.resources/glbs/stackeditems/building.glb/mesh.prefab",
    item_description = "挖掘或钻探地下矿物资源的设备",
}

prototype "采矿机III" {
    type = {"item"},
    item_category = "加工",
    station_limit = 8,
    chest_limit = 15,
    backpack_limit = 20,
    item_order = 34,
    pollution = 5000,
    item_icon = "/pkg/vaststars.resources/textures/icons/item/miner.texture",
    item_model = "/pkg/vaststars.resources/glbs/stackeditems/building.glb/mesh.prefab",
    item_d


 ctx);

	const expected: UserConfig = {
		extends: ['extender-name'],
		rules: {
			test1: [1, 'never', 'base'],
			test2: [2, 'never', 'extender-name'],
		},
	};

	expect(actual).toEqual(expected);
});

// https://github.com/conventional-changelog/commitlint/issues/327
test('parserPreset should resolve correctly in extended configuration', () => {
	const input = {extends: ['extender-name'], zero: 'root'};

	const require = (id: string) => {
		switch (id) {
			case 'extender-name':
				return {
					extends: ['recursive-extender-name'],
					parserPreset: {
						parserOpts: {
							issuePrefixes: ['#', '!', '&', 'no-references'],
							referenceActions: null,
						},
					},
				};
			case 'recursive-extender-name':
				return {parserPreset: {parserOpts: {issuePrefixes: ['#', '!']}}};
			default:
				return {};
		}
	};

	const ctx = {resolve: id, require: jest.fn(require)} as ResolveExtendsContext;

	const actual = resolveExtends(input, ctx);

	const expected = {
		extends: ['extender-name'],
		parserPreset: {
			parserOpts: {
				issuePrefixes: ['#', '!', '&', 'no-references'],
				referenceActions: null,
			},
		},
		zero: 'root',
	};

	expect(actual).toEqual(expected);
});

test('parserPreset should be merged correctly', () => {
	const input = {extends: ['extender-name'], zero: 'root'};

	const require = (id: string) => {
		switch (id) {
			case 'extender-name':
				return {
					extends: ['recursive-extender-name'],
					parserPreset: {
						parserOpts: {
							referenceActions: null,
						},
					},
				};
			case 'recursive-extender-name':
				return {parserPreset: {parserOpts: {issuePrefixes: ['#', '!']}}};
			default:
				return {};
		}
	};

	const ctx = {resolve: id, require: jest.fn(require)} as ResolveExtendsContext;

	const actual = resolveExtends(input, ctx);

	const expected = {
		extends: ['extender-name'],
		parserPreset: {
			parserOpts: {
				issuePrefixes: ['#', '!'],
				referenceActions: null,
			},
		},
		zero: 'root',
	};

	expect(actual).toEqual(expected);
});

test('should correctly merge nested configs', () => {
	const input = {extends: ['extender-1']};

	const require = (id: string) => {
		switch (id) {
			case 'extender-1':
				return {extends: ['extender-3', 'extender-2']};
			case 'extender-2':
				return {extends: ['extender-4']};
			case 'extender-3':
				return {rules: {test: [1, 'never', 3]}};
			case 'extender-4':
				return {
					extends: ['extender-5', 'extender-6'],
					rules: {test: [1, 'never', 4]},
				};
			case 'extender-5':
				return {rules: {test: [1, 'never', 5]}};
			case 'extender-6':
				return {rules: {test: [1, 'never', 6]}};
			default:
				return {};
		}
	};

	const ctx = {resolve: id, require: jest.fn(require)} as ResolveExtendsContext;

	const actual = resolveExtends(input, ctx);

	const expected = {
		extends: ['extender-1'],
		rules: {
			test: [1, 'never', 4],
		},
	};

	expect(actual).toEqual(expected);
});
import { Component, OnInit } from '@angular/core';

@Component({
	selector: 'app-monna


.long	516,16384,16794116,16777216
.long	16794112,4,16388,16794116
.long	16777220,16794112,16793600,16388
.long	545259648,545390592,131200,0
.long	537001984,8388736,545259520,545390720
.long	128,536870912,8519680,131200
.long	8519808,537002112,536871040,545259520
.long	131072,8519808,8388736,537001984
.long	545390720,536871040,0,8519680
.long	536870912,8388608,53


gh<_i10.AppDatabase>()));
    return this;
  }
}

class _$RegisterModule extends _i13.RegisterModule {}
// AUTO GENERATED FILE, DO NOT EDIT.
// Generated by `flutter_rust_bridge`@ 1.77.1.
// ignore_for_file: non_constant_identifier_names, unused_element, duplicate_ignore, directives_ordering, curly_braces_in_flow_control_structures, unnecessary_lambdas, slash_for_doc_comments, prefer_const_literals_to_create_immutables, implicit_dynamic_list_literal, duplicate_import, unused_import, unnecessary_import, prefer_single_quotes, prefer_const_constructors, use_super_parameters, always_use_package_imports, annotate_overrides, invalid_use_of_protected_member, constant_identifier_names, invalid_use_of_internal_member, prefer_is_empty, unnecessary_const

import 'dart:convert';
import 'dart:async';
import 'package:meta/meta.dart';
import 'package:flutter_rust_bridge/flutter_rust_bridge.dart';
import 'package:uuid/uuid.dart';

import 'dart:ffi' as ffi;

abstract class NativeApi {
  Future<void> hello({required String data, dynamic hint});

  FlutterRustBridgeTaskConstMeta get kHelloConstMeta;
}

class NativeApiImpl implements NativeApi {
  final NativeApiPlatform _platform;
  factory NativeApiImpl(ExternalLibrary dylib) =>
      NativeApiImpl.raw(NativeApiPlatform(dylib));

  /// Only valid on web/WASM platforms.
  factory NativeApiImpl.wasm(FutureOr<WasmModule> module) =>
      NativeApiImpl(module as ExternalLibrary);
  NativeApiImpl.raw(this._platform);
  Future<void> hello({required String data, dynamic hint}) {
    var arg0 = _platform.api2wire_String(data);
    return _platform.executeNormal(FlutterRustBridgeTask(
      callFfi: (port_) => _platform.inner.wire_hello(port_, arg0),
      parseSuccessData: _wire2api_unit,
      constMeta: kHelloConstMeta,
      argValues: [data],
      hint: hint,
    ));
  }

  FlutterRustBridgeTaskConstMeta get kHelloConstMeta =>
      const FlutterRustBridgeTaskConstMeta(
        debugName: "hello",
        argNames: ["data"],
      );

  void dispose() {
    _platform.dispose();
  }
// Section: wire2api

  void _wire2api_unit(dynamic raw) {
    return;
  }
}

// Section: api2wire

@protected
int api2wire_u8(int raw) {
  return raw;
}

// Section: finalizer

class NativeApiPlatform extends FlutterRustBridgeBase<NativeApiWire> {
  NativeApiPlatform(ffi.DynamicLibrary dylib) : super(NativeApiWire(dylib));

// Section: api2wire

  @protected
  ffi.Pointer<wire_uint_8_list> api2wire_String(String raw) {
    return api2wire_uint_8_list(utf8.encoder.convert(raw));
  }

  @protected
  ffi.Pointer<wire_uint_8_list> api2wire_uint_8_list(Uint8List raw) {
    final ans = inner.new_uint_8_list_0(raw.length);
    ans.ref.ptr.asTypedList(raw.length).setAll(0, raw);
    return ans;
  }
// Section: finalizer

// Section: api_fill_to_wire
}

// ignore_for_file: camel_case_types, non_constant_identifier_names, avoid_positional_boolean_parameters, annotate_overrides, constant_identifier_names

// AUTO GENERATED FILE, DO NOT EDIT.
//
// Generated by `package:ffigen`.
// ignore_for_file: type=lint

/// generated by fl


from django.template.defaultfilters import striptags
from django.test import SimpleTestCase
from django.utils.functional import lazystr
from django.utils.safestring import mark_safe

from ..utils import setup

class StriptagsTests(SimpleTestCase):
    @setup({"striptags01": "{{ a|striptags }} {{ b|striptags }}"})
    def test_striptags01(self):
        output = self.engine.render_to_string(
            "striptags01",
            {
                "a": "x
y
",
                "b": mark_safe("x
y
"),
            },
        )
        self.assertEqual(output, "x y x y")

    @setup(
        {
            "striptags02": (
                "{% autoescape off %}{{ a|striptags }} {{ b|striptags }}"
                "{% endautoescape %}"
            )
        }
    )
    def test_striptags02(self):
        output = self.engine.render_to_string(
            "striptags02",
            {
                "a": "x
y
",
                "b": mark_safe("x
y
"),
            },
        )
        self.assertEqual(output, "x y x y")

class FunctionTests(SimpleTestCase):
    def test_strip(self):
        self.assertEqual(
            striptags(
                'some html with  disallowed '
                " tags"
            ),
            'some html with alert("You smell") disallowed  tags',
        )

    def test_non_string_input(self):
        self.assertEqual(striptags(123), "123")

    def test_strip_lazy_string(self):
        self.assertEqual(
            striptags(
                lazystr(
                    'some html with  disallowed '
                    " tags"
                )
            ),
            'some html with alert("Hello") disallowed  tags',
        )


tic.internal.deInitPrefs
import com.afollestad.aesthetic.internal.initPrefs
import com.afollestad.aesthetic.internal.invalidateNavBar
import com.afollestad.aesthetic.internal.invalidateStatusBar
import com.afollestad.aesthetic.internal.navBarColorKey
import com.afollestad.aesthetic.internal.statusBarColorKey
import com.afollestad.aesthetic.internal.waitForAttach
import com.afollestad.aesthetic.utils.adjustAlpha
import com.afollestad.aesthetic.utils.color
import com.afollestad.aesthetic.utils.colorAttr
import com.afollestad.aesthetic.utils.combine
import com.afollestad.aesthetic.utils.darkenColor
import com.afollestad.aesthetic.utils.distinctToMainThread
import com.afollestad.aesthetic.utils.isColorLight
import com.afollestad.aesthetic.utils.kFlatMap
import com.afollestad.aesthetic.utils.mapToIntArray
import com.afollestad.aesthetic.utils.mutableArrayMap
import com.afollestad.aesthetic.utils.plusAssign
import com.afollestad.aesthetic.utils.save
import com.afollestad.aesthetic.utils.setInflaterFactory
import com.afollestad.aesthetic.utils.setTaskDescriptionColor
import com.afollestad.aesthetic.utils.subscribeTo
import com.afollestad.rxkprefs.RxkPrefs
import io.reactivex.Observable
import io.reactivex.disposables.CompositeDisposable
import io.reactivex.subjects.BehaviorSubject

/** @author Aidan Follestad (afollestad) */
class Aesthetic private constructor(private var context: Context?) {

  internal val onAttached = BehaviorSubject.create<Boolean>()
  internal var rPrefs: RxkPrefs? = null
  internal var prefs: SharedPreferences? = null
  internal var editor: SharedPreferences.Editor? = null
  internal var inflationDelegate: InflationDelegate? = null

  private val lastActivityThemes = mutableArrayMap<String, Int>(2)

  private var subs: CompositeDisposable? = null
  private var isResumed: Boolean = false

  init {
    initPrefs()
  }

  // The 4 fields below allow us to avoid using !!, and provide indication if we access them
  // before we should.
  internal val safeContext
    @CheckResult
    get() = context ?: blowUp()
  internal val safePrefs
    @CheckResult
    get() = prefs ?: blowUp()
  private val safePrefsEditor
    @CheckResult
    get() = editor ?: blowUp()
  private val safeRxkPrefs
    @CheckResult
    get() = rPrefs ?: blowUp()

  val isDark: Observable<Boolean>
    @CheckResult
    get() = textColorPrimary().kFlatMap {
      safeRxkPrefs.boolean(KEY_IS_DARK, it.isColorLight())
          .observe()
    }

  @CheckResult fun isDark(isDark: Boolean): Aesthetic {
    safePrefsEditor.save { putBoolean(KEY_IS_DARK, isDark) }
    return this
  }

  @CheckResult fun activityTheme(@StyleRes theme: Int): Aesthetic {
    safePrefsEditor.putInt(KEY_ACTIVITY_THEME, theme)
    return this
  }

  @CheckResult fun activityTheme() = waitForAttach().kFlatMap { rxPrefs ->
    rxPrefs
        .integer(KEY_ACTIVITY_THEME, 0)
        .observe()
        .filter { it != 0 && it != getLastActivityTheme(safeContext) }
  }

  @CheckResult
  fun attribute(
    @AttrRes attrId: Int,
    @ColorInt literal: Int? = null,
    @ColorRes res: Int? = null,
    applyNow: Boolean = false
  ): Aesthetic {