// Copyright (c) 2020-2025 SharpCrafters s.r.o. and contributors.
// SharpCrafters s.r.o. licenses this file to you under either the MIT license or a proprietary license, depending on the repository from which it was obtained.
// Refer to LICENSE.md in the repository root for complete details.

using Metalama.Framework.Code;
using Metalama.Framework.CompileTimeContracts;
using Metalama.Framework.Engine.SyntaxSerialization;
using Metalama.Framework.RunTime;

namespace Metalama.Framework.Engine.ReflectionMocks
{
    internal sealed class CompileTimeFieldOrPropertyInfo : FieldOrPropertyInfo, IUserExpression
    {
        public IFieldOrPropertyOrIndexer FieldOrPropertyOrIndexer { get; }

        private CompileTimeFieldOrPropertyInfo( IFieldOrPropertyOrIndexer fieldOrPropertyOrIndexer )
        {
            this.FieldOrPropertyOrIndexer = fieldOrPropertyOrIn


ficului, o formă de supraveghere a rețelei care amenință libertatea și intimitatea personală, activitățile și relațiile de afaceri confidențiale și securitatea statului.';
  }

  @override
  String guide250Sbbtc250Sbcard8722Sbfour8722Sb3(Object torBrowser, Object appName, Object torLink) {
    return 'Pentru a-l utiliza, trebuie doar să descărcați și să instalați $torBrowser de pe site-ul lor oficial. După ce îl lansați, puteți accesa $appName prin intermediul portalului nostru special Tor: $torLink';
  }

  @override
  String guide250Sbbtc250Sbcard8722Sbfour8722Sb4(Object appName) {
    return 'Când cumpărați pe $appName, utilizați metode de plată care implică numerar';
  }

  @override
  String get guide250Sbbtc250Sbcard8722Sbfour8722Sb5 => 'Ori de câte ori cumpărați folosind un transfer bancar, PayPal sau alte opțiuni de plată de acest tip, va exista întotdeauna o scurgere de informații privind confidențialitatea datorită înregistrărilor păstrate de companiile care procesează plata. Pentru a evita această scurgere de confidențialitate, folosiți metode care implică bani în numerar.';

  @override
  String get guide250Sbbtc250Sbcard8722Sbfour8722Sb6 => 'Folosiți metode precum numerar prin poștă, depuneri de numerar la bancomat, întâlniri față în față sau carduri cadou cumpărate cu numerar. ';

  @override
  String get guide250Sbbtc250Sbcard8722Sbfour250Sbtitle => 'Tehnici avansate de a rămâne anonim atunci când se utilizează această metodă de cumpărare Bitcoins';

  @override
  String guide250Sbbtc250Sbcard8722Sbone8722Sb1(Object wikipedia) {
    return 'Conform $wikipedia:';
  }

  @override
  String get guide250Sbbtc250Sbcard8722Sbone8722Sb2 => 'Monero (XMR) este o criptomonedă cu sursă deschisă, creată în aprilie 2014, care se concentrează pe fungibilitate, confidențialitate și descentralizare. Monero folosește un registru public ofuscat, ceea ce înseamnă că oricine poate difuza sau trimite tranzacții, dar niciun observator extern nu poate spune sursa, suma sau destinația. Monero folosește un mecanism Proof of Work pentru a emite noi monede și pentru a stimula minerii să securizeze rețeaua și să valideze tranzacțiile.';

  @override
  String get guide250Sbbtc250Sbcard8722Sbone8722Sb3 => 'Monero este încurajată în mod activ pentru cei care caută confidențialitate financiară, deoarece plățile și soldurile conturilor rămân în întregime ascunse, ceea ce nu este standardul pentru majoritatea criptomonedelor.';

  @override
  String get guide250Sbbtc250Sbcard8722Sbone250Sbtitle => '1. Ce este Monero?';

  @override
  String guide250Sbbtc250Sbcard8722Sbthree8722Sb1(Object appName) {
    return 'Pasul 6: Retragerea Bitcoins din $appName';
  }

  @override
  String get guide250Sbbtc250Sbcard8722Sbthree8722Sb2 => 'Acum, mergeți pe pagina po


spañol">

						<button type="button">

							IT Accessibility (with extended description)
						</button>

						<button type="button">

							The Deadline
						</button>

<!DOCTYPE html>

<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Audio Player with a playlist | Able Player Demos</title>
<link rel="stylesheet" href="demos.css" type="text/css">

<link rel="stylesheet" href="../build/ableplay


>=10 {
            break;
        }
        n+=1;

        if n==5 {
            continue;
        }
        println!("the value of n = {}",n);

    }
}
//! Memory type module.

pub mod index;

pub use self::index::*;
extern crate spidev;
use spidev::Spidev;
use std::io::prelude::*;

fn main() {
    let mut spidev = Spidev::open("/dev/spidev0.0").unwrap();
    spidev.write(&[0xAA, 0x00, 0x01, 0x02, 0x04]).unwrap();

    let mut buf: [u8; 10] = [0; 10];
    spidev.read(&mut buf).unwrap(); // read 10
    println!("{:?}", buf);
}
#![allow(dead_code)]
#![allow(non_camel_case_types)]

use libc::{c_char, c_int, c_uchar, c_uint, c_ushort, sockaddr, timeval, FILE};

#[repr(C)]
#[derive(Copy, Clone)]
pub struct bpf_program {
    pub bf_len: c_uint,
    pub bf_insns: *mut bpf_insn,
}

#[repr(C)]
#[derive(Copy, Clone)]
pub struct bpf_insn {
    pub code: c_ushort,
    pub jt: c_uchar,
    pub jf: c_uchar,
    pub k: c_uint,
}

pub enum pcap_t {}

pub enum pcap_dumper_t {}

#[repr(C)]
#[derive(Copy, Clone)]
pub struct pcap_file_header {
    pub magic: c_uint,
    pub version_major: c_ushort,
    pub version_minor: c_ushort,
    pub thiszone: c_int,
    pub sigfigs: c_uint,
    pub snaplen: c_uint,
    pub linktype: c_uint,
}

pub type pcap_direction_t = c_uint;

pub const PCAP_D_INOUT: pcap_direction_t = 0;
pub const PCAP_D_IN: pcap_direction_t = 1;
pub const PCAP_D_OUT: pcap_direction_t = 2;

#[repr(C)]
#[derive(Copy, Clone)]
pub struct pcap_pkthdr {
    pub ts: timeval,
    pub caplen: c_uint,
    pub len: c_uint,
}

#[repr(C)]
#[derive(Copy, Clone)]
pub struct pcap_stat {
    pub ps_recv: c_uint,
    pub ps_drop: c_uint,
    pub ps_ifdrop: c_uint,
}

#[repr(C)]
#[derive(Copy, Clone)]
pub struct pcap_if_t {
    pub next: *mut pcap_if_t,
    pub name: *mut c_char,
    pub description: *mut c_char,
    pub addresses: *mut pcap_addr_t,
    pub flags: c_uint,
}

#[repr(C)]
#[derive(Copy, Clone)]
pub struct pcap_addr_t {
    pub next: *mut pcap_addr_t,
    pub addr: *mut sockaddr,
    pub netmask: *mut sockaddr,
    pub broadaddr: *mut sockaddr,
    pub dstaddr: *mut sockaddr,
}

pub type pcap_handler =
    Option<extern "C" fn(arg1: *mut c_uchar, arg2: *const pcap_pkthdr, arg3: *const c_uchar) -> ()>;
pub(crate) static mut pcap_create_symbol: Option<
    fn(arg1: *const c_char, arg2: *mut c_char) -> *mut pcap_t,
> = None;
pub(crate) static mut pcap_lookupdev_symbol: Option<fn(arg1: *mut c_char) -> *mut c_char> = None;
pub(crate) static mut pcap_set_snaplen_symbol: Option<fn(arg1: *mut pcap_t, arg2: c_int) -> c_int> =
    None;
pub(crate) static mut pcap_set_promisc_symbol: Option<fn(arg1: *mut pcap_t, arg2: c_int) -> c_int> =
    None;
pub(crate) static mut pcap_set_timeout_symbol: Option<fn(arg1: *mut


ENET_RGB_MEANS, std=IMAGENET_RGB_STDS),
])

def preprocess(img_file) -> List["numpy.ndarray"]:
    with open(img_file, "rb") as img_file:
        img = Image.open(img_file)
        img = img.convert("RGB")
    img = preprocess_transforms(img)
    batch = torch.stack([img])
    return [batch.numpy()]

def postprocess(outputs: List["numpy.ndarray"]):
    return outputs
```

Spinning up:

```bash
deepsparse.server \
  --config-file custom-processing-config.yaml
```

Now the custom preprocess and postprocess functions will be used when
requests are made to this server!

## Multi-Stream

Stay tuned for documentation on multi-stream scheduling with DeepSparse!

## Logging

Stay tuned for documentation on DeepSparse Logging!

## Hot Reloading

Stay tuned for documentation on Hot Reloading!
<!--
Copyright (c) 2021 - present / Neuralmagic, Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

# **DeepSparse LangChain Integration**

[DeepSparse](https://github.com/neuralmagic/deepsparse) has an official integration within [LangChain](https://python.langchain.com/docs/integrations/llms/deepsparse).
It is broken into two parts: installation and then examples of DeepSparse usage.

## Installation and Setup

- Install the Python packages with `pip install deepsparse-nightly langchain`
- Choose a [SparseZoo model](https://sparsezoo.neuralmagic.com/?useCase=text_generation) or export a support model to ONNX [using Optimum](https://github.com/neuralmagic/notebooks/blob/main/notebooks/opt-text-generation-deepsparse-quickstart/OPT_Text_Generation_DeepSparse_Quickstart.ipynb)
- Models hosted on Hugging Face are also supported by prepending `"hf:"` to the model id, such as [`"hf:mgoin/TinyStories-33M-quant-deepsparse"`](https://huggingface.co/mgoin/TinyStories-33M-quant-deepsparse)

## Using DeepSparse With LangChain

There is a DeepSparse LLM wrapper, which you can access with:

```python
from langchain.llms import DeepSparse
```

It provides a simple, unified interface for all models:

```python
from langchain.llms import DeepSparse
llm = DeepSparse(model='zoo:nlg/text_generation/codegen_mono-350m/pytorch/huggingface/bigpython_bigquery_thepile/base-none')
print(llm('def fib():'))
```
## Streaming
The DeepSparse LangChain wrapper also supports per-token output streaming:

```python
from langchain.llms import DeepSparse
llm = DeepSparse(
    model="hf:neuralmagic/mpt-7b-chat-pruned50-quant",
    streaming=True
)
for chunk in llm.stream("Tell me a joke", stop=["'","\n"]):
    print(chunk, end='', flush=True)
```
## Using Instruction Fine-tune Models With DeepSparse
Here's an example of how to prompt an instruction in a fine-tuned model using DeepSparse and the MPT-Instruct model:
```python
prompt="""
Below is an instruction that describes a task. Write a response that appropriately completes the request. ### Instruction: what is quantization? ### Response:
"""
llm = DeepSparse(model='zoo:mpt-7b-dolly_mpt_pretrain-pruned50_quantized')
print(llm(prompt))
"""
In physics, the term "quantization" refers to the process of transforming a continuous variable into a set of discrete values. In the context of quantum mechanics, this process is used to describe the restriction of the degrees of freedom of a system to a set of discrete values. In other


io->flags & TC_MQPRIO_F_MAX_RATE);

	err = aq_validate_mqprio_opt(aq_nic, mqprio, mqprio->qopt.num_tc);
	if (err)
		return err;

	for (i = 0; i < mqprio->qopt.num_tc; i++) {
		if (has_max_rate) {
			u64 max_rate = mqprio->max_rate[i];

			do_div(max_rate, AQ_MBPS_DIVISOR);
			aq_nic_setup_tc_max_rate(aq_nic, i, (u32)max_rate);
		}

		if (has_min_rate) {
			u64 min_rate = mqprio->min_rate[i];

			do_div(min_rate, AQ_MBPS_DIVISOR);
			aq_nic_setup_tc_min_rate(aq_nic, i, (u32)min_rate);
		}
	}

	return aq_nic_setup_tc_mqprio(aq_nic, mqprio->qopt.num_tc,
				      mqprio->qopt.prio_tc_map);
}

static const struct net_device_ops aq_ndev_ops = {
	.ndo_open = aq_ndev_open,
	.ndo_stop = aq_ndev_close,
	.ndo_start_xmit = aq_ndev_start_xmit,
	.ndo_set_rx_mode = aq_ndev_set_multicast_settings,
	.ndo_change_mtu = aq_ndev_change_mtu,
	.ndo_set_mac_address = aq_ndev_set_mac_address,
	.ndo_set_features = aq_ndev_set_features,
	.ndo_eth_ioctl = aq_ndev_ioctl,
	.ndo_vlan_rx_add_vid = aq_ndo_vlan_rx_add_vid,
	.ndo_vlan_rx_kill_vid = aq_ndo_vlan_rx_kill_vid,
	.ndo_setup_tc = aq_ndo_setup_tc,
};

static int __init aq_ndev_init_module(void)
{
	int ret;

	aq_ndev_wq = create_singlethread_workqueue(aq_ndev_driver_name);
	if (!aq_ndev_wq) {
		pr_err("Failed to create workqueue\n");
		return -ENOMEM;
	}

	ret = aq_pci_func_register_driver();
	if (ret) {
		destroy_workqueue(aq_ndev_wq);
		return ret;
	}

	return 0;
}

static void __exit aq_ndev_exit_module(void)
{
	aq_pci_func_unregister_driver();

	if (aq_ndev_wq) {
		destroy_workqueue(aq_ndev_wq);
		aq_ndev_wq = NULL;
	}
}

module_init(aq_ndev_init_module);
module_exit(aq_ndev_exit_module);


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

#ifndef COPY_BYTES_H
#define COPY_BYTES_H

#include "unaligned.h"
#include "simd_utils.h"

static really_inline
void copy_upto_64_bytes(u8 *dst, const u8 *src, unsigned int len) {
    switch (len) {
    case 0:
        break;
    case 1:
        *dst = *src;
        break;
    case 2:
        unaligned_store_u16(dst, unaligned_load_u16(src));
        break;
    case 3:
        unaligned_store_u16(dst, unaligned_load_u16(src));
        dst[2] = src[2];
        break;
    case 4:
        unaligned_store_u32(dst, unaligned_load_u32(src));
        break;
    case 5:
    case 6:
    case 7:
        unaligned_store_u32(dst + len - 4, unaligned_load_u32(src + len - 4));
        unaligned_store_u32(dst, unaligned_load_u32(src));
        break;
    case 8:
        unaligned_store_u64a(dst, unaligned_load_u64a(src));
        break;
    case 9:
    case 10:
    case 11:
    case 12:
    case 13:
    case 14:
    case 15:
        unaligned_store_u64a(dst + len - 8, unaligned_load_u64a(src + len - 8));
        unaligned_store_u64a(dst, unaligned_load_u64a(src));
        break;
    case 16:
        storeu128(dst, loadu128(src));
        break;
    case 17:
    case 18:
    case 19:
    case 20:
    case 21:
    case 22:
    case 23:
    case 24:
    case 25:
    case 26:
    case 27:
    case 28:
    case 29:
    case 30:
    case 31:
        storeu128(dst + len - 16, loadu128(src + len - 16));
        storeu128(dst, loadu128(src));
        break;
    case 32:
        storeu256(dst, loadu256(src));
        break;
#ifdef HAVE_AVX512
    case 64:
        storebytes512(dst, loadu512(src), 64);
        break;
    default:
        assert(len < 64);
        u64a k = (1ULL << len) - 1;
        storeu_mask_m512(dst, k, loadu_maskz_m512(k, src));
        break;
#else
    default:
        assert(0);
        break;
#endif
    }
}

#endif


phoenix-btn-hover-border-color: rgba(167, 223, 153, 0.226);
	--phoenix-btn-focus-shadow-rgb: 112, 203, 90;
	--phoenix-btn-active-color: #000000;
	--phoenix-btn-active-bg: rgba(205, 237, 197, 0.312);
	--phoenix-btn-active-border-color: rgba(167, 223, 153, 0.226);
	--phoenix-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0);
	--phoenix-btn-disabled-color: #fff;
	--phoenix-btn-disabled-bg: rgba(37, 176, 3, 0.14);
	--phoenix-btn-disabled-border-color: rgba(37, 176, 3, 0.14)
}

.dark .btn-soft-info,.dark .picmo__popupContainer.picmo__light .btn-soft-info {
	--phoenix-btn-color: #60c6ff;
	--phoenix-btn-bg: rgba(0, 151, 235, 0.14);
	--phoenix-btn-border-color: rgba(0, 151, 235, 0.14);
	--phoenix-btn-hover-color: #60c6ff;
	--phoenix-btn-hover-bg: rgba(0, 151, 235, 0.2);
	--phoenix-btn-hover-border-color: rgba(152, 213, 247, 0.226);
	--phoenix-btn-focus-shadow-rgb: 67, 184, 249;
	--phoenix-btn-active-color: #000000;
	--phoenix-btn-active-bg: rgba(196, 231, 250, 0.312);
	--phoenix-btn-active-border-color: rgba(152, 213, 247, 0.226);
	--phoenix-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0);
	--phoenix-btn-disabled-color: #fff;
	--phoenix-btn-disabled-bg: rgba(0, 151, 235, 0.14);
	--phoenix-btn-disabled-border-color: rgba(0, 151, 235, 0.14)
}

.dark .btn-soft-warning,.dark .picmo__popupContainer.picmo__light .btn-soft-warning {
	--phoenix-btn-color: #ffcc85;
	--phoenix-btn-bg: rgba(229, 120, 11, 0.14);
	--phoenix-btn-border-color: rgba(229, 120, 11, 0.14);
	--phoenix-btn-hover-color: #ffcc85;
	--phoenix-btn-hover-bg: rgba(229, 120, 11, 0.2);
	--phoenix-btn-hover-border-color: rgba(245, 200, 156, 0.226);
	--phoenix-btn-focus-shadow-rgb: 247, 179, 97;
	--phoenix-btn-active-color: #000000;
	--phoenix-btn-active-bg: rgba(249, 224, 199, 0.312);
	--phoenix-btn-active-border-color: rgba(245, 200, 156, 0.226);
	--phoenix-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0);
	--phoenix-btn-disabled-color: #fff;
	--phoenix-btn-disabled-bg: rgba(229, 120, 11, 0.14);
	--phoenix-btn-disabled-border-color: rgba(229, 120, 11, 0.14)
}

.dark .btn-soft-danger,.dark .picmo__popupContainer.picmo__light .btn-soft-danger {
	--phoenix-btn-color: #f48270;
	--phoenix-btn-bg: rgba(237, 32, 0, 0.14);
	--phoenix-btn-border-color: rgba(237, 32, 0, 0.14);
	--phoenix-btn-hover-color: #f4827


*/
  @Synchronized fun openStreamCount(): Int = streams.size

  @Synchronized fun getStream(id: Int): Http2Stream? = streams[id]

  @Synchronized internal fun removeStream(streamId: Int): Http2Stream? {
    val stream = streams.remove(streamId)

    // The removed stream may be blocked on a connection-wide window update.
    notifyAll()

    return stream
  }

  @Synchronized internal fun updateConnectionFlowControl(read: Long) {
    readBytesTotal += read
    val readBytesToAcknowledge = readBytesTotal - readBytesAcknowledged
    if (readBytesToAcknowledge >= okHttpSettings.initialWindowSize / 2) {
      writeWindowUpdateLater(0, readBytesToAcknowledge)
      readBytesAcknowledged += readBytesToAcknowledge
    }
  }

  /**
   * Returns a new server-initiated stream.
   *
   * @param associatedStreamId the stream that triggered the sender to create this stream.
   * @param out true to create an output stream that we can use to send data to the remote peer.
   *     Corresponds to `FLAG_FIN`.
   */
  @Throws(IOException::class)
  fun pushStream(
    associatedStreamId: Int,
    requestHeaders: List<Header>,
    out: Boolean
  ): Http2Stream {
    check(!client) { "Client cannot push requests." }
    return newStream(associatedStreamId, requestHeaders, out)
  }

  /**
   * Returns a new locally-initiated stream.
   *
   * @param out true to create an output stream that we can use to send data to the remote peer.
   *     Corresponds to `FLAG_FIN`.
   */
  @Throws(IOException::class)
  fun newStream(
    requestHeaders: List<Header>,
    out: Boolean
  ): Http2Stream {
    return newStream(0, requestHeaders, out)
  }

  @Throws(IOException::class)
  private fun newStream(
    associatedStreamId: Int,
    requestHeaders: List<Header>,
    out: Boolean
  ): Http2Stream {
    val outFinished = !out
    val inFinished = false
    val flushHeaders: Boolean
    val stream: Http2Stream
    val streamId: Int

    synchronized(writer) {
      synchronized(this) {
        if (nextStreamId > Int.MAX_VALUE / 2) {
          shutdown(REFUSED_STREAM)
        }
        if (isShutdown) {
          throw ConnectionShutdownException()
        }
        streamId = nextStreamId
        nextStreamId += 2
        stream = Http2Stream(streamId, this, outFinished, inFinished, null)
        flushHeaders = !out ||
            writeBytesTotal >= writeBytesMaximum ||
            stream.writeBytesTotal >= stream.writeBytesMaximum
        if (stream.isOpen) {
          streams[streamId] = stream
        }
      }
      if (associatedStreamId == 0) {
        writer.headers(outFinished, streamId, requestHeaders)
      } else {
        require(!client) { "client streams shouldn't have associated stream IDs" }
        // HTTP/2 has a PUSH_PROMISE frame.
        writer.pushPromise(associatedStreamId, streamId, requestHeaders)
      }
    }

    if (flushHeaders) {
      writer.flush()
    }

    return stream
  }

  @Throws(IOException::class)
  internal fun writeHeaders(
    streamId: Int,
    outFinished: Boolean,
    alternating: List<Header>
  ) {
    writer.headers(outFinished, streamId, alternating)
  }

  /**
   * Callers of this method are not thread safe, and sometimes on application threads. Most often,
   * this method will be called to send a buffer worth of data to the peer.
   *
   * Writes are subject to the write window of the stream and the connection. Until there is a
   * window sufficient to send [byteCount],


sel	w0, w0, w4, ne
	cmp	w3, w0
	bcs	.L63
	mov	x2, x21
	mov	w1, w19
	mov	x0, x20
	bl	_list_remove_node
	mov	x2, x21
	mov	w1, w19
	mov	x0, x20
	ldr	x25, [sp, 64]
	ldp	x19, x20, [sp, 16]
	ldp	x21, x22, [sp, 32]
	ldp	x23, x24, [sp, 48]
	ldp	x29, x30, [sp], 80
	b	_insert_data_list
.L63:
	ldp	x19, x20, [sp, 16]
	ldp	x21, x22, [sp, 32]
	ldp	x23, x24, [sp, 48]
	ldr	x25, [sp, 64]
	ldp	x29, x30, [sp], 80
	ret
	.size	_list_update_data_list, .-_list_update_data_list
	.section	.text.nandc_de_cs.constprop.32,"ax",@progbits
	.align	2
	.type	nandc_de_cs.constprop.32, %function
nandc_de_cs.constprop.32:
	adrp	x0, .LANCHOR7
	ldr	x1, [x0, #:lo12:.LANCHOR7]
	ldr	w0, [x1]
	and	w0, w0, -256
	and	w0, w0, -131073
	str	w0, [x1]
	ret
	.size	nandc_de_cs.constprop.32, .-nandc_de_cs.constprop.32
	.section	.text.flash_read_status,"ax",@progbits
	.align	2
	.global	flash_read_status
	.type	flash_read_status, %function
flash_read_status:
	stp	x29, x30, [sp, -32]!
	add	x29, sp, 0
	str	x19, [sp, 16]
	mov	x19, x0
	mov	w0, 112
	str	w0, [x19, 8]
	mov	x0, 1
	bl	udelay
	ldr	w0, [x19]
	ldr	x19, [sp, 16]
	and	w0, w0, 255
	ldp	x29, x30, [sp], 32
	ret
	.size	flash_read_status, .-flash_read_status
	.section	.text.toshiba_set_rr_para,"ax",@progbits
	.align	2
	.global	toshiba_set_rr_para
	.type	toshiba_set_rr_para, %function
toshiba_set_rr_para:
	stp	x29, x30, [sp, -96]!
	add	x29, sp, 0
	str	x27, [sp, 80]
	and	w27, w1, 255
	add	w2, w27, 1
	stp	x21, x22, [sp, 32]
	mov	x21, x0
	mov	w0, 5
	stp	x19, x20, [sp, 16]
	adrp	x20, .LANCHOR14
	umull	x2, w2, w0
	stp	x23, x24, [sp, 48]
	adrp	x0, .LANCHOR15
	add	x20, x20, :lo12:.LANCHOR14
	add	x24, x0, :lo12:


/**
 * @file   adin_netaudio.c
 *
 * <JA>
 * @brief  ͥåȥϡNetAudio/DatLink Фβ
 *
 * ϥȤơDatLink ° NetAudio ФѤ
 * ٥ؿǤѤ뤳Ȥ DatLink Ϥ
 * ľǧ뤳ȤǤޤ
 * NetAudio 󥹥ȡ뤷ƤۥȤ configure 뤳Ȥ
 * ѥ뤵ޤ
 *
 * ؿμΤ adin_na.c Ƥޤ
 * </JA>
 * <EN>
 * @brief  Audio input from NetAudio/DatLink server
 *
 * Low level I/O functions for audio input via the NetAudio server.
 * NetAudio is a part of DatLink product, and this feature enables
 * direct live input recognition via DatLink.  This file will be
 * compiled if NetAudio headers and libraries are located on the machine.
 *
 * The actual procedure are defined in adin_na.c.
 * </EN>
 *
 * @author Akinobu LEE
 * @date   Sun Feb 13 19:50:55 2005
 *
 * $Revision: 1.7 $
 *
 */
/*
 * Copyright (c) 1991-2013 Kawahara Lab., Kyoto University
 * Copyright (c) 2000-2005 Shikano Lab., Nara Institute of Science and Technology
 * Copyright (c) 2005-2013 Julius project team, Nagoya Institute of Technology
 * All rights reserved
 */

/* Tested with DAT deck, DatLink hardware and NetAudio library
   on Solaris2.5.1  */

/* because of `boolean' type conflict in sentlib and datlink includes, */
/* there are only wrappers. The core functions are defined in adin_na.c */

#include <sent/stddefs.h>
#include <sent/adin.h>

static char server_devname[MAXPATHLEN];  ///< Device name

/**
 * Connection initialization: check connectivity and open for recording.
 *
 * @param sfreq [in] required sampling frequency
 * @param arg [in] server device name string to connect
 *
 * @return TRUE on success, FALSE on failure.
 */
boolean
adin_netaudio_standby(int sfreq, void *arg)
{
  strncpy(server_devname, arg, MAXPATHLEN);
  if (NA_standby(sfreq, server_devname) == 0) return(FALSE); /* error */
  return(TRUE);
}

/**
 * Start recording.
 *
 * @param pathname [in] path name to open or NULL for default
 *
 * @return TRUE on success, FALSE on failure.
 */
boolean
adin_netaudio_begin(char *pathname)
{
  NA_start();
  return(TRUE);
}

/**
 * Stop recording.
 *
 * @return TRUE on success, FALSE on failure.
 */
boolean
adin_netaudio_end()
{
  NA_stop();
  return(TRUE);
}

/**
 * @brief  Read samples from the daemon.
 *
 * Try to read @a sampnum samples and returns actual number of recorded
 * samples currently available.  This function will block until
 * at least one sample can be obtained.
 *
 * @param buf [out] samples obtained in this function
 * @param sampnum [in] wanted number of samples to be read
 *
 * @return actural number of read samples, -2 if an error occured.
 */
int
adin_netaudio_read(SP16 *buf, int sampnum)
{
  int cnt;
  cnt = NA_read(buf, sampnum);
  if (cnt < 0) {
    jlog("Error: adin_na: failed to read sample\n");
    return(-2);			/* return negative on error */
  }
  return(cnt);
}

/**
 *
 * Function to return current input source device name
 *
 * @return string of current input device name.
 *
 */
char *
adin_netaudio_input_name()
{
  return(server_devname);
}


HttpFixture.ENDPOINT_OVERRIDE_SYSPROP_NAME_SDK2, ec2ImdsHttpFixture::getAddress)
        .build();

    @ClassRule
    public static TestRule ruleChain = RuleChain.outerRule(ec2ImdsHttpFixture).around(s3Fixture).around(cluster);

    @Override
    protected String getTestRestCluster() {
        return cluster.getHttpAddresses();
    }

    @Override
    protected String getBucketName() {
        return BUCKET;
    }

    @Override
    protected String getBasePath() {
        return BASE_PATH;
    }

    @Override
    protected String getClientName() {
        return CLIENT;
    }
}
/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the "Elastic License
 * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
 * Public License v 1"; you may not use this file except in compliance with, at
 * your election, the "Elastic License 2.0", the "GNU Affero General Public
 * License v3.0 only", or the "Server Side Public License, v 1".
 */

package org.elasticsearch.repositories.s3;

import fixture.aws.DynamicAwsCredentials;
import fixture.aws.DynamicRegionSupplier;
import fixture.aws.imds.Ec2ImdsHttpFixture;
import fixture.aws.imds.Ec2ImdsServiceBuilder;
import fixture.aws.imds.Ec2ImdsVersion;
import fixture.s3.S3HttpFixture;

import com.carrotsearch.randomizedtesting.annotations.ThreadLeakFilters;
import com.carrotsearch.randomizedtesting.annotations.ThreadLeakScope;

import org.elasticsearch.test.cluster.ElasticsearchCluster;
import org.elasticsearch.test.fixtures.testcontainers.TestContainersThreadFilter;
import org.junit.ClassRule;
import org.junit.rules.RuleChain;
import org.junit.rules.TestRule;

import java.util.Set;
import java.util.function.Supplier;

@ThreadLeakFilters(filters = { TestContainersThreadFilter.class })
@ThreadLeakScope(ThreadLeakScope.Scope.NONE) // https://github.com/elastic/elasticsearch/issues/102482
public class RepositoryS3EcsCredentialsRestIT extends AbstractRepositoryS3RestTestCase {

    private static final String PREFIX = getIdentifierPrefix("RepositoryS3EcsCredentialsRestIT");
    private static final String BUCKET = PREFIX + "bucket";
    private static final String BASE_PATH = PREFIX + "base_path";
    private static final String CLIENT = "ecs_credentials_client";

    private static final Supplier<String> regionSupplier = new DynamicRegionSupplier();
    private static final DynamicAwsCredentials dynamicCredentials = new DynamicAwsCredentials(regionSupplier, "s3");

    private static final Ec2ImdsHttpFixture ec2ImdsHttpFixture = new Ec2ImdsHttpFixture(
        new Ec2ImdsServiceBuilder(Ec2ImdsVersion.V1).newCredentialsConsumer(dynamicCredentials::addValidCredentials)
            .alternativeCredentialsEndpoints(Set.of("/ecs_credentials_endpoint"))
    );

    private static final S3HttpFixture s3Fixture = new S3HttpFixture(true, BUCKET, BASE_PATH, dynamicCredentials::isAuthorized);

    public static ElasticsearchCluster cluster = ElasticsearchCluster.local()
        .module("repository-s3")
        .setting("s3.client." + CLIENT + ".endpoint", s3Fixture::getAddress)
        .environment("AWS_CONTAINER_CREDENTIALS_FULL_URI", () -> ec2ImdsHttpFixture.getAddress() + "/ecs_credentials_endpoint")
        .environment("AWS_REGION", regionSupplier) // Region is supplied by environment variable when running in ECS
        .build();

    @ClassRule
    public static TestRule ruleChain = RuleChain.outerR


import pytest
import pyspark.sql.functions as F

from cuallee import Check, CheckLevel

def test_positive(spark):
    df = spark.range(10).withColumn("VALUE", F.col("id") + 1000)
    check = Check(CheckLevel.WARNING, "pytest")
    check.is_greater_or_equal_than("VALUE", 1000)
    rs = check.validate(df)
    assert rs.first().status == "PASS"
    assert rs.first().violations == 0
    assert rs.first().pass_threshold == 1.0

def test_negative(spark):
    df = spark.createDataFrame([[1006], [1], [1070], [1900], [10]], ["VALUE"])
    check = Check(CheckLevel.WARNING, "pytest")
    check.is_greater_or_equal_than("VALUE", 1000)
    rs = check.validate(df)
    assert rs.first().status == "FAIL"
    assert rs.first().violations == 2
    assert rs.first().pass_threshold == 1.0
    assert rs.first().pass_rate >= 3 / 5

@pytest.mark.parametrize("rule_value", [int(1000), float(1000)], ids=("int", "float"))
def test_parameters(spark, rule_value):
    df = spark.range(10).withColumn("VALUE", F.col("id") + 1000)
    check = Check(CheckLevel.WARNING, "pytest")
    check.is_greater_or_equal_than("VALUE", rule_value)
    rs = check.validate(df)
    assert rs.first().status == "PASS"

def test_coverage(spark):
    df = spark.createDataFrame([[1006], [1], [1070], [1900], [10]], ["VALUE"])
    check = Check(CheckLevel.WARNING, "pytest")
    check.is_greater_or_equal_than("VALUE", 1000, 0.6)
    rs = check.validate(df)
    assert rs.first().status == "PASS"
    assert rs.first().violations == 2
    assert rs.first().pass_threshold == 0.6
    assert rs.first().pass_rate >= 3 / 5


("ServiceWebsocketTransportFunctionQualifier")
    @Expose
    private String ServiceWebsocketTransportFunctionQualifier;

    /**
    * API绑定微服务列表。
注意：此字段可能返回 null，表示取不到有效值。
    */
    @SerializedName("MicroServices")
    @Expose
    private MicroService [] MicroServices;

    /**
    * 微服务信息详情。
注意：此字段可能返回 null，表示取不到有效值。
    */
    @SerializedName("MicroServicesInfo")
    @Expose
    private Long [] MicroServicesInfo;

    /**
    * 微服务的负载均衡配置。
注意：此字段可能返回 null，表示取不到有效值。
    */
    @SerializedName("ServiceTsfLoadBalanceConf")
    @Expose
    private TsfLoadBalanceConfResp ServiceTsfLoadBalanceConf;

    /**
    * 微服务的健康检查配置。
注意：此字段可能返回 null，表示取不到有效值。
    */
    @SerializedName("ServiceTsfHealthCheckConf")
    @Expose
    private HealthCheckConf ServiceTsfHealthCheckConf;

    /**
    * 是否开启跨域。
注意：此字段可能返回 null，表示取不到有效值。
    */
    @SerializedName("EnableCORS")
    @Expose
    private Boolean EnableCORS;

    /**
    * API绑定的tag信息。
注意：此字段可能返回 null，表示取不到有效值。
    */
    @SerializedName("Tags")
    @Expose
    private Tag [] Tags;

    /**
    * API已发布的环境信息。
注意：此字段可能返回 null，表示取不到有效值。
    */
    @SerializedName("Environments")
    @Expose
    private String [] Environments;

    /**
    * 是否开启Base64编码，只有后端为scf时才会生效。
注意：此字段可能返回 null，表示取不到有效值。
    */
    @SerializedName("IsBase64Encoded")
    @Expose
    private Boolean IsBase64Encoded;

    /**
    * 是否开启Base64编码的header触发，只有后端为scf时才会生效。
注意：此字段可能返回 null，表示取不到有效值。
    */
    @SerializedName("IsBase64Trigger")
    @Expose
    private Boolean IsBase64Trigger;

    /**
    * Header触发规则，总规则数量不超过10。
注意：此字段可能返回 null，表示取不到有效值。
    */
    @SerializedName("Base64EncodedTriggerRules")
    @Expose
    private Base64EncodedTriggerRule [] Base64EncodedTriggerRules;

    /**
    * 是否开启SCF Event异步调用。
注意：此字段可能返回 null，表示取不到有效值。
    */
    @SerializedName("ServiceScfEventIsAsyncCall")
    @Expose
    private Boolean ServiceScfEventIsAsyncCall;

    /**
     * Get API 所在的服务唯一 ID。
注意：此字段可能返回 null，表示取不到有效值。
     * @return ServiceId API 所在的服务唯一 ID。
注意：此字段可能返回 null，表示取不


 ApplicationRequestGetter,
        configuration.spanKindExtractor(SpanKindExtractor.alwaysServer())
      )

      val feature = KtorServerTelemetry(instrumenter)

      val startPhase = PipelinePhase("OpenTelemetry")
      pipeline.insertPhaseBefore(ApplicationCallPipeline.Monitoring, startPhase)
      pipeline.intercept(startPhase) {
        val context = feature.start(call)

        if (context != null) {
          call.attributes.put(contextKey, context)
          withContext(context.asContextElement()) {
            try {
              proceed()
            } catch (err: Throwable) {
              // Stash error for reporting later since need ktor to finish setting up the response
              call.attributes.put(errorKey, err)
              throw err
            }
          }
        } else {
          proceed()
        }
      }

      val postSendPhase = PipelinePhase("OpenTelemetryPostSend")
      pipeline.sendPipeline.insertPhaseAfter(ApplicationSendPipeline.After, postSendPhase)
      pipeline.sendPipeline.intercept(postSendPhase) {
        val context = call.attributes.getOrNull(contextKey)
        if (context != null) {
          var error: Throwable? = call.attributes.getOrNull(errorKey)
          try {
            proceed()
          } catch (t: Throwable) {
            error = t
            throw t
          } finally {
            feature.end(context, call, error)
          }
        } else {
          proceed()
        }
      }

      pipeline.environment.monitor.subscribe(Routing.RoutingCallStarted) { call ->
        val context = call.attributes.getOrNull(contextKey)
        if (context != null) {
          HttpServerRoute.update(context, HttpServerRouteSource.SERVER, { _, arg -> arg.route.parent.toString() }, call)
        }
      }

      return feature
    }
  }
}
plugins {
  id("otel.javaagent-testing")
}

dependencies {
  testImplementation(project(":instrumentation:jaxws:jaxws-2.0-arquillian-testing"))
  testCompileOnly("jakarta.enterprise:jakarta.enterprise.cdi-api:2.0.2")
  testRuntimeOnly("org.apache.tomee:arquillian-tomee-embedded:8.0.6")
  testRuntimeOnly("org.apache.tomee:tomee-embedded:8.0.6")
  testRuntimeOnly("org.apache.tomee:tomee-webservices:8.0.6")

  testInstrumentation(project(":instrumentation:servlet:servlet-3.0:javaagent"))
  testInstrumentation(project(":instrumentation:jaxws:jaxws-2.0:javaagent"))
  testInstrumentation(project(":instrumentation:jaxws:jaxws-cxf-3.0:javaagent"))
  testInstrumentation(project(":instrumentation:jaxws:jaxws-jws-api-1.1:javaagent"))
}

otelJava {
  // due to security manager deprecation this test does not work on jdk 24 with default configuration
  maxJavaVersionForTests.set(JavaVersion.VERSION_23)
}

tasks.withType<Test>().configureEach {
  // required on jdk17
  jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
  jvmArgs("--add-exports=java.base/sun.misc=ALL-UNNAMED")
  jvmArgs("-XX:+IgnoreUnrecognizedVMOptions")
  jvmArgs("-Dotel.instrumentation.common.experimental.controller-telemetry.enabled=true")
}
plugins {
  id("otel.javaagent-instrumentation")
}

muzzle {
  pass {
    group.set("com.zaxxer")
    module.set("HikariCP")
    versions.set("[3.0.0,)")
    // muzzle does not detect PoolStats method references used - some of these methods were introduced in 3.0 and we can't assertInverse

    // 4.0.0 uses a broken slf4j version: the "${slf4j.version}" placeholder is taken literally
    skip("4.0.0")
  }
}

dependencies {
  library("com.zaxxer:HikariCP:3.0.0")

  implementation(project(":instrumentation:hikaricp-3.0


/109951163350929740.jpg?param=130y130",
          "lyric": ""
        },
        {
          "id": "1320649834",
          "name": "夜之光",
          "audio_url": "https://music.163.com/song/media/outer/url?id=1320649834.mp3",
          "artists": "花姐",
          "album_url": "http://p2.music.126.net/mOo5_Ok0uL3dx-MCll4Wcg==/109951163633343019.jpg?param=130y130",
          "lyric": ""
        },
        {
          "id": "1345848098",
          "name": "绿色",
          "audio_url": "https://music.163.com/song/media/outer/url?id=1345848098.mp3",
          "artists": "陈雪凝",
          "album_url": "http://p2.music.126.net/R4ZP3AJ9xV0vvw8LX7AbMA==/109951163860425334.jpg?param=130y130",
          "lyric": ""
        },
        {
          "id": "1398633928",
          "name": "Lose You To Love Me",
          "audio_url": "https://music.163.com/song/media/outer/url?id=1398633928.mp3",
          "artists": "Selena Gomez",
          "album_url": "http://p1.music.126.net/qz6xHSzC4gERYzfEVx6F-Q==/109951164443883328.jpg?param=130y130",
          "lyric": ""
        },
        {
          "id": "1301027901",
          "name": "Just Like This",
          "audio_url": "https://music.163.com/song/media/outer/url?id=1301027901.mp3",
          "artists": "Deepmaniak",
          "album_url": "http://p2.music.126.net/lIH4I7d7879op3sOfSUMrw==/109951163854904814.jpg?param=130y130",
          "lyric": ""
        },
        {
          "id": "1300528275",
          "name": "Sweet but Psycho",
          "audio_url": "https://music.163.com/song/media/outer/url?id=1300528275.mp3",
          "artists": "Ava Max",
          "album_url": "http://p1.music.126.net/gee-5oSaBNjcg3fhcBJdBQ==/109951163781396587.jpg?param=130y130",
          "lyric": ""
        },
        {
          "id": "486814412",
          "name": "沙漠骆驼",
          "audio_url": "https://music.163.com/song/media/outer/url?id=486814412.mp3",
          "artists": "展展与罗罗",
          "album_url": "http://p1.music.126.net/oov7j64hTKZSm0CEUkRNoQ==/109951163111639178.jpg?param=130y130",
          "lyric": ""
        },
        {
          "id": "415792773",
          "name": "Came For Some Nights",
          "audio_url": "https://music.163.com/song/media/outer/url?id=415792773.mp3",
          "artists": "Daniel Meroe / Calvin Harris / Rihanna / Fun.",
          "album_url": "http://p1.music.126.net/nxOKDChGK9lcQOLf5jDDDQ==/1410673429744597.jpg",
          "lyric": ""
        },
        {
          "id": "4364


       -9.5, -83.5, -70.0, -32.5, -94.0, -43.0, -14.0, -122.0, -95.5, -13.0, -82.0, -27.5,
                -120.5, -8.0, -2.5, -77.0, -28.5, -54.5, -126.5, -105.5, -31.0, -23.5, -55.5,
                -76.0, -98.0, -36.5, -59.5, -89.0, -73.5, -44.0, -20.5, -125.0, -119.0, -123.5,
                -20.0, -48.5, -115.0, -51.0, -84.5, -75.5, -124.5, -58.0, -33.0, -2.0, -40.0,
                -117.0, -1.5, -91.5, -35.5, -53.5, -118.5, -99.0, -87.5, -89.5, -18.0, -10.5,
                -97.5, -121.5, -15.0, -45.0, -88.0, -18.5, -40.5, -76.5, -58.5, -25.5, -61.0,
                -41.5, -3.5, -94.5, -113.5, -10.0, -46.0, -3.0, -114.5, -60.0, -62.5, -119.5
            ]
        );
    }

    #[test]
    fn parse_sweep_ext() {
        let length = (112 / 16) - 1;
        let bytes = [
            b'$', b's', length, 15, 136, 218, 52, 155, 233, 246, 235, 135, 113, 130, 74, 70, 251,
            124, 186, 231, 115, 199, 203, 64, 112, 146, 24, 170, 197, 77, 105, 121, 139, 134, 91,
            157, 44, 19, 167, 140, 65, 188, 86, 28, 244, 191, 26, 164, 55, 241, 16, 5, 154, 57,
            109, 253, 211, 62, 47, 111, 152, 196, 73, 119, 178, 147, 88, 41, 250, 238, 247, 40, 97,
            230, 102, 169, 151, 249, 116, 66, 4, 80, 234, 3, 183, 71, 107, 237, 198, 175, 179, 36,
            21, 195, 243, 30, 90, 176, 37, 81, 153, 117, 51, 122, 83, 7, 189, 227, 20, 92, 6, 229,
            120, 125, 239,
        ];
        let sweep_data = SweepDataExt::parse_from_bytes(&bytes[..]).unwrap().1;
        assert_eq!(
            sweep_data.amplitudes_dbm,
            &[
                -7.5, -68.0, -109.0, -26.0, -77.5, -116.5, -123.0, -117.5, -67.5, -56.5, -65.0,
                -37.0, -35.0, -125.5, -62.0, -93.0, -115.5, -57.5, -99.5, -101.5, -32.0, -56.0,
                -73.0, -12.0, -85.0, -98.5, -38.5, -52.5, -60.5, -69.5, -67.0, -45.5, -78.5, -22.0,
                -9.5, -83.5, -70.0, -32.5, -94.0, -43.0, -14.0, -122.0, -95.5, -13.0, -82.0, -27.5,
                -120.5, -8.0, -2.5, -77.0, -28.5, -54.5, -126.5, -105.5, -31.0, -23.5, -55.5,
                -76.0, -98.0, -36.5, -59.5, -89.0, -73.5, -44.0, -20.5, -125.0, -119.0, -123.5,
                -20.0, -48.5, -115.0, -51.0, -84.5, -75.5, -124.5, -58.0, -33.0, -2.0, -40.0,
                -


return {
    yellow = 0xffdcaf6c,
    green = 0xff98a8a9,
    red = 0xffc6755b,
    blue = 0xffa2aab9,
    darkblue = 0xff6275a1,
    purple = 0xff6a6378,
    monotone = 0xff98a8a9,
    orange = 0xffd09367,
    quicksilver = 0xffb2b2b2,
    pink = 0xff725955,
    magenta = 0xff595066,

    primary = 0xffb2b2b2,
    secondary = 0xff232323,

    black = 0xff000000,
    white = 0xffb4b4b4,
    grey = 0xff5a5959,

    transparent = 0x00000000,
    semi_transparent = 0x40ffffff,
    border_transparent = 0x33ffffff,

    icon = {
        grey = 0xffcdcdcd,
        primary = 0xff5d5d5d,
        secondary = 0xff191919,
    },
    bar = {
        bg = 0xff232323,
        bg2 = 0xff1c1c1c,
        bg_transparent = 0x99000000,
        accent = 0xff000000,
        active = 0xff9eaeb3,


    vid.autoplay = 'autoplay'
    vid.loop = 'loop'
    // vid.controls = true
    vid.muted = 'muted'
    vid.style.width = '100%'
    vid.style.height = '100%'
    vid.style.objectFit = 'contain'
    win.document.body.style.padding = '0px'
    win.document.body.style.margin = '0px'
    win.document.body.appendChild(vid)

    function setVideo(stream) {
      console.log('setting video', stream)
      if(stream !== null) {
        const tracks = stream.getVideoTracks()
        //.map((track) =>track.clone())
        const streamCopy = new MediaStream(tracks)

        vid.srcObject = streamCopy
      } else {
        vid.srcObject = null
      }
    }

    function setOpacity(opacity) {
      vid.style.opacity = opacity / 100
    }

    setVideo(stream)

    return { vid: vid, setVideo: setVideo, setOpacity: setOpacity }
  }
}
// how to handle channel?
// sometimes you just want to listen to channel events, regardless of the peer that is calling it

const EventEmitter = require('events').EventEmitter

/*
 bi-directional data channel for sharing information with a specific peer
 information that the remote peer shares to this channel is stored in 'log'
 localChannel refers to the corresponding local channel (class Channel) that contains

 current value is stored in 'value' property
 history of values is stored in log

 questions:
 1) right now local info is duplicated for each peer -- how to have central way of sending to all
*/
class PeerChannel extends EventEmitter {
  constructor ({ localChannel, peer, tag } = {}) {
    super()
    this.tag = tag
    this._peer = peer._peer
    this.peer = peer
    this.log = []
    this.localChannel = localChannel
    this.value = null
    this.isConnected = false
    this.outbox = [] // messages that cannot be sent yet
  }

  initialSync () {
    this.isConnected = true
    if (this.localChannel.localData !== undefined) {
      this.send('update', this.localChannel.localData)
    }
    this.outbox.forEach(msg => {
      this.send(msg.address, msg.data)
    })
    this.outbox = []
  }

  receivedMessage (msg) {
    this.emit(msg.address, msg.data)
    this.value = msg.data
    this.log.push(msg)
  }

  send (address, message) {
    const msg = { tag: this.tag, data: message, address: address }
    if (this.isConnected) {
      this._peer.send(JSON.stringify(msg))
    } else {
      this.outbox.push(msg)
    }
  }
}

module.exports = PeerChannel
const nanoid = require('nanoid').nanoid
const MultiPeer = require('./../lib/MultiPeer.js')
var AudioContext = window.AudioContext // Default
    || window.webkitAudioContext // Safari and old versions of Chrome
    || false;

if(!AudioContext) console.warn('this browser does not support WebAudio')

module.exports = (state, emitter) => {
  state.user = {
    uuid: nanoid(20),
    // for dev purposes, always regenerate id
    nickname: localStorage.getItem('livelab-nickname') || '',
    muted: false,
    version: process.env.version,
    loggedIn: false,
    isOnline: true,
    // room: state.query.room || localStorage.getItem('livelab-room') || 'zebra',
    room: state.query.room,
    server: process.env.NODE_ENV === 'production'
      ? 'https://livelab.app:6643'
      : 'https://live-lab-v1.glitch.me',
    statusMessage: '',
    r


rem_user(uint16_t rnti)
{
  const gtpu_tunnel_manager::ue_bearer_tunnel_list* tun_lst = tunnels.find_rnti_tunnels(rnti);
  if (tun_lst == nullptr) {
    logger.info("Removing user - rnti=0x%x not found.", rnti);
    return;
  }
  while (not tun_lst->empty()) {
    // Note: May send End-Marker to active forwarding tunnels during their removal
    rem_tunnel(tun_lst->front().teid);
  }
  tunnels.remove_rnti(rnti);
}

void gtpu::handle_end_marker(const gtpu_tunnel& rx_tunnel)
{
  uint16_t rnti = rx_tunnel.rnti;
  logger.info("Rx GTPU End Marker, " TEID_IN_FMT ", rnti=0x%x.", rx_tunnel.teid_in, rnti);

  if (rx_tunnel.state == gtpu_tunnel_state::forward_to) {
    // TS 36.300, Sec 10.1.2.2.1 - Path Switch upon handover
    // END MARKER should be forwarded to TeNB if forwarding is activated
    send_end_marker(rx_tunnel.fwd_tunnel->teid_in);
    rem_tunnel(rx_tunnel.fwd_tunnel->teid_in);
  }

  // Remove tunnel that received End Marker
  rem_tunnel(rx_tunnel.teid_in);
}

void gtpu::handle_gtpu_s1u_rx_packet(srsran::unique_byte_buffer_t pdu, const sockaddr_in& addr)
{
  srsran_assert(pdu != nullptr, "Called with null PDU");

  logger.debug("Received %d bytes from S1-U interface", pdu->N_bytes);
  pdu->set_timestamp();

  // Decode GTPU Header
  gtpu_header_t header;
  if (not gtpu_read_header(pdu.get(), &header, logger)) {
    return;
  }

  if (header.message_type == GTPU_MSG_ECHO_REQUEST) {
    // Echo request - send response
    echo_response(addr.sin_addr.s_addr, addr.sin_port, header.seq_number);
    return;
  }
  if (header.message_type == GTPU_MSG_ERROR_INDICATION) {
    logger.warning("Received Error Indication");
    return;
  }
  if (header.teid == 0) {
    logger.warning("Received GTPU S1-U message with " TEID_IN_FMT, header.teid);
  }

  // Find TEID present in GTPU Header
  const gtpu_tunnel* tun_ptr = tunnels.find_tunnel(header.teid);
  if (tun_ptr == nullptr) {
    // Received G-PDU for non-existing and non-zero TEID.
    // Sending GTP-U error indication
    error_indication(addr.sin_addr.s_addr, addr.sin_port, header.teid);
    return;
  }

  switch (header.message_type) {
    case GTPU_MSG_DATA_PDU: {
      handle_msg_data_pdu(header, *tun_ptr, std::move(pdu));
    } break;
    case GTPU_MSG_END_MARKER:
      handle_end_marker(*tun_ptr);
      break;
    default:
      logger.warning("Unhandled GTPU message type=%d", header.message_type);
      break;
  }
}

void gtpu::handle_msg_data_pdu(const gtpu_header_t&         header,
                               const gtpu_tunnel&


_t		epthru_dma_h;
	dma_addr_t		buf_dma_h;
} mbox_ccb_t;

/**
 * mraid_device_t - adapter soft state structure for mailbox controllers
 * @una_mbox64			: 64-bit mbox - unaligned
 * @una_mbox64_dma		: mbox dma addr - unaligned
 * @mbox			: 32-bit mbox - aligned
 * @mbox64			: 64-bit mbox - aligned
 * @mbox_dma			: mbox dma addr - aligned
 * @mailbox_lock		: exclusion lock for the mailbox
 * @baseport			: base port of hba memory
 * @baseaddr			: mapped addr of hba memory
 * @mbox_pool			: pool of mailboxes
 * @mbox_pool_handle		: handle for the mailbox pool memory
 * @epthru_pool			: a pool for extended passthru commands
 * @epthru_pool_handle		: handle to the pool above
 * @sg_pool			: pool of scatter-gather lists for this driver
 * @sg_pool_handle		: handle to the pool above
 * @ccb_list			: list of our command control blocks
 * @uccb_list			: list of cmd control blocks for mgmt module
 * @umbox64			: array of mailbox for user commands (cmm)
 * @pdrv_state			: array for state of each physical drive.
 * @last_disp			: flag used to show device scanning
 * @hw_error			: set if FW not responding
 * @fast_load			: If set, skip physical device scanning
 * @channel_class		: channel class, RAID or SCSI
 * @sysfs_mtx			: mutex to serialize access to sysfs res.
 * @sysfs_uioc			: management packet to issue FW calls from sysfs
 * @sysfs_mbox64		: mailbox packet to issue FW calls from sysfs
 * @sysfs_buffer		: data buffer for FW commands issued from sysfs
 * @sysfs_buffer_dma		: DMA buffer for FW commands issued from sysfs
 * @sysfs_wait_q		: wait queue for sysfs operations
 * @random_del_supported	: set if the random deletion is supported
 * @curr_ldmap			: current LDID map
 *
 * Initialization structure for mailbox controllers: memory based and IO based
 * All the fields in this structure are LLD specific and may be discovered at
 * init() or start() time.
 *
 * NOTE: The fields of this structures are placed to minimize cache misses
 */
#define MAX_LD_EXTENDED64	64
typedef struct {
	mbox64_t			*una_mbox64;
	dma_addr_t			una_mbox64_dma;
	mbox_t				*mbox;
	mbox64_t			*mbox64;
	dma_addr_t			mbox_dma;
	spinlock_t			mailbox_lock;
	unsigned long			baseport;
	void __iomem *			baseaddr;
	struct mraid_pci_blk		mbox_pool[MBOX_MAX_SCSI_CMDS];
	struct dma_pool			*mbox_pool_handle;
	struct mraid_pci_blk		epthru_pool[MBOX_MAX_SCSI_CMDS];
	struct dma_pool			*epthru_pool_handle;
	struct mraid_pci_blk		sg_pool[MBOX_MAX_SCSI_CMDS];
	struct dma_pool			*sg_pool_handle;
	mbox_ccb_t			ccb_list[MBOX_MAX_SCSI_CMDS];
	mbox_ccb_t			uccb_list[MBOX_MAX_USER_CMDS];
	mbox64_t			umbox64[MBOX_MAX_USER_CMDS];

	uint8_t				pdrv_state[MBOX_MAX_PHYSICAL_DRIVES];
	uint32_t			last_disp;
	int				hw_error;
	int				fast_load;
	uint8_t				channel_class;
	struct mutex			sysfs_mtx;
	uioc_t				*sysfs_uioc;
	mbox64_t			*sysfs_mbox64;
	caddr_t				sysfs_buffer;
	dma_addr_t			sysfs_buffer_dma;
	wait_queue_head_t		sysfs_wait_q;
	int				random_del_supported;
	uint16_t			curr_ldmap[MAX_LD_EXTENDED64];
} mraid_device_t;

// route to raid device from adapter
#define ADAP2RAIDDEV(adp)	((mraid_device_t *)((adp)->raid_device))

#define MAILBOX_LOCK(rdev)	(&(rdev)->mailbox_lock)

// Find out if this channel is a RAID or SCSI
#define IS_RAID_CH(rdev, ch)	(((rdev)->channel_class >> (ch)) & 0x01)

#define RDINDOOR(rdev)		readl((rdev)->baseaddr + 0x20)
#define RDOUTDOOR(rdev)		readl((rdev)->baseaddr + 0x2C)
#define WRINDOOR(rdev, value)	writel(value, (rdev)->baseaddr + 0x20)
#define WROUTDOOR(rdev, value)	writel(value, (rdev)->baseaddr + 0x2C)

#endif // _MEGARAID_H_

// vim: set ts=8 sw=8 tw=78:


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

// ---
// Author: Sanjay Ghemawat
//
// Portable implementation - just use glibc
//
// Note:  The glibc implementation may cause a call to malloc.
// This can cause a deadlock in HeapProfiler.

#ifndef BASE_STACKTRACE_GENERIC_INL_H_
#define BASE_STACKTRACE_GENERIC_INL_H_
// Note: this file is included into stacktrace.cc more than once.
// Anything that should only be defined once should be here:

#include <execinfo.h>
#include <string.h>
#include "gperftools/stacktrace.h"
#endif  // BASE_STACKTRACE_GENERIC_INL_H_

// Note: this part of the file is included several times.
// Do not put globals below.

// The following 4 functions are generated from the code below:
//   GetStack{Trace,Frames}()
//   GetStack{Trace,Frames}WithContext()
//
// These functions take the following args:
//   void** result: the stack-trace, as an array
//   int* sizes: the size of each stack frame, as an array
//               (GetStackFrames* only)
//   int max_depth: the size of the result (and sizes) array(s)
//   int skip_count: how many stack pointers to skip before storing in result
//   void* ucp: a ucontext_t* (GetStack{Trace,Frames}WithContext only)
static int GET_STACK_TRACE_OR_FRAMES {
  static const int kStackLength = 64;
  void * stack[kStackLength];
  int size;

  size = backtrace(stack, kStackLength);
  skip_count += 2;  // we want to skip the current and it's parent frame as well
  int result_count = size - skip_count;
  if (result_count < 0)
    result_count = 0;
  if (result_count > max_depth)
    result_count = max_depth;
  for (int i = 0; i < result_count; i++)
    result[i] = stack[i + skip_count];

#if IS_STACK_FRAMES
  // No implementation for finding out the stack frame sizes yet.
  memset(sizes, 0, sizeof(*sizes) * result_count);
#endif

  return result_count;
}


)
	ldr     r0, [pc, #0x58] @ 0x2238614, (=0xffff)
	ldr     r2, [r3, #0x0]
	ldr     r1, [pc, #0x58] @ 0x2238618, (=0xfcc)
	strh    r0, [r2, r1]
	.hword  0x1e8a @ sub r2, r1, #0x2
	ldr     r4, [r3, #0x0]
	.hword  0x1f09 @ sub r1, r1, #0x4
	strh    r0, [r4, r2]
	ldr     r2, [r3, #0x0]
	strh    r0, [r2, r1]
	bl      Function_2238624
	cmp     r0, #0x0
	bne     branch_22385f0
	mov     r0, #0x9
	bl      Function_2238534
	ldr     r0, [pc, #0x2c] @ 0x223860c, (=0x22403f8)
	ldr     r1, [r0, #0x0]
	ldr     r0, [pc, #0x38] @ 0x223861c, (=0x117c)
	ldr     r1, [r1, r0]
	cmp     r1, #0x0
	beq     branch_22385ec
	mov     r0, #0x4
	blx     r1
.thumb
branch_22385ec: @ 22385ec :thumb
	mov     r0, #0x0
	pop     {r4,pc}
@ 0x22385f0

.thumb
branch_22385f0: @ 22385f0 :thumb
	ldr     r1, [pc, #0x18] @ 0x223860c, (=0x22403f8)
	ldr     r0, [pc, #0x2c] @ 0x2238620, (=0x1158)
	ldr     r2, [r1, #0x0]
	mov     r3, #0x2
	strh    r3, [r2, r0]
	ldr     r1, [r1, #0x0]
	add     r0, #0x24
	ldr     r1, [r1, r0]
	cmp     r1, #0x0
	beq     branch_2238608
	mov     r0, #0x0
	blx     r1
.thumb
branch_2238608: @ 2238608 :thumb
	mov     r0, #0x1
	pop     {r4,pc}
@ 0x223860c

.word 0x22403f8 @ 0x223860c
.word 0x1150 @ 0x2238610
.word 0xffff @ 0x2238614
.word 0xfcc @ 0x2238618
.word 0x117c @ 0x223861c
.word 0x1158 @ 0x2238620
.thumb
Function_2238624: @ 2238624 :thumb
	push    {r3-r7,lr}
	ldr     r0, [pc, #0xd4] @ 0x22386fc, (=0x22403f8)
	ldr     r1, [r0, #0x0]
	ldr     r0, [pc, #0xd4] @ 0x2238700, (=0x1150)
	ldr     r0, [r1, r0]
	cmp     r0, #0x2
	beq     branch_2238638
	blx     OS_Panic
	mov     r0, #0x0
.thumb
branch_2238638: @ 2238638 :thumb
	blx     WM_GetAllowedChannel
	mov     r4, r0
	mov     r0, #0x2
	lsl     r0, r0, #14
	cmp     r4, r0
	bne     branch_2238650
	mov     r0, #0x


ьзовать нельзя.

        Не включай в ответ предложения продолжить диалог

Пример ответа

<example>
    Вот что я нашел по твоему запросу:

    🔸 Иван Петров - опытный Go-разработчик с 5+ лет опыта. Активно изучает микросервисы и архитектуру распределенных систем.

    🔸 Мария Сидорова - frontend-разработчик, специализируется на React и TypeScript. Увлекается UI/UX дизайном и созданием удобных интерфейсов.

    🔸 Алексей Козлов - Fullstack разработчик, работает с Python и Django. Интересуется машинным обучением и анализом данных.

    Если хочешь, чтобы другие участники тоже могли найти тебя, создай или обнови свой профиль командой /profile!
</example>

<database>%s</database>
<request>%s</request>
`
package repositories

import (
	"database/sql"
	"fmt"
	"time"
)

type RandomCoffeePair struct {
	ID        int
	PollID    int
	User1ID   int64
	User2ID   int64
	CreatedAt time.Time
}

type RandomCoffeePairRepository struct {
	db *sql.DB
}

func NewRandomCoffeePairRepository(db *sql.DB) *RandomCoffeePairRepository {
	return &RandomCoffeePairRepository{db: db}
}

func (r *RandomCoffeePairRepository) CreatePair(pollID int, user1ID, user2ID int) error {
	query := `
		INSERT INTO random_coffee_pairs (poll_id, user1_id, user2_id)
		VALUES ($1, $2, $3)
	`
	_, err := r.db.Exec(query, pollID, user1ID, user2ID)
	if err != nil {
		return fmt.Errorf("error creating random coffee pair: %w", err)
	}
	return nil
}

// GetPairsHistoryForUsers returns historical pairs for specified users from last N polls
func (r *RandomCoffeePairRepository) GetPairsHistoryForUsers(userIDs []int, lastNPolls int) (map[string][]int, error) {
	if len(userIDs) == 0 {
		return make(map[string][]int), nil
	}

	// Convert userIDs to a format suitable for SQL IN clause
	placeholders := ""
	args := make([]interface{}, len(userIDs)+1)
	for i, userID := range userIDs {
		if i > 0 {
			placeholders += ","
		}
		placeholders += fmt.Sprintf("$%d", i+2)
		args[i+1] = userID
	}
	args[0] = lastNPolls

	query := fmt.Sprintf(`
		SELECT p.user1_id, p.user2_id, poll.id as poll_id
		FROM random_coffee_pairs


AL FLAW: Possibly divide by zero */
            int result = (int)(100.0 / data);
            printIntLine(result);
        }
    }
}

/* goodG2B2() - use goodsource and badsink by reversing the blocks in the first if */
static void goodG2B2()
{
    float data;
    /* Initialize data */
    data = 0.0F;
    if(1)
    {
        /* FIX: Use a hardcoded number that won't a divide by zero */
        data = 2.0F;
    }
    if(1)
    {
        {
            /* POTENTIAL FLAW: Possibly divide by zero */
            int result = (int)(100.0 / data);
            printIntLine(result);
        }
    }
}

void CWE369_Divide_by_Zero__float_connect_socket_02_good()
{
    goodB2G1();
    goodB2G2();
    goodG2B1();
    goodG2B2();
}

#endif /* OMITGOOD */

/* Below is the main(). It is only used when building this testcase on
   its own for testing or for building a binary to use in testing binary
   analysis tools. It is not used when compiling all the testcases as one
   application, which is how source code analysis tools are tested. */

#ifdef INCLUDEMAIN

int main(int argc, char * argv[])
{
    /* seed randomness */
    srand( (unsigned)time(NULL) );
#ifndef OMITGOOD
    printLine("Calling good()...");
    CWE369_Divide_by_Zero__float_connect_socket_02_good();
    printLine("Finished good()");
#endif /* OMITGOOD */
#ifndef OMITBAD
    printLine("Calling bad()...");
    CWE369_Divide_by_Zero__float_connect_socket_02_bad();
    printLine("Finished bad()");
#endif /* OMITBAD */
    return 0;
}

#endif


Int(KEY_CUSTOM_COLOR, defValue)

    fun putCustomColor(value: Int) = biliPrefs.edit().putInt(KEY_CUSTOM_COLOR, value).apply()

    fun disableAppletShare() = xPrefs.getBoolean(KEY_APPLET_SHARE, false)

    fun disablePlayerRecommend() = xPrefs.getBoolean(KEY_PLAYER_RECOMMEND, false)

    fun disableDanmakuTextSizeSync() = xPrefs.getBoolean(KEY_DANMAKU_TEXT_SIZE_SYNC, false)
}package com.mentra.mentra
import expo.modules.splashscreen.SplashScreenManager

import android.os.Build
import android.os.Bundle

import com.facebook.react.ReactActivity
import com.facebook.react.ReactActivityDelegate
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
import com.facebook.react.defaults.DefaultReactActivityDelegate

import expo.modules.ReactActivityDelegateWrapper

class MainActivity : ReactActivity() {
  override fun onCreate(savedInstanceState: Bundle?) {
    // Set the theme to AppTheme BEFORE onCreate to support
    // coloring the background, status bar, and navigation bar.
    // This is required for expo-splash-screen.
    // setTheme(R.style.AppTheme);
    // @generated begin expo-splashscreen - expo prebuild (DO NOT MODIFY) sync-f3ff59a738c56c9a6119210cb55f0b613eb8b6af
    SplashScreenManager.registerOnActivity(this)
    // @generated end expo-splashscreen
    super.onCreate(null)
  }

  /**
   * Returns the name of the main component registered from JavaScript. This is used to schedule
   * rendering of the component.
   */
  override fun getMainComponentName(): String = "main"

  /**
   * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
   * which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
   */
  override fun createReactActivityDelegate(): ReactActivityDelegate {
    return ReactActivityDelegateWrapper(
          this,
          BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,
          object : DefaultReactActivityDelegate(
              this,
              mainComponentName,
              fabricEnabled
          ){})
  }

  /**
    * Align the back button behavior with Android S
    * where moving root activities to background instead of finishing activities.
    * @see onBackPressed
    */
  override fun invokeDefaultOnBackPressed() {
      if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) {
          if (!moveTaskToBack(false)) {
              // For non-root activities, use the default implementation to finish them.
              super.invokeDefaultOnBackPressed()
          }
          return
      }

      // Use the default back button implementation on Android S
      // because it's doing more than [Activity.moveTaskToBack] in fact.
      super.invokeDefaultOnBackPressed()
  }
}
package tech.thatgravyboat.skycubed.features.map.screen

import com.mojang.blaze3d.buffers.Std140Builder
import com.mojang.blaze3d.buffers.Std140SizeCalculator
import com.mojang.blaze3d.pipeline.RenderPipeline
import com.mojang.blaze3d.platform.DepthTestFunction
import com.mojang.blaze3d.shaders.UniformType
import com.mojang.blaze3d.systems.RenderSystem
import com.mojang.blaze3d.vertex.DefaultVertexFormat
import com.mojang.blaze3d.vertex.PoseStack
import com.mojang.blaze3d.vertex.Tesselator
import com.mojang.blaze3d.vertex.VertexFormat
import earth.terrarium.olympus.client.pipelines.pips.OlympusPictureInPictureRenderState


.word 0xd0ada000  ! 4133: STBA_I	stba	%r8, [%r22 + 0x0000] %asi
	.word 0xdad44400  ! 4134: LDSHA_R	ldsha	[%r17, %r0] 0x20, %r13
	wr_tick_cmpr_0_35:
	ta	T_CHANGE_HPRIV
	setx	0x0, %g1, %g2
	setx	0x8000000000000000, %g1, %g4
	setx	0x0, %g1, %g6
	or	%g2, 0xa9, %g2
	or	%g4, 0xae, %g4
	or	%g6, 0x9c, %g6
	wrpr	%g0, 0, %tick
	wr	%g2, 0, %tick_cmpr
	wr	%g4, 0, %sys_tick_cmpr
	wrhpr	%g6, 0, %hsys_tick_cmpr
	rdpr	%pstate, %g1
	wrpr	%g1, 2, %pstate
	ta	T_CHANGE_NONHPRIV
	.word 0xd8af8e60  ! 4136: STBA_R	stba	%r12, [%r30 + %r0] 0x73
	wr_tick_cmpr_0_36:
	ta	T_CHANGE_HPRIV
	setx	0x8000000000000000, %g1, %g2
	setx	0x8000000000000000, %g1, %g4
	setx	0x0, %g1, %g6
	or	%g2, 0xac, %g2
	or	%g4, 0x9f, %g4
	or	%g6, 0xa7, %g6
	wrpr	%g0, 0, %tick
	wr	%g2, 0, %tick_cmpr
	wr	%g4, 0, %sys_tick_cmpr
	wrhpr	%g6, 0, %hsys_tick_cmpr
	rdpr	%pstate, %g1
	wrpr	%g1, 2, %pstate
	ta	T_CHANGE_NONHPRIV
	.word 0xd0bf4e40  ! 4138: STDA_R	stda	%r8, [%r29 + %r0] 0x72
	mov	0x3f8, %r21
	.word 0xd0dd6000  ! 4140: LDXA_I	ldxa	[%r21, + 0x0000] %asi, %r8
	.word 0xd8a7ce80  ! 4141: STWA_R	stwa	%r12, [%r31 + %r0] 0x74
	mov	0x0, %r17
	.word 0xd8b52000  ! 4143: STHA_I	stha	%r12, [%r20 + 0x0000] %asi
	mov	0x0, %r26
	.word 0xd8bd6000  ! 4145: STDA_I	stda	%r12, [%r21 + 0x0000] %asi
	.word 0xd8f52000  ! 4146: STXA_I	stxa	%r12, [%r20 + 0x0000] %asi
	.word 0x8780204f  ! 4147: WRASI_I	wr	%r0, 0x004f, %asi
	.word 0xd2d7ce80  ! 4148: LDSHA_R	ldsha	[%r31, %r0] 0x74, %r9
	wr_tick_cmpr_0_37:
	ta	T_CHANGE_HPRIV
	setx	0x0, %g1, %g2
	setx	0x0, %g1, %g4
	setx	0x8000000000000000, %g1, %g6
	or	%g2, 0xbf, %g2
	or	%g4, 0xee, %g4
	or	%g6, 0xb9, %g


#pragma once

#include <memory>

#include <glm/glm.hpp>

#include <nvrhi/nvrhi.h>

struct NvSsao {
  NvSsao(class NvRenderer* renderer);
  void Init();

  class NvRendererBackend* m_backend;
  struct NvGbuffer* m_gbuffer;

  nvrhi::ShaderHandle m_CSPrefilterDepths16x16;
  nvrhi::ComputePipelineHandle m_PSOPrefilterDepths;
  nvrhi::BindingSetHandle m_BSPrefilterDepths;

  nvrhi::SamplerHandle m_SamplerPoint;

  nvrhi::ShaderHandle m_CSGTAOLow;
  nvrhi::ShaderHandle m_CSGTAOMedium;
  nvrhi::ShaderHandle m_CSGTAOHigh;
  nvrhi::ShaderHandle m_CSGTAOUltra;
  nvrhi::ComputePipelineHandle m_PSOGTAO;
  nvrhi::BindingSetHandle m_BSGTAO;

  nvrhi::ShaderHandle m_CSDenoisePass;
  nvrhi::ShaderHandle m_CSDenoiseLastPass;
  nvrhi::ComputePipelineHandle m_PSODenoise;
  nvrhi::ComputePipelineHandle m_PSODenoiseLastPass;
  nvrhi::BindingLayoutHandle m_BLDenoise;
  nvrhi::BindingSetHandle m_BSDenoise;

  nvrhi::ShaderHandle m_CSGenerateNormals;
  nvrhi::ComputePipelineHandle m_PSOGenerateNormals;
  nvrhi::BindingSetHandle m_BSGenerateNormals;

  nvrhi::TextureHandle m_workingDepths;
  nvrhi::TextureHandle m_workingEdges;
  nvrhi::TextureHandle m_workingAOTerm;
  nvrhi::TextureHandle m_workingAOTermPong;
  nvrhi::TextureHandle m_workingNormals;
  nvrhi::TextureHandle m_debugImage;
  nvrhi::TextureHandle m_outputAO;
  nvrhi::BufferHandle m_constantBuffer;

  int m_width;
  int m_height;

  void Render(nvrhi::ICommandList* command_list, const glm::mat4& projection,
              size_t frame_index);
};


e,
			name = L["Channel"],
			get = function(info)
				return E.db.WT.announcement[info[#info - 2]][info[#info - 1]][info[#info]]
			end,
			set = function(info, value)
				E.db.WT.announcement[info[#info - 2]][info[#info - 1]][info[#info]] = value
			end,
			args = {
				party = {
					order = 1,
					name = L["In Party"],
					type = "select",
					values = {
						NONE = L["None"],
						SELF = L["Self (Chat Frame)"],
						EMOTE = L["Emote"],
						PARTY = L["Party"],
						YELL = L["Yell"],
						SAY = L["Say"],
					},
				},
				instance = {
					order = 2,
					name = L["In Instance"],
					type = "select",
					values = {
						NONE = L["None"],
						PARTY = L["Party"],
						SELF = L["Self (Chat Frame)"],
						EMOTE = L["Emote"],
						INSTANCE_CHAT = L["Instance"],
						YELL = L["Yell"],
						SAY = L["Say"],
					},
				},
				raid = {
					order = 3,
					name = L["In Raid"],
					type = "select",
					values = {
						NONE = L["None"],
						SELF = L["Self (Chat Frame)"],
						EMOTE = L["Emote"],
						PARTY = L["Party"],
						RAID = L["Raid"],
						YELL = L["Yell"],
						SAY = L["Say"],
					},
				},
			},
		},
		tag = {
			order = 6,
			type = "group",
			inline = true,
			name = L["Tag"],
			get = function(info)
				return E.db.WT.announcement.quest[info[#info - 1]][info[#info]]
			end,
			set = function(info, value)
				E.db.WT.announcement.quest[info[#info - 1]][info[#info]] = value
			end,
			args = {
				enable = {
					order = 1,
					type = "toggle",
					name = L["Enable"],
					desc = L["The category of the quest."],
				},
				color = {
					order = 2,
					type = "color",
					name = L["Color"],
					hasAlpha = false,
					get = function(info)
						local colordb = E.db.WT.announcement.quest[info[#info - 1]].color
						local default = P.announcement.quest[info[#info - 1]].color
						return colordb.r, colordb.g, colordb.b, nil, default.r, default.g, default.b, nil
					end,
					set = function(info, r, g, b, a)
						E.db.WT.announcement.quest[info[#info - 1]].color = {
							r = r,
							g = g,
							b = b,
						}
					end,
				},
			},
		},
		suggestedGroup = {
			order = 7,
			type = "group",
			inline = true,
			name = L["Suggested Group"],
			get = function(info)
				return E.db.WT.announcement.quest[info[#info - 1]][info[#info]]
			end,
			set = function(info, value)
				E.db.WT.announcement.quest[info[#info - 1]][info[#info]] = value
			end,
			args = {
				enable = {
					order = 1,
					type = "toggle",
					name = L["Enable"],
					desc = L["If the quest is suggested with multi-players, add the number of players to the message."],
				},
				color = {
					order = 2,
					type = "color",
					name = L["Color"],
					hasAlpha = false,
					get = function(info)
						local colord


4 { v4.w = vsub(v19.w,{{ *}}v31.w):sat }
v4.w=vsub(v19.w,v31.w):sat

#CHECK: 1c67d816 { v22.ub = vsub(v24.ub,{{ *}}v7.ub):sat }
v22.ub=vsub(v24.ub,v7.ub):sat

#CHECK: 1c7ddc2f { v15.uh = vsub(v28.uh,{{ *}}v29.uh):sat }
v15.uh=vsub(v28.uh,v29.uh):sat

#CHECK: 1c5cc6d7 { v23.h = vsub(v6.h,{{ *}}v28.h) }
v23.h=vsub(v6.h,v28.h)

#CHECK: 1c54cae4 { v4.w = vsub(v10.w,{{ *}}v20.w) }
v4.w=vsub(v10.w,v20.w)

#CHECK: 1c4dc78b { v11.w = vadd(v7.w,{{ *}}v13.w):sat }
v11.w=vadd(v7.w,v13.w):sat

#CHECK: 1c48c7a4 { v4.b = vsub(v7.b,{{ *}}v8.b) }
v4.b=vsub(v7.b,v8.b)

#CHECK: 1cdec3b0 { v16.uh = vavg(v3.uh,{{ *}}v30.uh) }
v16.uh=vavg(v3.uh,v30.uh)

#CHECK: 1c76dc98 { v25:24.b = vadd(v29:28.b,{{ *}}v23:22.b) }
v25:24.b=vadd(v29:28.b,v23:22.b)

#CHECK: 1c7ad4a6 { v7:6.h = vadd(v21:20.h,{{ *}}v27:26.h) }
v7:6.h=vadd(v21:20.h,v27:26.h)

#CHECK: 1cc7c564 { v4.uw = vabsdiff(v5.w,{{ *}}v7.w) }
v4.uw=vabsdiff(v5.w,v7.w)

#CHECK: 1cd2cdc1 { v1.h = vavg(v13.h,{{ *}}v18.h) }
v1.h=vavg(v13.h,v18.h)

#CHECK: 1cd5d246 { v6.uh = vabsdiff(v18.uh,{{ *}}v21.uh) }
v6.uh=vabsdiff(v18.uh,v21.uh)

#CHECK: 1cdcd987 { v7.ub = vavg(v25.ub,{{ *}}v28.ub) }
v7.ub=vavg(v25.ub,v28.ub)

#CHECK: 1c92c6e4 { v5:4.uh = vsub(v7:6.uh,{{ *}}v19:18.uh):sat }
v5:4.uh=vsub(v7:6.uh,v19:18.uh):sat

#CHECK: 1c86dace { v15:14.ub = vsub(v27:26.ub,{{ *}}v7:6.ub):sat }
v15:14.ub=vsub(v27:26.ub,v7:6.ub):sat

#CHECK: 1cffc07c { v28.ub = vavg(v0.ub,{{ *}}v31.ub):rnd }
v28.ub=vavg(v0.ub,v31.ub):rnd

#CHECK: 1cf8d851 { v17.w = vnavg(v24.w,{{ *}}v24.w) }
v17.w=vnavg(v24.w,v24.w)

#CHECK:


OVC rC07, 21*64(pC)
            prefC(21*64+1536(pC))
         MOVC rC17, 22*64(pC)
            prefC(22*64+1536(pC))
         MOVC rC27, 23*64(pC)
            prefC(23*64+1536(pC))
         #ifdef BETA0
            add incC, pC
            mov KK0, KK
            add incBn, pB
            mov pA0, pA
         #else
            add incC, pC
         #endif
         dec nnu
      jnz NLOOP
      mov pB0, pB
      add incAm, pA0
      dec nmu
      mov pA0, pA
      mov nnu0, nnu
   jnz MLOOP

DONE:
   movq  -8(%rsp), %r15
   movq -16(%rsp), %r14
   movq -24(%rsp), %r13
   movq -32(%rsp), %r12
   movq -40(%rsp), %rbp
   movq -48(%rsp), %rbx
   ret


    public long getDaysUntilExpiry() {
        return expiryInfo.getDaysUntilExpiry();
    }

    // Getters
    public String getBatchId() { return batchId; }
    public ProductSKU getProductSku() { return productSku; }
    public String getSupplierId() { return supplierId; }
    public Quantity getCurrentQuantity() { return currentQuantity; }
    public Quantity getOriginalQuantity() { return originalQuantity; }
    public Money getUnitCost() { return unitCost; }
    public ExpiryInfo getExpiryInfo() { return expiryInfo; }
    public LocalDateTime getReceivedAt() { return receivedAt; }

    @Override
    public String toString() {
        return String.format("StockEntry(%s: %s of %s)", batchId, currentQuantity, productSku);
    }
}

// ====================================================================
// DOMAIN SERVICES
// ====================================================================

/**
 * Stock Allocation Service - Complex stock allocation logic
 * Stock Allocation Service - Complex stock allocation logic
 */
class StockAllocationService {

    /**
     * Allocate stock using FIFO (First In First Out) strategy
     * FIFO strategy का इस्तेमाल करके stock allocate करना
     */
    public List<StockEntry> allocateStock(ProductSKU productSku, Quantity requestedQuantity,
                                        List<StockEntry> availableStock) {

        System.out.println("🎯 Allocating " + requestedQuantity + " of " + productSku);

        // Filter available stock for the product (non-expired, non-empty)
        List<StockEntry> validStock = availableStock.stream()
            .filter(entry -> entry.getProductSku().equals(productSku))
            .filter(entry -> !entry.isEmpty())
            .filter(entry -> !entry.isExpired())
            .sorted((a, b) -> a.getReceivedAt().compareTo(b.getReceivedAt())) // FIFO
            .collect(Collectors.toList());

        if (validStock.isEmpty()) {
            throw new InsufficientStockException("No valid stock available for " + productSku);
        }

        // Calculate total available quantity
        Quantity totalAvailable = validStock.stream()
            .map(StockEntry::getCurrentQuantity)
            .reduce(new Quantity(0, requestedQuantity.getUnit()), Quantity::add);

        if (requestedQuantity.isGreaterThan(totalAvailable)) {
            throw new InsufficientStockException("Insufficient total stock. Available: " +
                totalAvailable + ", Requested: " + requestedQuantity);
        }

        // Allocate from batches using FIFO
        List<StockEntry> allocatedBatches = new ArrayList<>();
        Quantity remainingToAllocate = requestedQuantity;

        for (StockEntry stockEntry : validStock) {
            if (remainingToAllocate.isZero()) break;

            Quantity batchAvailable = stockEntry.getCurrentQuantity();
            Quantity toAllocateFromBatch = remainingToAllocate.isGreaterThan(batchAvailable)
                ? batchAvailable
                : remainingToAllocate;

            stockEntry.reserve(toAllocateFromBatch);
            allocatedBatches.add(stockEntry);
            remainingToAllocate = remainingToAllocate.subtract(toAllocateFromBatch);

            System.out.println("   📦 Allocated " + toAllocateFromBatch + " from batch " +
                stockEntry.getBatchId());
        }

        System.out.println("✅ Stock allocation complete: " + allocatedBatches.size() + " batches");
        return allocatedBatches;
    }

    /**
     * Check stock levels and get status
     * Stock levels check करके status निकालना
     */
    public StockStatus checkStockStatus(ProductSKU productSku, List<StockEntry> stockEntries,


	m_upAxis = 0;
	m_implicitShapeDimensions.setValue(0.5f*height, radius,radius);
}

btCapsuleShapeZ::btCapsuleShapeZ(btScalar radius,btScalar height)
{
	m_upAxis = 2;
	m_implicitShapeDimensions.setValue(radius,radius,0.5f*height);
}

/*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org

This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/

/// This file was created by Alex Silverman

#include "BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.h"
#include "BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.h"
//#include "BulletCollision/CollisionShapes/btOptimizedBvh.h"

///Obtains the material for a specific triangle
const btMaterial * btMultimaterialTriangleMeshShape::getMaterialProperties(int partID, int triIndex)
{
    const unsigned char * materialBase = 0;
    int numMaterials;
    PHY_ScalarType materialType;
    int materialStride;
    const unsigned char * triangleMaterialBase = 0;
    int numTriangles;
    int triangleMaterialStride;
    PHY_ScalarType triangleType;

    ((btTriangleIndexVertexMaterialArray*)m_meshInterface)->getLockedReadOnlyMaterialBase(&materialBase, numMaterials, materialType, materialStride,
        &triangleMaterialBase, numTriangles, triangleMaterialStride, triangleType, partID);

    // return the pointer to the place with the friction for the triangle
    // TODO: This depends on whether it's a moving mesh or not
    // BUG IN GIMPACT
    //return (btScalar*)(&materialBase[triangleMaterialBase[(triIndex-1) * triangleMaterialStride] * materialStride]);
    int * matInd = (int *)(&(triangleMaterialBase[(triIndex * triangleMaterialStride)]));
    btMaterial *matVal = (btMaterial *)(&(materialBase[*matInd * materialStride]));
    return (matVal);
}
/*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org

This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/

#include "btT


y NjY0 IFBhZGRpbmc= OTI0 UEQ= Qk9Y IFNQRUNJQUw= IGZlY2hh IHZpZGU= IExlYWRlcg== 5Lul JCgiLg== IGRpYW1ldGVy IG1pbGQ= NzQ1 IHJvY2tz YXBwaW5ncw== MDQ4 ZGlyZWN0b3J5 NTU3 LmZsdXNo IEplc3M= VU5JVA== IFBlYXI= IG1hbmRhdG9yeQ== U3Vy cXQ= IHN0cmVhbXM= IGNvb3BlcmF0aW9u IFNhYw== IGNoZWFwZXI= CWNo YW5pbWF0aW9u ZmFyZQ== KGhlaWdodA== KFRydWU= Tlk= IHdyZXN0 IHBvbGxz IGVuY291bnRlcmVk IE1hcmtldGFibGU= X1BBU1NXT1JE NzE2 X1NFTEVDVA== IEFyYWJpYQ== X2Nsb2Nr IHZveQ== INC40Lc= IHN0aXI= aXNpYmxl LWVmZmVjdA== LmNyZWF0ZWQ= IHRveXM= IFRyYWRhYmxl IHJ1c3Q= IHN0cmNweQ== X3RpbWVzdGFtcA== IHRhbGVudGVk LG51bGw= IEpvYnM= IFBvcnRsYW5k IHdlYWtuZXNz VGhyb3c= IEFuZ2Vs 5L+u NzU0 IHVuY2VydA== 77yJCg== IOydtA== V2hpY2g= IFstXTo= U29tZXRoaW5n IGNvbnZpY3RlZA== a2xl ZWRpdW0= IGJyYW5jaGVz IGJhc2Vz 564= IGNvbXBsZXhpdHk= IEZpZw== LnJlc2hhcGU= JGRi NzM2 X0NPTlNU IFRlcw== LnJ1bnRpbWU= IGRlbnk= IEJTRA== IGty aGF0dA== IFN0YXRpYw== IHVuaXZlcnNpdGllcw== UmVwbGFjZQ== IGRyb3Zl IGFkb2xlcw== X3BsdWdpbg== IExHQlQ= IHRleA== ZHVjdGlvbg== NzUx Nzk5 RURJ IFRlZA== X1VSSQ== IHJlY2VwdGlvbg== YXJ0ZW4= LlNpbmdsZQ== cmljZQ== c2Npb3Vz ODQz X2Jn IHdhZ2Vz IFNlcnZsZXQ= VUlMYXlvdXQ= IGZvcm1hdHRlZA== Lk1vZA== PGNsYXNz aXNlbg== IHJlcHJlc2VudGF0aXZlcw== Il09 IHBvcnRhbA== IEh1bnRlcg== IGhpcmluZw== X18pCg== cmljdWx1bQ== dW8= bGllc3Q= IHRlYXJz TGF0 IGxpdGVyYWw= Lkluc2VydA== IGN1cnM= IENvbXB1dA== IHRlcnJvcmlzbQ== IHN3ZWVw IFtdDQo= IHBhc3Nlbmdlcg== IGVhc3Rlcm4= IHR3ZWV0cw== IG9wZXJhdGVk d25k IFN5bg== LnRvb2xz IFdN dWxhdGVz IGJhY3Rlcmlh KGJ5dGVz LnNldERhdGE= IHZpc2liaWxpdHk= Ly89PT09PT09PT09PT09PT


 var(--ag-background-color);
}

[class*=ag-theme-] {
  -webkit-font-smoothing: antialiased;
  font-family: var(--ag-font-family);
  font-size: var(--ag-font-size);
  line-height: normal;
  color: var(--ag-foreground-color);
}

ag-grid, ag-grid-angular, ag-grid-ng2, ag-grid-polymer, ag-grid-aurelia {
  display: block;
}

.ag-aria-description-container {
  z-index: 9999;
  border: 0px;
  clip: rect(1px, 1px, 1px, 1px);
  height: 1px;
  width: 1px;
  position: absolute;
  overflow: hidden;
  padding: 0px;
  white-space: nowrap;
}

.ag-hidden {
  display: none !important;
}

.ag-invisible {
  visibility: hidden !important;
}

.ag-no-transition {
  transition: none !important;
}

.ag-drag-handle {
  cursor: grab;
}

.ag-column-drop-wrapper {
  display: flex;
}

.ag-column-drop-horizontal-half-width {
  display: inline-block;
  width: 50% !important;
}

.ag-unselectable {
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.ag-selectable {
  -moz-user-select: text;
  -webkit-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

.ag-tab {
  position: relative;
}

.ag-tab-guard {
  position: absolute;
  width: 0;
  height: 0;
  display: block;
}

.ag-select-agg-func-popup {
  position: absolute;
}

.ag-input-wrapper, .ag-picker-field-wrapper {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  line-height: normal;
  position: relative;
}

.ag-shake-left-to-right {
  animation-direction: alternate;
  animation-duration: 0.2s;
  animation-iteration-count: infinite;
  animation-name: ag-shake-left-to-right;
}

@keyframes ag-shake-left-to-right {
  from {
    padding-left: 6px;
    padding-right: 2px;
  }
  to {
    padding-left: 2px;
    padding-right: 6px;
  }
}
.ag-root-wrapper {
  cursor: default;
  position: relative;
  display: flex;
  flex-direction: column;
  overfl


user_content_votes.json');
    final redditor = reddit.redditor('DRAWApiOfficial');
    Future<List<String>> getUpvoted() async {
      final upvoted = <String>[];
      await for (final submission in redditor.upvoted()) {
        expect(submission is Submission, isTrue);
        upvoted.add((submission as Submission).fullname!);
      }
      return upvoted;
    }

    Future<List<String>> getDownvoted() async {
      final upvoted = <String>[];
      await for (final submission in redditor.downvoted()) {
        expect(submission is Submission, isTrue);
        upvoted.add((submission as Submission).fullname!);
      }
      return upvoted;
    }

    final subreddit = reddit.subreddit('drawapitesting');
    var upvoted = await getUpvoted();
    var downvoted = await getDownvoted();
    await for (final submission in submissionsHelper(subreddit)) {
      expect(upvoted.contains(submission.fullname), isFalse);
      expect(downvoted.contains(submission.fullname), isFalse);
      await submission.upvote();
    }

    upvoted = await getUpvoted();
    downvoted = await getDownvoted();
    await for (final submission in submissionsHelper(subreddit)) {
      expect(upvoted.contains(submission.fullname), isTrue);
      expect(downvoted.contains(submission.fullname), isFalse);
      await submission.downvote();
    }

    upvoted = await getUpvoted();
    downvoted = await getDownvoted();
    await for (final submission in submissionsHelper(subreddit)) {
      expect(upvoted.contains(submission.fullname), isFalse);
      expect(downvoted.contains(submission.fullname), isTrue);
      await submission.clearVote();
    }

    upvoted = await getUpvoted();
    downvoted = await getDownvoted();
    await for (final submission in submissionsHelper(subreddit)) {
      expect(upvoted.contains(submission.fullname), isFalse);
      expect(downvoted.contains(submission.fullname), isFalse);
    }
  });
}
// Copyright (c) 2017, the Dart Reddit API Wrapper project authors.
// Please see the AUTHORS file for details. All rights reserved.
// Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.

import 'dart:async';
import 'dart:io';

import 'package:draw/draw.dart';
import 'package:test/test.dart';

import '../test_utils.dart';

// ignore_for_file: unused_local_variable

Future<void> main() async {
  test('lib/subreddit/invalid', () async {
    final reddit = await createRedditTestInstance(
        'test/subreddit/lib_subreddit_invalid.json');
    await expectLater(
        () async => await reddit.subreddit('drawapitesting2').populate(),
        throwsA(TypeMatcher<DRAWInvalidSubredditException>()));
  });

  test('lib/subreddit/banned', () async {
    final reddit = await createRedditTestInstance(
        'test/subreddit/lib_subreddit_banned.json');
    final subreddit = reddit.subreddit('drawapitesting');
    await for (final user in subreddit.banned()) {
      fail('Expected no returned values, got: $user');
    }
    await subreddit.banned.add('spez');
    expect((await subreddit.banned().first).displayName, equals('spez'));
    await subreddit.banned.remove('spez');
    await for (final user in subreddit.banned()) {
      fail('Expected no returned val


namespace FairyGUI.Test.Scenes
{
	public class TreeViewScene : DemoScene
	{
		GComponent _mainView;
		TreeView _treeView;
		string _folderURL1;
		string _folderURL2;
		string _fileURL;

		public TreeViewScene()
		{
			UIPackage.AddPackage("UI/TreeView");
			_mainView = UIPackage.CreateObject("TreeView", "Main").asCom;
			_mainView.MakeFullScreen();
			_mainView.AddRelation(GRoot.inst, RelationType.Size);
			AddChild(_mainView);

			_folderURL1 = "ui://TreeView/folder_closed";
			_folderURL2 = "ui://TreeView/folder_opened";
			_fileURL = "ui://TreeView/file";

			_treeView = new TreeView(_mainView.GetChild("tree").asList);
			_treeView.onClickNode.Add(__clickNode);
			_treeView.treeNodeRender = RenderTreeNode;

			TreeNode topNode = new TreeNode(true);
			topNode.data = "I'm a top node";
			_treeView.root.AddChild(topNode);
			for (int i = 0; i < 5; i++)
			{
				TreeNode node = new TreeNode(false);
				node.data = "Hello " + i;
				topNode.AddChild(node);
			}

			TreeNode aFolderNode = new TreeNode(true);
			aFolderNode.data = "A folder node";
			topNode.AddChild(aFolderNode);
			fo


oles:  requires.GetRoles(),
		Traits: traitv1.FromProto(requires.GetTraits()),
	}
}
func convertOwnersFromProto(protoOwners []*accesslistv1.AccessListOwner) []accesslist.Owner {
	owners := make([]accesslist.Owner, len(protoOwners))
	for i, owner := range protoOwners {
		owners[i] = FromOwnerProto(owner)
		owners[i].IneligibleStatus = "" // default, overridden via option if needed
	}
	return owners
}

func convertGrantsFromProto(protoGrants *accesslistv1.AccessListGrants) accesslist.Grants {
	if protoGrants == nil {
		return accesslist.Grants{}
	}
	return accesslist.Grants{
		Roles:  protoGrants.GetRoles(),
		Traits: traitv1.FromProto(protoGrants.GetTraits()),
	}
}

// ToOwnerProto converts an internal access list owner into a v1 access list owner object.
func ToOwnerProto(owner accesslist.Owner) *accesslistv1.AccessListOwner {
	var ineligibleStatus accesslistv1.IneligibleStatus
	if owner.IneligibleStatus != "" {
		if enumVal, ok := accesslistv1.IneligibleStatus_value[owner.IneligibleStatus]; ok {
			ineligibleStatus = accesslistv1.IneligibleStatus(enumVal)
		}
	} else {
		ineligibleStatus = accesslistv1.IneligibleStatus_INELIGIBLE_STATUS_UNSPECIFIED
	}

	var kind accesslistv1.MembershipKind
	if enumVal, ok := accesslistv1.MembershipKind_value[owner.MembershipKind]; ok {
		kind = accesslistv1.MembershipKind(enumVal)
	}

	return &accesslistv1.AccessListOwner{
		Name:             owner.Name,
		Description:      owner.Description,
		IneligibleStatus: ineligibleStatus,
		MembershipKind:   kind,
	}
}

// FromOwnerProto converts a v1 access list owner into an internal access list owner object.
func FromOwnerProto(protoOwner *accesslistv1.AccessListOwner) accesslist.Owner {
	if protoOwner == nil {
		return accesslist.Owner{}
	}
	ineligibleStatus := ""
	if protoOwner.GetIneligibleStatus() != accesslistv1.IneligibleStatus_INELIGIBLE_STATUS_UNSPECIFIED {
		ineligibleStatus = protoOwner.GetIneligibleStatus().String()
	}

	return accesslist.Owner{
		Name:             protoOwner.GetName(),
		Description:      protoOwner.GetDescription(),
		IneligibleStatus: ineligibleStatus,
		MembershipKind:   protoOwner.GetMembershipKind().String(),
	}
}

// WithOwnersIneligibleStatusField sets the "ineligibleStatus" field to the provided proto value.
func WithOwnersIneligibleStatusField(protoOwners []*accesslistv1.AccessListOwner) AccessListOption {
	return func(a *accesslist.AccessList) {
		updatedOwners := make([]accesslist.Owner, len(a.GetOwners()))
		for i, owner := range a.GetOwners() {
			protoIneligibleStatus := protoOwners[i].GetIneligibleStatus()
			ineligibleStatus := ""
			if protoIneligibleStatus != accesslistv1.IneligibleStatus_INELIGIBLE_STATUS_UNSPECIFIED {
				ineligibleStatus = protoIneligibleStatus.String()
			}
			owner.IneligibleStatus = ineligibleStatus
			updatedOwners[i] = owner
		}
		a.SetOwners(updatedOwners)
	}
}

func convertStatusToProto(status *accesslist.Status) *accesslistv1.AccessListStatus {
	if status == nil {
		return nil
	}

	return &accesslistv1.AccessListStatus{
		MemberCount:            copyPointer(status.MemberCount),
		MemberListCount:        copyPointer(status.MemberListCount),
		OwnerOf:                status.OwnerOf,
		MemberOf:


�**：AUC-ROC、精確率 (Precision)、召回率 (Recall)、F1-score。

## 文件內容
此 Jupyter Notebook 包含以下內容：

## 使用方法
1. 確保已安裝必要的 Python 庫，包括 `pandas`、`numpy`、`xgboost`、`matplotlib`、`seaborn` 和 `scikit-learn`。
2. 下載數據集並放置於適當目錄中。
3. 運行 Notebook 以復現結果。

## 結果展示
分析結果包括混淆矩陣、特徵重要性排序及模型性能比較，詳細內容見 Notebook。

## 聲明
本專案僅用於學術研究與教學目的。
# 🛡 ZenScan – The Ultimate Free Cybersecurity Scanner

🚀 ZenScan is a powerful, open-source penetration testing tool designed to help security researchers, ethical hackers, and bug bounty hunters scan for vulnerabilities quickly & efficiently.

## 🔍 ZenScan Features:
✅ Nmap Scan – Find open ports & services </br>
✅ Port Scanner – Scan for vulnerable ports </br>
✅ SQL Injection Scanner – Detect SQLi vulnerabilities </br>
✅ Directory Scanner – Find hidden directories & sensitive files </br>
✅ Web Vulnerability Scanner (Wapiti) – Detect XSS, CSRF, SSRF, and more! </br>
✅ Real-Time Progress Bars – Stay informed while scanning </br>
✅ Custom Wordlist Support – Brute-force directories with custom lists </br>
✅ Fast, Lightweight & Open Source – Built for security professionals

## 📌 Installation & Usage (Linux)
Step 1: Clone the repository
```
git clone https://github.com/ScuriZen/ZenScan.git
cd ZenScan
```

Step 2: Install dependencies
```
pip install -r requirements.txt
```

Step 3: Run ZenScan
```
python start.py
```

Step 4: Select a scan type & enter the target domain/IP
```
[1] Nmap Scan
[2] Port Scan
[3] SQL Injection Scan
[4] Web Vulnerability Scan (Wapiti)
[5] Directory Scanner
[6] Exit
```

## 🛠 ZenScan Modules
| 🛡 Module | 🔍 Description | 📂 Command |
|-----------|----------------|------------|
| Nmap Scanner | Detect open ports, services & OS information | python start.py → [1] |
| Port Scanner | Scan for commonly open ports | python start.py → [2] |
| SQL Injection Scan | Detect SQL vulnerabilities using sqlmap | python start.py → [3] |
| Directory Scanner | Find hidden files & directories | python start.py → [5] |
| Web Vuln Scanner | XSS, CSRF, SSRF detection with Wapiti | python start.py → [4] |
| Brute Force Mode | Use a custom wordlist for directory scanning | python start.py → [5] |

## 📝 License
ZenScan is released under the MIT License. You are fr


JobsCount()) > 0) {
									if ((subProgress != null && subProgress.isCanceled())
											|| this.processingThread == null)
										throw new OperationCanceledException();
									IJob currentJob = currentJob();
									// currentJob can be null when jobs have been added to the queue but job manager is not enabled
									if (currentJob != null && currentJob != previousJob) {
										if (VERBOSE)
											Util.verbose("-> NOT READY - waiting until ready - " + searchJob);//$NON-NLS-1$
										if (subProgress != null) {
											String indexing = Messages.bind(Messages.jobmanager_filesToIndex, currentJob.getJobFamily(), Integer.toString(awaitingJobsCount));
											subProgress.subTask(indexing);
											// ratio of the amount of work relative to the total work
											float ratio = awaitingJobsCount < totalWork ? 1 : ((float) totalWork) / awaitingJobsCount;
											if (lastJobsCount > awaitingJobsCount) {
												totalWorked += (lastJobsCount - awaitingJobsCount) * ratio;
											} else {
												// more jobs were added, just increment by the ratio
												totalWorked += ratio;
											}
											if (totalWorked - lastWorked >= 1) {
												subProgress.worked((int) (totalWorked - lastWorked));
												lastWorked = totalWorked;
											}
											lastJobsCount = awaitingJobsCount;
										}
										previousJob = currentJob;
									}
									try {
										if (VERBOSE)
											Util.verbose("-> GOING TO SLEEP - " + searchJob);//$NON-NLS-1$
										Thread.sleep(50);
									} catch (InterruptedException e) {
										// ignore
									}
								}
							} finally {
								synchronized(this) {
									this.awaitingClients--;
								}
								if (t != null && originalPriority > -1 && t.isAlive())
									t.setPriority(originalPriority);
							}
						} finally {
							if (subProgress != null)
								subProgress.done();
						}
				}
			}
			status = searchJob.execute(progress == null ? null : new SubProgressMonitor(progress, concurrentJobWork));
		} finally {
			if (progress != null)
				progress.done();
			if (VERBOSE)
				Util.verbose("FINISHED  concurrent job - " + searchJob); //$NON-NLS-1$
		}
		return status;
	}
	public abstract String processName();

	public synchronized void request(IJob job) {

		job.ensureReadyToRun();

		// append the job to the list of ones to process later on
		int size = this.awaitingJobs.length;
		if (++this.jobEnd == size) { // when growing, relocate jobs starting at position 0
			this.jobEnd -= this.jobStart; // jobEnd now equals the number of jobs
			if (this.jobEnd < 50 && this.jobEnd < this.jobStart) {
				// plenty of free space in the queue so shift the remaining jobs to the beginning instead of growing it
				System.arraycopy(this.awaitingJobs, this.jobStart, this.awaitingJobs, 0, this.jobEnd);
				for (int i = this.jobStart; i < size; i++)
					this.awaitingJobs[i] = null;
			} else {
				System.arraycopy(this.awaitingJobs, this.jobStart, this.awaitingJobs = new IJob[size * 2], 0, this.jobEnd);
			}
			this.jobStart = 0;
		}
		this.awaitingJobs[this.jobEnd] = job;
		if (VERBOSE) {
			Util.verbose("REQUEST   background job - " + job); //$NON-NLS-1$
			Util.verbose("AWAITING JOBS count: " + awaitingJobsCount()); //$NON-NLS-1$
		}
		notifyAll(); // wake up the background thread if it is wa


333 0-74.666667-34.133333-74.666667-74.666667 0-19.2 8.533333-38.4 21.333334-51.2zM512 772.266667c-209.066667 0-345.6-209.066667-379.733333-266.666667 21.333333-36.266667 81.066667-130.133333 174.933333-196.266667l104.533333 104.533334c-25.6 25.6-38.4 59.733333-38.4 96 0 76.8 61.866667 138.666667 138.666667 138.666666 36.266667 0 70.4-14.933333 96-38.4l98.133333 98.133334c-61.866667 42.666667-128 64-194.133333 64z"  ></path></symbol><symbol id="pear-icon-email" viewBox="0 0 1024 1024"><path d="M874.666667 181.333333H149.333333c-40.533333 0-74.666667 34.133333-74.666666 74.666667v512c0 40.533333 34.133333 74.666667 74.666666 74.666667h725.333334c40.533333 0 74.666667-34.133333 74.666666-74.666667V256c0-40.533333-34.133333-74.666667-74.666666-74.666667z m-725.333334 64h725.333334c6.4 0 10.666667 4.266667 10.666666 10.666667v25.6L512 516.266667l-373.333333-234.666667V256c0-6.4 4.266667-10.666667 10.666666-10.666667z m725.333334 533.333334H149.333333c-6.4 0-10.666667-4.266667-10.666666-10.666667V356.266667l356.266666 224c4.266667 4.266667 10.666667 4.266667 17.066667 4.266666s12.8-2.133333 17.066667-4.266666l356.266666-224V768c0 6.4-4.266667 10.666667-10.666666 10.666667z"  ></path></symbol><symbol id="pear-icon-error" viewBox="0 0 1024 1024"><path d="M512 74.666667C270.933333 74.666667 74.666667 270.933333 74.666667 512S270.933333 949.333333 512 949.333333 949.333333 753.066667 949.333333 512 753.066667 74.666667 512 74.666667z m0 810.666666c-204.8 0-373.333333-168.533333-373.333333-373.333333S307.2 138.666667 512 138.666667 885.333333 307.2 885.333333 512 716.8 885.333333 512 885.333333z"  ></path><path d="M657.066667 360.533333c-12.8-12.8-32-12.8-44.8 0l-102.4 102.4-102.4-102.4c-12.8-12.8-32-12.8-44.8 0-12.8 12.8-12.8 32 0 44.8l102.4 102.4-102.4 102.4c-12.8 12.8-12.8 32 0 44.8 6.4 6.4 14.933333 8.533333 23.466666 8.533334s17.066667-2.133333 23.466667-8.533334l102.4-102.4 102.4 102.4c6.4 6.4 14.933333 8.533333 23.466667 8.533334s17.066667-2.