------------------------------------------- */
U_CDECL_BEGIN
static void  U_CALLCONV
_UTF16LEFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs,
                               UErrorCode *pErrorCode) {
    UConverter *cnv;
    const UChar *source;
    char *target;
    int32_t *offsets;

    uint32_t targetCapacity, length, sourceIndex;
    UChar c, trail;
    char overflow[4];

    source=pArgs->source;
    length=(int32_t)(pArgs->sourceLimit-source);
    if(length<=0) {
        /* no input, nothing to do */
        return;
    }

    cnv=pArgs->converter;

    /* write the BOM if necessary */
    if(cnv->fromUnicodeStatus==UCNV_NEED_TO_WRITE_BOM) {
        static const char bom[]={ (char)0xffu, (char)0xfeu };
        ucnv_fromUWriteBytes(cnv,
                             bom, 2,
                             &pArgs->target, pArgs->targetLimit,
                             &pArgs->offsets, -1,
                             pErrorCode);
        cnv->fromUnicodeStatus=0;
    }

    target=pArgs->target;
    if(target >= pArgs->targetLimit) {
        *pErrorCode=U_BUFFER_OVERFLOW_ERROR;
        return;
    }

    targetCapacity=(uint32_t)(pArgs->targetLimit-pArgs->target);
    offsets=pArgs->offsets;
    sourceIndex=0;

    /* c!=0 indicates in several places outside the main loops that a surrogate was found */

    if((c=(UChar)cnv->fromUChar32)!=0 && U16_IS_TRAIL(trail=*source) && targetCapacity>=4) {
        /* the last buffer ended with a lead surrogate, output the surrogate pair */
        ++source;
        --length;
        target[0]=(uint8_t)c;
        target[1]=(uint8_t)(c>>8);
        target[2]=(uint8_t)trail;
        target[3]=(uint8_t)(trail>>8);
        target+=4;
        targetCapacity-=4;
        if(offsets!=NULL) {
            *offsets++=-1;
            *offsets++=-1;
            *offsets++=-1;
            *offsets++=-1;
        }
        sourceIndex=1;
        cnv->fromUChar32=c=0;
    }

    if(c==0) {
        /* copy an even number of bytes for complete UChars */
        uint32_t count=2*length;
        if(count>targetCapacity) {
            count=targetCapacity&~1;
        }
        /* count is even */
        targetCapacity-=count;
        count>>=1;
        length-=count;

        if(offsets==NULL) {
            while(count>0) {
                c=*source++;
                if(U16_IS_SINGLE(c)) {
                    target[0]=(uint8_t)c;
                    target[1]=(uint8_t)(c>>8);
                    target+=2;
                } else if(U16_IS_SURROGATE_LEAD(c) && count>=2 && U16_IS_TRAIL(trail=*source)) {
                    ++source;
                    --count;
                    target[0]=(uint8_t)c;
                    target[1]=(uint8_t)(c>>8);
                    target[2]=(uint8_t)trail;
                    target[3]=(uint8_t)(trail>>8);
                    target+=4;
                } else {
                    break;
                }
                --count;
            }
        } else {


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

int i1[2048] ALIGNED16;
int o[2048] ALIGNED16;

__attribute__((noinline))
void example4c (){
   int i;
    const int MAX = 4;
   /* feature: support for if-conversion  */
   for (i=0; i<2048-1; i+=2){
      int j = i1[i];
      o[i] = (j > MAX ? MAX : 0);
      o[i+1] = j;
   }
}

int main(int argc,char* argv[]){
  init_memory(&i1[0], &i1[2048]);
  init_memory(&o[0], &o[2048]);
  BENCH("Example4c",  example4c(), Mi*4/2048*512, digest_memory(&o[0], &o[2048]));

  return 0;
}


ct Pos;
#[inline]
pub fn pos() -> Pos {
    Pos
}
impl<I: Input, C, S, M: Cb> ParserOnce<I, I::Pos, C, S, M> for Pos {
    #[inline]
    fn run_once(self, cont: ICont<I, C, S, M>) -> IResult<I::Pos, I, S, M> {
        self.run(cont)
    }
}
impl<I: Input, C, S, M: Cb> Parser<I, I::Pos, C, S, M> for Pos {
    #[inline]
    fn run(&self, cont: ICont<I, C, S, M>) -> IResult<I::Pos, I, S, M> {
        let ICont { ok, .. } = cont;
        Ok((ok.input.pos(), ok))
    }
}

#[derive(Clone, Copy)]
pub struct State<F>(F);
#[inline]
pub fn state<F>(f: F) -> State<F> {
    State(f)
}
impl<I: Input, C, S, M: Cb, F: FnOnce(S) -> S> ParserOnce<I, (), C, S, M> for State<F> {
    #[inline]
    fn run_once(self, cont: ICont<I, C, S, M>) -> IResult<(), I, S, M> {
        let IOk { input, err, state, cutted, .. } = cont.ok;
        Ok(((), IOk { input, state: self.0(state), err, cutted }))
    }
}
impl<I: Input, C, S, M: Cb, F: Fn(S) -> S> Parser<I, (), C, S, M> for State<F> {
    #[inline]
    fn run(&self, cont: ICont<I, C, S, M>) -> IResult<(), I, S, M> {
        let IOk { input, err, state, cutted, .. } = cont.ok;
        Ok(((), IOk { input, state: self.0(state), err, cutted }))
    }
}

#[derive(Clone, Copy)]
pub struct GetState<F>(F);
#[inline]
pub fn get_state<F>(f: F) -> GetState<F> {
    GetState(f)
}
impl<I: Input, O, C, S, M: Cb, P: ParserOnce<I, O, C, S, M>, F: FnOnce(&S) -> P> ParserOnce<I, O, C, S, M>
    for GetState<F>
{
    #[inline]
    fn run_once(self, cont: ICont<I, C, S, M>) -> IResult<O, I, S, M> {
        self.0(&cont.ok.state).run_once(cont)
    }
}
impl<I: Input, O, C, S, M: Cb, P: ParserOnce<I, O, C, S, M>, F: Fn(&S) -> P> Parser<I, O, C, S, M> for GetState<F> {
    #[inline]
    fn run(&self, cont: ICont<I, C, S, M>) -> IResult<O, I, S, M> {
        self.0(&cont.ok.state).run_once(cont)
    }
}

#[derive(Clone, Copy)]
pub struct SetState<S>(S);
#[inline]
pub fn set_state<S>(state: S) -> SetState<S> {
    SetState(state)
}
impl<I: Input, C, S, M: Cb> ParserOnce<I, (), C, S, M> for SetState<S> {
    #[inline]
    fn run_once(self, cont: ICont<I, C, S, M>) -> IResult<(), I, S, M> {
        let ICont { ok: IOk { input, err, cutted, .. }, .. } = cont;
        Ok(((), IOk { input, state: self.0, err, cutted }))
    }
}
impl


/*
    ChibiOS - Copyright (C) 2006,2007,2008,2009,2010,2011,2012,2013,2014,
              2015,2016,2017,2018,2019,2020,2021 Giovanni Di Sirio.

    This file is part of ChibiOS.

    ChibiOS is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation version 3 of the License.

    ChibiOS is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

/**
 * @file    ARMv6-M-RP2/compilers/GCC/chcoreasm.S
 * @brief   ARMv6-M-RP2 port low level code.
 *
 * @addtogroup ARMV6M_RP2_GCC_CORE
 * @{
 */

#if !defined(FALSE) || defined(__DOXYGEN__)
#define FALSE   0
#endif

#if !defined(TRUE) || defined(__DOXYGEN__)
#define TRUE    1
#endif

#define _FROM_ASM_
#include "chlicense.h"
#include "chconf.h"
#include "chcore.h"

#if !defined(__DOXYGEN__)

/*
 * RTOS-specific context offset.
 */
#if defined(_CHIBIOS_RT_CONF_)
#define CONTEXT_OFFSET  12

#elif defined(_CHIBIOS_NIL_CONF_)
#define CONTEXT_OFFSET  0

#else
#error "invalid chconf.h"
#endif

                .set    SCB_ICSR, 0xE000ED04
                .set    ICSR_PENDSVSET, 0x10000000
                .set    ICSR_NMIPENDSET, 0x80000000

                .cpu    cortex-m0
                .fpu    softvfp

                .thumb
                .text

/*--------------------------------------------------------------------------*
 * Performs a context switch between two threads.
 *--------------------------------------------------------------------------*/
                .thumb_func
                .globl  __port_switch
__port_switch:
                push    {r4, r5, r6, r7, lr}
                mov     r4, r8
                mov     r5, r9
                mov     r6, r10
                mov     r7, r11
                push    {r4, r5, r6, r7}

                mov     r3, sp
                str     r3, [r1, #CONTEXT_OFFSET]
                ldr     r3, [r0, #CONTEXT_OFFSET]
                mov     sp, r3


nd

function ghost_revenant_exhaustion:OnSpellStart()
	local duration = self:GetSpecialValueFor("duration")

	self:GetCaster():EmitSound("DOTA_Item.DustOfAppearance.Activate")

	local targets = FindUnitsInRadius(self:GetCaster():GetTeamNumber(), Vector(0, 0, 0), nil, FIND_UNITS_EVERYWHERE, DOTA_UNIT_TARGET_TEAM_ENEMY , DOTA_UNIT_TARGET_BASIC + DOTA_UNIT_TARGET_HERO , DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES + DOTA_UNIT_TARGET_FLAG_INVULNERABLE, FIND_ANY_ORDER , false)
	for _,unit in pairs(targets) do
		unit:AddNewModifier(self:GetCaster(), self, "modifier_ghost_revenant_exhaustion", {duration = duration * (1 - unit:GetStatusResistance())})
	end
end

if modifier_ghost_revenant_exhaustion == nil then modifier_ghost_revenant_exhaustion = class({}) end
function modifier_ghost_revenant_exhaustion:IsDebuff() return true end
function modifier_ghost_revenant_exhaustion:IsHidden() return false end
function modifier_ghost_revenant_exhaustion:IsPurgable() return true end

function modifier_ghost_revenant_exhaustion:DeclareFunctions()
	local decFuncs = {
		MODIFIER_PROPERTY_MOVESPEED_BONUS_PERCENTAGE,
	}
	return decFuncs
end

function modifier_ghost_revenant_exhaustion:OnCreated()
	if IsServer() then
		self.ms_reduction_pct = self:GetAbility():GetSpecialValueFor("ms_reduction_pct")
		EmitSoundOn("Hero_Visage.GraveChill.Target", self:GetCaster())
	end
end

function modifier_ghost_revenant_exhaustion:GetEffectName()
	return "particles/econ/items/windrunner/windrunner_cape_cascade/windrunner_windrun_slow_cascade.vpcf"
end

function modifier_ghost_revenant_exhaustion:GetEffectAttachType()
	return PATTACH_OVERHEAD_FOLLOW
end

function modifier_ghost_revenant_exhaustion:GetPriority()
	return MODIFIER_PRIORITY_SUPER_ULTRA
end

function modifier_ghost_revenant_exhaustion:GetModifierMoveSpeedBonus_Percentage()
	return self.ms_reduction_pct
end


type459 = new BitSet(new long[]{0x0000000000000004L});
    public static final BitSet FOLLOW_typeElement_in_type461 = new BitSet(new long[]{0x0000000000000008L});
    public static final BitSet FOLLOW_typeElement_in_type474 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_set_in_typeElement0 = new BitSet(new long[]{0x0000000000000002L});

}
/***
 * Excerpted from "Language Implementation Patterns",
 * published by The Pragmatic Bookshelf.
 * Copyrights apply to this code. It may not be used to create training material,
 * courses, books, articles, and the like. Contact us if you are in doubt.
 * We make no guarantees that this code is fit for any purpose.
 * Visit http://www.pragmaticprogrammer.com/titles/tpdsl for more book information.
***/
import java.util.ArrayList;
import java.util.List;

public class Test {
    public static IntNode I(int i) {
        return new IntNode(new Token(Token.INT, String.valueOf(i)));
    }
    public static void main(String[] args) {
        // x = 3+4
        List<StatNode> stats = new ArrayList<StatNode>();
        AddNode a = new AddNode(I(3),new Token(Token.PLUS), I(4));
        VarNode x = new VarNode(new Token(Token.ID,"x"));
        AssignNode assign = new AssignNode(x, new Token(Token.ASSIGN,"="), a);
        stats.add(assign);
        // print x * [2, 3, 4]
        Token mult = new Token(Token.MULT,"*");
        List<ExprNode> elements = new ArrayList<ExprNode>();
        elements.add(I(2));
        elements.add(I(3));
        elements.add(I(4));
        VectorNode v = new VectorNode(new Token(Token.VEC), elements);
        VarNode xref = new VarNode(new Token(Token.ID,"x"));
        ExprNode pv = new MultNode(xref, mult, v);
        PrintNode p = new PrintNode(new Token(Token.PRINT,"print"), pv);
        stats.add(p);
        StatListNode statlist = new StatListNode(stats);

        // Create visitor and then call visit on root node (statlist)
        PrintVisitor visitor = new PrintVisitor();
        statlist.visit(visitor); // tell root node to visit with this visitor

        // Create visitor and then visit root node (statlist)
        IndependentPrintVisitor indepVisitor = new IndependentPrintVisitor();
        indepVisitor.print(statlist); // tell visitor to print from root
    }
}
/***
 * Excerpted from "Language Implementation Patterns",
 * published by The Pragmatic Bookshelf.
 * Copyrights apply to this code. It may not be used to create training material,
 * courses, books, articles, and the like. Contact us if you are in doubt.
 * We make no guarantees that this code is fit for any purpose.
 * Visit http://www.pragmaticprogrammer.com/titles/tpdsl for more book information.
***/
public class IndependentPrintVisitor {
    // visitor dispatch according to node token type
    public void print(VecMathNode n) {
        switch ( n.token.type ) {
            case Token.ID :        print((VarNode)n); break;
            case Token.ASSIGN :    print((AssignNode)n); break;
            case Token.PRINT :     print((PrintNode)n); break;
            case Token.PLUS :      print((AddNode)n); break;
            case Token.MULT :      print((MultNode)n); break;
            case Token.DOT :       print((DotProductNode)n); break;
            case Token.INT :       print((IntNode)n); break;
            case Token.VEC :       print((VectorNode)n); break;
            case Token.STAT_LIST : print((StatListNode)n); break;


alpha$ 值。

![Figure6.1](figures/chapter6/TrainLRMin.svg)
`图 6.1 线性回归模型的梯度下降。a) 训练集由 12 对输入/输出数据对 {xi , yi} 组成。b) 损失函数图展示了梯度下降的迭代过程。从点 0 出发，我们沿最陡峭的下降方向前进，直至无法进一步降低损失，从而到达点 1。然后，我们重复此过程，测量点 1 的梯度并继续下降到点 2，以此类推。c) 通过热图可以更直观地展示这一过程，图中的亮度代表了损失大小。仅经过四轮迭代，我们已经非常接近最小损失值。d) 点 0 处参数（线条最浅）的模型对数据的描述非常不准确，但随着每轮迭代，模型的拟合度都有所提升。点 4 处参数（线条最深）的模型已能合理描述训练数据。`

### 6.1.2 Gabor模型示例
线性回归问题的损失函数（参见图 6.1c）总是有一个清晰定义的全局最小值。更形式化地说，这些函数是凸函数，意味着曲面上任意两点连线（即弦）不会穿过函数图像。凸性保证了无论参数初始化在何处，只要我们不断地“下坡”，最终都能找到最小值；这样的训练过程是不会失败的。

然而，大部分非线性模型（包括浅层和深层网络）的损失函数都是非凸的。由于参数众多，使得神经网络损失函数的可视化变得极具挑战性。因此，我们首先研究一个参数较少的简单非线性模型，以深入理解非凸损失函数的特性：

$$
f(x, \phi) = \sin[\phi_0 + 0.06 \cdot \phi_1x] \cdot \exp \left( - \frac{(\phi_0 + 0.06 \cdot \phi_1x)^2}{32.0} \right) \tag{6.8}
$$

这个Gabor模型将标量输入$x$映射到标量输出$y$，并且由一个正弦分量（产生振荡效果）和一个负指数分量（使得振幅随离中心距离增加而减小）相乘构成。模型具有两个参数$\phi = [\phi_0, \phi_1]^T$，$\phi_0 \in \mathbb{R}$ 控制函数的拉伸或压缩，而$\phi_1 \in \mathbb{R}^+$ 则决定沿x轴的拉伸或压缩（见图6.2）。

考虑一个包含$I$个样本$\{x_i, y_i\}$的训练集。定义$I$个训练样本的最小二乘损失函数为：
$$
L(\ph


, },
		[40] = { 1.3799999952316, 2.0799999237061, critChance = 5, storedUses = 3, damageEffectiveness = 0.3, cooldown = 8, levelRequirement = 100, statInterpolation = { 3, 3, }, cost = { Mana = 37, }, },
	},
}
skills["FlickerStrike"] = {
	name = "Flicker Strike",
	baseTypeName = "Flicker Strike",
	color = 2,
	baseEffectiveness = 0,
	description = "Teleports the character to a nearby monster and attacks with a melee weapon. If no specific monster is targeted, one is picked at random. Grants a buff that increases movement speed for a duration. The cooldown can be bypassed by expending a Frenzy Charge.",
	skillTypes = { [SkillType.Attack] = true, [SkillType.Melee] = true, [SkillType.MeleeSingleTarget] = true, [SkillType.Multistrikeable] = true, [SkillType.Movement] = true, [SkillType.Duration] = true, [SkillType.Cooldown] = true, },
	weaponTypes = {
		["One Handed Mace"] = true,
		["Sceptre"] = true,
		["Thrusting One Handed Sword"] = true,
		["Two Handed Sword"] = true,
		["Dagger"] = true,
		["Staff"] = true,
		["Two Handed Axe"] = true,
		["Two Handed Mace"] = true,
		["One Handed Axe"] = true,
		["Claw"] = true,
		["One Handed Sword"] = true,
	},
	statDescriptionScope = "skill_stat_descriptions",
	castTime = 1,
	statMap = {
		["base_skill_show_average_damage_instead_of_dps"] = {
		},
		["flicker_strike_buff_movement_speed_+%"] = {
			mod("MovementSpeed", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff" }),
		},
	},
	baseFlags = {
		attack = true,
		melee = true,
		duration = true,
	},
	qualityStats = {
		Default = {
			{ "add_frenzy_charge_on_skill_hit_%", 0.5 },
		},
	},
	constantStats = {
		{ "base_attack_speed_+%_per_frenzy_charge", 10 },
		{ "add_frenzy_charge_on_skill_hit_%", 15 },
		{ "flicker_strike_buff_movement_speed_+%", 20 },
		{ "base_skill_effect_duration", 3000 },
	},
	stats = {
		"ignores_proximity_shield",
		"base_skill_show_average_damage_instead_of_dps",
		"melee_defer_damage_prediction",
	},
	levels = {
		[1] = { attackSpeedMultiplier = 20, PvPDamageMultiplier = -30, cooldown = 2, damageEffectiveness = 1.773, baseMultiplier = 1.773, storedUses = 1, levelRequirement = 10, cost = { Mana = 5, }, },
		[2] = { attackSpeedMultiplier = 20, PvPDamageMultiplier = -30, cooldown = 2, damageEffectiveness = 1.853, baseMultiplier = 1.853, storedUses = 1, levelRequirement = 13, cost = { Mana = 5, }, },
		[3] = { attackSpeedMultiplier = 20, PvPDamageMultiplier = -30, cooldown = 2, damageEffectiveness = 1.94, baseMultiplier = 1.94, storedUses = 1, levelRequirement = 17, cost = { Mana = 6, }, },
		[4] = { attackSpeedMultiplier = 20, PvPDamage


്കെ നിങ്ങള് അതങ്ങനെ മേടിക്കും?"
  },
  {
    "surah_number": 4,
    "verse_number": 22,
    "content":
        "നിങ്ങളുടെ പിതാക്കള് വിവാഹം ചെയ്ത സ്ത്രീകളെ നിങ്ങള് വിവാഹം കഴിക്കരുത്; മുമ്പ് ചെയ്തുപോയതൊഴികെ. തീര്‍ച്ചയായും അത് ഒരു നീചവൃത്തിയും വെറുക്കപ്പെട്ട കാര്യവും ദുഷിച്ച മാര്‍ഗവുമാകുന്നു."
  },
  {
    "surah_number": 4,
    "verse_number": 23,
    "content":
        "നിങ്ങളുടെ മാതാക്കള്, പുത്രിമാര്, സഹോദരിമാര്, പിതൃസഹോദരിമാര്, മാതൃസഹോദരിമാര്, നിങ്ങളെ മുലകുടിപ്പിച്ച പോറ്റമ്മമാര്, മുലകുടി മുഖേനയുള്ള നിങ്ങളുടെ സഹോദരിമാര്, നിങ്ങളുടെ ഭാര്യാമാതാക്കള് എന്നിവര് (അവരെ വിവാഹം ചെയ്യല്) നിങ്ങള്‍ക്ക് നിഷിദ്ധമാക്കപ്പെട്ടിരിക്കുന്നു. നിങ്ങള് ലൈംഗികവേഴ്ചയില് ഏര്‍പെട്ടിട്ടുള്ള നിങ്ങ


'10220140',	'1',	''},
{'102201',	'102201',	'',	'41',	'',	'召唤时',	'领教一下我的手段吧——机神投射！',	'10220141',	'1',	''},
{'702701',	'702701',	'',	'',	'',	'',	'',	'',	'',	''},
{'702701',	'702701',	'',	'1',	'1',	'游戏开始',	'CrossCore。',	'70270101',	'1',	''},
{'702701',	'702701',	'',	'2',	'2',	'获得',	'什么，托尔那个家伙以统治者的身份跟你们签订了合作协议？真是的，又在我不知情的情况下擅自做决定……严格维护律法是瓦尔基里的使命，既然协议已生效，那就让我来协助你们吧。',	'70270102',	'1',	''},
{'702701',	'702701',	'',	'3',	'3',	'出击',	'全体出击！',	'70270103',	'1',	''},
{'702701',	'702701',	'',	'4',	'4',	'行动开始',	'就让我来履行瓦尔基里的职责吧。',	'70270104',	'1',	''},
{'702701',	'702701',	'',	'5',	'',	'攻击1',	'吼。',	'70270105',	'1',	''},
{'702701',	'702701',	'',	'6',	'',	'攻击2',	'哈。',	'70270106',	'1',	''},
{'702701',	'702701',	'',	'7',	'',	'攻击3',	'喝。',	'70270107',	'1',	''},
{'702701',	'702701',	'',	'8',	'',	'攻击4',	'哼。',	'70270108',	'1',	''},
{'702701',	'702701',	'',	'9',	'',	'技能1',	'突击！',	'70270109',	'1',	''},
{'702701',	'702701',	'',	'10',	'',	'技能2',	'为了消除一切不公！',	'70270110',	'1',	''},
{'702701',	'702701',	'',	'11',	'',	'必杀（发动时）',	'看来需要让你们明白践踏规则的代价。',	'70270111',	'1',	''},
{'702701',	'702701',	'',	'12',	'',	'必杀（结束前）',	'毁灭吧！',	'70270112',	'1',	''},
{'702701',	'702701',	'',	'13',	'',	'overload',	'我即是突破一切的战旗。',	'


heckPoint.Disable{
		baseName = {
			"swamp",
			"swampWest",
			"swampSouth",
			"swampEast",
		}
	}
end

this.SetUpTimerForTarget01Monologue = function()
	if GkEventTimerManager.IsTimerActive( "CountDown_Target01_Monologue" ) then

		GkEventTimerManager.Stop( "CountDown_Target01_Monologue" )
		GkEventTimerManager.Start( "CountDown_Target01_Monologue", 8 )
	else

		GkEventTimerManager.Start( "CountDown_Target01_Monologue", 8 )
	end
end

this.SetUpTimerForTarget02Monologue = function()
	if GkEventTimerManager.IsTimerActive( "CountDown_Target02_Monologue" ) then

		GkEventTimerManager.Stop( "CountDown_Target02_Monologue" )
		GkEventTimerManager.Start( "CountDown_Target02_Monologue", 10 )
	else

		GkEventTimerManager.Start( "CountDown_Target02_Monologue", 10 )
	end
end

function this.OnTargetDead( s_characterId )
		Fox.Log("###CommonRadio_TargetDead_f8000_gmov0110###")
		TppMission.ReserveGameOver( TppDefine.GAME_OVER_TYPE.TARGET_DEAD, TppDefine.GAME_OVER_RADIO.TARGET_DEAD )
end

function this.OnTwoHostageRescued()
		Fox.Log( "****Check_If_All_TARGET_Are_Rescued!Get_Out!!!!*****" )
	if 	(svars.isTarget01Rescue		== true) and (svars.isTarget02Rescue	== true) then
		Fox.Log( "****GoTo_Seq_Game_Escape!!!!*****" )
		TppSequence.SetNextSequence("Seq_Game_Escape")

	elseif	(svars.isTarget01Rescue		== true) and (svars.isTarget02Rescue	== false) then
		Fox.Log( "****GoTo_Seq_Game_SwampTarget!!!!*****" )
		TppSequence.SetNextSequence("Seq_Game_SwampTarget" )
		Fox.Log("###Radio s0091_rtrg2010+ α###")
		this.PlayRadio001()
		this.OnSwithOptionalRadio()

	elseif	(svars.isTarget01Rescue		== false) and (svars.isTarget02Rescue	== true) then
		Fox.Log( "****GoTo_Seq_Game_ForestTarget!!!!*****" )
		TppSequence.SetNextSequence("Seq_Game_ForestTarget" )
		Fox.Log("###Radio s0091_rtrg2010+ α###")
		this.PlayRadio001()
		this.OnSwithOptionalRadio()

	else
		Fox.Log( "****WRONG_RescueCondition!!!!*****" )
	end

end

this.InsertTarget01HudPhoto = function()
	Fox.Log("###***InsertTarget01HudPhoto")
	if svars.isTarget01Marked == false then
		Fox.Log("###***Target01_NotMarkedYet_InsertTarget01HudPhoto")
		local gameObjectId = GameObject.GetGameObjectId( TARGET_HOSTAGE.NORTH_FOREST )
		local staffId = TppMotherBaseManagement.GetStaffIdFromGameObject{ gameObjectId = gameObjectId }
		TppUiCommand.ShowPictureInfoHud( "mb_staff", staffId, 3.0 )
	else
		Fox.Log("###***Target01_HasAlreadyMarked_NoNeedforHudPhoto")
	end
end

this.InsertTarget01HudPhotoAfterFulton = function()
	Fox.Log("###***InsertTarget01HudPhotoAfterFulton ")
	if svars.isTarget01Marked == false then
		Fox.Log("###***Target01_NotMarkedYet_InsertTarget01HudPhoto")
		TppSoundDaemon.PostEvent( 'sfx_s_enemytag_main_


OADK R8 K13 [0]
  LOADN R9 255
  LOADN R10 0
  LOADN R11 1
  LOADN R12 0
  LOADN R13 1
  LOADN R14 0
  LOADN R15 0
  CALL R3 12 1
  SETTABLEKS R3 R2 K3 ["C0"]
  GETIMPORT R3 K12 [CFrame.new]
  LOADK R4 K17 [-0.5]
  LOADN R5 1
  LOADN R6 0
  LOADK R7 K13 [0]
  LOADK R8 K13 [0]
  LOADN R9 255
  LOADN R10 0
  LOADN R11 1
  LOADN R12 0
  LOADN R13 1
  LOADN R14 0
  LOADN R15 0
  CALL R3 12 1
  SETTABLEKS R3 R2 K4 ["C1"]
  LOADK R3 K14 [0.1]
  SETTABLEKS R3 R2 K5 ["MaxVelocity"]
  SETTABLEKS R2 R1 K15 ["Left Hip"]
  DUPTABLE R2 K6 [{"Name", "Part0", "Part1", "C0", "C1", "MaxVelocity"}]
  LOADK R3 K18 ["Left Shoulder"]
  SETTABLEKS R3 R2 K0 ["Name"]
  LOADK R3 K9 ["Torso"]
  SETTABLEKS R3 R2 K1 ["Part0"]
  LOADK R3 K19 ["Left Arm"]
  SETTABLEKS R3 R2 K2 ["Part1"]
  GETIMPORT R3 K12 [CFrame.new]
  LOADN R4 255
  LOADK R5 K20 [0.5]
  LOADN R6 0
  LOADK R7 K13 [0]
  LOADK R8 K13 [0]
  LOADN R9 255
  LOADN R10 0
  LOADN R11 1
  LOADN R12 0
  LOADN R13 1
  LOADN R14 0
  LOADN R15 0
  CALL R3 12 1
  SETTABLEKS R3 R2 K3 ["C0"]
  GETIMPORT R3 K12 [CFrame.new]
  LOADK R4 K20 [0.5]
  LOADK R5 K20 [0.5]
  LOADN R6 0
  LOADK R7 K13 [0]
  LOADK R8 K13 [0]
  LOADN R9 255
  LOADN R10 0
  LOADN R11 1
  LOADN R12 0
  LOADN R13 1
  LOADN R14 0
  LOADN R15 0
  CALL R3 12 1
  SETTABLEKS R3 R2 K4 ["C1"]
  LOADK R3 K14 [0.1]
  SETTABLEKS R3 R2 K5 ["MaxVelocity"]
  SETTABLEKS R2 R1 K18 ["Left Shoulder"]
  DUPTABLE R2 K6 [{"Name", "Part0", "Part1", "C0", "C1", "MaxVelocity"}]
  LOADK R3 K21 ["Neck"]
  SETTABLEKS R3 R2 K0 ["Name"]
  LOADK R3 K9 ["Torso"]
  SETTABLEKS R3 R2 K1 ["Part0"]
  LOADK R3 K22 ["Head"]
  SETTABLEKS R3 R2 K2 ["Part1"]
  GETIMPORT R3 K12 [CFrame.new]
  LOADN R4 0
  LOADN R5 1
  LOADN R6 0
  LOADN R7 255
  LOADK R8 K13 [0]
  LOADK R9 K13 [0]
  LOADN R10 0
  LOADN R11 0
  LOADN R12 1
  LOADN R13 0
  LOADN R14 1
  LOADN R15 0
  CALL R3 12 1
  SETTABLEKS R3 R2 K3 ["C0"]
  GETIMPORT R3 K12 [CFrame.new]
  LOADN R4 0
  LOADK R5 K17 [-0.5]
  LOADN R6 0
  LOADN R7 255
  LOADK R8 K13 [0]
  LOADK R9 K13 [0]
  LOADN


 "Albania",
      country_dial_code: "355",
      country_currency_name: "Albanian lek",
      country_currency_symbol: "L",
      country_currency_code: "ALL"
    },
    {
      country_id: "3",
      country_code: "DZ",
      country_name: "Algeria",
      country_dial_code: "213",
      country_currency_name: "Algerian dinar",
      country_currency_symbol: "\u062f.\u062c",
      country_currency_code: "DZD"
    },
    {
      country_id: "4",
      country_code: "AS",
      country_name: "American Samoa",
      country_dial_code: "1684",
      country_currency_name: null,
      country_currency_symbol: null,
      country_currency_code: null
    },
    {
      country_id: "5",
      country_code: "AD",
      country_name: "Andorra",
      country_dial_code: "376",
      country_currency_name: "Euro",
      country_currency_symbol: "\u20ac",
      country_currency_code: "EUR"
    },
    {
      country_id: "6",
      country_code: "AO",
      country_name: "Angola",
      country_dial_code: "244",
      country_currency_name: "Angolan kwanza",
      country_currency_symbol: "Kz",
      country_currency_code: "AOA"
    },
    {
      country_id: "7",
      country_code: "AI",
      country_name: "Anguilla",
      country_dial_code: "1264",
      country_currency_name: "East Caribbean dolla",
      country_currency_symbol: "$",
      country_currency_code: "XCD"
    },
    {
      country_id: "8",
      country_code: "AQ",
      country_name: "Antarctica",
      country_dial_code: "0",
      country_currency_name: null,
      country_currency_symbol: null,
      country_currency_code: null
    },
    {
      country_id: "9",
      country_code: "AG",
      country_name: "Antigua And Barbuda",
      country_dial_code: "1268",
      country_currency_name: "East Caribbean dolla",
      country_currency_symbol: "$",
      country_currency_code: "XCD"
    },
    {
      country_id: "10",
      country_code: "AR",
      country_name: "Argentina",
      country_dial_code: "54",
      country_currency_name: "Argentine peso",
      country_currency_symbol: "$",
      country_currency_code: "ARS"
    },
    {
      country_id: "11",
      country_code: "AM",
      country_name: "Armenia",
      country_dial_code: "374",
      country_currency_name: "Armenian dram",
      country_currency_symbol: null,
      country_currency_code: "AMD"
    },
    {
      country_id: "12",
      country_code: "AW",
      country_name: "Aruba",
      country_dial_code: "297",
      country_currency_name: "Aruban florin",
      country_currency_symbol: "\u0192",
      country_currency_code: "AWG"
    },
    {
      country_id: "13",
      country_code: "AU",
      country_name: "Australia",
      country_dial_code: "61",
      country_currency_name: "Australian dollar",
      country_currency_symbol: "$",
      country_currency_code: "AUD"
    },
    {
      country_id: "14",
      country_code: "AT",
      country_name: "Austria",


berforce on 2019-04-25 at 06:48.
 */
class ArtistModelLoader(concreteLoader: ModelLoader<GlideUrl, InputStream>) : ImageUrlLoader<Artist>(concreteLoader) {
    override var lastFmUrlKey: String = "artist"
    override var spotifyUrlKey: String = "artists"

    override fun getLastFmParams(model: Artist): Map<String, String>? {
        return mapOf(Pair("method", "artist.getinfo"), Pair("artist", model.name))
    }

    override fun getSpotifyFmParams(model: Artist): Map<String, String>? {
        return mapOf(Pair("q", String.format("artist:%s", model.name)), Pair("type", "artist"))
    }

}package dji.sampleV5.moduledrone.pages

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.CompoundButton
import android.widget.RadioButton
import android.widget.RadioGroup
import androidx.core.view.isVisible
import androidx.fragment.app.activityViewModels
import androidx.navigation.Navigation
import dji.sampleV5.moduleaircraft.R
import dji.sampleV5.modulecommon.pages.DJIFragment
import dji.sampleV5.moduleaircraft.models.RTKCenterVM
import dji.v5.common.utils.GpsUtils
import dji.sdk.keyvalue.value.rtkbasestation.RTKReferenceStationSource
import dji.sdk.keyvalue.value.rtkmobilestation.RTKLocation
import dji.sdk.keyvalue.value.rtkmobilestation.RTKSatelliteInfo
import dji.v5.manager.aircraft.rtk.RTKLocationInfo
import dji.v5.manager.aircraft.rtk.RTKSystemState
import dji.v5.utils.common.LogUtils
import dji.v5.utils.common.StringUtils
import dji.sampleV5.modulecommon.util.ToastUtils
import dji.v5.ux.core.extension.hide
import dji.v5.ux.core.extension.show
import kotlinx.android.synthetic.main.frag_rtk_center_page.*

/**
 * Description :
 *
 * @author: Byte.Cai
 *  date : 2022/3/19
 *
 * Copyright (c) 2022, DJI All Rights Reserved.
 */
class RTKCenterFragment : DJIFragment(), CompoundButton.OnCheckedChangeListener, RadioGroup.OnCheckedChangeListener {
    private val TAG = LogUtils.getTag("RTKCenterFragment")

    companion object {
        const val KEY_IS_QX_RTK = "key_is_qx_rtk"
        const val KEY_IS_CMCC_RTK = "key_is_cmcc_rtk"
    }

    private val rtkCenterVM: RTKCenterVM by activityViewModels()
    private var mIsUpdatingKeepStatus = false
    private var mIsUpdatingPrecisionStatus = false

    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
        return inflater.inflate(R.layout.frag_rtk_center_page, container, false)
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)

        //初始化
        initListener()
        rtkCenterVM.addRTKLocationInfoListener()
        rtkCenterVM.addRTKSystemStateListener()

        rtkCenterVM.getRTKMaintainAccuracyEnabled()

    }

    private fun initListener() {
        tb_rtk_keep_status_switch.setOnCheckedChangeListener(this)
        tb_precision_preservation_switch.setOnCheckedChangeListener(this)
        rtk_source_radio_group.setOnCheckedChangeListener(this)

        //处理打开相关RTK逻辑
        bt_open_network_rtk.setOnClickListener {


using UnityEditor;
using UnityEngine;
using UnityEngine.UIElements;
using Banter.SDK;

namespace Banter.SDKEditor
{
    [CustomEditor(typeof(BanterRigidbody))]
    public class BanterRigidbodyEditor : Editor
    {
        void OnEnable()
        {
            if (target is BanterRigidbody)
            {
                var script = (BanterRigidbody)target;
                // script.gameObject.GetComponent<MeshFilter>().hideFlags = HideFlags.HideInInspector;
                var path = AssetDatabase.GetAssetPath(script);
            }
        }
        public override bool UseDefaultMargins() => false;
        public override VisualElement CreateInspectorGUI()
        {
            var script = (BanterRigidbody)target;
            Editor editor = Editor.CreateEditor(script);
            // script.gameObject.GetComponent<MeshFilter>().hideFlags = HideFlags.HideInInspector;
            VisualElement myInspector = new VisualElement();

            var _mainWindowStyleSheet = Resources.Load<StyleSheet>("BanterCustomInspector");
            myInspector.styleSheets.Add(_mainWindowStyleSheet);

            var title = new Label("PROPERTIES SEEN BY JS");
            title.style.fontSize = 14;
            myInspector.Add(title);
            var seeFields = new Label("mass, drag, angularDrag, isKinematic, useGravity, centerOfMass, collisionDetectionMode, freezePositionX, freezePositionY, freezePositionZ, freezeRotationX, freezeRotationY, freezeRotationZ, ");
            seeFields.style.unityFontStyleAndWeight = FontStyle.Bold;
            seeFields.style.flexWrap = Wrap.Wrap;
            seeFields.style.whiteSpace = WhiteSpace.Normal;
            seeFields.style.marginBottom = 10;
            seeFields.style.marginTop = 10;
            seeFields.style.color = Color.gray;
            myInspector.Add(seeFields);
            var titleSynced = new Label("SYNC BANTERRIGIDBODY TO JS");
            titleSynced.style.fontSize = 14;
            myInspector.Add(titleSynced);


7219_DEBUG_PLANNER_QUEUE, last_depth, current_depth);
      last_depth = current_depth;
    }
  #endif

  // After resume() automatically do a refresh()
  if (suspended == 0x80) {
    suspended = 0;
    refresh();
  }
}

#endif // MAX7219_DEBUG
/**
 * Marlin 3D Printer Firmware
 * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
 *
 * Based on Sprinter and grbl.
 * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 *
 */

/**
 * planner_bezier.cpp
 *
 * Compute and buffer movement commands for bezier curves
 *
 */

#include "../inc/MarlinConfig.h"

#if ENABLED(BEZIER_CURVE_SUPPORT)

#include "planner.h"
#include "motion.h"
#include "temperature.h"

#include "../MarlinCore.h"
#include "../gcode/queue.h"

// See the meaning in the documentation of cubic_b_spline().
#define MIN_STEP 0.002f
#define MAX_STEP 0.1f
#define SIGMA 0.1f

// Compute the linear interpolation between two real numbers.
static inline float interp(const float &a, const float &b, const float &t) { return (1 - t) * a + t * b; }

/**
 * Compute a Bézier curve using the De Casteljau's algorithm (see
 * https://en.wikipedia.org/wiki/De_Casteljau%27s_algorithm), which is
 * easy to code and has good numerical stability (very important,
 * since Arudino works with limited precision real numbers).
 */
static inline float eval_bezier(const float &a, const float &b, const float &c, const float &d, const float &t) {
  const float iab = interp(a, b, t),
              ibc = interp(b, c, t),
              icd = interp(c, d, t),
              iabc = interp(iab, ibc, t),
              ibcd = interp(ibc, icd, t);
  return interp(iabc, ibcd, t);
}

/**
 * We approximate Euclidean distance with the sum of the coordinates
 * offset (so-called "norm 1"), which is quicker to compute.
 */
static inline float dist1(const float &x1, const float &y1, const float &x2, const float &y2) { return ABS(x1 - x2) + ABS(y1 - y2); }

/**
 * The algorithm for computing the step is loosely based on the one in Kig
 * (See https://sources.debian.net/src/kig/4:15.08.3-1/misc/kigpainter.cpp/#L759)
 * However, we do not use the stack.
 *
 * The algorithm goes as it follows: the parameters t runs from 0.0 to
 * 1.0 describing the curve, which is evaluated by eval_bezier(). At
 * each iteration we have to choose a step, i.e., the increment of the
 * t variable. By default the step of the previous iteration is taken,
 * and then it is enlarged or reduced depending on how straight the
 * curve locally is. The step is always clamped between MIN_STEP/2 and
 * 2*MAX_STEP. MAX_STEP is taken at the first iterat


File(filePath)

	if err != nil {
		fmt.Printf("[-] load poc %s error1: %v\n", filePath, err)
		return nil, err
	}
	err = yaml.Unmarshal(yamlFile, p)
	if err != nil {
		fmt.Printf("[-] load poc %s error2: %v\n", filePath, err)
		return nil, err
	}
	return p, err
}

// Read 获取yaml文件内容
func Read(fileName string) (*Finger, error) {
	p := &Finger{}

	file, err := os.Open(fileName)
	if err != nil {
		return p, err
	}
	defer file.Close()

	if err := yaml.NewDecoder(file).Decode(&p); err != nil {
		return p, err
	}
	return p, nil
}

// ReadDir 获取特定目录下面所有yaml文件
func ReadDir(root string) ([]string, error) {
	var allPocs []string

	err := filepath.WalkDir(root, func(path string, d fs.DirEntry, err error) error {
		if err != nil {
			return err
		}
		if !d.IsDir() && (strings.HasSuffix(path, ".yaml") || strings.HasSuffix(path, ".yml")) {
			allPocs = append(allPocs, path)
		}
		return nil
	})

	return allPocs, err
}

// IsHTTPType 判断是否是http请求
func (finger *Finger) IsHTTPType() bool {
	for _, rule := range finger.Rules {
		reqType := rule.Value.Request.Type
		if len(reqType) == 0 || reqType == HttpType {
			return true
		}
	}
	return false
}

// UnmarshalYAML 解析yaml文件内容
func (r *Rule) UnmarshalYAML(unmarshal func(any) error) error {

	var tmp ruleAlias
	if err := unmarshal(&tmp); err != nil {
		return err
	}

	r.Request = tmp.Request
	r.Expression = tmp.Expression
	r.Expressions = append(r.Expressions, tmp.Expressions...)
	r.Output = tmp.Output
	r.StopIfMatch = tmp.StopIfMatch
	r.StopIfMismatch = tmp.StopIfMismatch
	r.BeforeSleep = tmp.BeforeSleep
	r.order = order

	order += 1
	return nil
}

// UnmarshalYAML 解析yaml文件内容
func (m *RuleMapSlice) UnmarshalYAML(unmarshal func(any) error) error {
	order = 0

	tempMap := make(map[string]Rule, 1)
	err := unmarshal(&tempMap)
	if err != nil {
		return err
	}

	newRuleSlice := make([]RuleMap, len(tempMap))
	for roleName, role := range tempMap {
		newRuleSlice[role.order] = RuleMap{
			Key:   roleName,
			Value: role,
		}
	}

	*m = newRuleSlice
	return nil
}
package main

import (
	"context"
	"fmt"
	"os"
	"os/signal"
	"runtime/debug"
	"syscall"

	"github.com/cybertec-postgresql/pg_timetable/internal/api"
	"github.com/cybertec-postgresql/pg_timetable/internal/config"
	"github.com/cybertec-postgresql/pg_timetable/internal/log"
	"github.com/cybertec-postgresql/pg_timetable/internal/pgengine"
	"github.com/cybertec-postgresql/pg_timetable/internal/scheduler"
)

/**
 * pg_timetable is the daemon application responsible to execute scheduled SQL tasks that cannot be triggered by the
 * PostgreSQL server (PostgreSQL does not support time triggers).
 *
 * This application may run on the same machine as PostgreSQL server and must grant full access permission to the
 * timetable tables.
 */
var pge *pgengine.PgEngine

// SetupCloseHandler creates a 'lis


/*
 * Copyright 2011 Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation;
 * either version 2, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTIES OR REPRESENTATIONS; without even
 * the implied warranty of MERCHANTABILITY or FITNESS FOR
 * A PARTICULAR PURPOSE.See the GNU General Public License
 * for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc.,
 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */
/*
 * driver for Chrontel CH7301 DVI Transmitter
 */

#include <linux/slab.h>
#include "via_aux.h"

static const char *name = "CH7301 DVI Transmitter";

static void probe(struct via_aux_bus *bus, u8 addr)
{
	struct via_aux_drv drv = {
		.bus	=	bus,
		.addr	=	addr,
		.name	=	name};
	u8 tmp;

	if (!via_aux_read(&drv, 0x4B, &tmp, 1) || tmp != 0x17)
		return;

	printk(KERN_INFO "viafb: Found %s at address 0x%x\n", name, addr);
	via_aux_add(&drv);
}

void via_aux_ch7301_probe(struct via_aux_bus *bus)
{
	probe(bus, 0x75);
	probe(bus, 0x76);
}


serWidget *self,
                                                           gboolean             setting);
GDK_AVAILABLE_IN_ALL
gboolean      gtk_app_chooser_widget_get_show_other       (GtkAppChooserWidget *self);

GDK_AVAILABLE_IN_ALL
void          gtk_app_chooser_widget_set_show_all         (GtkAppChooserWidget *self,
                                                           gboolean             setting);
GDK_AVAILABLE_IN_ALL
gboolean      gtk_app_chooser_widget_get_show_all         (GtkAppChooserWidget *self);

GDK_AVAILABLE_IN_ALL
void          gtk_app_chooser_widget_set_default_text     (GtkAppChooserWidget *self,
                                                           const gchar         *text);
GDK_AVAILABLE_IN_ALL
const gchar * gtk_app_chooser_widget_get_default_text     (GtkAppChooserWidget *self);

G_END_DECLS

#endif /* __GTK_APP_CHOOSER_WIDGET_H__ */


lues(stepInfoControl
					.updateStepIDToSharedValueVoAndGetList(preStepID,
							postStepID));
		}

		/**
		 * StepVo의 ID가 변경되었을 때 StepVo, BeanIDList 갱신
		 *
		 * @param selectJobVo
		 * @param selectSDVo
		 * @param newStepVo
		 * @param preStepID
		 * @param postStepID
		 */
		private void updateStepVoAndBeanIDListWhenIDChanged(JobVo selectJobVo,
				StepVo selectSDVo, StepVo newStepVo, String preStepID,
				String postStepID) {

			ArrayList<StepAndDecisionVo> refList = getReferenceList(
					selectJobVo, selectSDVo);

			String message = createRefDialogModifyString(selectSDVo.getName(),
					refList);

			if (openConfirmDialog(
					BatchMessages.BatchJobCreationCustomizePage_APPLY_BUTTON_DIALOG_TITLE,
					message)) {

				updateStepVoAndBeanIDListWhenIDNotChanged(selectJobVo,
						selectSDVo, newStepVo, preStepID, postStepID);

				updateStepDecisionIDToRefList(preStepID, newStepVo.getName(),
						refList);
			}
		}

	};

	/** Step의 Restore Default Button을 클릭시 작동하는 Listener */
	Listener stepAndDecisionRestoreButtonListener = new Listener() {

		public void handleEvent(Event event) {
			String message = BatchMessages.BatchJobCreationCustomizePage_RESTORE_DEFAULT_CONFIRM_MESSAGE;
			if (!openConfirmDialog(
					BatchMessages.BatchJobCreationCustomizePage_RESTORE_DEFAULT_BUTTON_DIALOG_TITLE,
					message)) {
				return;
			}

			StepAndDecisionVo selectSDVo = getStepDecisionListSelection();
			if (NullUtil.isNull(selectSDVo)) {
				stepAndDecisionCombo
						.notifyListeners(SWT.Selection, new Event());
			} else {
				stepAndDecisionListTableListener.handleEvent(new Event());
			}
		}
	};

	/** Step/Decision의 Add Button을 클릭시 작동하는 Listener */
	Listener stepAndDecisionAddButtonListener = new Listener() {

		public void handleEvent(Event event) {
			setPageComplete(false);

			deselectStepDecisionList();

			setMessage(
					BatchMessages.BatchJobCreationCustomizePage_SHOW_NEW_STEP_DECISION_INFO,
					NONE);

			infoLabel.setText("");

			clearInfoContentsAndButtonListenerAndMessage();

			createStepDecisionAddButtonSelectInfoContents();

			refreshInfoControl();

			stepAndDecisionCombo.setVisible(true);
			stepAndDecisionCombo.setEnabled(true);
			stepAndDecisionCombo.setText(DEFAULT);

			if (stepAndDecisionListTable.getTable().getItemCount() > 0) {
				removeStepAndDecisionComboListener();

				setEnableStepAndDecisionComboListener();

			} else {
				removeStepAndDecisionComboListener();

				atFirstStepComboListener();

			}

			jobRemoveButton.setEnabled(false);

			stepAndDecisionRemove.setEnabled(false);

			applyButton.setEnabled(false);

			restoreDefaultsButton.setEnabled(false);

			stepAndDecisionListTable.setSelection(null);
		}
	};

	/** Step/Decision의 Remove Button을 클릭시 작동하는 Listener */
	Listener stepAndDecisionRemoveTableViewerListener = new Listener() {

		public void handleEvent(Event event) {
			JobVo selectJobVo = getJobListSelection();
			StepAndDecisionVo selectStepAndDecisionVo = getStepDecisionListSelection();

			ArrayList<StepAndDecisionVo> refMemberList


Object target = point.getTarget();

    log.debug("处理方法:{}.{}", target.getClass().getName() , methodSignature.getMethod().getName());
    Object[] parameterValues = point.getArgs();

    //查看入参
    log.debug("参数名:{}，参数值:{}", JSONObject.toJSONString(parameterNames), JSONObject.toJSONString(parameterValues));

    Class returnType = methodSignature.getReturnType();

    // 返回类型是否布尔类型
    boolean booleanType = boolean.class.equals(returnType) || Boolean.class.equals(returnType);
    try {
        if (Objects.nonNull(JdHotKeyStore.get("redis_connection_failed"))) {
            // 值不为空表示redis连接失败，这里就不再继续请求redis了，直接返回false或者null
            log.error("获取缓存失败，redis连接失败，直接返回 false 或者 null");
            if (booleanType) {
                return false;
            }
            return null;
        }
        return point.proceed();
    } catch (Throwable throwable) {
        log.error("执行方法:{}失败，异常信息:{}", methodSignature.getMethod().getName(), throwable);
        /*
         * redis连接失败，不抛异常，返回空值，
         * 继续用数据库提供服务，避免整个服务异常
         * 一分钟之内或者30秒之内出现了几次redis连接失败
         * 此时可以设置一个key，告诉hotkey，redis连接不上了，指定1分钟左右的过期时间
         * 下次获取缓存的时候，先根据hotkey来判断，redis是否异常了
         * hotkey在1分钟之后，会删除key，下次再有redis请求过来，重新去看redis能否连接
         * 这样可以简单的实现redis挂掉之后直接走数据库的降级
         */
        if (JdHotKeyStore.isHotKey("redis_connection_failed")) {
            JdHotKeyStore.smartSet("redis_connection_failed", "{}");
        }

        // 让后续操作继续，判断返回类型是Boolean则返回false，其他类型返回null
        log.error("缓存操作失败，直接返回 false 或者 null");
        if (booleanType) {
            return false;
        }
        return null;
    }
}
```

如果 Redis 故障的话，通过 `key=redis_connection_failed` 就已经记录下来了


.impl.summary.logSummary
import java.io.File
import java.net.URISyntaxException
import java.net.URL

/** Converts resource string path to the file. */
@Throws(URISyntaxException::class)
fun getFileFromResource(fileName: String): File {
    val classLoader: ClassLoader = object {}.javaClass.classLoader
    val resource: URL? = classLoader.getResource(fileName)
    return if (resource == null) {
        throw IllegalArgumentException("file not found! $fileName")
    } else {
        File(resource.toURI())
    }
}

fun runImageRecognitionPrediction(modelType: TFModels.CV<out GraphTrainableModel>) {
    val modelHub = TFModelHub(cacheDirectory = File("cache/pretrainedModels"))
    val model = modelHub.loadModel(modelType)

    val imageNetClassLabels = modelHub.loadClassLabels()

    model.use {
        it.compile(
            optimizer = Adam(),
            loss = Losses.MAE,
            metric = Metrics.ACCURACY
        )

        it.printSummary()
        it.logSummary()

        val hdfFile = modelHub.loadWeights(modelType)

        it.loadWeights(hdfFile)

        val fileDataLoader = modelType.createPreprocessing(it).fileLoader()
        for (i in 1..8) {
            val inputData = fileDataLoader.load(getFileFromResource("datasets/vgg/image$i.jpg"))

            val res = it.predictLabel(inputData)
            println("Predicted object for image$i.jpg is ${imageNetClassLabels[res]}")

            val top5 = it.predictTop5Labels(inputData, imageNetClassLabels)

            println(top5.toString())
        }
    }
}
/*
 * Copyright 2020-2023 JetBrains s.r.o. and Kotlin Deep Learning project contributors. All Rights Reserved.
 * Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file.
 */

package examples.visualization

import examples.inference.lenet5
import org.jetbrains.kotlinx.dl.api.core.layer.convolutional.Conv2D
import org.jetbrains.kotlinx.dl.api.core.layer.weights
import org.jetbrains.kotlinx.dl.api.core.loss.Losses
import org.jetbrains.kotlinx.dl.api.core.metric.Metrics
import org.jetbrains.kotlinx.dl.api.core.optimizer.Adam
import org.jetbrains.kotlinx.dl.dataset.embedded.mnist
import org.jetbrains.kotlinx.dl.impl.inference.imagerecognition.predictLabel
import org.jetbrains.kotlinx.dl.impl.summary.logSummary
import org.jetbrains.kotlinx.dl.visualization.letsplot.columnPlot
import org.jetbrains.kotlinx.dl.visualization.letsplot.filtersPlot
import org.jetbrains.kotlinx.dl.visualization.letsplot.flattenImagePlot
import org.jetbrains.kotlinx.dl.visualization.letsplot.modelActivationOnLayersPlot
import org.jetbrains.kotlinx.dl.visualization.swing.drawActivations
import org.jetbrains.kotlinx.dl.visualization.swing.drawFilters

private const val EPOCHS = 1
private const val TRAINING_BATCH_SIZE = 500
private const val TEST_BATCH_SIZE = 1000

/**
 * This examples demonstrates model activations and Conv2D filters visualisation.
 *
 * Model is trained on Mnist dataset.
 */
fun main() {

    val (train, test) = mnist()

    val sampleIndex = 42
    val x = test.getX(sampleIndex)
    val y = test.getY(sampleIndex).toInt()

    lenet5().use {

        it.compile(
            optimizer = Adam(),
            loss = Losses.SOFT_MAX_CROSS_ENTROPY_WITH_LOGITS,
            metric = Metrics.ACCURACY
        )

        it.logSummary()

        it.fit(
            data


疗解决方案供应商？ |
| 大数据分析 | 如何利用大数据分析提高网站的转化率？ |
| 区块链技术 | 区块链技术在金融领域中有哪些应用？ |
| 机器学习算法 | 常用的机器学习算法有哪些，它们各有什么优缺点？ |
| 无人驾驶 | 自动驾驶汽车目前存在哪些安全隐患？ |
| 社交网络 | 对于一款新的社交网络产品，如何才能够吸引更多的用户加入？ |
| 分类 | 如何将一组文本分类为正面或负面情感？ |
| 生成 | 生成一个符合规范的汽车行业新闻标题。 |
| 编辑 | 对于给定的文章，如何将其缩短至指定的字数，同时保持其核心内容不变？ |
| 摘要 | 如何从一篇长篇文章中提取最重要的信息，以形成一个简洁的摘要？ |
| 翻译 | 如何将一句英语翻译成中文，同时确保它完全符合语境？ |
| 推断 | 如果今天是星期三，那么后天是星期几？ |
| 建议 | 对于一个即将到来的活动，如何推荐相关的场地和服务供应商？ |
| 解释 | 解释什么是人工智能及其在现代社会中的应用。 |
| 审查 | 对于一篇文章，如何检查其中的语法错误并提出改进意见？ |
| 表示 | 如何使用图表清晰地展示一组数据的趋势和关联性？ |
| 商品推荐 | 基于用户历史购买记录和当前热门商品，请推荐5件适合该用户的商品。 |
| 财务分析 | 对过去一年的销售数据进行财务分析，包括总收入、总支出、净利润、销售额增长率等指标。 |
| 文本摘要 | 给定一篇长文本，请生成一段长度为100字左右的摘要，概括该文本的主要内容。|
| 图像编辑 | 将一张室内环境的图片调整成冷色调，并增加对比度。 |
| 新闻分类 | 对新闻类别进行分类，包括政治、经济、体育、娱乐、教育等各个方面。 |
| 智能客服 | 用户输入“我想知道怎么办理信用卡”，请返回一个自然语言回复，提供详细的办卡流程说明。 |
| 情感分析 | 给定一段电影评论，请判断该评论的情感极性，正向或负向。 |
| 机器翻译 | 将一段英文文本翻译成中文，并保持原


    expect!(MatchingRule::from_json(&json)).to(be_ok().value(
      MatchingRule::ArrayContains(
        vec![
          (0, matchingrules_list! { "body"; [ MatchingRule::Equality ] }, HashMap::default())
        ])
    ));

    let json = json!({
      "match": "arrayContains",
      "variants": [
        {
          "index": 0,
          "rules": {
            "matchers": [ { "match": "equality" } ]
          },
          "generators": {
            "a": { "type": "Uuid" }
          }
        }
      ]
    });
    let generators = hashmap!{ DocPath::new_unwrap("a") => Generator::Uuid(None) };
    expect!(MatchingRule::from_json(&json)).to(be_ok().value(
      MatchingRule::ArrayContains(
        vec![
          (0, matchingrules_list! { "body"; [ MatchingRule::Equality ] }, generators)
        ])
    ));

    let json = json!({
      "match": "statusCode",
      "status": "success"
    });
    expect!(MatchingRule::from_json(&json)).to(be_ok().value(
      MatchingRule::StatusCode(HttpStatus::Success)
    ));

    let json = json!({
      "match": "statusCode",
      "status": [200, 201, 204]
    });
    expect!(MatchingRule::from_json(&json)).to(be_ok().value(
      MatchingRule::StatusCode(HttpStatus::StatusCodes(vec![200, 201, 204]))
    ));
  }

  #[test]
  fn matching_rule_to_json_test() {
    expect!(MatchingRule::StatusCode(HttpStatus::ClientError).to_json()).to(
      be_equal_to(json!({
        "match": "statusCode",
        "status": "clientError"
      })));
    expect!(MatchingRule::StatusCode(HttpStatus::StatusCodes(vec![400, 401, 404])).to_json()).to(
      be_equal_to(json!({
        "match": "statusCode",
        "status": [400, 401, 404]
      })));
  }

  #[test]
  fn matcher_is_defined_returns_false_when_there_are_no_matchers() {
    let matchers = matchingrules!{};
    expect!(matchers.matcher_is_defined("body", &vec!["$", "a", "b"])).to(be_false());
  }

  #[test]
  fn matcher_is_defined_returns_false_when_the_path_does_not_have_a_matcher_entry() {
    let matchers = matchingrules!{
      "body" => { }
    };
    expect!(matchers.matcher_is_defined("body", &vec!["$", "a", "b"])).to(be_false());
  }

  #[test]
  fn matcher_is_defined_returns_true_when_the_path_does_have_a_matcher_entry() {
    let matchers = matchingrules! {
      "body" => {
        "$.a.b" => [ MatchingRule::Type ]
      }
    };
    expect!(matchers.matcher_is_defined("body", &vec!["$", "a", "b"])).to(be_true());
  }

  #[test]
  fn matcher_is_defined_returns_false_when_the_path_is_empty() {
    let matchers = matchingrules! {
      "body" => {
        "$.a.b" => [ MatchingRule::Type ]
      }
    };
    expect!(matchers.matcher_is_defined("body", &vec![])).to(be_false());
  }

  #[test]
  fn matcher_is_defined_returns_true_when_the_parent_of_the_path_does_hav


Param;
}

NamedDecl *Sema::ActOnTemplateTemplateParameter(
    Scope *S, SourceLocation TmpLoc, TemplateParameterList *Params,
    bool Typename, SourceLocation EllipsisLoc, IdentifierInfo *Name,
    SourceLocation NameLoc, unsigned Depth, unsigned Position,
    SourceLocation EqualLoc, ParsedTemplateArgument Default) {
  assert(S->isTemplateParamScope() &&
         "Template template parameter not in template parameter scope!");

  // Construct the parameter object.
  bool IsParameterPack = EllipsisLoc.isValid();
  TemplateTemplateParmDecl *Param = TemplateTemplateParmDecl::Create(
      Context, Context.getTranslationUnitDecl(),
      NameLoc.isInvalid() ? TmpLoc : NameLoc, Depth, Position, IsParameterPack,
      Name, Typename, Params);
  Param->setAccess(AS_public);

  if (Param->isParameterPack())
    if (auto *LSI = getEnclosingLambda())
      LSI->LocalPacks.push_back(Param);

  // If the template template parameter has a name, then link the identifier
  // into the scope and lookup mechanisms.
  if (Name) {
    maybeDiagnoseTemplateParameterShadow(*this, S, NameLoc, Name);

    S->AddDecl(Param);
    IdResolver.AddDecl(Param);
  }

  if (Params->size() == 0) {
    Diag(Param->getLocation(), diag::err_template_template_parm_no_parms)
    << SourceRange(Params->getLAngleLoc(), Params->getRAngleLoc());
    Param->setInvalidDecl();
  }

  // C++0x [temp.param]p9:
  //   A default template-argument may be specified for any kind of
  //   template-parameter that is not a template parameter pack.
  if (IsParameterPack && !Default.isInvalid()) {
    Diag(EqualLoc, diag::err_template_param_pack_default_arg);
    Default = ParsedTemplateArgument();
  }

  if (!Default.isInvalid()) {
    // Check only that we have a template template argument. We don't want to
    // try to check well-formedness now, because our template template parameter
    // might have dependent types in its template parameters, which we wouldn't
    // be able to match now.
    //
    // If none of the template template parameter's template arguments mention
    // other template parameters, we could actually perform more checking here.
    // However, it isn't worth doing.
    TemplateArgumentLoc DefaultArg = translateTemplateArgument(*this, Default);
    if (DefaultArg.getArgument().getAsTemplate().isNull()) {
      Diag(DefaultArg.getLocation(), diag::err_template_arg_not_valid_template)
        << DefaultArg.getSourceRange();
      return Param;
    }

    // Check for unexpanded parameter packs.
    if (DiagnoseUnexpandedParameterPack(DefaultArg.getLocation(),
                                        DefaultArg.getArgument().getAsTemplate(),
                                        UPPC_DefaultArgument))
      return Param;

    Param->setDefaultArgument(Context, DefaultArg);
  }

  return Param;
}

namespace {
class ConstraintRefersToContainingTemplateChecker
    : public TreeTransform<ConstraintRefersToContainingTemplateChecker> {
  bool Result = false;
  const FunctionDecl *Friend = nullptr;
  unsigned TemplateDepth = 0;

  // Check a record-decl that we've seen to see if it is a lexical parent of the
  // Friend, likely because it was referred to without its template arguments.
  void CheckIfContainingRecord(const CXXRecordDecl *CheckingRD) {
    CheckingRD = CheckingRD->getMostRecentDecl();
    if (!CheckingRD->isTemplated())
      return;

    for (const DeclContext *DC = Friend->getLexicalDeclContext();
         DC && !DC->isFileContext(); DC = DC->getParent())


 the 'inner' vertices before
   * clipping. When enabled the preserveCollinear property prevents this default behavior to allow these inner vertices to appear in the solution.
   */
  preserveCollinear?: boolean;

  /**
   * If this is not undefined then cleaning of the result polygon will be performed.
   * This operation is only available when the output format is not a poly tree.
   */
  cleanDistance?: number;
}

const addPathOrPaths = (
  clipper: Clipper,
  inputDatas: (SubjectInput | ClipInput)[] | undefined,
  polyType: PolyType
) => {
  if (inputDatas === undefined) {
    return;
  }

  // add each input
  for (let i = 0, maxi = inputDatas.length; i < maxi; i++) {
    const inputData = inputDatas[i];

    // add the path/paths
    const pathOrPaths = inputData.data;
    if (!pathOrPaths || pathOrPaths.length <= 0) {
      continue;
    }

    const closed =
      (inputData as SubjectInput).closed === undefined ? true : (inputData as SubjectInput).closed;

    // is it a path or paths?
    if (Array.isArray(pathOrPaths[0])) {
      // paths
      if (!clipper.addPaths(pathOrPaths as Paths, polyType, closed)) {
        throw new ClipperError("invalid paths");
      }
    } else {
      // path
      if (!clipper.addPath(pathOrPaths as Path, polyType, closed)) {
        throw new ClipperError("invalid path");
      }
    }
  }
};

export function clipToPathsOrPolyTree(
  polyTreeMode: boolean,
  nativeClipperLib: NativeClipperLibInstance,
  params: ClipParams
): Paths | PolyTree {
  if (devMode) {
    if (!polyTreeMode && params.subjectInputs && params.subjectInputs.some((si) => !si.closed)) {
      throw new Error("clip to a PolyTree (not to a Path) when using open paths");
    }
  }

  const clipper = new Clipper(nativeClipperLib, params);

  //noinspection UnusedCatchParameterJS
  try {
    addPathOrPaths(clipper, params.subjectInputs, PolyType.Subject);
    addPathOrPaths(clipper, params.clipInputs, PolyType.Clip);
    let result;
    const clipFillType =
      params.clipFillType === undefined ? params.subjectFillType : params.clipFillType;
    if (!polyTreeMode) {
      result = clipper.executeToPaths(
        params.clipType,
        params.subjectFillType,
        clipFillType,
        params.cleanDistance
      );
    } else {
      if (params.cleanDistance !== undefined) {
        throw new ClipperError("cleaning is not available for poly tree results");
      }
      result = clipper.executeToPolyTee(params.clipType, params.subjectFillType, clipFillType);
    }
    if (result === undefined) {
      throw new ClipperError("error while performing clipping task");
    }
    return result;
  } finally {
    clipper.dispose();
  }
}

export function clipToPaths(nativeClipperLib: NativeClipperLibInstance, params: ClipParams): Paths {
  return clipToPathsOrPolyTree(false, nativeClipperLib, params) as Paths;
}

export function clipToPolyTree(
  nativeClipperLib: NativeClipperLibInstance,
  params: ClipParams
): PolyTree {
  return clipToPathsOrPolyTree(true, nativeClipperLib, params) as PolyTree;
}
/**
 * Created by zhangsong on 2018/8/3.
 */
import BaseHooks from './baseHooks';

export default class UpdateHooks extends BaseHooks {
  constructor(prop) {
    super(prop);
  }

  public run(plainTextValue, obj) {
    if (plainTextValue) {
      Object.keys(plainTextValue).forEach((item) => {
        const columnObj = item.split('.').red


Case(name.trim())] = value.trim();
  });
  return style;
};

const stringifyStyle = (style: any) => {
  let buffer = ``;

  for (const name in style) {
    buffer += `${name}:${style[name]};`
  }

  return buffer;
}/**
 * Utility functions related to chat messages
 */
import { ChatFragment } from '../../common/twitch-ext-emotes';

export function getFullUserName(username: string, displayName: string) {
  if (!displayName) {
    return username;
  }

  if (username.toLocaleUpperCase() === displayName.toLocaleUpperCase()) {
    return displayName;
  }
  return `${displayName}(${username})`;
}

export function getTextMessage(fragments: ChatFragment[]) {
  const textFragments = fragments
    .filter((fragment) => fragment.emote === undefined)
    .map((fragment) => fragment.text.trim());
  return textFragments.join(' ');
}
/**
 * @license Use of this source code is governed by an MIT-style license that
 * can be found in the LICENSE file at https://github.com/cartant/rxjs-etc
 */

import { from, Observable } from "rxjs";

// https://github.com/ReactiveX/rxjs/issues/2306

export interface IterableLike<T> {
  [Symbol.iterator]: () => Iterator<T> | IterableIterator<T>;
}

export function fromIterable<T>(iterable: IterableLike<T>): Observable<T> {
  return from(iterable as any) as Observable<T>;
}
import { Negociacao, NegociacaoAPI } from '../models/index';

export class NegociacaoService {

    obterNegociacoes(url: string, handler: HandlerFunction): Promise<void | Negociacao[]> {

        return fetch(url)
            .then(response => handler(response).json())
            .then((dados: NegociacaoAPI[]) =>
                dados.map(dado => new Negociacao(new Date(), dado.vezes, dado.montante)))
            .catch(err => {
                console.log(err);
                throw new Error('Não foi possível importar as negociações');
            });
    }
}

export interface HandlerFunction{

    (res: Response): Response;
}import appRootPath from 'app-root-path';
import * as path from 'path';
import { NewLineCharacter } from './new-line-character';

export class FormatStackTrace {
  public static readonly divider = '    at';
  public static toNewLines(stack: string): string {
    const lines = this.toArray(stack);
    return lines.join(`${NewLineCharacter()}${this.divider}`);
  }

  public static toArray(stack: string): string[] {
    let noNewLines = stack.replace(/\n/gi, '');
    noNewLines = noNewLines.replace(/\r/gi, '');
    const lines = noNewLines.split(this.divider);
    // this filters out lines relating to this package when referenced from other projects
    const linesWithoutLocalFiles = lines.filter((m) => m.match(/node_modules\/.*console-log-json\/.*/gi) == null);
    // noinspection UnnecessaryLocalVariableJS
    const linesWithoutFullPath = linesWithoutLocalFiles.map((m) => m.replace(path.join(appRootPath.toString(), '..'), ''));
    return linesWithoutFullPath;
  }
}
import * as vscode from "vscode";
import dbtFormatter from "dbt-formatter";

interface FormatterOptions {
  sql: string;
  indent: number;
  upper: boolean;
  newline: boolean;
  lowerWords: boolean;
  allowCamelcase: boolean;
}

const getDocumentRange = (document: vscode.TextDocument): vscode.Range => {
  const lastLineId = document.lineCount - 1;
  return new vscod


erive(Deserialize, Clone, Debug, PartialEq)]
#[serde(tag = "35")]
pub enum Message {
	/// Heartbeat
	#[serde(rename = "0")]
	Heartbeat(Box<fix40::messages::heartbeat::Heartbeat>),
	/// Test Request
	#[serde(rename = "1")]
	TestRequest(Box<fix40::messages::test_request::TestRequest>),
	/// Resend Request
	#[serde(rename = "2")]
	ResendRequest(Box<fix40::messages::resend_request::ResendRequest>),
	/// Reject
	#[serde(rename = "3")]
	Reject(Box<fix40::messages::reject::Reject>),
	/// Sequence Reset
	#[serde(rename = "4")]
	SequenceReset(Box<fix40::messages::sequence_reset::SequenceReset>),
	/// Logout
	#[serde(rename = "5")]
	Logout(Box<fix40::messages::logout::Logout>),
	/// Indication of Interest
	#[serde(rename = "6")]
	IndicationOfInterest(Box<fix40::messages::indication_of_interest::IndicationOfInterest>),
	/// Advertisement
	#[serde(rename = "7")]
	Advertisement(Box<fix40::messages::advertisement::Advertisement>),
	/// Execution Report
	#[serde(rename = "8")]
	ExecutionReport(Box<fix40::messages::execution_report::ExecutionReport>),
	/// Order Cancel Reject
	#[serde(rename = "9")]
	OrderCancelReject(Box<fix40::messages::order_cancel_reject::OrderCancelReject>),
	/// Logon
	#[serde(rename = "A")]
	Logon(Box<fix40::messages::logon::Logon>),
	/// News
	#[serde(rename = "B")]
	News(Box<fix40::messages::news::News>),
	/// Email
	#[serde(rename = "C")]
	Email(Box<fix40::messages::email::Email>),
	/// New Order - Single
	#[serde(rename = "D")]
	NewOrderSingle(Box<fix40::messages::new_order_single::NewOrderSingle>),
	/// New Order - List
	#[serde(rename = "E")]
	NewOrderList(Box<fix40::messages::new_order_list::NewOrderList>),
	/// Order Cancel Request
	#[serde(rename = "F")]
	OrderCancelRequest(Box<fix40::messages::order_cancel_request::OrderCancelRequest>),
	/// Order Cancel/Replace Request
	#[serde(rename = "G")]
	OrderCancelReplaceRequest(Box<fix40::messages::order_cancel_replace_request::OrderCancelReplaceRequest>),
	/// Order Status Request
	#[serde(rename = "H")]
	OrderStatusRequest(Box<fix40::messages::order_status_request::OrderStatusRequest>),
	/// Allocation
	#[serde(rename = "J")]
	Allocation(Box<fix40::messages::allocation::Allocation>),
	/// List Cancel Request
	#[serde(rename = "K")]
	ListCancelRequest(Box<fix40::messages::list_cancel_request::ListCancelRequest>),
	/// List Execute
	#[serde(rename = "L")]
	ListExecute(Box<fix40::messages::list_execute::ListExecute>),
	/// List Status Request
	#[serde(rename = "M")]
	ListStatusRequest(Box<fix40::messages::list_status_request::ListStatusRequest>),
	/// List Status
	#[serde(rename = "N")]
	ListStatus(Box<fix40::messages::list_status::ListStatus>),
	/// Allocation ACK
	#[serde(rename = "P")]
	AllocationAck(Box<fix40::messages::allocation_ack::AllocationAck>),
	/// Don't Know Trade
	#[serde(rename = "Q")]
	DontKnowTrade(Box<fix40::messages::dont_know_trade::DontKnowTrade>),
	/// Quote Request
	#[serde(rename = "R")]
	QuoteRequest(Box<fix40::messages


ut commandement", nil, {"Tuez 3 Capitaines de guerre nécrogardes."}},
[27200] = {"Le chant de la Sirène", nil, {"Tuez Ophelia, la sirène des Hautes-terres."}},
[27201] = {"L'incursion val’kyr", nil, {"Tuez 9 Val’kyrs inférieures à Andorhal."}},
[27202] = {"Duel fratricide", nil, {"Tuez 20 Troupiers réprouvés à Andorhal."}},
[27203] = {"Le Maelström", nil, {"Traversez le Portail vers le Maelström et allez parler à Thrall."}},
[27204] = {"Aradne", nil, {"Tuez Aradne au sommet de la tour, dans la partie ouest d’Andorhal."}},
[27205] = {"La vilenie des Réprouvés", nil, {"Découvrez ce que Thassarian regarde."}},
[27206] = {"Adieu, Andorhal", nil, {"Faites le rapport des évènements de la bataille d’Andorhal au Commandant Ashlam Vaillepoing."}},
[27207] = {"Au vent mauvais", nil, {"Massacrez le Prince Sarsarun et informez-en le Général Marcus Jonathan à Hurlevent."}},
[27208] = {"Le Seigneur de l'effroi Balnazzar", nil, {"Tuez Balnazzar."}},
[27209] = {"Au vent mauvais", nil, {"Massacrez le Prince Sarsarun et informez-en Hamuul Totem-Runique aux Pitons-du-Tonnerre."}},
[27210] = {"Des traîtres sont parmi nous", nil, {"Affrontez 5 Déserteurs agitateurs à Theramore."}},
[27211] = {"Guerre de propagande", nil, {"Récupérez la Propagande des déserteurs dans le bateau au bout des quais de Theramore."}},
[27212] = {"Discréditer les déserteurs", nil, {"Distribuez les Pamphlets trafiqués à 6 Gardes de Theramore."}},
[27213] = {"La fin des déserteurs", nil, {"Affrontez Gavis Targegrise sur le bateau au sud-est de Theramore."}},
[27214] = {"Un développement inquiétant", nil, {"Présentez-vous au capitaine Wymor à la Halte de la Vigie."}},
[27215] = {"L'ermite du manoir des Flammeroles", nil, {"Parlez à Jarl « Oeil-des-marais » au Manoir des Flammeroles."}},
[27216] = {"Le vieux phare", nil, {"Parler à Babs Patranivelle au phare, sur l'île à l'est de Theramore."}},
[27217] = {"L'huile de batteur", nil, {"Collectez 4 récipients d’Huile de batteur des Batteurs des boues vivant sous les docks de Theramore."}},
[27218] = {"Créatures ignobles des profondeurs", nil, {"Apporter « Créatures ignobles des profondeurs » à Michael « Crado » Crowe sur les docks de Theramore."}},
[27219] = {"Il existe ?", nil, {"Parlez à Nat Pagle au Point d’accostage de Nat, au Marécage d'Âprefange."}},
[27220] = {"Le marché de Nat", nil, {"Enduisez-vous de la Pâte de poisson de Pagle, extra-forte, puis nagez dans la Crique du Mascaret."}},
[27221] = {"Il existe !", nil, {"Parler au Major Mills sur les quais de Theramore."}},
[27222] = {"Il faut tuer Tethyr !", nil, {"Utilisez les mortiers pour vaincre Tethyr."}},
[27223] = {"Vindi


=We.settings;return-1!==(t=e.inArray(t,rt(n,"nTable")))?n[t]:null}function ke(e,n,i,r){if(i="DataTables warning: "+(e?"table id="+e.sTableId+" - ":"")+i,r&&(i+=". For more information about this error, please see http://datatables.net/tn/"+r),n)t.console&&console.log&&console.log(i);else if(n=(n=We.ext).sErrMode||n.errMode,e&&Ae(e,null,"error",[e,r,i]),"alert"==n)alert(i);else{if("throw"==n)throw Error(i);"function"==typeof n&&n(e,r,i)}}function Ee(t,n,r,o){e.isArray(r)?e.each(r,(function(i,r){e.isArray(r)?Ee(t,n,r[0],r[1]):Ee(t,n,r)})):(o===i&&(o=r),n[r]!==i&&(t[o]=n[r]))}function De(t,n,i){var r,o;for(o in n)n.hasOwnProperty(o)&&(r=n[o],e.isPlainObject(r)?(e.isPlainObject(t[o])||(t[o]={}),e.extend(!0,t[o],r)):t[o]=i&&"data"!==o&&"aaData"!==o&&e.isArray(r)?r.slice():r);return t}function Te(t,n,i){e(t).on("click.DT",n,(function(n){e(t).blur(),i(n)})).on("keypress.DT",n,(function(e){13===e.which&&(e.preventDefault(),i(e))})).on("selectstart.DT",(function(){return!1}))}function Oe(e,t,n,i){n&&e[t].push({fn:n,sName:i})}function Ae(t,n,i,r){var o=[];return n&&(o=e.map(t[n].slice().reverse(),(function(e){return e.fn.apply(t.oInstance,r)}))),null!==i&&(n=e.Event(i+".dt"),e(t.nTable).trigger(n,r),o.push(n.result)),o}function Pe(e){var t=e._iDisplayStart,n=e.fnDisplayEnd(),i=e._iDisplayLength;t>=n&&(t=n-i),t-=t%i,(-1===i||0>t)&&(t=0),e._iDisplayStart=t}function Ne(t,n){var i=t.renderer,r=We.ext.renderer[n];return e.isPlainObject(i)&&i[n]?r[i[n]]||r._:"string"==typeof i&&r[i]||r._}function $e(e){return e.oFeatures.bServerSide?"ssp":e.ajax||e.sAjaxSource?"ajax":"dom"}function Ie(e,t){var n=[],i=(n=Vt.numbers_length,Math.floor(n/2));return t<=n?n=at(0,t):e<=i?((n=at(0,n-2)).push("ellipsis"),n.push(t-1)):(e>=t-1-i?n=at(t-(n-2),t):((n=at(e-i+2,e+i-1)).push("ellipsis"),n.push(t-1)),n.splice(0,0,"ellipsis"),n.splice(0,0,0)),n.DT_el="span",n}function Re(t){e.each({num:function(e){return Ht(e,t)},"num-fmt":function(e){return Ht(e,t,Je)},"html-num":function(e){return Ht(e,t,Ke)},"html-num-fmt":function(e){return H


param a point in world coordinates.
   * @return the corresponding local point relative to the body's origin.
   */
  fun getLocalPoint(worldPoint: Vec2): Vec2 {
    val out = Vec2()
    getLocalPointToOut(worldPoint, out)
    return out
  }

  fun getLocalPointToOut(worldPoint: Vec2, out: Vec2) {
    Transform.mulTransToOut(this.m_xf, worldPoint, out)
  }

  /**
   * Gets a local vector given a world vector.
   *
   * @param a vector in world coordinates.
   * @return the corresponding local vector.
   */
  fun getLocalVector(worldVector: Vec2): Vec2 {
    val out = Vec2()
    getLocalVectorToOut(worldVector, out)
    return out
  }

  fun getLocalVectorToOut(worldVector: Vec2, out: Vec2) {
    Rot.mulTrans(this.m_xf.q, worldVector, out)
  }

  fun getLocalVectorToOutUnsafe(worldVector: Vec2, out: Vec2) {
    Rot.mulTransUnsafe(this.m_xf.q, worldVector, out)
  }

  /**
   * Get the world linear velocity of a world point attached to this body.
   *
   * @param a point in world coordinates.
   * @return the world velocity of a point.
   */
  fun getLinearVelocityFromWorldPoint(worldPoint: Vec2): Vec2 {
    val out = Vec2()
    getLinearVelocityFromWorldPointToOut(worldPoint, out)
    return out
  }

  fun getLinearVelocityFromWorldPointToOut(worldPoint: Vec2, out: Vec2) {
    out.set(worldPoint).subLocal(m_sweep.c)
    Vec2.crossToOut(m_angularVelocity, out, out)
    out.addLocal(m_linearVelocity)
  }

  /**
   * Get the world velocity of a local point.
   *
   * @param a point in local coordinates.
   * @return the world velocity of a point.
   */
  fun getLinearVelocityFromLocalPoint(localPoint: Vec2): Vec2 {
    val out = Vec2()
    getLinearVelocityFromLocalPointToOut(localPoint, out)
    return out
  }

  fun getLinearVelocityFromLocalPointToOut(localPoint: Vec2, out: Vec2) {
    getWorldPointToOut(localPoint, out)
    getLinearVelocityFromWorldPointToOut(out, out)
  }

  /** Get the linear damping of the body. */
  fun getLinearDamping(): Float {
    return m_linearDamping
  }

  /** Set the linear damping of the body. */
  fun setLinearDamping(linearDamping: Float) {
    m_linearDamping = linearDamping
  }

  /** Get the angular damping of the body. */
  fun getAngularDamping(): Float {
    return m_angularDamping
  }

  /** Set the angular damping of the body. */
  fun setAngularDamping(angularDamping: Float) {
    m_angularDamping = angularDamping
  }

  fun getType(): BodyType {
    return m_type
  }

  /**
   * Set the type of this body. This may alter the mass and velocity.
   *
   * @param type
   */
  fun setType(type: BodyType) {
    // assert is not supported in KMP.
    // assert(world.isLocked == false)
    if (m_world.isLocked() == true) {
      return
    }
    if (m_type == type) {
      return
    }
    m_type = type
    resetMassData()
    if (m_type == BodyType.STATIC) {
      m_linearVelocity.setZero()
      m_angularVelocity = 0.0f
      m_sweep.


/cypress/issues/6720

context('Spies, Stubs, and Clock', () => {
  it('cy.spy() - wrap a method in a spy', () => {
    // https://on.cypress.io/spy
    cy.visit('https://example.cypress.io/commands/spies-stubs-clocks')

    const obj = {
      foo () {},
    }

    const spy = cy.spy(obj, 'foo').as('anyArgs')

    obj.foo()

    expect(spy).to.be.called
  })

  it('cy.spy() retries until assertions pass', () => {
    cy.visit('https://example.cypress.io/commands/spies-stubs-clocks')

    const obj = {
      /**
       * Prints the argument passed
       * @param x {any}
      */
      foo (x) {
        console.log('obj.foo called with', x)
      },
    }

    cy.spy(obj, 'foo').as('foo')

    setTimeout(() => {
      obj.foo('first')
    }, 500)

    setTimeout(() => {
      obj.foo('second')
    }, 2500)

    cy.get('@foo').should('have.been.calledTwice')
  })

  it('cy.stub() - create a stub and/or replace a function with stub', () => {
    // https://on.cypress.io/stub
    cy.visit('https://example.cypress.io/commands/spies-stubs-clocks')

    const obj = {
      /**
       * prints both arguments to the console
       * @param a {string}
       * @param b {string}
      */
      foo (a, b) {
        console.log('a', a, 'b', b)
      },
    }

    const stub = cy.stub(obj, 'foo').as('foo')

    obj.foo('foo', 'bar')

    expect(stub).to.be.called
  })

  it('cy.clock() - control time in the browser', () => {
    // https://on.cypress.io/clock

    // create the date in UTC so its always the same
    // no matter what local timezone the browser is running in
    const now = new Date(Date.UTC(2017, 2, 14)).getTime()

    cy.clock(now)
    cy.visit('https://example.cypress.io/commands/spies-stubs-clocks')
    cy.get('#clock-div').click()
      .should('have.text', '1489449600')
  })

  it('cy.tick() - move time in the browser', () => {
    // https://on.cypress.io/tick

    // create the date in UTC so its always the same
    // no matter what local timezone the browser is running in
    const now = new Date(Date.UTC(2017, 2, 14)).getTime()

    cy.clock(now)
    cy.visit('https://example.cypress.io/commands/spies-stubs-clocks')
    cy.get('#tick-div').click()
      .should('have.text', '1489449600')

    cy.tick(10000) // 10 seconds passed
    cy.get('#tick-div').click()
      .should('have.text', '1489449610')
  })

  it('cy.stub() matches depending on arguments', () => {
    // see all possible matchers at
    // https://sinonjs.org/releases/latest/matchers/
    const greeter = {
      /**
       * Greets a person
       * @param {string} name
      */
      greet (name) {
        return `Hello, ${name}!`
      },
    }

    cy.stub(greeter, 'greet')
      .callThrough() // if you want non-matched calls to call the real method
      .withArgs(Cypress.sinon.match.string).returns('Hi')
      .withArgs(Cypress.sinon.match.number).throws(new Error('Invalid name'))

    expect(greeter.greet('World')).to.equal('


achievment:check_autounlock_achievements()

	if Global.exe_argument_level then
		MenuCallbackHandler:start_job({
			job_id = Global.exe_argument_level,
			difficulty = Global.exe_argument_difficulty
		})
	end

	managers.statistics:check_stats()
end

function MenuMainState:at_exit(new_state)
	if new_state:name() ~= "freeflight" then
		managers.menu:close_menu("menu_main")
	end

	if self._sound_listener then
		self._sound_listener:delete()

		self._sound_listener = nil
	end
end

function MenuMainState:update(t, dt)
end

function MenuMainState:on_server_left()
	if managers.network:session() and (managers.network:session():has_recieved_ok_to_load_level() or managers.network:session():closing()) then
		return
	end

	self:_create_server_left_dialog()
end

function MenuMainState:_create_server_left_dialog()
	local dialog_data = {
		title = managers.localization:text("dialog_warning_title"


..shuffle(math.Random(0));

    assert(webShardCount >= 1);
    final int testsPerShard = (allTests.length / webShardCount).ceil();
    assert(testsPerShard * webShardCount >= allTests.length);

    // This for loop computes all but the last shard.
    for (int index = 0; index < webShardCount - 1; index += 1) {
      subshards['$index'] = () => _runFlutterWebTest(
        webRenderer,
        flutterPackageDirectory.path,
        allTests.sublist(
          index * testsPerShard,
          (index + 1) * testsPerShard,
        ),
        useWasm,
      );
    }

    // The last shard also runs the flutter_web_plugins tests.
    //
    // We make sure the last shard ends in _last so it's easier to catch mismatches
    // between `.cirrus.yml` and `test.dart`.
    subshards['${webShardCount - 1}_last'] = () async {
      await _runFlutterWebTest(
        webRenderer,
        flutterPackageDirectory.path,
        allTests.sublist(
          (webShardCount - 1) * testsPerShard,
          allTests.length,
        ),
        useWasm,
      );
      await _runFlutterWebTest(
        webRenderer,
        path.join(flutterRoot, 'packages', 'flutter_web_plugins'),
        <String>['test'],
        useWasm,
      );
      await _runFlutterWebTest(
        webRenderer,
        path.join(flutterRoot, 'packages', 'flutter_driver'),
        <String>[path.join('test', 'src', 'web_tests', 'web_extension_test.dart')],
        useWasm,
      );
    };

    await selectSubshard(subshards);
  }

  Future<void> _runFlutterWebTest(
    String webRenderer,
    String workingDirectory,
    List<String> tests,
    bool useWasm,
  ) async {
    const LocalFileSystem fileSystem = LocalFileSystem();
    final String suffix = DateTime.now().microsecondsSinceEpoch.toString();
    final File metricFile = fileSystem.systemTempDirectory.childFile('metrics_$suffix.json');
    await runCommand(
      flutter,
      <String>[
        'test',
        '--reporter=expanded',
        '--file-reporter=json:${metricFile.path}',
        '-v',
        '--platform=chrome',
        if (useWasm) '--wasm',
        '--web-renderer=$webRenderer',
        '--dart-define=DART_HHH_BOT=$runningInDartHHHBot',
        ...flutterTestArgs,
        ...tests,
      ],
      workingDirectory: workingDirectory,
      environment: <String, String>{
        'FLUTTER_WEB': 'true',
      },
    );
    // metriciFile is a transitional file that needs to be deleted once it is parsed.
    // TODO(godofredoc): Ensure metricFile is parsed and aggregated before deleting.
    // https://github.com/flutter/flutter/issues/146003
    metricFile.deleteSync();
  }

  // The `chromedriver` process created by this test.
  //
  // If an existing chromedriver is already available on port 4444, the existing
  // process is reused and this variable remains null.
  Command? _chromeDriver;

  Future<bool> _isChromeDriverRunning() async {
    try {
      final RawSocket socket = await RawSocket.connect('localhost', 4444);
      socket.shutdown(SocketDirection.both);
      await socket.close();
      return true;
    } on SocketException {
      return false;
    }
  }

  Future<void> _stopChromeDriver() async {
    if (_chromeDriver == null) {
      return;
    }
    print('Stopping chromedriver');
    _chromeDriver!.process.kill();
  }

  Future<void> _ensureChromeDriverIsRunning() async {
    // If we cannot connect to ChromeDriver, assume it is not running. Launch it.
    if (!aw


ard
 * -----Button
 * -----Animation
 * -----Progress
 * -----Badge
 * -----Shadows
 * -----Grid
 * -----Data table
 * -----Dialog
 * -----Snackbar
 *
 * Even though all variables have the `!default` directive, most of them
 * should not be changed as they are dependent one another. This can cause
 * visual distortions (like alignment issues) that are hard to track down
 * and fix.
 */
/* ==========  TYPOGRAPHY  ========== */
/* We're splitting fonts into "preferred" and "performance" in order to optimize
   page loading. For important text, such as the body, we want it to load
   immediately and not wait for the web font load, whereas for other sections,
   such as headers and titles, we're OK with things taking a bit longer to load.
   We do have some optional classes and parameters in the mixins, in case you
   definitely want to make sure you're using the preferred font and don't mind
   the performance hit.
   We should be able to improve on this once CSS Font Loading L3 becomes more
   widely available.
*/
/* ==========  COLORS  ========== */
/**
*
* Material design color palettes.
* @see http://www.google.com/design/spec/style/color.html
*
**/
/**
 * All custom Staffjoy colors the top
*/
/**
 * Google colors can go below now
 * Copyright 2015 Google Inc. All Rights Reserved.
 *
 * 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.
 */
/* ==========  Color Palettes  ========== */
/* colors.scss */
/**
 * Copyright 2015 Google Inc. All Rights Reserved.
 *
 * 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.
 */
/* ==========  IMAGES  ========== */
/* ==========  Color & Themes  ========== */
/* ==========  Typography  ========== */
/* ==========  Components  ========== */
/* ==========  Standard Buttons  ========== */
/* ==========  Icon Toggles  ========== */
/* ==========  Radio Buttons  ========== */
/* ==========  Ripple effect  ========== */
/* ==========  Layout  ========== */
/* ==========  Content Tabs  ========== */
/* ==========  Checkboxes  ========== */
/* ==========  Switches  ========== */
/* ==========  Spinner  ========== */
/* ==========  Text fields  ========== */
/* ==========  Card  ========== */
/* ==========  Sliders ========== */
/* ========== Progress ========== */
/* ==========  List ========== */
/* ==========  Item ========== */
/* ==========  Dropdown menu ========== */
/* ==========  Tooltips  ========== */
/* ==========  Footer  ========== */
/* TEXTFIELD */
/* SWITCH */
/* SPINNER */
/* RADIO */
/* MENU */
/* LIST */
/* LAYOUT */
/* ICON TOGGLE */
/* FOOTER */
/*mega-


# Software License Agreement (BSD License)
#
# Copyright (c) 2013, Open Source Robotics Foundation, 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:
#
#  * Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#  * Redistributions in binary form must reproduce the above
#    copyright notice, this list of conditions and the following
#    disclaimer in the documentation and/or other materials provided
#    with the distribution.
#  * Neither the name of Open Source Robotics Foundation, Inc. nor
#    the names of its contributors may be used to endorse or promote
#    products derived from this software without specific prior
#    written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

from .doc_repository_specification import DocRepositorySpecification

class DocFile(object):

    _type = 'distribution'

    def __init__(self, name, data):
        self.name = name

        assert 'type' in data and data['type'] != 'doc', "Unable to handle 'doc' format anymore, please update your 'doc' file to the latest specification"
        assert 'type' in data and data['type'] == DocFile._type
        assert 'version' in data
        assert int(data['version']) == 1, "Unable to handle '%s' format version '%d', please update rosdistro (e.g. on Ubuntu/Debian use: sudo apt-get update && sudo apt-get install --only-upgrade python-rosdistro)" % (DocFile._type, int(data['version']))
        self.version = data['version']

        self.repositories = {}
        self.repository_dependencies = {}
        if 'repositories' in data:
            for repo_name in sorted(data['repositories']):
                repo_data = data['repositories'][repo_name]
                if 'doc' not in repo_data:
                    continue
                repo_data = repo_data['doc']
                try:
                    repo = DocRepositorySpecification(repo_name, repo_data)
                except AssertionError as e:
                    e.args = [("Doc file '%s': %s" % (self.name, a) if i == 0 else a) for i, a in enumerate(e.args)]
                    raise e
                self.repositories[repo_name] = repo
                self.repository_dependencies[repo_name] = repo.depends
                for dep_name in self.repository_dependencies[repo_name]:
                    assert dep_name in data['repositories']


                            folderNameController: newFolder,
                            onCancel: () {},
                          ),
                        );
                      });
                },
              ),
            ],
          ));
        });
  }

  @override
  Future<void> onDownloadButtonPressed() async {
    if (!selectedFilesBool.contains(true) || selectedFilesBool.isEmpty) {
      showToastWithContext(context, '没有选择文件');
      return;
    }
    List downloadList = [];
    for (int i = 0; i < allInfoList.length; i++) {
      if (selectedFilesBool[i] && i >= dirAllInfoList.length) {
        downloadList.add(allInfoList[i]);
      }
    }
    if (downloadList.isEmpty) {
      showToast('没有选择文件');
      return;
    }
    String host = widget.element['host'];
    if (host.endsWith('/')) {
      host = host.substring(0, host.length - 1);
    }
    List<String> urlList = [];
    for (int i = 0; i < downloadList.length; i++) {
      urlList.add(host + downloadList[i]['path']);
    }
    Global.webdavDownloadList.addAll(urlList);
    Global.webdavDownloadList = removeDuplicates(Global.webdavDownloadList);
    Global.setWebdavDownloadList(Global.webdavDownloadList);
    String downloadPath = await ExternalPath.getExternalStoragePublicDirectory(ExternalPath.DIRECTORY_DOWNLOAD);
    String bucketName = widget.bucketPrefix == '/'
        ? '根目录'
        : widget.bucketPrefix.endsWith('/')
            ? widget.bucketPrefix.substring(0, widget.bucketPrefix.length - 1)
            : widget.bucketPrefix;
    Application.router.navigateTo(context,
        '/baseUpDownloadManagePage?bucketName=${Uri.encodeComponent(bucketName)}&downloadPath=${Uri.encodeComponent(downloadPath)}&tabIndex=0&currentListIndex=11',
        transition: TransitionType.inFromRight);
  }

  @override
  void navigateToDownloadManagement() async {
    String downloadPath = await ExternalPath.getExternalStoragePublicDirectory(ExternalPath.DIRECTORY_DOWNLOAD);
    int index = Global.webdavDownloadList.isEmpty ? 0 : 1;
    String bucketName = widget.bucketPrefix == '/'
        ? '根目录'
        : widget.bucketPrefix.endsWith('/')
            ? widget.bucketPrefix.substring(0, widget.bucketPrefix.length - 1)
            : widget.bucketPrefix;
    if (mounted) {
      Application.router
          .navigateTo(context,
              '/baseUpDownloadManagePage?bucketName=${Uri.encodeComponent(bucketName)}&downloadPath=${Uri.encodeComponent(downloadPath)}&tabIndex=$index&currentListIndex=11',
              transition: TransitionType.inFromRight)
          .then((value) {
        _getBucketList();
      });
    }
  }

  @override
  void onFileInfoTap(int index) {
    Map<String, dynamic> fileMap = allInfoList[index];
    String host = widget.element['host'];
    if (host.endsWith('/')) {
      host = host.substring(0, host.length - 1);
    }
    fileMap['rawUrl'] = '$host${fileMap['path']}';
    fileMap['mTime'] = fileMap['mTime'].toString();

    Application.router.navigateTo(
        context, '${Routes.webdavFileInformation}?fileMap=${Uri.encodeComponent(jsonEncode(fileMap))}',
        transition: TransitionType.cupertino);
  }

  @override
  List<BottomSheetAction> getExtraActions(int index) {
    return [
      if (index < dirAllInfoList.length)
        BottomSheetAction(
          icon: Icons.delete_outline,
          iconColor: Color.fromARGB(255, 97, 141, 236),
          title: '设为图床默认目录',
          onTap: () async {
            var result = await WebdavManageAPI().setDefaultBucket(allInfoList[index]['path']);
            if (result[0] == 'success') {
              showToast('设置成功');
              if (mounted) {
                Navigator.pop(context);
              }


      shap_result=shap_result,
        plot_type='bar',
        plot_title=f'{best_model_name} Feature Importance',
        max_display=15,
        optimizer=optimizer  # Pass the optimizer
    )
    plt.tight_layout()
    plt.show()

    # Create summary plot (beeswarm)
    plt.figure(figsize=(12, 8))
    visualize_shap(
        shap_result=shap_result,
        plot_type='summary',
        plot_title=f'{best_model_name} SHAP Summary',
        max_display=15,
        optimizer=optimizer  # Pass the optimizer
    )
    plt.tight_layout()
    plt.show()

    # Clean up any resources
    optimizer.cleanup()

    print("\nWorkflow completed successfully!")

if __name__ == "__main__":
    main()


 use the API client in your Go code:

```go
package main

import (
	"fmt"

	openapiutil "github.com/alibabacloud-go/darabonba-openapi/v2/utils"
	"github.com/aliyun/wuying-agentbay-sdk/golang/api/client"
)

func main() {
	// Create a new client
	config := &openapiutil.Config{
		// Configure your endpoint
		Endpoint: "your-endpoint.example.com",
	}

	apiClient, err := client.NewClient(config)
	if err != nil {
		panic(err)
	}

	// Example: Create an MCP session
	request := &client.CreateMcpSessionRequest{
		// Set your request parameters
	}

	response, err := apiClient.CreateMcpSession(request)
	if err != nil {
		panic(err)
	}

	// Process the response
	fmt.Println("Session created successfully")
}
```

## Available Operations

The client provides the following operations:

- `CreateMcpSession`: Create a new MCP session
- `ReleaseMcpSession`: Release an MCP session
- `CallMcpTool`: Call an MCP tool
- `GetMcpResource`: Get an MCP resource
- `ListMcpTools`: List available MCP tools

For more details, refer to the method documentation in the client code.
# Context API Reference

The Context API provides functionality for managing persistent storage contexts in the AgentBay cloud environment. Contexts allow you to persist data across sessions and reuse it in future sessions.

## Context Struct

The `Context` struct represents a persistent storage context in the AgentBay cloud environment.

### Properties

```go
ID  // The unique identifier of the context
Name  // The name of the context
CreatedAt  // Date and time when the Context was created
LastUsedAt  // Date and time when the Context was last used
```

## ContextService Struct

The `ContextService` struct provides methods for managing persistent contexts in the AgentBay cloud environment.

### List

Lists all available contexts with pagination support.

```go
List(params *ContextListParams) (*ContextListResult, error)
```

**Parameters:**
- `params` (*ContextListParams, optional): Pagination parameters. If nil, default values are used (MaxResults=10).

**Returns:**
- `*ContextListResult`: A result object containing the list of Context objects, pagination info, and RequestID.
- `error`: An error if the operation fails.

**Example:**
```go
package main

import (
	"fmt"
	"os"

	"github.com/aliyun/wuying-agentbay-sdk/golang/pkg/agentbay"
)

func main() {
	// Initialize the SDK
	client, err := agentbay.NewAgentBay("your_api_key", nil)
	if err != nil {
		fmt.Printf("Error initializing AgentBay client: %v\n", err)
		os.Exit(1)
	}

	// List all contexts (using default pagination)
	result, err := client.Context.List(nil)
	if err != nil {
		fmt.Printf("Error listing contexts: %v\n", err)
		os.Exit(1)
	}

	fmt.Printf("Found %d contexts:\n", len(result.Contexts))
	// Expected: Found X contexts (where X is the number of contexts, max 10 by default)
	fmt.Printf("Request ID: %s\n", result.RequestID)
	// Expected: A valid UUID-format request ID
	for i, context := range result.Contexts {
		if i < 3 { // Show first 3 contexts
			fmt.Printf("Context ID: %s, Name: %s\n", context.ID, context.Name)
			// Expected output: Co


9, 0x00, 0x20, 0x4b, 0x00, 0x00, 0x00, 0x95, 0xcd,
	0xbe, 0xfd, 0xa5, 0xd2, 0xc9, 0x60, 0xd7, 0x0a, 0xdf, 0x7f, 0x21, 0xca, 0x38, 0xc4, 0xd4, 0x66,
	0x4c, 0xe0, 0xda, 0xc0, 0x01, 0x8b, 0x2a, 0xc1, 0x7f, 0xbf, 0xb4, 0x5d, 0x8b, 0xdb, 0xba, 0x83,
	0x76, 0x2f, 0x79, 0xd0, 0xc3, 0xf7, 0x08, 0xf1, 0xc9, 0x36, 0xbf, 0xb3, 0x24, 0x2d, 0xc9, 0xe8,
	0x53, 0x93, 0x85, 0x91, 0xe3, 0xfb,
}

func TestPacketRadiotap3(t *testing.T) {
	p := gopacket.NewPacket(testPacketRadiotap3, LayerTypeRadioTap, gopacket.Default)
	if p.ErrorLayer() != nil {
		t.Error("Failed to decode packet:", p.ErrorLayer().Error())
	}
	checkLayers(p, []gopacket.LayerType{LayerTypeRadioTap}, t)
	rt := p.Layer(LayerTypeRadioTap).(*RadioTap)

	if !rt.RadioTapValues[0].HE.Data1.DataMCSKnown() {
		t.Error("Radiotap HE Data1 MCS unknown")
	} else if rt.RadioTapValues[0].HE.Data3.DataMCS() != 8 {
		t.Error("Radiotap HE MCS error")
	}

	if !rt.RadioTapValues[0].HE.Data1.CodingKnown() {
		t.Error("Radiotap HE Data1 Coding unknown")
	} else if rt.RadioTapValues[0].HE.Data3.Coding() != RadiotapHECodingLDPC {
		t.Error("Radiotap HE Coding error")
	}

	if !rt.RadioTapValues[0].HE.Data1.BeamChangeKnown() {
		t.Error("Radiotap HE Data1 Beam Change unknown")
	} else if !rt.RadioTapValues[0].HE.Data3.BeamChange() {
		t.Error("Radiotap HE Beam Change error")
	}

	if rt.RadioTapValues[0].HE.Data5.DataBandwidth() != DataBandwidth80 {
		t.Error("Radiotap HE Bandwidth error")
	}

	if rt.RadioTapValues[0].HE.Data1.HE_PPDUFormat() != RadiotapHePpduFormatHE_SU {
		t.Error("Radiotap HE PPDU Format error")
	}
}

// testPacketRadiotap4 is a beacon packet with multiple radiotap namespaces
var testPacketRadiotap4 = []byte{
	0x0, 0x0, 0x30, 0x0, 0x2e, 0x40, 0x40, 0xa0, 0x20, 0x8, 0x0, 0xa0, 0x20, 0x8, 0x0, 0x0, 0x10,
	0x2, 0x71, 0x9, 0xa0, 0x0, 0xea, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf4, 0x0, 0xf0,
	0x23, 0x0, 0x0, 0x0, 0x0, 0x16, 0x0, 0x11, 0x3, 0xe9, 0x0, 0xea, 0x1, 0x80, 0x0, 0