/*
 * Copyright (C) 2009 Apple Inc. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef CanvasRenderingContext_h
#define CanvasRenderingContext_h

#include "GraphicsLayer.h"
#include "HTMLCanvasElement.h"
#include <wtf/HashSet.h>
#include <wtf/Noncopyable.h>
#include <wtf/text/StringHash.h>

namespace WebCore {

class CanvasPattern;
class HTMLCanvasElement;
class HTMLImageElement;
class HTMLVideoElement;
class KURL;
class WebGLObject;

class CanvasRenderingContext {
    WTF_MAKE_NONCOPYABLE(CanvasRenderingContext); WTF_MAKE_FAST_ALLOCATED;
public:
    virtual ~CanvasRenderingContext() { }

    void ref() { m_canvas->ref(); }
    void deref() { m_canvas->deref(); }
    HTMLCanvasElement* canvas() const { return m_canvas; }

    virtual bool is2d() const { return false; }
    virtual bool is3d() const { return false; }
    virtual bool isAccelerated() const { return false; }

    virtual void paintRenderingResultsToCanvas() {}
    virtual bool paintsIntoCanvasBuffer() const { return true; }

#if USE(ACCELERATED_COMPOSITING)
    virtual PlatformLayer* platformLayer() const { return 0; }
#endif

protected:
    CanvasRenderingContext(HTMLCanvasElement*);
    void checkOrigin(const CanvasPattern*);
    void checkOrigin(const HTMLCanvasElement*);
    void checkOrigin(const HTMLImageElement*);
    void checkOrigin(const HTMLVideoElement*);
    void checkOrigin(const KURL&);

private:
    HTMLCanvasElement* m_canvas;
    HashSet<String> m_cleanOrigins;
};

} // namespace WebCore

#endif


A122C  39 61 00 20 */	addi r11, r1, 0x20
/* 801A55D0 001A1230  48 02 1B A5 */	bl _restgpr_27
/* 801A55D4 001A1234  80 01 00 24 */	lwz r0, 0x24(r1)
/* 801A55D8 001A1238  7C 08 03 A6 */	mtlr r0
/* 801A55DC 001A123C  38 21 00 20 */	addi r1, r1, 0x20
/* 801A55E0 001A1240  4E 80 00 20 */	blr
/* 801A55E4 001A1244  38 60 00 01 */	li r3, 1
/* 801A55E8 001A1248  4E 80 00 20 */	blr
/* 801A55EC 001A124C  38 60 00 01 */	li r3, 1
/* 801A55F0 001A1250  4E 80 00 20 */	blr
/* 801A55F4 001A1254  4B FF BB CC */	b func_801A11C0
/* 801A55F8 001A1258  94 21 FF E0 */	stwu r1, -0x20(r1)
/* 801A55FC 001A125C  7C 08 02 A6 */	mflr r0
/* 801A5600 001A1260  90 01 00 24 */	stw r0, 0x24(r1)
/* 801A5604 001A1264  93 E1 00 1C */	stw r31, 0x1c(r1)
/* 801A5608 001A1268  93 C1 00 18 */	stw r30, 0x18(r1)
/* 801A560C 001A126C  93 A1 00 14 */	stw r29, 0x14(r1)
/* 801A5610 001A1270  7C 9D 23 78 */	mr r29, r4
/* 801A5614 001A1274  7F A3 EB 78 */	mr r3, r29
/* 801A5618 001A1278  4B FD 93 3D */	bl func_8017E954
/* 801A561C 001A127C  54 7E 06 3E */	clrlwi r30, r3, 0x18
/* 801A5620 001A1280  48 20 72 09 */	bl func_803AC828
/* 801A5624 001A1284  48 20 72 25 */	bl func_803AC848
/* 801A5628 001A1288  7C 7F 1B 78 */	mr r31, r3
/* 801A562C 001A128C  48 20 71 FD */	bl func_803AC828
/* 801A5630 001A1290  7F E4 FB 78 */	mr r4, r31
/* 801A5634 001A1294  7F C5 F3 78 */	mr r5, r30
/* 801A5638 001A1298  48 21 B0 6D */	bl func_803C06A4
/* 801A563C 001A129C  2C 1D 00 00 */	cmpwi r29, 0
/* 801A5640 001A12A0  54 64 06 3E */	clrlwi r4, r3, 0x18
/* 801A5644 001A12A4  40 82 00 0C */	bne lbl_801A5650
/* 801A5648 001A12A8  38 00 00 00 */	li r0, 0
/* 801A564C 001A12AC  48 00 00 10 */	b lbl_801A565C
lbl_801A5650:
/* 801A5650 001A12B0  80 7D 07 98 */	lwz r3, 0x798(r29)
/* 801A5654 001A12B4  80 03 00 04 */	lwz r0, 4(r3)
/* 801A5658 001A12B8  54 00 6F 7E */	rlwinm r0, r0, 0xd


import torch
import torch.nn.functional as F
from Mydataset import get_test_data_loader
from torch.utils.tensorboard import SummaryWriter
from resnetforcifar import resnet18cifar
from calculate_model_size.model_size import compute_model_nbits
MODEL_PATH='Models/model9509.pkl'
TESTSET_LENGTH=10000
device='cuda:1' if torch.cuda.is_available() else 'cpu'

def test():
    test_loader=get_test_data_loader(128)
    ckpt = 'save_model/origin_model/Resnet18_cifar100.pt'
    original_model = torch.load(ckpt)
    quantization_model = torch.load('save_fine/QLTD/4_2_0.005_512_R18_C100.pt')
    # print(quantization_model)
    quantization_model.to(device)
    print('compression ratio:', compute_model_nbits(original_model) / compute_model_nbits(quantization_model))
    # torch.save_decom(network,'E:/！！！research/Holiday_网络压缩/LRQ/save_model/origin_model/Resnet18_cifar10.pt')
    total_correct=0
    total_loss=0
    with torch.no_grad():
        for images,labels in test_loader:
            images=images.to(device)
            labels=labels.to(device)
            preds=quantization_model(images)
            loss=F.cross_entropy(preds,labels)
            a=preds.argmax(dim=1).equal(labels)
            total_loss+=loss.item()
            total_correct+=preds.argmax(dim=1).eq(labels).sum().item()
        test_acc=total_correct/TESTSET_LENGTH
    print(test_acc*100)
    print(ckpt)
    return test_acc

if __name__=='__main__':
   test()


=a("type"),aKX=a("and"),aKY=a("val"),aK3=a("external"),aK2=[0,[18,[1,[0,[11,a("<2>"),0],a("<2>")]],[2,0,[12,32,[15,[11,a(" :"),[17,[0,a("@ "),1,0],[15,[15,[17,0,0]]]]]]]]],a("@[<2>%s %a :@ %a%a@]")],aLd=[0,[17,[0,a("@ "),1,0],[11,a("| "),0]],a("@ | ")],aLb=[0,[17,[0,a("@ "),1,0],0],a("@ ")],aLa=[0,[11,a(" ="),[15,[17,[0,a("@;<1 2>"),1,2],[15,0]]]],a(" =%a@;<1 2>%a")],aK$=[0,[11,a(" = .."),0],a(" = ..")],aLc=[0,[11,a(" ="),[15,[11,a(" {"),[15,[17,[0,a("@;<1 -2>"),1,-2],[12,125,0]]]]]],a(" =%a {%a@;<1 -2>}")],aLe=[0,[11,a(" ="),[15,[17,[0,a("@;<1 2>"),1,2],[15,0]]]],a(" =%a@;<1 2>%a")],aK_=[0,[11,a(" private"),0],a(" private")],aK9=[0,[2,0,[12,32,[16,[15,0]]]],a("%s %t%a")],aK8=[0,[11,a(" ="),[17,[0,a("@ "),1,0],[15,0]]],a(" =@ %a")],aK5=[0,[12,44,[17,[0,a("@ "),1,0],0]],a(",@ ")],aK6=[0,[18,[1,[0,0,a("")]],[12,40,[18,[1,[0,0,a("")]],[15,[12,41,[17,0,[17,[0,a("@ "),1,0],[2,0,[17,0,0]]]]]]]]],a("@[(@[%a)@]@ %s@]")],aK7=[0,[18,[1,[0,0,a("")]],[15,[17,[0,a("@ "),1,0],[2,0,[17,0,0]]]]],a("@[%a@ %s@]")],aK4=[0,[17,[0,a("@ "),1,0],[18,[1,[0,[11,a("<2>"),0],a("<2>")]],[11,a("constraint "),[15,[11,a(" ="),[17,[0,a("@ "),1,0],[15,[17,0,0]]]]]]]],a("@ @[<2>constraint %a =@ %a@]")],aLf=[0,[18,[1,[0,[11,a("<2>"),0],a("<2>")]],[18,[1,[0,[11,a("<hv 2>"),0],a("<hv 2>")]],[16,[15,[17,0,[16,[17,0,0]]]]]]],a("@[<2>@[<hv 2>%t%a@]%t@]")],aLg=a(" *"),aLh=[0,[18,[1,[0,[11,a("<2>"),0],a("<2>")]],[2,0,[11,a(" :"),[17,[0,a("@ "),1,0],[15,[11,a(" -> "),[15,[17,0,0]]]]]]]],a("@[<2>%s :@ %a -> %a@]")],aLi=[0,[18,[1,[0,[11,a("<2>"),0],a("<2>")]],[2,0,[11,a(" :"),[17,[0,a("@ "),1,0],[15,[17,0,0]]]]]],a("@[<2>%s :@


);
        cache.addAll([`test.css?key=${key}`]);
      } catch (e) {
        throw new Error("Unsupported");
      }
    }

read: async () => {
      let cache = await caches.open("supercookies");
      let cacheKeys = await cache.keys();
      let url = cacheKeys[0].url;
      return (new URL(url)).searchParams.get("key");
    }

result, same session: c80c4c16-bf73-4fc2-b74f-8de4e7e26663_3p, f9265e9c-fd03-4950-ae36-e38466aa1659_3p, 89092474-ecbe-4851-bd01-f985e5f05989_3p, 0b4a2c01-7e5c-40a0-95cb-ab319533a7c7_3p, 432bdf06-7afb-4c45-a220-49f05418636c_3p

result, different session: c80c4c16-bf73-4fc2-b74f-8de4e7e26663_3p, f9265e9c-fd03-4950-ae36-e38466aa1659_3p, 89092474-ecbe-4851-bd01-f985e5f05989_3p, 0b4a2c01-7e5c-40a0-95cb-ab319533a7c7_3p, 432bdf06-7afb-4c45-a220-49f05418636c_3p

unsupported: false, false, false, false, false

passed: false, false, false, false, false

test failed: false, false, false, false, false

write: async (key) => {
      try {
        let cache = await caches.open("supercookies");
        cache.addAll([`test.css?key=${key}`]);
      } catch (e) {
        throw new Error("Unsupported");
      }
    }

read: async () => {
      let cache = await caches.open("supercookies");
      let cacheKeys = await cache.keys();
      let url = cacheKeys[0].url;
      return (new URL(url)).searchParams.get("key");
    }

result, same session: 98ab664d-57ed-456d-93c8-244651ccf9d4_3p, 98ab664d-57ed-456d-93c8-244651ccf9d4_3p, 98ab664d-57ed-456d-93c8-244651ccf9d4_3p, 98ab664d-57ed-456d-93c8-244651ccf9d4_3p, 98ab664d-57ed-456d-93c8-244651ccf9d4_3p

result, different session: 98ab664d-57ed-456d-93c8-244651ccf9d4_3p, 98ab664d-57ed-456d-93c8-244651ccf9d4_3p, 98ab664d-57ed-456d-93c8-244651ccf9d4_3p, 98ab664d-57ed-456d-93c8-244651ccf9d4_3p, 98ab664d-57ed-456d-93c8-244651ccf9d4_3p

unsupported: false, false, false, false, false

passed: false, false, false, false, false

test failed: false, false, false, false, false

	<div cla


  print("AI场景配置已成功保存。")

    def get_prompt_config(self) -> dict:
        """返回当前的AI场景配置"""
        return self.prompt_config

    def get_single_file_suggestion(self, instruction: str, context_type: str, context_data: dict, source_app: str) -> str:
        """
        【已重构】使用模板和可配置的系统指令来构建最终的提示词。
        """
        # --- 步骤 1: 准备所有运行时数据 ---
        context_before = context_data.get("context_before", "")
        context_after = context_data.get("context_after", "")
        attached_files = context_data.get("attached_files", [])

        attachments_content_string = ""
        if attached_files:
            # ... (读取和格式化附件文件的逻辑与上一版完全相同) ...
            attachments_content_string += "\n\n--- [附加文件上下文] ---\n"
            for file_path in attached_files:
                try:
                    with open(file_path, 'r', encoding='utf-8', errors='ignore') as f:
                        file_content = f.read(1024 * 1024)
                    attachments_content_string += f"\n### 文件: `{os.path.basename(file_path)}`\n"
                    attachments_content_string += f"```\n{file_content}\n```\n"
                except Exception as e:
                    attachments_content_string += f"\n### 文件: `{os.path.basename(file_path)}` (读取失败: {e})\n"

        # --- 步骤 2: 根据场景，选择用户配置的系统指令 ---
        system_prompt = ""
        if context_type == "no_context":
            print("AI服务启用【无上下文】系统指令。")
            system_prompt = self.prompt_no_context
        else:  # "content_split" or "content_full"
            print("AI服务启用【有上下文】系统指令。")
            system_prompt = self.prompt_with_context
            # 我们可以根据 source_app 为 system_prompt 添加一些额外建议
            if 'winword.exe' in source_app:
                system_prompt += "\n\n*提示: 当前应用是Microsoft Word，请优先考虑文档写作和编辑相关的任务。*"
            else:
                system_prompt += "\n\n*提示: 当前应用可能是代码编辑器，请优先考虑编程相关的任务。*"

        # --- 步骤 3: 【核心】使用模板和数据，构建最终的提示词 ---
        final_prompt = self.PROMPT_TEMPLATE.format(
            system_prompt=system_prompt,
            context_before=context_before,
            instruction=instruction,
            context_after=context_after,
            attachments_content_string=attachments_content_string
        )

        # 对于“无上下文”的场景，模板中的上下文部分会是空的，这完全没问题
        if context_type == "no_context":
            # 我们可以为无上下文场景使用一个更简洁的模板或直接构建
            final_prompt = f"{system_prompt}\n\n**【用户请求】**\n{instruction}"

        print("--- [最终发送给AI的提示词] ---\n" + final_prompt +
              "\n----------------------------")

        return self._call_llm_api(final_prompt)

    def _parse_llm_response(self, response_json: dict, model_name: str) -> str:
        """
        根据模型属性，智能地从API响应中提取最终答案。
        """
        try:
            # 1. 查询当前模型是否支持深度思考
            model_info = self.MODEL_METADATA.get(
                model_name, {"supports_deep_thought": False})
            supports_deep_thought = model_info["supports_deep_thought"]

            # 2. 安全地获取 candidates 列表
            candidates = response_json.get("candidates", [])

            if not candidates:
                return "LLM API返回了空的 'candidates' 列表。"

            # 3. 安全地获取第一个 candidate 的 parts 列表
            parts = candidates[0].get("content", {}).get("parts", [])

            if not parts:
                return "LLM API返回了空的 'parts' 列表。"

            # 4. **核心逻辑**：根据深度思考属性，选择正确的索引
            if supports_deep_thought and len(parts) > 1:
                # 如果支持深度思考且返回了多个部分，我们取第二部分
                print(f"模型 '{model_name}' 支持深度思考，提取 parts[1]。")
                return parts[1]["text"]
            else:
                # 否则，我们总是安全地取第一部分
                print(f"模型 '{model_name}' 不支持或未返回深度思考内容，提取 parts[0]。")
                return parts[0]["text"]

        except (KeyError, IndexError, TypeError) as e:
            print(f"解析LLM响应时发生结构错误: {e}")
            # 返回原始的JSON，方便调试
            return f"解析响应时出错。原始响应: \n\n```json\n{json.dumps(response_json, indent=2)}\n```"

    def _get_prompt_from_scene(self, scene: str) -> str:
        """
        【全新辅助方法】一个通用的、健壮的函数，用于根据场景字符串查找提示词。
        """
        # 1. 解析场景标识符
        parts = scene.split(".", 1)
        primary_scene_name = parts[0]
        secondary_scene_name = parts[1] if len(parts) > 1 else "default"

        # 2. 准备最终的回退 (fallback) prompt
        fallback_prompt = self.prompt_config.get("general", {}).get(
            "default", {}).get("prompt", "请处理以下内容:")

        # 3. 查找一级场景，如果找不到则回退到 general
        primary_config = self.prompt_config.get(
            pr


stNum<Sita12Num)
        {
            SitaMostNum=Sita12Num;
            if(Sita12Num==0)    Sita12Num=1;
            Sita=Sita12Sum/Sita12Num;
        }
        if(SitaMostNum<Sita13Num)
        {
            SitaMostNum=Sita13Num;
            if(Sita13Num==0)    Sita13Num=1;
            Sita=Sita13Sum/Sita13Num;
        }
        if(SitaMostNum<Sita14Num)
        {
            SitaMostNum=Sita14Num;
            if(Sita14Num==0)    Sita14Num=1;
            Sita=Sita14Sum/Sita14Num;
        }

        Point RectUplPoint=Point(0,0);//矩形左上角坐标
        RectUplPoint.x=(int)(-DisksCenterPoints[FirstBestPointSort].x*cos(Sita/180*3.14)+(-DisksCenterPoints[FirstBestPointSort].y)*sin(Sita/180*3.14) + FirstBestPoint.x);
        RectUplPoint.y=(int)(-(-DisksCenterPoints[FirstBestPointSort].x)*sin(Sita/180*3.14)+(-DisksCenterPoints[FirstBestPointSort].y)*cos(Sita/180*3.14)  + FirstBestPoint.y);
        DrawRotationRect(ImageFinalResult2,RectUplPoint,GrayTemplate.cols,GrayTemplate.rows,(double)Sita);

        //***********************************************************************
        //***********************************************************************
        timeSum=((double)getTickCount() - timeSum)/getTickFrequency();//运行时间
        qDebug("模板匹配结束，总耗时：%f秒",timeSum);
        qDebug("***********************");

    /*
        //利用2个最佳匹配点画矩形框
        //计算两向量夹角
        float AvectorAngle=AnglePolar(DisksCenterPoints[SecondBestPointSort]-DisksCenterPoints[FirstBestPointSort]);//原始参考向量
        float BvectorAngle=AnglePolar(SecondBestPoint-FirstBestPoint);//实际向量
        //两向量夹角0-360°
        float Sita=BvectorAngle-AvectorAngle;
        if(Sita<0) Sita=Sita+360;

        Point RectUplPoint;//矩形左上角坐标
        RectUplPoint.x=(int)(-DisksCenterPoints[FirstBestPointSort].x*cos(Sita/180*3.14)+(-DisksCenterPoints[FirstBestPointSort].y)*sin(Sita/180*3.14) + FirstBestPoint.x);
        RectUplPoint.y=(int)(-(-DisksCenterPoints[FirstBestPointSort].x)*sin(Sita/180*3.14)+(-DisksCenterPoints[FirstBestPointSort].y)*cos(Sita/180*3.14)  + FirstBestPoint.y);
        DrawRotationRect(ImageFinalResult2,RectUplPoint,GrayTemplate.cols,GrayTemplate.rows,(double)Sita);
    */

        //显示结果
        qDebug("最终匹配的矩形左上角坐标=(%d,%d);旋转角=%f°",RectUplPoint.x,RectUplPoint.y,0);
        imshow("ImageCandidates",GrayImageDisp);//局部特征粗匹配得到候选匹配点集
        imshow("ImageBestMatches",ImageBestMatches);
        imshow("ImageFinalResult",ImageFinalResult);//Most Neighbors Similarity: 获取9个最佳匹配点
        imshow("ImageFinalOne",ImageFinalResult2);//Most Neighbors Similarity: 从9个匹配点中获取最佳的2个匹配点

    /*
        Mat srcImageDisp;
        //resize函数前加cv：：，因为Qt也有resize函数，故加cv：：加以区别，不然会出现错误
        int resize


.endm

.macro LOAD_8X4_DATA arg0
    //Load the p_enc data and save to "v20 ~ v21"--- 8X4 bytes
    ld1     {v0.8b}, [\arg0], x3
    ld1     {v1.8b}, [\arg0], x3
    ld1     {v0.d}[1], [\arg0], x3
    ld1     {v1.d}[1], [\arg0], x3
    trn1    v2.4s, v0.4s, v1.4s
    trn2    v1.4s, v0.4s, v1.4s
    trn1    v20.2d, v2.2d, v1.2d
    trn2    v21.2d, v2.2d, v1.2d
.endm

.macro HDM_TRANSFORM_4X4_L0 arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9
    //Do the vertical transform
    uadd\arg9\()   v0.8h, \arg0, \arg1
    usub\arg9\()   v1.8h, \arg0, \arg1
    trn1    v3.2d, v0.2d, v1.2d
    trn2    v1.2d, v0.2d, v1.2d
    add     v4.8h, v3.8h, v1.8h //{0,1,2,3,4,5,6,7}
    sub     v5.8h, v3.8h, v1.8h //{12,13,14,15,8,9,10,11}

    //Do the horizontal transform
    trn1    v0.4s, v4.4s, v5.4s
    trn2    v1.4s, v4.4s, v5.4s
    add     v4.8h, v0.8h, v1.8h
    sub     v5.8h, v0.8h, v1.8h
    trn1    v0.8h, v4.8h, v5.8h
    trn2    v1.8h, v4.8h, v5.8h
    add     v4.8h, v0.8h, v1.8h
    sub     v5.8h, v0.8h, v1.8h

    //16x16_v
    trn1    v0.2s, v4.2s, v5.2s
    trn2    v1.2s, v4.2s, v5.2s
    sabal   \arg5, v0.4h, \arg2
    sabal   \arg5, v1.4h, \arg8\().4h
    sabal2  \arg5, v4.8h, \arg8\().8h
    sabal2  \arg5, v5.8h, \arg8\().8h

    //16x16_h
    ins     v3.d[0], v4.d[1]
    trn1    v0.4h, v4.4h, v3.4h
    trn2    v1.4h, v4.4h, v3.4h
    sabal   \arg6, v0.4h, \arg3
    sabdl   v4.4s, v1.4h, \arg8\().4h
    sabal   v4.4s, v5.4h, \arg8\().4h
    sabal2  v4.4s, v5.8h, \arg8\().8h
    add     \arg6, \arg6, v4.4s

    //16x16_dc_both
    sabal   \arg7, v0.4h, \arg4
    add     \arg7, \arg7, v4.4s
.endm

//int32_t WelsIntra


你在创业的时候，遇上一段经济困难期，朋友父母都劝你放弃创业好好上班，你怎么办？",
                answers: [
                    { answer: "继续创业",event: "互联网中期家人劝放弃事件1" },
                    { answer: "放弃创业，去工作",event: "互联网中期家人劝放弃事件2" },
                ],
                left_times: 1,
                require: function(properties) {
                    if(properties.happiness < 90) { return 1; }
                    else { return 3; }
                },
            },
            {
                question: "由于长期熬夜，加班加点的工作，你的身体出现了一些问题，你该如何选择？",
                answers: [
                    { answer: "有得必有失，继续坚持创业",event: "互联网中期身体出问题事件1" },
                    { answer: "调整作息，锻炼身体，少花一些时间在工作上",event: "互联网中期身体出问题事件2" },
                    { answer: "放弃创业，找份轻松的工作",event: "互联网中期身体出问题事件3" },
                    { answer: "给自己放一个假，公司的事让合伙人盯着",event: "互联网中期身体出问题事件4" },
                ],
                left_times: 1,
                require: function(properties) {
                    if(properties.health < 80) { return 1; }
                    else { return 3; }
                },
            },
            {
                question: "对于公司或产品的PR(public relations,公共关系)，你怎么看？",
                answers: [
                    { answer: "PR很重要，要花大功夫去做",event: "互联网中期做公司PR事件1" },
                    { answer: "PR重要但不必要，做的一般般就行",event: "互联网中期做公司PR事件2" },
                    { answer: "PR可有可无",event: "互联网中期做公司PR事件3" },
                ],
                left_times: 1,
                require: function(properties) { return 2 },
            },
            {
                question: "时间过去了三年，你的公司还处于半死不活的状态，你改如何选择？",
                answers: [
                    { answer: "坚持就是胜利",event: "互联网中期三年后半死不活事件1" },
                    { answer: "把公司卖掉，套现走人",event: "互联网中期三年后半死不活事件2" },
                    { answer: "直接关门，重新开始",event: "互联网中期三年后半死不活事件3" },
                ],
                left_times: 1,
                require: function(properties) {
                    if(properties.state_time > 12 && properties.wealth < 2000000) { return 1; }
                    else { return 3; }
                },
            },
            {
                question: "由于经营不善，你破产了",
                answers: [
                    { answer: "是时候放弃了，老老实实去上班吧",e


 cx="19" cy="19" stroke="black"></circle>
        </symbol>

        <symbol id="micon_settings">
          <path d="M19.43 12.98c.04-.32.07-.64.07-.98s-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.23-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98s.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.23.09.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z"></path>
        </symbol>
        <symbol id="micon_save">
          <path d="M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7l-4-4zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3zm3-10H5V5h10v4z"></path>
        </symbol>
        <symbol id="micon_open">
          <path d="M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z"></path>
        </symbol>
        <symbol id="micon_upload">
          <path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"/>
        </symbol>
        <symbol id="micon_download">
          <path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM17 13l-5 5-5-5h3V9h4v4h3z"/>
        </symbol>
        <sym


"""
This module defines the User model, integrating FastAPI Users
with SQLAlchemy for persistence.
"""

from fastapi_users_db_sqlalchemy import SQLAlchemyBaseUserTable

from db_models.base import Base

class User(SQLAlchemyBaseUserTable[int], Base):
    """
    Represents a user entity for authentication and user management.

    Inherits from:
        SQLAlchemyBaseUserTable[int]: FastAPI Users' base user class for integer-based IDs.
        Base: The custom base model to integrate with the application's database.
    """

    pass


Collections.singletonList(expect), actual);
    }

}
/*
 * Copyright (c) 2023 OceanBase.
 *
 * 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.oceanbase.odc.metadb.schedule;

import java.util.Collections;
import java.util.List;
import java.util.Optional;

import org.junit.Test;
import org.locationtech.jts.util.Assert;
import org.springframework.beans.factory.annotation.Autowired;

import com.oceanbase.odc.ServiceTestEnv;

/**
 * @Author：tinker
 * @Date: 2024/6/20 15:44
 * @Descripition:
 */
public class LatestTaskMappingRepositoryTest extends ServiceTestEnv {

    @Autowired
    private LatestTaskMappingRepository repository;

    @Test
    public void listByScheduleIds() {
        LatestTaskMappingEntity entity = create();
        List<LatestTaskMappingEntity> entities = repository.findByScheduleIdIn(Collections.singleton(1L));
        Assert.equals(1, entities.size());
        Assert.equals(entity, entities.get(0));
        delete(entity);
    }

    @Test
    public void findByScheduleId() {
        LatestTaskMappingEntity entity = create();
        Optional<LatestTaskMappingEntity> byScheduleId = repository.findByScheduleId(1L);
        Assert.isTrue(byScheduleId.isPresent());
        delete(entity);

    }

    private LatestTaskMappingEntity create() {
        LatestTaskMappingEntity entity = new LatestTaskMappingEntity();
        entity.setScheduleId(1L);
        entity.setLatestScheduleTaskId(99L);
        return repository.save(entity);
    }

    private void delete(LatestTaskMappingEntity entity) {
        repository.delete(entity);
    }
}
/*
 * Copyright (c) 2023 OceanBase.
 *
 * 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.oceanbase.odc.metadb.schedule;

import java.util.List;
import java.util.Optional;

import org.junit.Test;
import org.locationtech.jts.util.Assert;
import org.springframework.beans.factory.annotation.Autowired;

import com.oceanbase.odc.ServiceTestEnv;
import com.oceanbase.odc.service.schedule.model.OperationType;
import com.oceanbase.odc.service.schedule.model.ScheduleChangeStatus;

/**
 * @Author：tinker
 * @Date: 2024/6/20 15:44
 * @Descripition:
 */
public class ScheduleChangeLogRepositoryTest extends ServiceTestEnv {

    @Autowired
    private ScheduleChangeLogRepository repository;

    @Test
    public void findByScheduleId() {
        ScheduleChangeLogEntity entity = create();
        List<ScheduleChangeLogEntity> byScheduleId = repository.findByScheduleId(entity.getScheduleId());
        Assert.equals(1, byScheduleId.size());
        Assert.equals(entity.getScheduleId(), byScheduleId.get


r k=O.ff(a,{parent:!0});var m=k.node;k=O.ff(b,{parent:!0});k=k.node;if(!m||!k)throw new O.af(44);if(m.jf!==k.jf)throw new O.af(75);var r=O.Bf(m,e);d=Vb(a,d);if("."!==d.charAt(0))throw new O.af(28);d=Vb(b,c);if("."!==d.charAt(0))throw new O.af(55);try{var q=O.Bf(k,g)}catch(t){}if(r!==q){c=O.kf(r.mode);if(e=O.xg(m,e,c))throw new O.af(e);if(e=q?O.xg(k,g,c):O.Yg(k,g))throw new O.af(e);if(!m.cf.rename)throw new O.af(63);if(O.Nf(r)||q&&O.Nf(q))throw new O.af(10);
if(k!==m&&(e=O.Jf(m,"w")))throw new O.af(e);try{O.mf.willMovePath&&O.mf.willMovePath(a,b)}catch(t){u("FS.trackingDelegate['willMovePath']('"+a+"', '"+b+"') threw an exception: "+t.message)}O.Ah(r);try{m.cf.rename(r,k,g)}catch(t){throw t;}finally{O.zh(r)}try{if(O.mf.onMovePath)O.mf.onMovePath(a,b)}catch(t){u("FS.trackingDelegate['onMovePath']('"+a+"', '"+b+"') threw an exception: "+t.message)}}},rmdir:function(a){var b=O.ff(a,{parent:!0}).node,c=Rb(a),d=O.Bf(b,c),e=O.xg(b,c,!0);if(e)throw new O.af(e);
if(!b.cf.rmdir)throw new O.af(63);if(O.Nf(d))throw new O.af(10);try{O.mf.willDeletePath&&O.mf.willDeletePath(a)}catch(g){u("FS.trackingDelegate['willDeletePath']('"+a+"') threw an exception: "+g.message)}b.cf.rmdir(b,c);O.Ng(d);try{if(O.mf.onDeletePath)O.mf.onDeletePath(a)}catch(g){u("FS.trackingDelegate['onDeletePath']('"+a+"') threw an exception: "+g.message)}},readdir:function(a){a=O.ff(a,{wf:!0}).node;if(!a.cf.readdir)throw new O.af(54);return a.cf.readdir(a)},unlink:function(a){var b=O.ff(a,
{parent:!0}).node,c=Rb(a),d=O.Bf(b,c),e=O.xg(b,c,!1);if(e)throw new O.af(e);if(!b.cf.unlink)throw new O.af(63);if(O.Nf(d))throw new O.af(10);try{O.mf.willDeletePath&&O.mf.willDeletePath(a)}catch(g){u("FS.trackingDelegate['willDeletePath']('"+a+"') threw an exception: "+g.message)}b.cf.unlink(b,c);O.Ng(d);try{if(O.mf.onDeletePath)O.mf.onDeletePath(a)}catch(g){u("FS.trackingDelegate['onDeletePath']('"+a+"') threw an exception: "+g.message)}},read


// 結果也是 1 + 2 + 3 + 4 + 5 = 15

// 驗證：(...args: number): number
console.log(F(1, 2, 3, 4, 5));

// 驗證：(arr: number[]): number
console.log(F([1, 2, 3, 4, 5]));

// 裡面摻雜亂源會被發現錯誤
// F(1, 2, '3', 4, 5);

// 陣列型別也是，裡面摻雜亂源會被發現錯誤
// F([1, 2, '3', 4, 5]);

//#endregion Day17/**
 * 捕获所有异常
 */
import { ExceptionFilter, Catch, ArgumentsHost, HttpException, HttpStatus } from '@nestjs/common';
import { Logger } from '../utils';
import { GqlArgumentsHost } from '@nestjs/graphql';
import { GraphQLException } from '../exception';

@Catch()
export class AllExceptionsFilter implements ExceptionFilter {
  catch(exception: Error, host: ArgumentsHost): any {
    console.log(exception);
    const ctx = host.switchToHttp();
    const response = ctx.getResponse();
    const request = ctx.getRequest();

    const status = exception instanceof HttpException ? exception.getStatus() : HttpStatus.INTERNAL_SERVER_ERROR;

    if (request) { // http异常
      const logFormat = exception instanceof HttpException ?
        `Request original url: ${request.originalUrl} Method: ${request.method} IP: ${request.ip} Response: ${JSON.stringify(exception.getResponse())}` :
        `Request original url: ${request.originalUrl} Method: ${request.method} IP: ${request.ip} Status code: ${status} Response: ${exception.message}`;
      Logger.error(logFormat);
      const errorResponse = {
        code: status,
        message: exception instanceof HttpException ? `${exception.getResponse() instanceof Array ? JSON.stringify(exception.getResponse()) : exception.getResponse()}` : `Service Error: ${exception.message}`,
      };
      // 设置返回的状态码、请求头、发送错误信息
      response.status(status);
      response.header('Content-Type', 'application/json; charset=utf-8');
      response.send(errorResponse);
    } else { // GraphQL异常
      const gqlHost = GqlArgumentsHost.create(host);
      Logger.error('异常提示', JSON.stringify({
        info: gqlHost.getInfo().path,
        args: gqlHost.getArgs(),
        exception: exception.message,
      }));
      throw new GraphQLException(exception.message, status.toString());
    }
  }
}
import { PaymentSdkConfigType, QrGeneratorInterface } from "./types";

import { XcooBeePaymentSDK } from "./XcooBeePaymentSDK";

import { logoSrc } from "./config";

/**
 * Implements node version of QrGeneratorInterface to generate QRs
 *
 * @implements QrGeneratorInterface
 */
const qrGenerator: QrGeneratorInterface = {
  generate: (url: string, size: number): Promise<string> => {
    let


      ))
    }

    @Test
    fun test2ndThirdMonWedThuOfMarch1700() {
        assertThat(
            iterateOverSchedule(
                "2nd,third mon,wed,thu of march 17:00",
                ZonedDateTime.parse("2007-12-03T10:15:30+02:00[Europe/Kiev]"),
                limit = 7
            )
        ).isEqualTo(listOf(
            "2008-03-10T17:00:00+02:00[Europe/Kiev]",
            "2008-03-12T17:00:00+02:00[Europe/Kiev]",
            "2008-03-13T17:00:00+02:00[Europe/Kiev]",
            "2008-03-17T17:00:00+02:00[Europe/Kiev]",
            "2008-03-19T17:00:00+02:00[Europe/Kiev]",
            "2008-03-20T17:00:00+02:00[Europe/Kiev]",
            "2009-03-09T17:00:00+02:00[Europe/Kiev]"
        ))
    }

    @Test
    fun test1stMondayOfSepOctNov1700() {
        assertThat(
            iterateOverSchedule(
                "1st monday of sep,oct,nov 17:00",
                ZonedDateTime.parse("2007-12-03T10:15:30+02:00[Europe/Kiev]"),
                limit = 4
            )
        ).isEqualTo(listOf(
            "2008-09-01T17:00:00+03:00[Europe/Kiev]",
            "2008-10-06T17:00:00+03:00[Europe/Kiev]",
            "2008-11-03T17:00:00+02:00[Europe/Kiev]",
            "2009-09-07T17:00:00+03:00[Europe/Kiev]"
        ))
    }

    @Test
    fun test1stOfJanAprilJulyOct0000() {
        assertThat(
            iterateOverSchedule(
                "1 of jan,april,july,oct 00:00",
                ZonedDateTime.parse("2007-12-03T10:15:30+02:00[Europe/Kiev]"),
                limit = 5
            )
        ).isEqualTo(listOf(
            "2008-01-01T00:00:00+02:00[Europe/Kiev]",
            "2008-04-01T00:00:00+03:00[Europe/Kiev]",
            "2008-07-01T00:00:00+03:00[Europe/Kiev]",
            "2008-10-01T00:00:00+03:00[Europe/Kiev]",
            "2009-01-01T00:00:00+02:00[Europe/Kiev]"
        ))
    }

    @Test
    fun testEveryHourSynchronizedSame() {
        assertThat(
            iterateOverSchedule(
                "every 1 hours synchronized",
                ZonedDateTime.parse("2017-07-09T21:59:14-07:00[America/Los_Angeles]"),
                skipFirstIfSame = false
            )
        ).isEqualTo(listOf(
            "2017-07-09T22:00:00-07:00[America/Los_Angeles]",
            "2017-07-09T23:00:00-07:00[America/Los_Angeles]",
            "2017-07-10T00:00:00-07:00[America/Los_Angeles]"
        ))
    }

    @Test
    fun testEveryHourMinuteTruncationSame() {
        assertThat(
            iterateOverSchedule(
                "every 1 hours from 00:29 to 23:29",
                ZonedDateTime.parse("2016-03-21T16:29:15.007Z"),
                skipFirstIfSame = false
            )
        ).isEqualTo(listOf(
            "2016-03-21T17:29:00Z",
            "2016-03-21T18:29:00Z",
            "2016-03-


itialModelStates = {}

	-- Get index of parts
	local PartIndex = Support.FlipTable(Selection.Parts);

	-- Stop parts from moving, and capture the initial state of the parts
	for _, Part in pairs(Selection.Parts) do
		InitialPartStates[Part] = {
			Anchored = Part.Anchored;
			CanCollide = Part.CanCollide;
			CFrame = Part.CFrame;
		}
		Part.Anchored = true;
		Part.CanCollide = false;
		InitialPartStates[Part].Joints = Core.PreserveJoints(Part, PartIndex);
		Part:BreakJoints();
		Part.Velocity = Vector3.new();
		Part.RotVelocity = Vector3.new();
	end;

	-- Record model pivots
	-- (temporarily pcalled due to pivot API being in beta)
	pcall(function ()
		for _, Model in pairs(Selection.Models) do
			InitialModelStates[Model] = {
				Pivot = Model:GetPivot();
			}
		end
	end)

	return InitialPartStates, InitialModelStates
end;

function GetIncrementMultiple(Number, Increment)

	-- Get how far the actual distance is from a multiple of our increment
	local MultipleDifference = Number % Increment;

	-- Identify the closest lower and upper multiples of the increment
	local LowerMultiple = Number - MultipleDifference;
	local UpperMultiple = Number - MultipleDifference + Increment;

	-- Calculate to which of the two multiples we're closer
	local LowerMultipleProximity = math.abs(Number - LowerMultiple);
	local UpperMultipleProximity = math.abs(Number - UpperMultiple);

	-- Use the closest multiple of our increment as the distance moved
	if LowerMultipleProximity <= UpperMultipleProximity then
		Number = LowerMultiple;
	else
		Number = UpperMultiple;
	end;

	return Number;
end;

-- Return the tool
return RotateTool;


 at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// compile-flags: -Z borrowck=mir -Z nll

#![allow(dead_code)]

// Test that we relate the type of the fn type to the type of the fn
// ptr when doing a `ReifyFnPointer` cast.
//
// This test is a bit tortured, let me explain:
//

// The `where 'a: 'a` clause here ensures that `'a` is early bound,
// which is needed below to ensure that this test hits the path we are
// concerned with.
fn foo<'a>(x: &'a u32) -> &'a u32
where
    'a: 'a,
{
    panic!()
}

fn bar<'a>(x: &'a u32) -> &'static u32 {
    // Here, the type of `foo` is `typeof(foo::<'x>)` for some fresh variable `'x`.
    // During NLL region analysis, this will get renumbered to `typeof(foo::<'?0>)`
    // where `'?0` is a new region variable.
    //
    // (Note that if `'a` on `foo` were late-bound, the type would be
    // `typeof(foo)`, which would interact differently with because
    // the renumbering later.)
    //
    // This type is then coerced to a fn type `fn(&'?1 u32) -> &'?2
    // u32`. Here, the `'?1` and `'?2` will have been created during
    // the NLL region renumbering.
    //
    // The MIR type checker must therefore relate `'?0` to `'?1` and `'?2`
    // as part of checking the `ReifyFnPointer`.
    let f: fn(_) -> _ = foo;
    //~^ WARNING not reporting region error due to -Znll
    f(x)
    //~^ ERROR free region `'_#1r` does not outlive free region `'static`
}

fn main() {}
fn main() {
    println!("cargo:rustc-link-search={}", "/usr/local/Cellar/r/4.1.2/lib/");
    println!("cargo:rustc-link-lib=dylib={}", "R");

    cc::Build::new()
        .cpp(true)
        .include("src/binding.h")
        .include("src/include")
        .flag_if_supported("-w")
        .flag_if_supported("-std=c++11")
        .file("src/binding.cc")
        .compile("r");
}//! Rust doesn't support either default function arguments or named function arguments.
//!
//! This crate generates a macro interface for a given function that can be invoked with named arguments and fills default argument values, while keeping the original function intact.
//!
//! # Generating a macro interface
//!
//! In order to generate a macro for a function, we just need to wrap its definition with `duang!{...}`:
//!
//! ```
//! use duang::duang;
//!
//! # const IGNORE: &str = stringify! {
//! duang!(
//! pub fn foo<T>(a: T, b: f64 = 13.0, c: T = a * a) -> (T, f64, T)
//! # )
//! # };
//! # pub fn foo<T>(a: T, b: f64, c: T) -> (T, f64, T)
//! where
//!   T: std::ops::Mul<T, Output = T>,
//!   T: std::fmt::Display,
//!   T: Copy,
//! {
//!   (a, b, c)
//! }
//! # const IGNORE2: &str = stringify! {
//! # (
//!


 mesh file in surf format.
impl FsSurfaceHeader {

    /// Read an FsSurface header from a file.
    pub fn from_file<P: AsRef<Path>>(path: P) -> Result<FsSurfaceHeader> {
        let mut file = BufReader::new(File::open(path)?);
        FsSurfaceHeader::from_reader(&mut file)
    }

    /// Read an FsSurface header from the given byte stream.
    /// It is assumed that the input is currently at the start of the
    /// FsSurface header.
    pub fn from_reader<S>(input: &mut S) -> Result<FsSurfaceHeader>
    where
        S: Read,
    {
        let mut hdr = FsSurfaceHeader::default();

        let mut input = ByteOrdered::be(input);

        hdr.surf_magic[0] = input.read_u8()?;
        hdr.surf_magic[1] = input.read_u8()?;
        hdr.surf_magic[2] = input.read_u8()?;
        hdr.info_line = read_fs_variable_length_string(&mut input)?;
        hdr.num_vertices = input.read_i32()?;
        hdr.num_faces = input.read_i32()?;

        let magic: i32 = interpret_fs_int24(hdr.surf_magic[0], hdr.surf_magic[1], hdr.surf_magic[2]);

        if !(magic == TRIS_MAGIC_FILE_TYPE_NUMBER) {
            Err(NeuroformatsError::InvalidFsSurfaceFormat)
        } else {
            Ok(hdr)
        }
    }
}

/// Compute the min and max coordinates for the x, y, and z axes.
///
/// # Panics
///
/// If the min and max coordinates for the axes cannot be computed. E.g., when the coordinate vector is empty, has a length that is not a multiple of 3, or contains invalid vertex coordinates like `NAN` values.
///
/// # Return value
///
/// The 6 values in the returned tuple are, in the following order: (min_x, max_x, min_y, max_y, min_z, max_z).
///
/// Examples
///
/// ```no_run
/// let coords: Vec<f32> = vec![0.0, 0.1, 0.2, 0.3, 0.3, 0.3, 1.0, 2.0, 4.0];
/// let (minx, maxx, miny, maxy, minz, maxz) = neuroformats::fs_surface::coord_extrema(&coords).unwrap();
/// assert_eq!(0.0, minx);
/// assert_eq!(0.1, miny);
/// assert_eq!(0.2, minz);
/// assert_eq!(1.0, maxx);
/// assert_eq!(2.0, maxy);
/// assert_eq!(4.0, maxz);
/// ```
pub fn coord_extrema(coords : &Vec<f32>) -> Result<(f32, f32, f32, f32, f32, f32)> {
    let all_coords = Array2::from_shape_vec((coords.len()/3 as usize, 3 as usize), coords.clone()).unwrap();
    let x_coords =  all_coords.slice(s![.., 0]);
    let y_coords =  all_coords.slice(s![.., 1]);
    let z_coords =  all_coords.slice(s![.., 2]);

    let min_x = x_coords.min().unwrap().clone(); // min() on type ndarray::ArrayBase is available from ndarray-stats Quantile trait
    let max_x = x_coords.max().unwrap().clone();

    let min_y = y_coords.min().unwrap().clone();
    let max_y = y_coords.max().unwrap().clone();


icalClass> l = new List<SecurityCriticalClass>();

            // CA2140 violation - transparent method accessing a critical field.  This can be fixed by any of:
            //  1. Make TransparentMethod critical
            //  2. Make TransparentMethod safe critical
            //  3. Make m_criticalField safe critical
            //  4. Make m_criticalField transparent
            m_criticalField = l;

            // CA2140 violation - transparent method accessing a critical method.  This can be fixed by any of:
            //  1. Make TransparentMethod critical
            //  2. Make TransparentMethod safe critical
            //  3. Make CriticalMethod safe critical
            //  4. Make CriticalMethod transparent
            CriticalMethod();
        }
    }
}

//</Snippet1>


c00a0949c9e.png)

![picture 18](../images/ff792949fdb0d8359b1f20a1db6763d23430e8d94b58180f38be1342f8ccce0c.png)

![picture 19](../images/42b313a369564f02f6cc7afb400de46e6d08e6d25cf2df0802babdec3263866b.png)

![picture 20](../images/f88288b384cfd27d55d410ba9015be1d1b32ed6cf060b46f73dae23f0f497fc4.png)

![picture 21](../images/20014d5f04411184559b7a49ca1300a9b95e867acda5b7942524f035e054a28b.png)

![picture 22](../images/554aaa554abae4a604986b38b3fbd9900e29aa433448adcb58188a351b3a1ec7.png)

![picture 23](../images/a1cac133c49ff024b2024d1a78d2da451d1e58d3c827651e4dc62090d9e87183.png)

## 安装

### 通过 Docker 安装

为了方便安装，我们提供了 Docker 安装方式。也推荐优先使用本方式。

#### 依赖环境

首先，你需要一个支持 `git` 和 `docker-compose` 的容器环境，如果还没有安装，可以参考[这篇文章](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-compose-on-ubuntu-20-04)。

#### 初始化

首先通过 clone 本项目代码

```bash
git clone https://github.com/easychen/MemberPrism2.git prism
```

进入目录，通过 `docker-compose` 启动服务

```bash
cd  prism && docker-compose up -d
```

服务将启动两个端口：

- 8801：MemberPrism，网站
- 8802: MemberProxy，启用后端保护时，用户将访问这里

可以通过修改根目录下的 `docker-compose.yaml` 中 `port` 部分调整这个两个服务的端口：

```yaml
ports:
    - '8801:80'
    - '8802:8802'
```

##### HTTPS 支持

首先，将证书放入 `ssl` 目录下。

打开 `docker/web/vhost.conf`，去掉以下行之前的注释：

```conf
SSLEngine             on
SSLCertificateFile    /app/ssl/server.crt
SSLCertificateKeyFile /app/ssl/server.key
```

打开 `web/.env` 修改 `PRISM_HTTPS` 为 `true`：

```conf
PR


older in aquiredChunkHolders) {
                            holder.unregisterUser(worldUser)
                            chunksacquired--
                        }

                        aquiredHeightmaps.forEach { it.unregisterUser(worldUser) }

                        aquiredHeightmaps.clear()
                        aquiredChunkHolders.clear()
                    }
                }
            }
        }

        waveFence.traverse()
        wave = 0

        // Terminate
        for (holder in aquiredChunkHolders) {
            holder.unregisterUser(worldUser)
            chunksacquired--
        }

        for (heightmap in aquiredHeightmaps)
            heightmap.unregisterUser(worldUser)

        aquiredHeightmaps.clear()
        aquiredChunkHolders.clear()
    }

    protected fun stetFourTidbits(mcWorld: MinecraftWorld, csWorld: WorldImplementation) {
        verbose("Entering step four: tidbits")

        val spawnX = (mcWorld.levelDotDat.root.getTag("Data.SpawnX") as NBTInt).getData()
        val spawnY = (mcWorld.levelDotDat.root.getTag("Data.SpawnY") as NBTInt).getData()
        val spawnZ = (mcWorld.levelDotDat.root.getTag("Data.SpawnZ") as NBTInt).getData()

        csWorld.properties = csWorld.properties.copy(spawn = Location(csWorld, spawnX.toDouble(), spawnY.toDouble(), spawnZ.toDouble()))

        // TODO
        // csWorld.saveEverything().traverse()

        csWorld.destroy()
    }

}
package com.hujiayucc.hook.hooker

import com.highcapable.yukihookapi.hook.factory.constructor
import com.hujiayucc.hook.annotation.Run
import de.robv.android.xposed.XposedHelpers

@Run(
    appName = "红果免费短剧",
    packageName = "com.phoenix.read",
    action = "会员、广告"
)
object HGMFDJ : Base() {
    override fun onStart() {
        "com.dragon.read.user.model.VipInfoModel".toClass()
            .constructor()
            .hook {
                after {
                    XposedHelpers.setObjectField(instance, "expireTime", "4102444799")
                    XposedHelpers.setObjectField(instance, "isVip", "1")
                    XposedHelpers.setObjectField(instance, "leftTime", "1")
                    XposedHelpers.setBooleanField(instance, "isAutoCharge", true)
                    XposedHelpers.setBooleanField(instance, "isUnionVip", true)
                    XposedHelpers.setIntField(instance, "unionSource", 1)
                    XposedHelpers.setBooleanField(instance, "isAdVip", true)
                    XposedHelpers.setObjectField(instance, "subType", args[7])
                }
            }
    }
}package com.hujiayucc.hook.hooker

import android.content.Context
import android.view.View
import com.highcapable.yukihookapi.hook.factory.method
import com.highcapable.yukihookapi.hook.type.android.ApplicationClass
import com.hujiayucc.hook.annotation.Run
import org.luckypray.dexkit.DexKitBridge

@Run(
    appName = "七猫免费小说",
    packageName = "com.kmxs.reader",
    action = "开屏广告"
)
object QiCat : Base() {
    override fun onStart() {
        val boolMap = emptyMap<String, String>().toMutableMap()
        DexKitBridge.create(appInfo.sourceDir).use { bridge ->
            bridge.add("org.geometerplus.android.fbreader", "isSpeechMode", "boolean", boolMap)
            bridge.add("com.qimao.qmuser.model.entity.mine_v2", "isVipStateChange", "boolean", boolMap)
            bridge.adds("", "isVipUser", "boolean", boolMap, "com.qimao.qmreader.bridge.app")
            bridge.adds("", "isBookVip", "boolean", boolMap)
            bridge.close()
        }

        ApplicationClass.method { name = "attach" }.hook {
            before {
                for ((className, methodName) in boolMap) {
                    className.toClassOrNull((args[0] as Context).classLoader)?.method { name = methodName }
                        ?.hook { replaceTo(true) }?.ignoredAllFailure()
                }
            }
        }

        val baseInfo = "


:titlecase;

lazy_static! {
    static ref GODS: HashSet<&'static str> = hashset! {
        "Achilles",
        "Agni",
        "<NAME>",
        "<NAME>",
        "Amaterasu",
        "Anhur",
        "Anubis",
        "<NAME>",
        "Aphrodite",
        "Apollo",
        "Arachne",
        "Ares",
        "Artemis",
        "Artio",
        "Athena",
        "Atlas",
        "Awilix",
        "<NAME>",
        "Bacchus",
        "Bakasura",
        "<NAME>",
        "Bastet",
        "Bellona",
        "Cabrakan",
        "Camazotz",
        "Cerberus",
        "Cernunnos",
        "Chaac",
        "Chang'e",
        "Charybdis",
        "Chernobog",
        "Chiron",
        "Chronos",
        "Cliodhna",
        "Cthulhu",
        "<NAME>",
        "Cupid",
        "<NAME>",
        "Danzaburou",
        "Discordia",
        "<NAME>",
        "Eset",
        "Fafnir",
        "Fenrir",
        "Freya",
        "Ganesha",
        "Geb",
        "Gilgamesh",
        "<NAME>",
        "Hachiman",
        "Hades",
        "<NAME>",
        "Heimdallr",
        "Hel",
        "Hera",
        "Hercules",
        "Horus",
        "<NAME>",
        "<NAME>",
        "Izanami",
        "Janus",
        "<NAME>",
        "Jormungandr",
        "Kali",
        "Khepri",
        "<NAME>",
        "Kukulkan",
        "Kumbhakarna",
        "Kuzenbo",
        "Loki",
        "Medusa",
        "Mercury",
        "Merlin",
        "<NAME>",
        "Mulan",
        "<NAME>",
        "Neith",
        "Nemesis",
        "Nike",
        "Nox",
        "<NAME>",
        "Odin",
        "Olorun",
        "Osiris",
        "Pele",
        "Persephone",
        "Poseidon",
        "Ra",
        "Raijin",
        "Rama",
        "Ratatoskr",
        "Ravana",
        "Scylla",
        "Serqet",
        "Set",
        "Shiva",
        "Skadi",
        "Sobek",
        "Sol",
        "<NAME>",
        "Susano",
        "Sylvanus",
        "Terra",
        "Thanatos",
        "<NAME>",
        "Thor",
        "Thoth",
        "Tiamat",
        "Tsukuyomi",
        "Tyr",
        "Ullr",
        "Vamana",
        "Vulcan",
        "Xbalanque",
        "<NAME>",
        "Yemoja",
        "Ymir",
        "Zeus",
        "<NAME>"
    };
}

#[command]
pub async fn counter(ctx: &Context, msg: &Message, args: Args) -> CommandResult {
    let god = titlecase(args.message().trim());
    let text = if GODS.contains(&god[..]) {
        format!(
            indoc! {"
            Check out
                - https://smite.fandom.com/wiki/{}#Abilities
                - https://www.google.com/search?q=SMITE+How+to+Counter+{},
            "},
            god.replace(" ", "_"),
            god.replace(" ", "_")
        )
    } else {
        format!("Couldn't find God named {} :(", god)
    };
    msg.reply(ctx, text).await?;
    Ok(())
}
<reponame>myrrlyn/calm_io<gh_stars>10-100
/*! Calm, non-panicking I/O operations.

A fun fact about Rust is that `println!`


/* SPDX-License-Identifier: 0BSD */

/*
 * Copyright (C) 2021 by Forest Crossman <cyrozap@gmail.com>
 *
 * Permission to use, copy, modify, and/or distribute this software for
 * any purpose with or without fee is hereby granted.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 * PE


  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 14px;
  cursor: pointer;
  -webkit-transition: all 0.3s ease;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.08);
  opacity: 0;
}

.tb-project-card-edit-btn:hover {
  color: rgba(255, 255, 255, 0.8);
}

.tb-project-card-edit-btn:focus {
  outline: none;
}

.tb-project-card:hover .tb-project-card-edit-btn {
  opacity: 1;
}

@media screen and (max-width: 991px) {
  .tb-drop-list-wrap.tb-style2 {
    display: block;
    margin: 0;
  }

  .tb-drop-list-wrap.tb-style2 .tb-drop-list-in {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 30px;
  }

  .tb-drop-list-wrap.tb-style2 .tb-drop-list-in:last-child {
    margin-bottom: 0;
  }
}

/*========== End Project Card  ==========*/
/*========== Start Email  ==========*/
.tb-outline-label {
  font-size: 24px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  height: 100%;
  color: rgba(255, 255, 255, 0.3);
}

.tb-email-badgh {
  display: inline-block;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  background-color: #34c759;
  border-radius: 4px;
  padding: 2px 6px;
}

.tb-email-text.tb-style1 {
  font-size: 16px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
}

.tb-email-text.tb-style1 .tb-email-title {
  font-weight: 400;
  font-size: inherit;
  margin-right: 5px;
  margin-bottom: 0;
  line-height: inherit;
}

.tb-table.tb-style4 {
  padding-bottom: 30px;
  margin-bottom: -30px;
  padding-top: 30px;
  margin-top: -30px;
}

.tb-table.tb-style4 .table {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tb-table.tb-style4 .table td {
  vertical-align: middle;
  border-color: rgba(255, 255, 255, 0.08);
}

.tb-table.tb-style4 td {
  padding: 8px 7px;
}

.tb-table.tb-style4 td:first-child {
  padding-left: 30px;
  width: 56px;
}

.tb-table.tb-style4 td:nth-child(2) {
  width: 36px;
}

.tb-table.tb-style4 td:nth-child(3) {
  width: 37px;
}

.tb-table.tb-style4 td:nth-child(4) {
  width: 185px;
}

.tb-table.tb-style4 td:nth-child(5) {
  width: 60px;
}

.tb-table.tb-style4 td:last-child {
  padding-right: 30px;
  min-width: 110px;
}

.tb-table.tb-style4 tr {
  position: relative;
  -webkit-transition: all 0.3s ease;
  transition: all 0.3s ease;
  cursor: pointer;
}

.tb-table.tb-style4 tr.tb-new-message {
  background-color: #1D1F3C


onents of a p5.Vector
 * @return {Number}       the angle between (in radians)
 * @example
 *

 *
 * var v1 = createVector(1, 0, 0);
 * var v2 = createVector(0, 1, 0);
 *
 * var angle = v1.angleBetween(v2);
 * // angle is PI/2
 * print(angle);
 *
 *

 */
p5.Vector.prototype.angleBetween = function angleBetween(v) {
  var dotmagmag = this.dot(v) / (this.mag() * v.mag());
  // Mathematically speaking: the dotmagmag variable will be between -1 and 1
  // inclusive. Practically though it could be slightly outside this range due
  // to floating-point rounding issues. This can make Math.acos return NaN.
  //
  // Solution: we'll clamp the value to the -1,1 range
  var angle = Math.acos(Math.min(1, Math.max(-1, dotmagmag)));
  if (this.p5) {
    if (this.p5._angleMode === constants.DEGREES) {
      angle = polarGeometry.radiansToDegrees(angle);
    }
  }
  return angle;
};

/**
 * Linear interpolate the vector to another vector
 *
 * @method lerp
 * @param  {Number}    x   the x component
 * @param  {Number}    y   the y component
 * @param  {Number}    z   the z component
 * @param  {Number}    amt the amount of interpolation; some value between 0.0
 *                         (old vector) and 1.0 (new vector). 0.9 is very near
 *                         the new vector. 0.5 is halfway in between.
 * @chainable
 *
 * @example
 *

 *
 * var v = createVector(1, 1, 0);
 *
 * v.lerp(3, 3, 0, 0.5); // v now has components [2,2,0]
 *
 *

 *
 *

 *
 * var v1 = createVector(0, 0, 0);
 * var v2 = createVector(100, 100, 0);
 *
 * var v3 = p5.Vector.lerp(v1, v2, 0.5);
 * // v3 has components [50,50,0]
 * print(v3);
 *
 *

 */
/**
 * @method lerp
 * @param  {p5.Vector} v   the p5.Vector to lerp to
 * @param  {Number}    amt
 * @chainable
 */
p5.Vector.prototype.lerp = function lerp(x, y, z, amt) {
  if (x instanceof p5.Vector) {
    return this.lerp(x.x, x.y, x.z, y);
  }
  this.x += (x - this.x) * amt || 0;
  this.y += (y - this.y) * amt || 0;
  this.z += (z - this.z) * amt || 0;
  return this;
};

/**
 * Return a representation of this vector as a float array. This is only
 * for temporary use. If used in any other fashion, the contents should be
 * copied by using the p5.Vector.copy() method to copy into your own
 * array.
 *
 * @method array
 * @return {Number[]} an Array with the 3 values
 * @example
 *

 *
 * function setup() {
 *   var v = createVector(20, 30);
 *   print(v.array()); // Prints : Array [20, 30, 0]
 * }
 *
 *

 *
 *

 *
 * var v = createVector(10.0


, {
  pattern = "lua",
  callback = function()
    vim.api.nvim_buf_set_keymap(
      0,
      "n",
      "<F5>",
      '<ESC>:w<CR>:TermExec direction=float cmd="lua %"<CR>',
      { silent = true, noremap = true }
    )
  end,
})
vim.api.nvim_create_autocmd("FileType", {
  pattern = "java",
  callback = function()
    -- -fsanitize=address -fsanitize=undefined -D_GLIBCXX_DEBUG
    vim.api.nvim_buf_set_keymap(
      0,
      "n",
      "<F5>",
      '<ESC>:w<CR>:TermExec direction=float cmd="javac %:t:r.java ; java %:t:r"<CR>',
      { silent = true, noremap = true }
    )
    vim.api.nvim_buf_set_keymap(
      0,
      "n",
      "<F4>",
      "<ESC>:w<CR>:!javac %:t:r.java<CR>",
      { silent = true, noremap = true }
    )
  end,
})
vim.api.nvim_create_autocmd("FileType", {
  pattern = "go",
  callback = function()
    -- -fsanitize=address -fsanitize=undefined -D_GLIBCXX_DEBUG
    vim.api.nvim_buf_set_keymap(
      0,
      "n",
      "<F5>",
      '<ESC>:w<CR>:TermExec direction=float cmd="go run %:t:r.go"<CR>',
      { silent = true, noremap = true }
    )
    vim.api.nvim_buf_set_keymap(
      0,
      "n",
      "<F4>",
      "<ESC>:w<CR>:!go build %:t:r.go<CR>",
      { silent = true, noremap = true }
    )
  end,
})
vim.api.nvim_create_autocmd("FileType", {
  pattern = "rust",
  callback = function()
    -- -fsanitize=address -fsanitize=undefined -D_GLIBCXX_DEBUG
    vim.api.nvim_buf_set_keymap(
      0,
      "n",
      "<F5>",
      '<ESC>:w<CR>:TermExec direction=float cmd="rustc %:t:r.rs ; ./%:t:r.exe"<CR>',
      { silent = true, noremap = true }
    )
    vim.api.nvim_buf_set_keymap(
      0,
      "n",
      "<F4>",
      "<ESC>:w<CR>:!rustc %:t:r.rs<CR>",
      { silent = true, noremap = true }
    )
  end,
})


ny of the routine names begin with the name of the data type they
      operate on:

          B4 - a 4 byte word;

          CH - a character;

          CHVEC - a vector of characters;

          DEC - a decimal fraction;

          DIGIT - a character representing a numeric digit;

          I4 - an integer;

          R4 - a single precision real;

          R8 - a double precision real;

          RAT - a ratio I/J;

          S - a string;

          SVEC - a vector of strings;

          SVECI - a vector of strings, implicitly capitalized;

      Licensing:

      The computer code and data files described and made available on this web page
      are distributed under
      the GNU LGPL license.

      Languages:

      CHRPAK is available in
      a C version and
      a C++ version and
      a FORTRAN77 version and
      a FORTRAN90 version and
      a MATLAB version.

      Reference:

          Carl Branden, John Tooze,

          Introduction to Protein Structure,

          Second Edition,

          Garland Publishing, 1999,

          ISBN: 0815323050,

          LC: QP551.B7635.

          Paul Bratley, Bennett Fox, Linus Schrage,

          A Guide to Simulation,

          Second Edition,

          Springer, 1987,

          ISBN: 0387964673,

          LC: QA76.9.C65.B73.

          IEEE Standards Committee 754,

          IEEE Standard for Binary Floating Point Arithmetic,

          ANSI/IEEE Standard 754-1985,

          SIGPLAN Notices,

          Volume 22, Number 2, 1987, pages 9-25.

          Donald Knuth,

          The Art of Computer Programming,

          Volume 3, Sorting and Searching,

          Second Edition,

          Addison Wesley, 1998,

          ISBN: 0201896850,

          LC: QA76.6.K64.

          Albert Nijenhuis, Herbert Wilf,

          Combinatorial Algorithms for Computers and Calculators,

          Academic Press, 1978,


gs/ppyolo/ppyolo_test.yml`用于评估COCO test-dev2017数据集的效果，评估COCO test-dev2017数据集的效果须先从[COCO数据集下载页](https://cocodataset.org/#download)下载test-dev2017数据集，解压到`configs/ppyolo/ppyolo_test.yml`中`EvalReader.dataset`中配置的路径，并使用如下命令进行评估

```bash
# 使用PaddleDetection发布的权重
CUDA_VISIBLE_DEVICES=0 python tools/eval.py -c configs/ppyolo/ppyolo_test.yml -o weights=https://paddlemodels.bj.bcebos.com/object_detection/ppyolo.pdparams

# 使用训练保存的checkpoint
CUDA_VISIBLE_DEVICES=0 python tools/eval.py -c configs/ppyolo/ppyolo_test.yml -o weights=output/ppyolo/best_model
```

评估结果保存于`bbox.json`中，将其压缩为zip包后通过[COCO数据集评估页](https://competitions.codalab.org/competitions/20794#participate)提交评估。

**注意:** `configs/ppyolo/ppyolo_test.yml`仅用于评估COCO test-dev数据集，不用于训练和评估COCO val2017数据集。

### 3. 推理

使用单GPU通过如下命令一键式推理图像，通过`--infer_img`指定图像路径，或通过`--infer_dir`指定目录并推理目录下所有图像

```bash
# 推理单张图像
CUDA_VISIBLE_DEVICES=0 python tools/infer.py -c configs/ppyolo/ppyolo.yml -o weights=https://paddlemodels.bj.bcebos.com/object_detection/ppyolo.pdparams --infer_img=demo/000000014439_640x640.jpg

# 推理目录下所有图像
CUDA_VISIBLE_DEVICES=0 python tools/infer.py -c configs/ppyolo/ppyolo.yml -o weights=https://paddlemodels.bj.bcebos.com/object_detection/ppyolo.pdparams --infer_dir=demo
```

### 4. 推理部署与benchmark

PP-YOLO模型部署及推理benchmark需要通过`tools/export_model.py`导出模型后使用Paddle预测库进行部署和推理，可通过如下命令一键式启动。

```bash
# 导出模型，默认存储于output/ppyolo目录
python tools/export_model.py -c configs/ppyolo/ppyolo.yml -o weights=https://paddlemodels.bj.bcebos.com/object_detection/ppyolo.pdparams

# 预测库推理
CUDA_VISIBLE_DEVICES=0 python deploy/python/infer.py --model_dir=output/ppyolo --image_file=demo/000000014439_640x640.jpg --use_gpu=True
```

PP-YOLO模型benchmark测试为不包含数据预处理和网络输出后处理(NMS)的网络结构部分数据，导出模型时须指定`--exlcude_nms`来裁剪掉模型中后处理的NMS部分，通过如下命令进行模型导出和benchmark测试。

```bash
# 导出模型，通过--exclude_nms参数裁剪掉模型中的NMS部分，默认存储于output/ppyolo目录
python tools/export_model.py -c configs/ppyolo/ppyolo.yml -o weights=https://paddlemodels.bj.bcebos.com/object_detection/ppyolo.pdparams --exclude_nms

# FP32 benchmark测试


d_normal((10, 2)), columns=columns)
    path = tmp_path / setup_path
    msg = "cannot have non-object label DataIndexableCol"
    with pytest.raises(ValueError, match=msg):
        df.to_hdf(path, key="df", format="table", data_columns=True)

@pytest.mark.parametrize("dtype", [None, "category"])
def test_to_hdf_with_object_column_names_should_run(tmp_path, setup_path, dtype):
    # GH9057
    df = DataFrame(
        np.random.default_rng(2).standard_normal((10, 2)),
        columns=Index(["a", "b"], dtype=dtype),
    )
    path = tmp_path / setup_path
    df.to_hdf(path, key="df", format="table", data_columns=True)
    result = read_hdf(path, "df", where=f"index = [{df.index[0]}]")
    assert len(result)

def test_hdfstore_strides(setup_path):
    # GH22073
    df = DataFrame({"a": [1, 2, 3, 4], "b": [5, 6, 7, 8]})
    with ensure_clean_store(setup_path) as store:
        store.put("df", df)
        assert df["a"].values.strides == store["df"]["a"].values.strides

def test_store_bool_index(tmp_path, setup_path):
    # GH#48667
    df = DataFrame([[1]], columns=[True], index=Index([False], dtype="bool"))
    expected = df.copy()

    # # Test to make sure defaults are to not drop.
    # # Corresponding to Issue 9382
    path = tmp_path / setup_path
    df.to_hdf(path, key="a")
    result = read_hdf(path, "a")
    tm.assert_frame_equal(expected, result)


bg-4 blockquote{
	color: #fff;
	text-shadow: 1px 1px 1px rgba(0,0,0,0.2);
}

.demo-1 .bg-4 blockquote:before {
	color: #379eaa;
}

/* Fifth Slide */
.demo-1 .bg-5 .sl-slide-inner,
.demo-1 .bg-5 .sl-content-slice {
	background: #ffeb41;
}

.demo-1 .bg-5 .deco {
	border-color: #ECD82C;
}

.demo-1 .bg-5 .deco:after {
	color: #000;
	text-shadow: 0 0 1px #000;
}

.demo-1 .bg-5 h2,
.demo-1 .bg-5 blockquote{
	color: #000;
	text-shadow: 1px 1px 1px rgba(0,0,0,0.1);
}

.demo-1 .bg-5 blockquote:before {
	color: #ecd82c;
}

.demo-2 .bg-img-1 {
	background-image: url(../images/banner/1.jpg);
}
.demo-2 .bg-img-2 {
	background-image: url(../images/banner/2.jpg);
}
.demo-2 .bg-img-3 {
	background-image: url(../images/banner/3.jpg);
}
.demo-2 .bg-img-4 {
	background-image: url(../images/banner/4.jpg);
}
.demo-2 .bg-img-5 {
	background-image: url(../images/banner/5.jpg);
}

/* Animations for content elements */

.sl-trans-elems .deco{
	-webkit-animation: roll 1s ease-out both, fadeIn 1s ease-out both;
	-moz-animation: roll 1s ease-out both, fadeIn 1s ease-out both;
	-o-animation: roll 1s ease-out both, fadeIn 1s ease-out both;
	-ms-animation: roll 1s ease-out both, fadeIn 1s ease-out both;
	animation: roll 1s ease-out both, fadeIn 1s ease-out both;
}
.sl-trans-elems h2{
	-webkit-animation: moveUp 1s ease-in-out both;
	-moz-animation: moveUp 1s ease-in-out both;
	-o-animation: moveUp 1s ease-in-out both;
	-ms-animation: moveUp 1s ease-in-out both;
	animation: moveUp 1s ease-in-out both;
}
.sl-trans-elems blockquote{
	-webkit-animation: fadeIn 0.5s linear 0.5s both;
	-moz-animation: fadeIn 0.5s linear 0.5s both;
	-o-animation: fadeIn 0.5s linear 0.5s both;
	-ms-animation: fadeIn 0.5s linear 0.5s both;
	animation: fadeIn 0.5s linear 0.5s both;
}
.sl-trans-back-elems .deco{
	-webkit-animation: scaleDown 1s ease-in-out both;
	-moz-animation: scaleDown 1s ease-in-out both;
	-o-animation: scaleDown 1s ease-in-out both;
	-ms-animation: scaleDown 1s ease-in-out both;
	animation: scaleDown 1s ease-in-out both;
}
.sl-trans-back-elems h2{
	-webkit-animation: fadeOut 1s ease-in-out both;
	-moz-animation: fadeOut 1s ease-in-out both;
	-o-animation: fadeOut 1s ease-in-out both;
	-ms-animation: fadeOut 1s ease-in-out both;
	animation: fadeOut 1s ease-in-out both;
}
.sl-trans-back-elems blockquote{
	-webkit-animation: fadeOut 1s linear both;
	-moz-animation: fadeOut 1s l


/C2敵中枢艦隊出現時",
		story = "POXIAOBINGHUA6",
		id = 1535,
		icon = "memory_poxiaobinghua",
		is_open = 0
	},
	[1536] = {
		mask = "bg/bg_cccpv2_2",
		subtitle = "",
		type = 1,
		title = "意外な収穫",
		condition = "A2/C2ボス撃破",
		story = "POXIAOBINGHUA7",
		id = 1536,
		icon = "memory_poxiaobinghua",
		is_open = 0
	},
	[1537] = {
		mask = "bg/bg_cccpv2_2",
		subtitle = "",
		type = 1,
		title = "潜水指揮艦",
		condition = "A2/C2クリア",
		story = "POXIAOBINGHUA8",
		id = 1537,
		icon = "memory_poxiaobinghua",
		is_open = 0
	},
	[1538] = {
		mask = "bg/bg_cccpv2_2",
		subtitle = "",
		type = 1,
		title = "ミラー・アンダー・シー",
		condition = "A3/C3開始",
		story = "POXIAOBINGHUA9",
		id = 1538,
		icon = "memory_poxiaobinghua",
		is_open = 0
	},
	[1539] = {
		mask = "bg/bg_cccpv2_2",
		subtitle = "",
		type = 1,
		title = "避難所",
		condition = "A3/C3敵中枢艦隊出現時",
		story = "POXIAOBINGHUA10",
		id = 1539,
		icon = "memory_poxiaobinghua",
		is_open = 0
	},
	[1540] = {
		mask = "bg/bg_cccpv2_2",
		subtitle = "",
		type = 1,
		title = "防衛施設",
		condition = "A3/C3ボスに遭遇",
		story = "POXIAOBINGHUA11",
		id = 1540,
		icon = "memory_poxiaobinghua",
		is_open = 0
	},
	[1541] = {
		mask = "bg/bg_cccpv2_2",
		subtitle = "",
		type = 1,
		title = "渦巻",
		condition = "A3/C3ボス撃破1回",
		story = "POXIAOBINGHUA12",
		id = 1541,
		icon = "memory_poxiaobinghua",
		is_open = 0
	},
	[1542] = {
		mask = "bg/bg_cccpv2_2",
		subtitle = "",
		type = 1,
		title = "制御室",
		condition = "A3/C3ボス撃破2回",
		story = "POXIAOBINGHUA13",
		id = 1542,
		icon = "memory_poxiaobinghua",
		is_open = 0
	},
	[1543] = {
		mask = "bg/bg_cccpv2_2",
		subtitle = "",
		type = 1,
		title = "秘密都市",
		condition = "A3/C3クリア",
		story = "POXIAOBINGHUA14",
		id = 1543,
		icon = "memory_poxiaobinghua",
		is_open = 0
	},
	[1544] = {
		mask = "bg/bg_cccpv2_10",
		subtitle = "",
		type = 1,
		title = "ストリング・Ⅰ


change the line 15 of `output.py `

```
image_path = 'sample images/original images/21 original.png' # put the path of the image that you convert.
```
into the path of image file that you use.
You should use a grayscale line image.

then run `output.py `.
converted images will be output at `output/ `.

You can select light model by change the line 13, 14  of `output.py ` into
```
model_path = "model/model_light.json"
weight_path = "model/weight_light.hdf5"
```
## License
The pre-trained models and the other files we have provided are licensed under the MIT License.
# iEDA User Guide

## Tool Preparation

### Environment

- Server Configuration
- Operating System: Ubuntu 20.04.5 LTS
- Process Environment: SkyWater PDK

### Compilation and Construction

```bash
# Download the iEDA repository
git clone https://gitee.com/oscc-project/iEDA.git iEDA && cd iEDA
# Install compilation dependencies via apt, root privileges required
sudo bash build.sh -i apt
# Compile iEDA
bash build.sh -j 16
# If "Hello iEDA!" is output normally, the compilation is successful
./bin/iEDA -script scripts/hello.tcl
```

Copy `./bin/iEDA` to the directory `./scripts/design/sky130_gcd`

```bash
# Copy iEDA to the sky130 directory
cp./bin/iEDA scripts/design/sky130_gcd/.
```

### Process File Preparation

Download SkyWater PDK
Copy the TechLEF file and LEF file to the directory `./scripts/foundry/sky130/lef`

```bash
# Copy the TechLEF file to the directory `./scripts/foundry/sky130/lef`
cp <skywater130pdk_tlef_path>/*.tlef scripts/foundry/sky130/lef/.
# Copy the LEF file to the directory `./scripts/foundry/sky130/lef`
cp <skywater130pdk_lef_path>/*.lef scripts/foundry/sky130/lef/.
```

Copy the Lib file to `./scripts/foundry/sky130/lib`

```bash
# Copy the Lib file to the directory `./scripts/foundry/sky130/lib`
cp <skywater130pdk_lib_path>/*.lib scripts/foundry/sky130/lib/.
```

Copy the sdc file to `./scripts/foundry/sky130/sdc`

```bash
# Copy the sdc file to the directory `./scripts/foundry/sky130/sdc`
cp <skywater130pdk_sdc_path>/*.sdc scripts/foundry/sky130/sdc/.
```

### Design File Preparation

Copy the `.v` Netlist file to the directory `scripts/design/sky130_gcd/result/verilog`

```bash
# Copy the `.v` file to the directory `./scripts/design/sky130_gcd/result/verilog`
cp <skywater130pdk_verilog_path>/gcd.v scripts/design/sky130_gcd/result/verilog/.
```

## Tool Flow

This document takes running the physical backend design flow of the skywater PDK 130nm process as an example to illustrate how to configure parameters, run, and analyze the results of each point tool of iEDA.

### Module Division

```
scripts
├── design                   # iEDA flows for different designs
│   ├── ispd18               # tbd
│   └── sky130_gcd           # flow of gcd in sky130
│       ├── iEDA
│       ├── iEDA_config      # iEDA parameters configuration files
│       ├── README.md
│       ├── result           # iEDA result output files
│       ├── run_iEDA_gui.py  # Python3 script for running all iEDA flow with GUI layout
│       ├── run_iEDA.py      # Python


 perimeter = this.test3.reduce(this.getArraySum)/2;
      let area =  Math.sqrt(perimeter*((perimeter-side1)*(perimeter-side2)*(perimeter-side3)));
      this.answer3 = String(area);
    } else {
      this.answer3 = 'Invalid Triangle.';
    }
  }

  private getArraySum(total, num){
      return total + num;
  }

  private isTriangle(sides): boolean {
    let isTrianlge = true;
    sides.forEach((side, index, array) => {
      if (side <= 0){
        isTrianlge = false;
      };
      let nextSide = array.slice();
      nextSide.splice(index, 1);
      if (side >= nextSide.reduce((a, b) => {return a + b})) {
        isTrianlge = false;
      }
    });
    return isTrianlge;
  }
  `;
  private question4 = `
  private findMostCommonNumbers(){
    let keepCount = {};
    this.test4.forEach(function (a) {
      keepCount[a] = (keepCount[a] || 0) + 1;
    });
    let countObjects = Object.keys(keepCount).reduce(function (r, k, i) {
        if (!i || keepCount[k] > keepCount[r[0]]) {
            return [k];
        }
        if (keepCount[k] === keepCount[r[0]]) {
            r.push(k);
        }
        return r;
    }, []);
    this.answer4 = String(countObjects);
  }`;
  private answer1: Array<string> = [];
  private test1: Array<any> = [null, undefined, '', 'Am I a string?'];
  private answer2: Array<any> = [];
  private test2: any = 60;
  private answer3: string;
  private test3: Array<any> = [3, 4, 5];
  private answer4: string;
  private test4: Array<any> = [5, 4, 3, 2, 4, 5, 1, 6, 1, 2, 5, 4];
  constructor() { }

  private runStringCheck(): void {
    let i;
    let testDisplay = [];
    for (i = 0; i < this.test1.length; i++) {
      let test = this.checkNullOrEmpty(this.test1[i]);
      let testName = this.test1[i];
      let testNameEval = String(testName) == '' ? 'Empty String' : String(testName);
      let testResult = testNameEval + ': ' + test;
      testDisplay.push(testResult);
    }
    this.answer1 = testDisplay;
  }

  private checkNullOrEmpty(value: string): string {
    if (!!value) {
      return 'You are a valid string!'
    } else {
      return 'You are not a valid string!'
    }
  }

  private runDivisorsGenerate(): void {
    let testDisplay = [];
    let c = 0;
    let i;
    for (i = 1; i <= this.test2; i++) {
      c = this.test2 / i;
      if (c === Math.floor(c)) {
        testDisplay.push(i);
      }
    }
    this.answer2 = testDisplay;
  }

  private calculateTriangle(): void {
    if (this.isTriangle(this.test3)) {
      let side1 = this.test3[0];
      let side2 = this.test3[1];
      let side3 = this.test3[2];
      let perimeter = this.test3.reduce(this.getArraySum) / 2;
      let area = Math.sqrt(perimeter * ((perimeter - side1) * (perimeter - side2) * (perimeter - side3)));
      this.answer3 = String(area);
    } else {
      this.answer3 = 'Invalid Triangle.';
    }
  }

  private getArraySum(total, num) {
    return total + num;
  }

  private isTriangle(sides): boolean {
    let isTrianlge = true;
    sides.forEach((side, index, array) => {
      if (side <= 0) {
        isTrianlge = false;
      };


ProcAddress( hDLL, "ADL2_AdapterX2_Caps");
		ADL2_Adapter_ConnectionState_Get = (ADL2_ADAPTER_CONNECTIONSTATE_GET) GetProcAddress (hDLL, "ADL2_Adapter_ConnectionState_Get");
		ADL2_Adapter_ConnectionData_Get = (ADL2_ADAPTER_CONNECTIONDATA_GET) GetProcAddress(hDLL, "ADL2_Adapter_ConnectionData_Get");
		ADL2_Adapter_ConnectionData_Set = (ADL2_ADAPTER_CONNECTIONDATA_SET) GetProcAddress(hDLL, "ADL2_Adapter_ConnectionData_Set");
		ADL2_Adapter_SupportedConnections_Get = (ADL2_ADAPTER_SUPPORTEDCONNECTIONS_GET) GetProcAddress(hDLL, "ADL2_Adapter_SupportedConnections_Get");
		ADL2_Adapter_EmulationMode_Set = (ADL2_ADAPTER_EMULATIONMODE_SET) GetProcAddress( hDLL,"ADL2_Adapter_EmulationMode_Set");
		ADL2_Adapter_ConnectionData_Remove = (ADL2_ADAPTER_CONNECTIONDATA_REMOVE) GetProcAddress (hDLL, "ADL2_Adapter_ConnectionData_Remove");
		ADL2_Adapter_BoardLayout_Get = (ADL2_ADAPTER_BOARDLAYOUT_GET) GetProcAddress (hDLL, "ADL2_Adapter_BoardLayout_Get");
		ADL2_Display_EdidData_Get = (ADL2_DISPLAY_EDIDDATA_GET) GetProcAddress(hDLL, "ADL2_Display_EdidData_Get");
		if ( NULL == ADL2_Main_Control_Create ||
			 NULL == ADL2_Main_Control_Destroy ||
			 NULL == ADL2_Adapter_NumberOfAdapters_Get||
			 NULL == ADL2_Adapter_AdapterInfo_Get ||
			 NULL == ADL2_Adapter_EDIDManagement_Caps ||
			 NULL == ADL2_AdapterX2_Caps ||
			 NULL == ADL2_Adapter_ConnectionState_Get ||
			 NULL == ADL2_Adapter_ConnectionData_Get ||
			 NULL == ADL2_Adapter_ConnectionData_Set ||
			 NULL == ADL2_Adapter_SupportedConnections_Get ||
			 NULL == ADL2_Adapter_EmulationMode_Set ||
			 NULL == ADL2_Adapter_ConnectionData_Remove ||
			 NULL == ADL2_Adapter_BoardLayout_Get ||
			 NULL == ADL2_Display_EdidData_Get)
		{
			PRINTF("Failed to get ADL function pointers\n");
			return FALSE;
		}
	}
	if ( ADL_OK != ADL2_Main_Control_Create (ADL_Main_Memory_Alloc, 1, &context) )
	{
		PRINTF("ADL2_Main_Control_Create() failed\n");
		return FALSE;
	}

	return TRUE;
}

void deinitializeADL()
{
    FreeLibrary(hDLL);
}

int printAdapaterInfo()
{
	int  iNumberAdapters, iNumberofPorts = 0;
	int iAdapterIndex =0, i=0, j=0, k=0,iGPUIndex=0, iGPUfound=0, iBusNumber,iGPUCounter = 0, slotIndex=-1;
	int iEDIDSupported = 0;
	int igpuBusIndexes[4];
	int iValidFlags,iNumofSlots, iNumofConnectors;
	ADLBracketSlotInfo* barcketSlotInfo;
	ADLConnectorInfo* connectorInfo;

	LPAdapterInfo     lpAdapterInfo = NULL;
	// Obtain the number of adapters for the system
    if ( ADL_OK != ADL2_Adapter_NumberOfAdapters_Get (context, &iNumberAdapters ) )
	{
	       PRINTF("Cannot get the number of adapters!\n");
		   return 0;
	}

    if ( 0 < iNumberAdapters )
    {
        lpAdapterInfo = (LPAdapterInfo)malloc ( sizeof (AdapterInfo) *


;\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(windowCoord);\neyeCoordinate.w = 1.0 / depthFromCamera;\nreturn eyeCoordinate;\n#else\nvec4 windowCoord = vec4(fragmentCoordinateXY, depthOrLogDepth, 1.0);\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(windowCoord);\n#endif\nreturn eyeCoordinate;\n}\n",czm_writeDepthClamp="#if defined(GL_EXT_frag_depth) && !defined(LOG_DEPTH)\nvarying float v_WindowZ;\n#endif\nvoid czm_writeDepthClamp()\n{\n#if defined(GL_EXT_frag_depth) && !defined(LOG_DEPTH)\ngl_FragDepthEXT = clamp(v_WindowZ * gl_FragCoord.w, 0.0, 1.0);\n#endif\n}\n",czm_writeLogDepth="#ifdef LOG_DEPTH\nvarying float v_depthFromNearPlusOne;\n#ifdef POLYGON_OFFSET\nuniform vec2 u_polygonOffset;\n#endif\n#endif\nvoid czm_writeLogDepth(float depth)\n{\n#if defined(GL_EXT_frag_depth) && defined(LOG_DEPTH)\nif (depth <= 0.9999999 || depth > czm_farDepthFromNearPlusOne) {\ndiscard;\n}\n#ifdef POLYGON_OFFSET\nfloat factor = u_polygonOffset[0];\nfloat units = u_polygonOffset[1];\n#ifdef GL_OES_standard_derivatives\nfloat x = dFdx(depth);\nfloat y = dFdy(depth);\nfloat m = sqrt(x * x + y * y);\ndepth += m * factor;\n#endif\n#endif\ngl_FragDepthEXT = log2(depth) * czm_oneOverLog2FarDepthFromNearPlusOne;\n#ifdef POLYGON_OFFSET\ngl_FragDepthEXT += czm_epsilon7 * units;\n#endif\n#endif\n}\nvoid czm_writeLogDepth() {\n#ifdef LOG_DEPTH\nczm_writeLogDepth(v_depthFromNearPlusOne);\n#endif\n}\n",czm_writeNonPerspective="float czm_writeNonPerspective(float value, float w) {\nreturn value * w;\n}\nvec2 czm_writeNonPerspective(vec2 value, float w) {\nreturn value * w;\n}\nvec3 czm_writeNonPerspective(vec3 value, float w) {\nreturn value * w;\n}\nvec4 czm_writeNonPerspective(vec4 value, float w) {\nreturn value * w;\n}\n",czm_XYZToRGB="vec3 czm_XYZToRGB(vec3 Yxy)\n{\nconst mat3 XYZ2RGB = mat3( 3.2405, -0.9693,  0.0556,\n-1.5371,  1.8760, -0.2040,\n-0.4985,  0.0416,  1.0572);\nvec3 xyz;\nxyz.r = Yxy.r * Yxy.g / Yxy.b;\nxyz.g = Yxy.r;\nxyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b;\nreturn XYZ2RGB * xyz;\n}\n",CzmBuiltins={czm_degreesPerRadian:czm_degreesPerRadian,czm_depthRange:czm_depthRange,czm_epsilon1:czm_epsilon1,czm_epsilon2:czm_epsilon2,czm_epsilon3:czm_epsilon3,czm_epsilon4:czm_epsilon4,czm_epsilon5:czm_epsilon5,czm_epsilon6:czm_epsilon6,czm_epsilon7:czm_epsilon7,czm_infinity:czm_infinity,czm_oneOverPi:czm_oneOverPi,czm_oneOverTwoPi:czm_oneOverTwoPi,czm_passCesium3DTile:czm_passCesium3DTile,czm_passCesium3DTileClassification:czm_


ITY, 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.

import 'package:expect/expect.dart';

import 'v8_regexp_utils.dart';

void main() {
  void t(RegExp re, String s) {
    assertTrue(re.hasMatch(s));
  }

  void f(RegExp re, String s) {
    assertFalse(re.hasMatch(s));
  }

  assertThrows(() => RegExp("\\p{Hiragana}", unicode: true));
  assertThrows(() => RegExp("\\p{Bidi_Class}", unicode: true));
  assertThrows(() => RegExp("\\p{Bidi_C=False}", unicode: true));
  assertThrows(() => RegExp("\\P{Bidi_Control=Y}", unicode: true));
  assertThrows(() => RegExp("\\p{AHex=Yes}", unicode: true));

  assertThrows(() => RegExp("\\p{Composition_Exclusion}", unicode: true));
  assertThrows(() => RegExp("\\p{CE}", unicode: true));
  assertThrows(() => RegExp("\\p{Full_Composition_Exclusion}", unicode: true));
  assertThrows(() => RegExp("\\p{Comp_Ex}", unicode: true));
  assertThrows(() => RegExp("\\p{Grapheme_Link}", unicode: true));
  assertThrows(() => RegExp("\\p{Gr_Link}", unicode: true));
  assertThrows(() => RegExp("\\p{Hyphen}", unicode: true));
  assertThrows(() => RegExp("\\p{NFD_Inert}", unicode: true));
  assertThrows(() => RegExp("\\p{NFDK_Inert}", unicode: true));
  assertThrows(() => RegExp("\\p{NFC_Inert}", unicode: true));
  assertThrows(() => RegExp("\\p{NFKC_Inert}", unicode: true));
  assertThrows(() => RegExp("\\p{Segment_Starter}", unicode: true));

  t(RegExp(r"\p{Alphabetic}", unicode: true), "æ");
  f(RegExp(r"\p{Alpha}", unicode: true), "1");

  t(RegExp(r"\p{ASCII_Hex_Digit}", unicode: true), "f");
  f(RegExp(r"\p{AHex}", unicode: true), "g");

  t(RegExp(r"\p{Bidi_Control}", unicode: true), "\u200e");
  f(RegExp(r"\p{Bidi_C}", unicode: true), "g");

  t(RegExp(r"\p{Bidi_Mirrored}", unicode: true), "(");
  f(RegExp(r"\p{Bidi_M}", unicode: true), "-");

  t(RegExp(r"\p{Case_Ignorable}", unicode: true), "\u02b0");
  f(RegExp(r"\p{CI}", unicode: true), "a");

  t(RegExp(r"\p{Changes_When_Casefolded}", unicode: true), "B");
  f(RegExp(r"\p{CWCF}", unicode: true), "1");

  t(RegExp(r"\p{Changes_When_Casemapped}", unicode: true), "b");
  f(RegExp(r"\p{CWCM}", unicode: true), "1");

  t(RegExp(r"\p{Changes_When_Lowercased}", unicode: true), "B");
  f(RegExp(r"\p{CWL}", unicode: true), "1");

  t(RegExp(r"\p{Changes_When_Titlecased}", unicode: true), "b");
  f(RegExp(r"\p{CWT}", unicode: true), "1");

  t(RegExp(r"\p{Changes_When_Uppercased}", unicode: true), "b");
  f(RegExp(r"\p{CWU}", unicode: true), "1");

  t(RegExp(r"\p{Dash}", unicode: true), "-");
  f(RegExp(r"\p{Dash}", unicode: true), "1");

  t(RegExp(r"\p{Default_Ignorable_Code_Point}", unicode: true), "\u00ad");
  f(RegExp(r"\p{DI}", unicode: true), "1");

  t(RegExp(r"\p{Deprecated}", unicode: true), "\u17a3");
  f(RegExp(r"\p{Dep}", unicode: true), "1");

  t(RegExp(r"\p{Diacritic}", unicode: true), "\u0301");
  f(RegExp(r"\p{Dia}", unicode: true), "1");

  t(RegExp(r"\p{Emoji}", unicode: true), "\u2603");
  f(RegExp(r"\p{Emoji}", unicode: true), "x");

  t(RegExp(r"\p{Emoji_Component}", unicode: true), "\u{1


// ***************************************************************************************
// Copyright (c) 2023-2025 Peng Cheng Laboratory
// Copyright (c) 2023-2025 Institute of Computing Technology, Chinese Academy of Sciences
// Copyright (c) 2023-2025 Beijing Institute of Open Source Chip
//
// iEDA is licensed under Mulan PSL v2.
// You can use this software according to the terms and conditions of the Mulan PSL v2.
// You may obtain a copy of Mulan PSL v2 at:
// http://license.coscl.org.cn/MulanPSL2
//
// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
//
// See the Mulan PSL v2 for more details.
// ***************************************************************************************
#pragma once

#include <any>
#include <fstream>
#include <iostream>
#include <map>
#include <string>

#include "ScriptEngine.hh"
#include "tcl_definition.h"

namespace tcl {

using ieda::ScriptEngine;
using ieda::TclCmd;
using ieda::TclCmds;
using ieda::TclDoubleListOption;
using ieda::TclDoubleOption;
using ieda::TclIntListOption;
using ieda::TclIntOption;
using ieda::TclOption;
using ieda::TclStringListOption;
using ieda::TclStringOption;
using ieda::TclSwitchOption;

class TclFpInit : public TclCmd
{
 public:
  explicit TclFpInit(const char* cmd_name);
  ~TclFpInit() override = default;

  unsigned check();
  unsigned exec();
};

class TclFpMakeTracks : public TclCmd
{
 public:
  explicit TclFpMakeTracks(const char* cmd_name);
  ~TclFpMakeTracks() override = default;

  unsigned check() override;
  unsigned exec() override;

 private:
  // private function
  // private data
};

class TclFpPlacePins : public TclCmd
{
 public:
  explicit TclFpPlacePins(const char* cmd_name);
  ~TclFpPlacePins() override = default;

  unsigned check();
  unsigned exec();
};

class TclFpPlacePort : public TclCmd
{
 public:
  explicit TclFpPlacePort(const char* cmd_name);
  ~TclFpPlacePort() override = default;

  unsigned check();
  unsigned exec();
};

class TclFpPlaceIOFiller : public TclCmd
{
 public:
  explicit TclFpPlaceIOFiller(const char* cmd_name);
  ~TclFpPlaceIOFiller() override = default;

  unsigned check();
  unsigned exec();
};

class TclFpAutoPlaceIO : public TclCmd
{
 public:
  explicit TclFpAutoPlaceIO(const char* cmd_name);
  ~TclFpAutoPlaceIO() override = default;

  unsigned check();
  unsigned exec();
};

class TclFpAddPlacementBlockage : public TclCmd
{
 public:
  explicit TclFpAddPlacementBlockage(const char* cmd_name);
  ~TclFpAddPlacementBlockage() override = default;

  unsigned check();
  unsigned exec();
};

class TclFpAddPlacementHalo : public TclCmd
{
 public:
  explicit TclFpAddPlacementHalo(const char* cmd_name);
  ~TclFpAddPlacementHalo() override = default;

  unsigned check();
  unsigned exec();
};

class TclFpAddRoutingBlockage : public TclCmd
{
 public:
  explicit TclFpAddRoutingBlockage(const char* cmd_name);
  ~TclFpAddRoutingBlockage() override = default;

  unsigned check();
  unsigned exec();
};

class TclFpAddRoutingHalo : public TclCmd
{
 public:
  explicit TclFpAddRoutingHalo(const char* cmd_name);
  ~TclFpAddRoutingHalo() override = default;

  unsigned check();
  unsigned exec();
};

class TclFpTapCell : public TclCmd
{
 public:
  explicit TclFpTapCell(const char* cmd_name);
  ~TclFpTapCell() override = default;

  unsigned check();
  unsigned exec();
};

}  // namespace tcl


1Point(alpha)));
        }
        assertEquals(1, set.asList().size());
        assertEquals(0.0, set.asList().get(0).getInf(), 1.0e-10);
        assertEquals(2 * FastMath.PI, set.asList().get(0).getSup(), 1.0e-10);
        assertEquals(2 * FastMath.PI, set.getSize(), 1.0e-10);
        assertEquals(Location.INSIDE, set.checkPoint(set.getInteriorPoint()));
    }

    @Test
    void testFullCircle() {
        ArcsSet set = new ArcsSet(1.0e-10);
        assertEquals(1.0e-10, set.getTolerance(), 1.0e-20);
        assertEquals(Region.Location.INSIDE, set.checkPoint(new S1Point(9.0)));
        for (double alpha = -20.0; alpha <= 20.0; alpha += 0.1) {
            assertEquals(Region.Location.INSIDE, set.checkPoint(new S1Point(alpha)));
        }
        assertEquals(1, set.asList().size());
        assertEquals(0.0, set.asList().get(0).getInf(), 1.0e-10);
        assertEquals(2 * FastMath.PI, set.asList().get(0).getSup(), 1.0e-10);
        assertEquals(2 * FastMath.PI, set.getSize(), 1.0e-10);
        assertEquals(Location.INSIDE, set.checkPoint(set.getInteriorPoint()));
    }

    @Test
    void testEmpty() {
        ArcsSet empty = (ArcsSet) new RegionFactory<Sphere1D, S1Point, LimitAngle, SubLimitAngle>().getComplement(new ArcsSet(1.0e-10));
        assertEquals(1.0e-10, empty.getTolerance(), 1.0e-20);
        assertEquals(0.0, empty.getSize(), 1.0e-10);
        assertTrue(empty.asList().isEmpty());
        assertNull(empty.getInteriorPoint());
    }

    @Test
    void testTiny() {
        ArcsSet tiny = new ArcsSet(0.0, Precision.SAFE_MIN / 2, 1.0e-10);
        assertEquals(1.0e-10, tiny.getTolerance(), 1.0e-20);
        assertEquals(Precision.SAFE_MIN / 2, tiny.getSize(), 1.0e-10);
        assertEquals(1, tiny.asList().size());
        assertEquals(0.0, tiny.asList().get(0).getInf(), 1.0e-10);
        assertEquals(Precision.SAFE_MIN / 2, tiny.asList().get(0).getSup(), 1.0e-10);
        assertEquals(Location.BOUNDARY, tiny.checkPoint(tiny.getInteriorPoint()));
    }

    @Test
    void testSpecialConstruction() {
        List<SubLimitAngle> boundary = new ArrayList<>();
        boundary.add(new LimitAngle(new S1Point(0.0), false, 1.0e-10).wholeHyperplane());
        boundary.add(new LimitAngle(new S1Point(MathUtils.TWO_PI - 1.0e-11), true, 1.0e-10).wholeHyperplane());
        ArcsSet set = new ArcsSet(boundary, 1.0e-10);
        assertEquals(MathUtils.TWO_PI, set.getSize(), 1.0e-10);
        assertEquals(1.0e-10, set.getTolerance(), 1.0e-20);
        assertEquals(1, set.asList().size());
        assertEquals(0.0, set.asList().get(0).getInf(), 1.0e-10);
        assertEquals(MathUtils.TWO_PI, set.asList().get(0).getSup(), 1.0e-10);
        assertEquals(Location.INSIDE, set.checkPoint(set.getInteriorPoint()));
    }

    @Test
    void testDifference() {

        ArcsSet a   = new ArcsSet(1.0, 6.0, 1.0e-10);
        List<Arc> aList = a.asList();
        assertEquals(1,   aList.size());
        assertEquals(1.0,


	) -> DispatchResult {
		unimplemented!("Used as a mock, shouldn't be called")
	}

	fn account_for_simple_transfer(
		_from: AccountId,
		_to: AccountId,
		_amount: CoinAmount,
	) -> Result {
		unimplemented!("Used as a mock, shouldn't be called")
	}

	fn account_for_fees(_f: CoinAmount, _p: AccountId) -> DispatchResult {
		unimplemented!("Used as a mock, shouldn't be called")
	}

	// fn account_for_burnt_fees(_f: CoinAmount, _p: AccountId) -> DispatchResult {
	// 	unimplemented!("Used as a mock, shouldn't be called")
	// }

	// fn distribute_fees_rewards(_f: CoinAmount, _p: AccountId) -> DispatchResult {
	// 	unimplemented!("Used as a mock, shouldn't be called")
	// }

	fn get_escrow_account() -> AccountId {
		unimplemented!("Used as a mock, shouldn't be called")
	}

	fn get_netfees_account() -> AccountId {
		unimplemented!("Used as a mock, shouldn't be called")
	}

	fn get_pseudo_random_hash(_s: AccountId, _r: AccountId) -> Hash {
		unimplemented!("Used as a mock, shouldn't be called")
	}
}
use serde::{Deserialize, Serialize};
use std::error::Error;
use std::fmt;

pub mod issue_or_pr;
pub mod issues_with_label;

#[derive(Clone, Deserialize, Eq, Hash, PartialEq, Serialize)]
pub struct Repo {
    pub owner: String,
    pub name: String,
}

impl Repo {
    pub fn new(owner: &str, name: &str) -> Self {
        Self {
            owner: owner.to_string(),
            name: name.to_string(),
        }
    }
}

#[derive(Debug)]
struct QueryError {
    name: &'static str,
    errors: Vec<graphql_client::Error>,
}

impl fmt::Display for QueryError {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        writeln!(f, "query '{}' fails:", self.name)?;
        for error in self.errors.iter() {
            writeln!(f, "{}", error)?;
        }
        Ok(())
    }
}

impl Error for QueryError {}
<reponame>nwtnni/advent-of-code
use std::collections::HashMap;

use aoc::*;

#[derive(Clone, Debug)]
pub struct AuntSue(Vec<HashMap<String, i64>>);

impl Fro for AuntSue {
    fn fro(input: &str) -> Self {
        input
            .trim()
            .split('\n')
            .filter_map(|line| {
                let (_, traits) = line.split_once(": ")?;
                traits
                    .split(", ")
                    .filter_map(|r#trait| r#trait.split_once(": "))
                    .map(|(r#trait, count)| (String::from(r#trait), i64::fro(count)))
                    .collect::<HashMap<_, _>>()
                    .tap(Option::Some)
            })
            .collect::<Vec<_>>()
            .tap(Self)
    }
}

fn needle() -> HashMap<String, i64> {
    let mut needle = HashMap::new();
    needle.insert(String::from("children"), 3);
    needle.insert(String::from("cats"), 7);
    needle.insert(String::from("samoyeds"), 2);
    needle.insert(String::from("pomeranians"), 3);
    needle.insert(String::from("akitas"), 0);
    needle.insert(String::from("vizslas"), 0);
    needle.insert(String::from("goldfish"), 5);
    needle.insert(String::from("trees"), 3);
    needle.insert(String::from("cars"), 2);
    needle.insert(String::fr


 = NULL;
  ScopeValue* owner_value = get_scope_value(jvmci_env()->get_StackLockValue_owner(value), T_OBJECT, objects, second, JVMCI_CHECK_NULL);
  assert(second == NULL, "monitor cannot occupy two stack slots");

  ScopeValue* lock_data_value = get_scope_value(jvmci_env()->get_StackLockValue_slot(value), T_LONG, objects, second, JVMCI_CHECK_NULL);
  assert(second == lock_data_value, "monitor is LONG value that occupies two stack slots");
  assert(lock_data_value->is_location(), "invalid monitor location");
  Location lock_data_loc = ((LocationValue*)lock_data_value)->location();

  bool eliminated = false;
  if (jvmci_env()->get_StackLockValue_eliminated(value)) {
    eliminated = true;
  }

  return new MonitorValue(owner_value, lock_data_loc, eliminated);
}

void CodeInstaller::initialize_dependencies(JVMCIObject compiled_code, OopRecorder* oop_recorder, JVMCI_TRAPS) {
  JavaThread* thread = JavaThread::current();
  CompilerThread* compilerThread = thread->is_Compiler_thread() ? thread->as_CompilerThread() : NULL;
  _oop_recorder = oop_recorder;
  _dependencies = new Dependencies(&_arena, _oop_recorder, compilerThread != NULL ? compilerThread->log() : NULL);
  JVMCIObjectArray assumptions = jvmci_env()->get_HotSpotCompiledCode_assumptions(compiled_code);
  if (assumptions.is_non_null()) {
    int length = JVMCIENV->get_length(assumptions);
    for (int i = 0; i < length; ++i) {
      JVMCIObject assumption = JVMCIENV->get_object_at(assumptions, i);
      if (assumption.is_non_null()) {
        if (jvmci_env()->isa_Assumptions_NoFinalizableSubclass(assumption)) {
          assumption_NoFinalizableSubclass(assumption);
        } else if (jvmci_env()->isa_Assumptions_ConcreteSubtype(assumption)) {
          assumption_ConcreteSubtype(assumption);
        } else if (jvmci_env()->isa_Assumptions_LeafType(assumption)) {
          assumption_LeafType(assumption);
        } else if (jvmci_env()->isa_Assumptions_ConcreteMethod(assumption)) {
          assumption_ConcreteMethod(assumption);
        } else if (jvmci_env()->isa_Assumptions_CallSiteTargetValue(assumption)) {
          assumption_CallSiteTargetValue(assumption, JVMCI_CHECK);
        } else {
          JVMCI_ERROR("unexpected Assumption subclass %s", jvmci_env()->klass_name(assumption));
        }
      }
    }
  }
  if (JvmtiExport::can_hotswap_or_post_breakpoint()) {
    JVMCIObjectArray methods = jvmci_env()->get_HotSpotCompiledCode_methods(compiled_code);
    if (methods.is_non_null()) {
      int length = JVMCIENV->get_length(methods);
      for (int i = 0; i < length; ++i) {
        JVMCIObject method_handle = JVMCIENV->get_object_at(methods, i);
        methodHandle method = jvmci_env()->asMethod(method_handle);
        _dependencies->assert_evol_method(method());
      }
    }
  }
}

#if INCLUDE_AOT
RelocBuffer::~RelocBuffer() {
  if (_buffer != NULL) {
    FREE_C_HEAP_ARRAY(char, _buffer, mtJVMCI);
  }
}

address RelocBuffer::begin() const {
  if (_buffer != NULL) {
    return (address) _buffer;
  }
  return (address) _static_buff


    ssl_verify = opts.ssl_verify
            server_name = opts.server_name or host
        end

        if opts.headers then
            headers = opts.headers
            if type(headers) ~= "table" then
                return nil, "custom headers must be a table"
            end
        end
    end

    local ok, err
    if sock_opts then
        ok, err = sock:connect(host, port, sock_opts)
    else
        ok, err = sock:connect(host, port)
    end
    if not ok then
        return nil, "failed to connect: " .. err
    end

    if scheme == "wss" then
        if not ssl_support then
            return nil, "ngx_lua 0.9.11+ required for SSL sockets"
        end
        if client_cert then
            ok, err = sock:setclientcert(client_cert, client_priv_key)
            if not ok then
                return nil, "failed to set TLS client certificate: " .. err
            end
        end
        ok, err = sock:sslhandshake(false, server_name, ssl_verify)
        if not ok then
            return nil, "ssl handshake failed: " .. err
        end
    end

    -- check for connections from pool:

    local count, err = sock:getreusedtimes()
    if not count then
        return nil, "failed to get reused times: " .. err
    end
    if count > 0 then
        -- being a reused connection (must have done handshake)
        return 1
    end

    local custom_headers
    if headers then
        custom_headers = concat(headers, "\r\n")
        custom_headers = "\r\n" .. custom_headers
    end

    -- do the websocket handshake:

    local bytes = char(rand(256) - 1, rand(256) - 1, rand(256) - 1,
                       rand(256) - 1, rand(256) - 1, rand(256) - 1,
                       rand(256) - 1, rand(256) - 1, rand(256) - 1,
                       rand(256) - 1, rand(256) - 1, rand(256) - 1,
                       rand(256) - 1, rand(256) - 1, rand(256) - 1,
                       rand(256) - 1)

    local key = encode_base64(bytes)
    local req = "GET " .. path .. " HTTP/1.1\r\nUpgrade: websocket\r\nHost: "
                .. host .. ":" .. port
                .. "\r\nSec-WebSocket-Key: " .. key
                .. (proto_header or "")
                .. "\r\nSec-WebSocket-Version: 13"
                .. (origin_header or "")
                .. "\r\nConnection: Upgrade"
                .. (custom_headers or "")
                .. "\r\n\r\n"

    local bytes, err = sock:send(req)
    if not bytes then
        return nil, "failed to send the handshake request: " .. err
    end

    local header_reader = sock:receiveuntil("\r\n\r\n")
    -- FIXME: check for too big response headers
    local header, err, partial = header_reader()
    if not header then
        return nil, "failed to receive response header: " .. err
    end

    -- error("header: " .. header)

    -- FIXME: verify the response headers

    m, err = re_match(header, [[^\s*HTTP/1\.1\s+]], "jo")
    if not m then
        return nil, "bad HTTP response status line: " .. header
    end

    return 1
end

function _M.set_timeout(self, time)
    local sock = self.sock
    if not sock then
        return nil, nil, "not initialized yet"
    end

    return sock:settimeout(time)
end

function _M.recv_frame(self)
    if self.fatal then
        return nil, nil, "fatal error already happened"
    end


4  90 01 00 40 */	stw r0, 0x40(r1)
/* 8014C158 00147DB8  EC 60 20 28 */	fsubs f3, f0, f4
/* 8014C15C 00147DBC  C0 21 00 20 */	lfs f1, 0x20(r1)
/* 8014C160 00147DC0  C0 41 00 28 */	lfs f2, 0x28(r1)
/* 8014C164 00147DC4  38 00 FF 00 */	li r0, -256
/* 8014C168 00147DC8  88 7F 00 11 */	lbz r3, 0x11(r31)
/* 8014C16C 00147DCC  FC 00 08 1E */	fctiwz f0, f1
/* 8014C170 00147DD0  FC 60 18 1E */	fctiwz f3, f3
/* 8014C174 00147DD4  7C 68 03 78 */	or r8, r3, r0
/* 8014C178 00147DD8  EC 42 08 28 */	fsubs f2, f2, f1
/* 8014C17C 00147DDC  D8 01 00 50 */	stfd f0, 0x50(r1)
/* 8014C180 00147DE0  C8 22 8E 58 */	lfd f1, lbl_80641458-_SDA2_BASE_(r2)
/* 8014C184 00147DE4  38 60 2A 3B */	li r3, 0x2a3b
/* 8014C188 00147DE8  D8 61 00 30 */	stfd f3, 0x30(r1)
/* 8014C18C 00147DEC  FC 00 10 1E */	fctiwz f0, f2
/* 8014C190 00147DF0  80 A1 00 54 */	lwz r5, 0x54(r1)
/* 8014C194 00147DF4  80 01 00 34 */	lwz r0, 0x34(r1)
/* 8014C198 00147DF8  D8 01 00 38 */	stfd f0, 0x38(r1)
/* 8014C19C 00147DFC  7C 06 07 34 */	extsh r6, r0
/* 8014C1A0 00147E00  7C 84 30 50 */	subf r4, r4, r6
/* 8014C1A4 00147E04  80 E1 00 3C */	lwz r7, 0x3c(r1)
/* 8014C1A8 00147E08  54 80 0F FE */	srwi r0, r4, 0x1f
/* 8014C1AC 00147E0C  7C 00 22 14 */	add r0, r0, r4
/* 8014C1B0 00147E10  7C E7 07 34 */	extsh r7, r7
/* 8014C1B4 00147E14  7C 00 0E 70 */	srawi r0, r0, 1
/* 8014C1B8 00147E18  6C 00 80 00 */	xoris r0, r0, 0x8000
/* 8014C1BC 00147E1C  90 01 00 44 */	stw r0, 0x44(r1)
/* 8014C1C0 00147E20  C8 01 00 40 */	lfd f0, 0x40(r1)
/* 8014C1C4 00147E24  EC 00 08 28 */	fsubs f0, f0, f1
/* 8014C1C8 00147E28  EC 04 00 2A */	fadds f0, f4, f0
/* 8014C1CC 00147E2C  FC 00 00 1E */	fctiwz f0, f0
/* 8014C1D0 00147E30  D8 01 00 48 */	stfd f0, 0x48(r1)
/* 8014C1D4 00147E34  80 81 00 4C */	lwz r4, 0x4c(r1)
/* 8014C1D8 00147E38  48 10 3F 5D */	bl func_80250134