锐利，露凶光，为人贪杯；更见凶煞助旺，大难临头。岁运元辰逢冲有凶讯，病灾不免。 女命，元辰见刑冲，不识大体，不守礼法，尤再见劫煞。 八字或是岁运流年元辰逢合而质变，为喜则见吉庆加临，为忌则更助其凶讯。\r\n\r\n元辰与官符并见，会无缘无故受到挫折；元辰与劫煞并见，男人做事不能注意小节，动招危辱，穷贱无耻。妇人声粗雄，性糊涂，私通淫邪，不遵礼法，一生多灾难，生子性拗不孝。\r\n\r\n逢合化解，逢凶化夷。冲相对合，如果命局中有冲则效果减少。《洞元经》云：\"元辰遇合而大亨。\"八字中原有七杀，岁运再遇七杀，亦与元辰同观。元辰之煞虽凶，流年大运逢之尤可畏，但知凶而不往元辰所临之方，则可免凶。元辰与伤官并为忌神则不吉；如果元辰与闲神相并，与它支成三合，六合，化出五行为用神，则无大碍，如和用神并，君子小人难辨，往往君子也会变为小人，事业屡遭小人暗中破坏，机遇频频擦肩而过。\r\n\r\n元辰与印星并 ，会出现多种情况，父母为印星，为用神，如果是乙酉，乙是印星，酉是元辰，印星被破坏，母亲身体健康不利，自身得不到良好的呵护和教育，如果命理不用印星，只显示母亲不健康与其它无碍。\r\n\r\n元辰与劫财并 ，身旺，命主本人挥霍无度，花钱没有节制，以致负债累累，在经济上走极端，困境之中心生邪念，取不义之财。\r\n\r\n元辰与比肩并 ：受兄弟姐妹拖累，或拖累兄弟姐妹，一生为家人朋友操心，或家人朋友为他操心。\r\n\r\n元辰与桃花并 ；具有此命的女性尤为不利，易连续发生婚外恋情，贪恋情感不顾及家庭，不负责任，甘习下贱，甘做下流，不为他人所尊重，也有的是情场大军的一员，俗称商女，现代称“小姐”，以致搞得自己声名狼藉。\r\n\r\n命带元辰不是一律概括，要看元辰符号在命理的作用大小而言，如果元辰就是闲神，命理不需要的，要按正五行看。元辰被有力符号合住，化为有用的五行，依然是好命。遇有这种情况不用担心，以正五行标准推测，才是纲领性的规律。 \r\n\r\n\r\n\r\n";

                            命局神煞 += 大耗;
                        }
                    }

                    //破碎
                    if (jia == jia)
                    {
                        int 破碎真假 = 0;
                        if (ydz == yin || ydz == shen || ydz == sii || ydz == hai)
                        {
                            if (ndz == you)
                            {
                                ndzpuosui += 1; linkLabelndzss1.Text += "破碎-"; 破碎真假 = 1;
                            }
                            if (rdz == you)
                            {
                                rdzpuosui += 1; linkLabelrdzss1.Text += "破碎-"; 破碎真假 = 1;
                            }
                            if (sdz == you)
                            {
                                sdzpuosui += 1; linkLabelsdzss1.Text += "破碎-


Map<String, dynamic>? _encodedRequest;
  String? _uniqueKey;

  Map<String, dynamic>? encode() {
    _encodedRequest ??= <String, dynamic>{
      'src': src.encode(),
      'width': imageWidth,
      'height': imageHeight,
      'imageType': imageType,
      'renderingType': renderingType,
      'uniqueKey': uniqueKey()
    };

    return _encodedRequest;
  }

  String? uniqueKey() {
    _uniqueKey ??=
        '${src.encode().toString()}_imageType:${imageType}_imageWidth:${imageWidth}_imageHeight:${imageHeight}_renderingType:$renderingType'; //TODO 修改
    return _uniqueKey;
  }
}
// automatically generated by the FlatBuffers compiler, do not modify
// ignore_for_file: unused_import, unused_field, unused_local_variable

library namespace_c;

import 'dart:typed_data' show Uint8List;
import 'package:flat_buffers/flat_buffers.dart' as fb;

import 'namespace_test1_namespace_c_generated.dart';
import './namespace_test2_namespace_a_generated.dart' as namespace_a;

class TableInC {
  TableInC._(this._bc, this._bcOffset);
  factory TableInC(List<int> bytes) {
    fb.BufferContext rootRef = new fb.BufferContext.fromBytes(bytes);
    return reader.read(rootRef, 0);
  }

  static const fb.Reader<TableInC> reader = const _TableInCReader();

  final fb.BufferContext _bc;
  final int _bcOffset;

  namespace_a.TableInFirstNS get referToA1 => namespace_a.TableInFirstNS.reader.vTableGet(_bc, _bcOffset, 4, null);
  namespace_a.SecondTableInA get referToA2 => namespace_a.SecondTableInA.reader.vTableGet(_bc, _bcOffset, 6, null);

  @override
  String toString() {
    return 'TableInC{referToA1: $referToA1, referToA2: $referToA2}';
  }
}

class _TableInCReader extends fb.TableReader<TableInC> {
  const _TableInCReader();

  @override
  TableInC createObject(fb.BufferContext bc, int offset) =>
    new TableInC._(bc, offset);
}

class TableInCBuilder {
  TableInCBuilder(this.fbBuilder) {
    assert(fbBuilder != null);
  }

  final fb.Builder fbBuilder;

  void begin() {
    fbBuilder.startTable();
  }

  int addReferToA1Offset(int offset) {
    fbBuilder.addOffset(0, offset);
    return fbBuilder.offset;
  }
  int addReferToA2Offset(int offset) {
    fbBuilder.addOffset(1, offset);
    return fbBuilder.offset;
  }

  int finish() {
    return fbBuilder.endTable();
  }
}

class TableInCObjectBuilder extends fb.ObjectBuilder {
  final namespace_a.TableInFirstNSObjectBuilder _referToA1;
  final namespace_a.SecondTableInAObjectBuilder _referToA2;

  TableInCObjectBuilder({
    namespace_a.TableInFirstNSObjectBuilder referToA1,
    namespace_a.SecondTableInAObjectBuilder referToA2,
  })
      : _referToA1 = referToA1,
        _referToA2 = referToA2;

  /// Finish building, and store into the [fbBuilder].
  @override
  int finish(
    fb.Builder fbBuilder) {
    assert(fbBuilder != null);
    final int referToA1Offset = _referToA1?.getOrCreateOffset(fbBuilder);
    final int referToA2Offset = _referToA2?.getOrCreateOffset(fbBuilder);

    fbBuilder.startTable(


{% block object-tools %}{% endblock %}
            {{ content }}
          {% endblock %}
          {% block sidebar %}{% endblock %}

        {% block footer %}

{% endblock %}

<svg xmlns="http://www.w3.org/2000/svg" class="base-svgs">
  <symbol viewBox="0 0 24 24" width="1rem" height="1rem" id="icon-auto"><path d="M0 0h24v24H0z" fill="currentColor"/><path d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2V4a8 8 0 1 0 0 16z"/></symbol>
  <symbol viewBox="0 0 24 24" width="1rem" height="1rem" id="icon-moon"><path d="M0 0h24v24H0z" fill="currentColor"/><path d="M10 7a7 7 0 0 0 12 4.9v.1c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2h.1A6.979 6.979 0 0 0 10 7zm-6 5a8 8 0 0 0 15.062 3.762A9 9 0 0 1 8.238 4.938 7.999 7.999 0 0 0 4 12z"/></symbol>
  <symbol viewBox="0 0 24 24" width="1rem" height="1rem" id="icon-sun"><path d="M0 0h24v24H0z" fill="currentColor"/><path d="M12 18a6 6 0 1 1 0-12 6 6 0 0 1 0 12zm0-2a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM11 1h2v3h-2V1zm0 19h2v3h-2v-3zM3.515 4.929l1.414-1.414L7.05 5.636 5.636 7.05 3.515 4.93zM16.95 18.364l1.414-1.414 2.121 2.121-1.414 1.414-2.121-2.121zm2.121-14.85l1.414 1.415-2.121 2.121-1.414-1.414 2.121-2.121zM5.636 16.95l1.414 1.414-2.121 2.121-1.414-1.414 2.121-2.121zM23 11v2h-3v-2h3zM4 11v2H1v-2h3z"/></symbol>
</svg>

{% extends "layout/main.html" %}

{% block body %}

   ← Back to dashboard

    Edit Post

  <form class="edit-post-form">

      <input name="post-title" type="text" value="{{post.title}}" />
      ({{post.post_url|format_url}})

      {{post.vote_count}} {{post.vote_count|format_plural('point')}} by you on {{post.created_at.strftime('%B %d, %Y')}}
      |
      {{post.comments|length}} {{post.comments|length|format_plural('comment')}}

    <button type="submit">Save post</button>
    <button type="button" class="delete-post-btn">Delete post</button>
  </form>

<form class="comment-form">

    <textarea name="comment-body"></textarea>

    <button type="submit">add comment</button>

</form>

{% with comments=post.comments %}
  {% include "partials/comments.html" %}
{% endwith %}

{%


imes6SignedArea += (y(i) + y(i + 1)) * twoSA;
  }
  const sixSignedArea = 3 * twoTimesSignedArea;
  return [
    cxTimes6SignedArea / sixSignedArea,
    cyTimes6SignedArea / sixSignedArea,
  ];
};
import { AnyRecord } from '../types';
import { arrayDelete } from './';

type ListenersArray = Array<Function>;
type Listeners = AnyRecord<ListenersArray>;
export default class Dispatcher {
    protected readonly _listeners: Listeners = {};

    $subscribe(eventName: string, func: Function) {
        if (!this._listeners[eventName]) {
            this._listeners[eventName] = [];
        }

        this._listeners[eventName].push(func);
    }

    $unsubscribe(eventName: string, func: Function) {
        if (this._listeners[eventName]) {
            arrayDelete(this._listeners[eventName], func);
        }
    }

    $dispatch(eventName: string, ...args: Array<any>) {
        if (this._listeners[eventName]) {
            this._listeners[eventName].forEach(listener => {
                listener.apply(this, [...args]);
            });
        }
    }
}import {
  CompositeDetails,
  CompositeProperty,
  Declaration,
  InstantiatedConfig,
  InterfacePropertyDeclaration,
  TypeImport,
} from 'kanel';

import MakeKyselyConfig from './MakeKyselyConfig';

/**
 * This is a quirky way to get Kysely interfaces. Basically, what happens is that this
 * hook will filter out initializer and mutators. It takes the selector and transforms
 * it into the Kysely *Table interface, by going over each property. In the end,
 * it adds the New* and *Update types as per the Kysely documentation.
 *
 * This only works when the output from Kanel is close to the default configuration,
 * if you've changed things around too much it will probably not work.
 */
const processFile = (
  declarations: Declaration[],
  compositeDetails: CompositeDetails,
  instantiatedConfig: InstantiatedConfig,
  path: string,
  makeKyselyConfig: MakeKyselyConfig,
): {
  modifiedDeclarations: Declaration[];
  tableImport: TypeImport;
  tableProperty: InterfacePropertyDeclaration;
} => {
  const { name: selectorName } = instantiatedConfig.getMetadata(
    compositeDetails,
    'selector',
    instantiatedConfig,
  );
  const { name: initializerName } = instantiatedConfig.getMetadata(
    compositeDetails,
    'initializer',
    instantiatedConfig,
  );
  const { name: mutatorName } = instantiatedConfig.getMetadata(
    compositeDetails,
    'mutator',
    instantiatedConfig,
  );

  let canInitialize = true;
  let canMutate = true;

  if (compositeDetails.kind !== 'table') {
    canInitialize = false;
    canMutate = false;
  }

  const { tableInterfaceName, selectableName, insertableName, updatableName } =
    makeKyselyConfig.getKyselyItemMetadata(
      compositeDetails,
      selectorName,
      canInitialize,
      canMutate,
      instantiatedConfig,
    );

  const modifiedDeclarations = declarations.map((declaration) => {
    if (declaration.declarationType === 'interface') {
      if (declaration.name === selectorName) {
        const name = tableInterfaceName;
        const typeImports = [...(declaration.typeImports || [])];

        type


0338 80A57538 8FAF0018 */  lw      $t7, 0x0018($sp)
/* 0033C 80A5753C 3C0E80A5 */  lui     $t6, %hi(func_80A57CA8)    ## $t6 = 80A50000
/* 00340 80A57540 25CE7CA8 */  addiu   $t6, $t6, %lo(func_80A57CA8) ## $t6 = 80A57CA8
/* 00344 80A57544 ADEE0190 */  sw      $t6, 0x0190($t7)           ## 00000190
/* 00348 80A57548 8FBF0014 */  lw      $ra, 0x0014($sp)
/* 0034C 80A5754C 27BD0018 */  addiu   $sp, $sp, 0x0018           ## $sp = 00000000
/* 00350 80A57550 03E00008 */  jr      $ra
/* 00354 80A57554 00000000 */  nop


>

   革命无罪，造反有理!

   革命造反精神万岁!

   无产阶级专政万岁!

   伟大的中国共产党万岁！

   我们最最敬爱的领袖毛主席万岁！万岁！！万万岁！！！

   市印三厂《红太阳》革命造反纵队筹委会一九六六年十一月二十九日

   〔附件二〕

   《红太阳》革命造反纵队向市印三厂工作队，党总支提出五项要求：

   一、承认《红太阳》革命造反纵队是一个革命的合法的组织。

   二、政治上有出版，言论，集会，广播等自由权利。

   三、宣传用品，革命串联经费一律由行政支付。

   四、要有一个办公地点，要有一只电话。

   五、对任何一个《红太阳》革命造反纵队队员不准有任何打击报复和政治陷害。

   致

    崇高革命敬礼!

   此文一式三份

   主送：

   市印三厂工作队  刘毅山(签字)市印三厂临时总支  顾健群(签字)《红太阳》革命造反纵队  火桂泉(签字)一九六六年十一月廿九日

   12月1日：下午四点半，队部召开《向工作队提意见大会》，会上《红太阳》革命造反纵队提问要求工作队队委回答，打破了照发言稿读的惯例，引起分歧，后来又有老保×××插话，顿时使会场大乱，无法继续开下去，大会主席宣布休会。

   同日：赤卫队《总部》在黑市委


        // cycle weight + new edge - removal of old
        double scr = cyc_weight + scoreMatrix[i][j1] - scoreMatrix[par[j1]][j1];
        if (scr > max2) {
          max2 = scr;
          wh2 = j1;// oldO[i][j1];
        }
      }

      scoreMatrix[rep][i] = max1;
      oldI[rep][i] = oldI[wh1][i];// wh1;
      oldO[rep][i] = oldO[wh1][i];// oldO[wh1][i];
      scoreMatrix[i][rep] = max2;
      oldO[i][rep] = oldO[i][wh2];// wh2;
      oldI[i][rep] = oldI[i][wh2];// oldI[i][wh2];

    }

    TIntIntHashMap[] rep_cons = new TIntIntHashMap[cyc_nodes.length];
    for (int i = 0; i < cyc_nodes.length; i++) {
      rep_cons[i] = new TIntIntHashMap();
      int[] keys = reps[cyc_nodes[i]].keys();
      Arrays.sort(keys);
      if (print)
        System.out.print(cyc_nodes[i] + ": ");
      for (int j = 0; j < keys.length; j++) {
        rep_cons[i].put(keys[j], 0);
        if (print)
          System.out.print(keys[j] + " ");
      }
      if (print)
        System.out.println();
    }

    // don't consider not representative nodes
    // these nodes have been folded
    for (int i = 1; i < cyc_nodes.length; i++) {
      curr_nodes[cyc_nodes[i]] = false;
      int[] keys = reps[cyc_nodes[i]].keys();
      for (int j = 0; j < keys.length; j++)
        reps[rep].put(keys[j], 0);
    }

    chuLiuEdmonds(scoreMatrix, curr_nodes, oldI, oldO, print, final_edges, reps);

    // check each node in cycle, if one of its representatives
    // is a key in the final_edges, it is the one.
    int wh = -1;
    boolean found = false;
    for (int i = 0; i < rep_cons.length && !found; i++) {
      int[] keys = rep_cons[i].keys();
      for (int j = 0; j < keys.length && !found; j++) {
        if (final_edges.contains(keys[j])) {
          wh = cyc_nodes[i];
          found = true;
        }
      }
    }

    int l = par[wh];
    while (l != wh) {
      int ch = oldO[par[l]][l];
      int pr = oldI[par[l]][l];
      final_edges.put(ch, pr);
      l = par[l];
    }

    if (print) {
      int[] keys = final_edges.keys();
      Arrays.sort(keys);
      for (int i = 0; i < keys.length; i++)
        System.out.print(final_edges.get(keys[i]) + "|" + keys[i] + " ");
      System.out.println();
    }

    return final_edges;

  }

}
/*
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.  Sun designates this
 * particular file as subject to the "Classpath" exception as provided
 * by Sun in the LICENSE file that accompanied this code.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 * CA 95054 USA or visit www.sun.com if you need additional information or
 * have any questions.
 */

/*
 * This file is availab


< 2) - 4], &c__4)) {
	    setmsg_("The quaternion at index # has magnitude zero.", (ftnlen)
		    45);
	    errint_("#", &i__, (ftnlen)1);
	    sigerr_("SPICE(ZEROQUATERNION)", (ftnlen)21);
	    chkout_("CKW02", (ftnlen)5);
	    return 0;
	}
    }

/*     No more checks, begin writing the segment. */

    dafbna_(handle, descr, segid, segid_len);
    if (failed_()) {
	chkout_("CKW02", (ftnlen)5);
	return 0;
    }

/*     Now add the quaternions, angular velocity vectors, and time */
/*     conversion factors for each interval. */

    i__1 = *nrec;
    for (i__ = 1; i__ <= i__1; ++i__) {
	dafada_(&quats[(i__ << 2) - 4], &c__4);
	dafada_(&avvs[i__ * 3 - 3], &c__3);
	dafada_(&rates[i__ - 1], &c__1);
    }

/*     The SCLK start times. */

    dafada_(start, nrec);

/*     The SCLK stop times. */

    dafada_(stop, nrec);

/*     The time tag directory.  The Ith element is defined to be the */
/*     average of the (I*100)th STOP time and the (I*100+1)th START time. */

    ndir = (*nrec - 1) / 100;
    index = 100;
    i__1 = ndir;
    for (i__ = 1; i__ <= i__1; ++i__) {
	dirent = (stop[index - 1] + start[index]) / 2.;
	dafada_(&dirent, &c__1);
	index += 100;
    }

/*     End the segment. */

    dafena_();
    chkout_("CKW02", (ftnlen)5);
    return 0;
} /* ckw02_ */


nect_retry_ct_ > 0 || reason == ConnectReason::WAS_SHOWN;

  // If the channel is working we should get a call to FrameAttachedAck().
  // Otherwise, OnDisconnect() should be called to retry the
  // connection.
  browser_frame->FrameAttached(receiver_.BindNewPipeAndPassRemote(),
                               reattached);
  receiver_.set_disconnect_with_reason_and_result_handler(
      base::BindOnce(&CefFrameImpl::OnRenderFrameDisconnect, this));
}

const mojo::Remote<cef::mojom::BrowserFrame>& CefFrameImpl::GetBrowserFrame(
    bool expect_acked) {
  DCHECK_EQ(expect_acked,
            browser_connection_state_ == ConnectionState::CONNECTION_ACKED);

  if (!browser_frame_.is_bound()) {
    auto render_frame = content::RenderFrameImpl::FromWebFrame(frame_);
    if (render_frame) {
      // Triggers creation of a CefBrowserFrame in the browser process.
      render_frame->GetBrowserInterfaceBroker().GetInterface(
          browser_frame_.BindNewPipeAndPassReceiver());
      browser_frame_.set_disconnect_with_reason_and_result_handler(
          base::BindOnce(&CefFrameImpl::OnBrowserFrameDisconnect, this));
    }
  }
  return browser_frame_;
}

void CefFrameImpl::OnBrowserFrameDisconnect(uint32_t custom_reason,
                                            const std::string& description,
                                            MojoResult error_result) {
  OnDisconnect(DisconnectReason::BROWSER_FRAME_DISCONNECT, custom_reason,
               description, error_result);
}

void CefFrameImpl::OnRenderFrameDisconnect(uint32_t custom_reason,
                                           const std::string& description,
                                           MojoResult error_result) {
  OnDisconnect(DisconnectReason::RENDER_FRAME_DISCONNECT, custom_reason,
               description, error_result);
}

// static
std::string CefFrameImpl::GetDisconnectDebugString(
    ConnectionState connection_state,
    bool frame_is_valid,
    bool frame_is_main,
    DisconnectReason reason,
    uint32_t custom_reason,
    const std::string& description,
    MojoResult error_result) {
  std::string reason_str;
  switch (reason) {
    case DisconnectReason::DETACHED:
      reason_str = "DETACHED";
      break;
    case DisconnectReason::RENDER_FRAME_DISCONNECT:
      reason_str = "RENDER_FRAME_DISCONNECT";
      break;
    case DisconnectReason::BROWSER_FRAME_DISCONNECT:
      reason_str = "BROWSER_FRAME_DISCONNECT";
      break;
  };

  std::string state_str;
  switch (connection_state) {
    case ConnectionState::DISCONNECTED:
      state_str = "DISCONNECTED";
      break;
    case ConnectionState::CONNECTION_PENDING:
      state_str = "CONNECTION_PENDING";
      break;
    case ConnectionState::CONNECTION_ACKED:
      state_str = "CONNECTION_ACKED";
      break;
    case ConnectionState::RECONNECT_PENDING:
      state_str = "RECONNECT_PENDING";
      break;
  }

  if (!frame_is_valid) {
    state_str += ", FRAME_INVALID";
  } else if (frame_is_main) {
    state_str += ", MAIN_FRAME";
  } else {
    state_str += ", SUB_FRAME";
  }

  if (custom_reason !=
      static_cast<uint32_t>(frame_util::ResetReason::kNoReason)) {
    state_str += ", custom_reason=" + base::NumberToString(custom_reason);
  }

  if (!description.empty()) {
    state_str += ", description=" + description;
  }

  if (error_result != MOJO_RESULT_OK) {


org/en-US/docs/Web/API/WindowClient/visibilityState)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `VisibilityState`, `WindowClient`*"]
    pub fn visibility_state(this: &WindowClient) -> VisibilityState;
    # [ wasm_bindgen ( structural , method , getter , js_class = "WindowClient" , js_name = focused ) ]
    #[doc = "Getter for the `focused` field of this object."]
    #[doc = ""]
    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WindowClient/focused)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `WindowClient`*"]
    pub fn focused(this: &WindowClient) -> bool;
    # [ wasm_bindgen ( catch , method , structural , js_class = "WindowClient" , js_name = focus ) ]
    #[doc = "The `focus()` method."]
    #[doc = ""]
    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WindowClient/focus)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `WindowClient`*"]
    pub fn focus(this: &WindowClient) -> Result<::js_sys::Promise, JsValue>;
    # [ wasm_bindgen ( catch , method , structural , js_class = "WindowClient" , js_name = navigate ) ]
    #[doc = "The `navigate()` method."]
    #[doc = ""]
    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WindowClient/navigate)"]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `WindowClient`*"]
    pub fn navigate(this: &WindowClient, url: &str) -> Result<::js_sys::Promise, JsValue>;
}
<gh_stars>10-100
use crate::intercom::{self, ReplyFuture};
use network_core::error as core_error;
use network_core::server::request_stream::{MapResponse, ProcessingError};

use slog::Logger;

fn log_stream_termination(logger: &Logger, res: &Result<(), ProcessingError>) {
    match res {
        Ok(()) => {
            debug!(logger, "request stream closed by the peer");
        }
        Err(e) => {
            debug!(
                logger,
                "request stream failed";
                "error" => ?e,
            );
        }
    }
}

// Hack: impl for a type from another module
impl<T, R> MapResponse for intercom::RequestSink<T, R, core_error::Error>
where
    R: Send + 'static,
{
    type Response = R;
    type ResponseFuture = ReplyFuture<R, core_error::Error>;

    fn on_stream_termination(&mut self, res: Result<(), ProcessingError>) -> Self::ResponseFuture {
        log_stream_termination(self.logger(), &res);
        self.take_reply_future()
    }
}
<gh_stars>1-10
// This file is part of Substrate.

// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the


able.
 *       Use av_packet_make_writable instead for that purpose.
 *
 * @see av_packet_ref
 * @see av_packet_make_writable
 *
 * @param pkt packet whose data should be made reference counted.
 *
 * @return 0 on success, a negative AVERROR on error. On failure, the
 *         packet is unchanged.
 */
int av_packet_make_refcounted(AVPacket *pkt);

/**
 * Create a writable reference for the data described by a given packet,
 * avoiding data copy if possible.
 *
 * @param pkt Packet whose data should be made writable.
 *
 * @return 0 on success, a negative AVERROR on failure. On failure, the
 *         packet is unchanged.
 */
int av_packet_make_writable(AVPacket *pkt);

/**
 * Convert valid timing fields (timestamps / durations) in a packet from one
 * timebase to another. Timestamps with unknown values (AV_NOPTS_VALUE) will be
 * ignored.
 *
 * @param pkt packet on which the conversion will be performed
 * @param tb_src source timebase, in which the timing fields in pkt are
 *               expressed
 * @param tb_dst destination timebase, to which the timing fields will be
 *               converted
 */
void av_packet_rescale_ts(AVPacket *pkt, AVRational tb_src, AVRational tb_dst);

/**
 * @}
 */

#endif // AVCODEC_PACKET_H


()
   {
      this.getItems("completed").map((item)=>
      {
         delete this._data.items[item.id];
      });

      this.update();
   }

   private _toggleItem(id)
   {
      this._data.items[id].done = !this._data.items[id].done;
      this.update();
   }

   private _toggleAll()
   {
      var filter = this.isDone ? 'completed' : 'active';
      this.getItems(filter).forEach((item)=>
      {
         this._data.items[item.id].done = !this._data.items[item.id].done;
      });
      this.update();
   }

   // =============== business logic utils ===============

   public getItems(filter)
   {
      return Object.keys(this._data.items).filter((id)=> {
         return this.matchFilter(this._data.items[id], filter);
      }).map((id)=> {
         return this._data.items[id];
      });
   }

   private matchFilter(item, filter) {
      return !filter ||
         filter.toString() === item.id.toString() ||
         filter === (item.done ? 'completed' : 'active');
   }

   private generateId()
   {
      var keys = Object.keys(this._data.items), i = keys.length;
      return (i ? this._data.items[keys[i - 1]].id + 1 : i + 1);
   }

   get isDone()
   {
      return this.getItems('active').length == 0;
   }
}
/*
    装饰器:装饰器是一种特殊类型的声明，它能够被附加到类声明，方法，属性或参数上，可以修改类的行为。

    通俗的讲装饰器就是一个方法，可以注入到类、方法、属性参数上来扩展类、属性、方法、参数的功能。

    常见的装饰器有：类装饰器、属性装饰器、方法装饰器、参数装饰器

    装饰器的写法：普通装饰器（无法传参） 、 装饰器工厂（可传参）

    装饰器是过去几年中js最大的成就之一，已是Es7的标准特性之一

*/

//1、类装饰器：类装饰器在类声明之前被声明（紧靠着类声明）。 类装饰器应用于类构造函数，可以用来监视，修改或替换类定义。 传入一个参数

//1.1 类装饰器:普通装饰器（无法传参）
    /*
        function logClass(params:any){

            console.log(params);
            // params 就是当前类
            params.prototype.apiUrl='动态扩展的属性';
            params.prototype.run=function(){
                console.log('我是一个run方法');
            }

        }

        @logClass
        class HttpClient{
            constructor(){
            }
            getData(){

            }
        }
        var http:any=new HttpClient();
        console.log(http.apiUrl);
        http.run();
    */

//1.2 类装饰器:装饰器工厂（可传参）

       /*
        function logClass(params:string){
            return function(target:any){
                console.log(target);
                console.log(params);
                target.prototype.apiUrl=params;
            }
        }

        @logClass('http://www.itying.com/api')
        class HttpClient{
            constructor(){
            }

            getData(){

            }
        }

        var http:any=new HttpClient();
        console.log(http.apiUrl);

       */

/*

1、类装饰器

     下面是一个重载构造函数的例子。

     类装饰器表达式会在运行时当作函数被调用，类的构造函数作为其唯一的参数。

     如果类装饰器返回一个值，它会使用提供的构�


ing the '
        'replica, you should verify that the replica has applied all '
        'transactions received from the primary.') + '\n\n')
    if promote_replica_docs_link:
      sys.stderr.write(promote_replica_docs_link)

    console_io.PromptContinue(message='', default=True, cancel_on_no=True)

    result = sql_client.instances.PromoteReplica(
        sql_messages.SqlInstancesPromoteReplicaRequest(
            project=instance_ref.project, instance=instance_ref.instance,
            failover=args.failover))
    operation_ref = client.resource_parser.Create(
        'sql.operations', operation=result.name, project=instance_ref.project)

    if args.async_:
      return sql_client.operations.Get(
          sql_messages.SqlOperationsGetRequest(
              project=operation_ref.project, operation=operation_ref.operation))

    operations.OperationsV1Beta4.WaitForOperation(sql_client, operation_ref,
                                                  'Promoting Cloud SQL replica')

    log.status.write('Promoted [{instance}].\n'.format(instance=instance_ref))


}
	}
	return nil, multierr.Combine(evErr, quoteErr, internetErr)
}
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package rotate

import (
	"context"
	"crypto/x509"
	"errors"
	"fmt"
	"math/big"
	"time"

	"github.com/google/gce-tcb-verifier/keys"
	sops "github.com/google/gce-tcb-verifier/sign/ops"
	styp "github.com/google/gce-tcb-verifier/sign/types"
)

var (
	// ErrNoSigningKeySerial is returned during certificate template construction when the signing
	// key serial number is undetermined.
	ErrNoSigningKeySerial = errors.New("could not determine signing key serial number")
)

// InternalSignAndUploadRequest is exported for internal testing.
type InternalSignAndUploadRequest struct {
	Mutation              styp.CertificateAuthorityMutation
	Issuer                *x509.Certificate
	SubjectKeyVersionName string
	IssuerKeyVersionName  string
}

func signCert(ctx context.Context, req *InternalSignAndUploadRequest) (*x509.Certificate, error) {
	c, err := keys.FromContext(ctx)
	if err != nil {
		return nil, err
	}
	subjectPubKey, err := sops.RsaPublicKey(ctx, c.Signer, req.SubjectKeyVersionName)
	if err != nil {
		return nil, fmt.Errorf("could not get public key for key version %q: %v", req.SubjectKeyVersionName, err)
	}
	template, err := c.Manager.CertificateTemplate(ctx, req.Issuer, subjectPubKey)
	if err != nil {
		return nil, err
	}

	cert, err := sops.CreateCertificateFromTemplate(ctx, &sops.CertRequest{
		Issuer:               req.Issuer,
		Template:             template,
		IssuerKeyVersionName: req.IssuerKeyVersionName,
		Signer:               c.Signer,
		Random:               c.Random,
	})
	if err != nil {
		return nil, fmt.Errorf("could not create certificate for key version %q: %v", req.SubjectKeyVersionName, err)
	}

	req.Mutation.AddSigningKeyCert(req.SubjectKeyVersionName, cert)
	return cert, nil
}

// InternalSignAndUpload should only be used internally for testing implementations.
func InternalSignAndUpload(ctx context.Context, req *InternalSignAndUploadRequest) (*x509.Certificate, error) {
	cert, err := signCert(ctx, req)
	if err != nil {
		return nil, err
	}
	if req.Issuer == nil {
		req.Mutation.SetRootKeyCert(cert)
	} else {
		req.Mutation.AddSigningKeyCert(req.SubjectKeyVersionName, cert)
	}
	return cert, nil
}

// GoogleCertificateTemplate returns a certificate template with metadata indicating a Google
// source, specifically the Confidential Computing engineering team in Kirkland, WA, USA.
func GoogleCertificateTemplate(ctx context.Context, issuer *x509.Certificate, subjectPubKey any) (*x509.Certificate, error) {
	bc, err := FromBootstrapContex


# This file is part of Indico.
# Copyright (C) 2002 - 2025 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.

# ruff: noqa: E501

import pytest
from markdown import Markdown

from indico.util.mdx_latex import LaTeXExtension, latex_escape

def test_escape():
    assert latex_escape(r'\naughty') == r'\textbackslash{}naughty'
    assert (latex_escape(r'this\\is\\harmless') ==
            r'this\textbackslash{}\textbackslash{}is\textbackslash{}\textbackslash{}harmless')
    assert latex_escape(r'\\\extranaughty') == r'\textbackslash{}\textbackslash{}\textbackslash{}extranaughty'

def test_escape_math():
    assert latex_escape(r'$\naughty$') == r'\protect $\\naughty$'
    assert latex_escape(r'$\\naughty$') == r'\protect $\\naughty$'
    assert latex_escape(r'$harm\\less$') == r'\protect $harm\\less$'
    assert latex_escape(r'$\\\extranaughty$') == r'\protect $\\\\extranaughty$'

@pytest.mark.parametrize(('input', 'expected'), (
    ('\nplain text\n', 'plain text'),
    ('plain text with reserved characters &^{}', r'plain text with reserved characters \&\^{}\{\}'),
    ('**bold text**', r'\textbf{bold text}'),
    ('**bold with &reserved{} characters**', r'\textbf{bold with \&reserved\{\} characters}'),
    ('*italic text*', r'\emph{italic text}'),
    ('*italic text with reserved chars &{}*', r'\emph{italic text with reserved chars \&\{\}}'),
    ('[link with reserved chars&{}](http://indico.github.io)', r'\href{http://indico.github.io}{link with reserved chars\&\{\}}'),
    ('> Plain Blockquote', '\\begin{quotation}\nPlain Blockquote\n\\end{quotation}'),
    ('> Blockquote with reserved chars &{}', '\\begin{quotation}\nBlockquote with reserved chars \\&\\{\\}\n\\end{quotation}'),
    ('\tPlain code sample', '\\begin{verbatim}\nPlain code sample\n\\end{verbatim}'),
    ('\tCode sample with reserved chars &{}', '\\begin{verbatim}\nCode sample with reserved chars \\&\\{\\}\n\\end{verbatim}'),
    ('## Plain Heading ##', r'\subsection{Plain Heading}'),
    ('## Heading with reserved chars &{} ##', r'\subsection{Heading with reserved chars \&\{\}}'),
))
def test_convert_markdown_to_latex(input, expected):
    md = Markdown(safe_mode='remove')
    _latex_md = LaTeXExtension(configs={'apply_br': True})
    _latex_md.extendMarkdown(md, md.__dict__)
    assert md.convert(input) == expected


}
                else if (listCategory == ListCategory.Emulator)
                {
                    targetListbox = listView_Emulators;
                    targetTextblock = textblock_Category_Menu_Emulators;
                }
                else if (listCategory == ListCategory.Launcher)
                {
                    targetListbox = listView_Launchers;
                    targetTextblock = textblock_Category_Menu_Launchers;
                }
                else if (listCategory == ListCategory.Shortcut)
                {
                    targetListbox = listView_Shortcuts;
                    targetTextblock = textblock_Category_Menu_Shortcuts;
                }
                else if (listCategory == ListCategory.Process)
                {
                    targetListbox = listView_Processes;
                    targetTextblock = textblock_Category_Menu_Processes;
                }
                else if (listCategory == ListCategory.Gallery)
                {
                    targetListbox = listView_Gallery;
                    targetTextblock = textblock_Category_Menu_Gallery;
                }
                else if (listCategory == ListCategory.Search)
                {
                    targetListbox = listView_Search;
                    targetTextblock = textblock_Category_Menu_Search;
                }

                //Show target listbox
                listView_Apps.Visibility = Visibility.Collapsed;
                listView_Games.Visibility = Visibility.Collapsed;
                listView_Emulators.Visibility = Visibility.Collapsed;
                listView_Launchers.Visibility = Visibility.Collapsed;
                listView_Shortcuts.Visibility = Visibility.Collapsed;
                listView_Processes.Visibility = Visibility.Collapsed;
                listView_Gallery.Visibility = Visibility.Collapsed;
                listView_Search.Visibility = Visibility.Collapsed;
                targetListbox.Visibility = Visibility.Visible;

                //Update button foreground
                textblock_Category_Menu_Apps.Style = (Style)Application.Current.Resources["TextBlockGrayLight"];
                textblock_Category_Menu_Games.Style = (Style)Application.Current.Resources["TextBlockGrayLight"];
                textblock_Category_Menu_Emul


import reflex as rx
from RandIA.components.create_centered_heading_01 import create_centered_heading
from RandIA.components.create_feature_box_01 import create_feature_box

def create_services_section():
    """Create the services section with feature boxes."""
    return rx.box(
        create_centered_heading(
            heading_text="Your AI Marketplace",
            color="#white"
        ),
        rx.box(
            create_feature_box(
                icon_alt="Data Visualization",
                icon_tag="bar-chart-2",
                heading_text="Save time",
                #Ahorra tiempo
                description_text="Our marketplace allows you to find the AI products you need in one place, without having to search on different platforms.",
                #Nuestro marketplace te permite encontrar los productos de inteligencia artificial que necesitas en un solo lugar, sin tener que buscar en distintas plataformas.
            ),
            create_feature_box(
                icon_alt="Predictive Analytics",
                icon_tag="trending-up",
                heading_text="Find what you're looking for",
                #Encuentra lo que buscas
                description_text="Find high-quality artificial intelligence products with endless solutions, innovation, and AI technology.",
                #Encuentra productos de inteligencia artificial de alta calidad, con soluciones infinitas, innovación y tecnología de inteligencia artificial.
            ),
            create_feature_box(
                icon_alt="Data Integration",
                icon_tag="layers",
                heading_text="Experiment with the latest AI technology",
                description_text="Use state-of-the-art artificial intelligence solutions to improve your company's efficiency and productivity.",
                # Usa soluciones de inteligencia artificial de última generación para mejorar la eficiencia y la productividad de tu empresa.
            ),
            gap="2rem",
            display="grid",
            grid_template_columns=rx.breakpoints(
                {
                    "0px": "repeat(1, minmax(0, 1fr))",
                    "768px": "repeat(3, minmax(0, 1fr))",
                }
            ),
        ),
        width="100%",
        style=rx.breakpoints(
            {
                "640px": {"max-width": "640px"},
                "768px": {"max-width": "768px"},
                "1024px": {"max-width": "1024px"},
                "1280px": {"max-width": "1280px"},
                "1536px": {"max-width": "1536px"},
            }
        ),
        margin_left="auto",
        margin_right="auto",
        padding_left="1.5rem",
        padding_right="1.5rem",
    )


ma_visitor_overrideVisitUnknownType() {
    expect(unknownType.accept(
        new _TypeSchemaVisitor<String>(visitUnknownType: (UnknownType node) {
      expect(node, same(unknownType));
      return 'visitUnknownType';
    })), 'visitUnknownType');
  }

  void test_typeSchemaToString() {
    expect(unknownType.toString(), isNot('?'));
    expect(typeSchemaToString(unknownType), '?');
    expect(
        typeSchemaToString(new FunctionType(
            [unknownType, unknownType], unknownType, Nullability.legacy)),
        '(?, ?) →* ?');
  }

  void test_visitChildren() {
    unknownType
        .visitChildren(new _TypeSchemaVisitor(defaultDartType: (DartType node) {
      fail('Should not have visited anything');
    }));
  }
}

class _OrdinaryVisitor<R> extends Visitor<R?> with VisitorNullMixin<R> {
  final _UnaryFunction<DartType, R>? _defaultDartType;

  _OrdinaryVisitor({_UnaryFunction<DartType, R>? defaultDartType})
      : _defaultDartType = defaultDartType;

  @override
  R? defaultDartType(DartType node) {
    if (_defaultDartType != null) {
      return _defaultDartType!(node);
    } else {
      return super.defaultDartType(node);
    }
  }
}

class _TypeSchemaVisitor<R> extends Visitor<R?> with VisitorNullMixin<R> {
  final _UnaryFunction<DartType, R>? _defaultDartType;
  final _UnaryFunction<UnknownType, R>? _visitUnknownType;

  _TypeSchemaVisitor(
      {_UnaryFunction<DartType, R>? defaultDartType,
      _UnaryFunction<UnknownType, R>? visitUnknownType})
      : _defaultDartType = defaultDartType,
        _visitUnknownType = visitUnknownType;

  @override
  R? defaultDartType(DartType node) {
    if (node is UnknownType && _visitUnknownType != null) {
      return _visitUnknownType!(node);
    } else if (_defaultDartType != null) {
      return _defaultDartType!(node);
    } else {
      return super.defaultDartType(node);
    }
  }
}
// Copyright (c) 2019, the Dart 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 "legacy_upper_bound_helper.dart" show LegacyUpperBoundTest;

import "package:kernel/ast.dart" show DartType, InterfaceType;

import "package:kernel/class_hierarchy.dart" show ClassHierarchy;

class KernelLegacyUpperBoundTest extends LegacyUpperBoundTest {
  late ClassHierarchy hierarchy;

  @override
  bool get isNonNullableByDefault => true;

  @override
  Future<void> parseComponent(String source) async {
    await super.parseComponent(source);
    hierarchy = new ClassHierarchy(env.component, env.coreTypes);
  }

  @override
  DartType getLegacyLeastUpperBound(DartType a, DartType b,
      {required bool isNonNullableByDefault}) {
    return hierarchy.getLegacyLeastUpperBound(
        a as InterfaceType, b as InterfaceType,
        isNonNullableByDefault: isNonNullableByDefault);
  }
}

void main() {
  new KernelLegacyUpperBoundTest().test();
}
// Copyright (c) 2019, the Dart 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 "package:async_helper/async_helper.dart" show asyncTest;

import "package:kernel/ast.dart" show Component, DartType


"""
Optimisation example using scipy.optimize.minimize.

Extended to ad.

This code accompanies the blog post
  https://www.pyxll.com/blog/extending-the-excel-user-interface/
"""
import sys

from functools import partial
from pyxll import xl_app, xl_menu
from win32com.client import constants
import numpy as np
from scipy.optimize import minimize
from PyQt5.QtWidgets import QApplication, QMessageBox

def get_qt_app():
    """Returns a QApplication instance.

    MUST be called before showing any dialogs.
    """
    app = QApplication.instance()
    if app is None:
        app = QApplication([sys.executable])
    return app

@xl_menu("Optimize")
def optimize4():
    """
    Trigger optimization of a spreadsheet model that
    takes the named range "Inputs" as inputs and
    produces output in the named range "Output".
    """
    qt_app = get_qt_app()  # pragma noqc
    xl = xl_app()
    # Get the initial values of the input cells
    in_values = list(xl.Range("Inputs").Value)
    X = np.array([x[0] for x in in_values])

    orig_calc_mode = xl.Calculation
    try:
        # switch Excel to manual calculation
        # and disable screen updating
        xl.Calculation = constants.xlManual
        xl.ScreenUpdating = False

        # run the minimization routine
        xl_obj_func = partial(obj_func, xl)
        result = minimize(xl_obj_func, X, method="nelder-mead")
        xl.ScreenUpdating = True
        mbox = QMessageBox()
        mbox.setIcon(QMessageBox.Information)
        mbox.setText("Optimization results shown below." "\nMake changes permanent?")
        mbox.setWindowTitle("Optimization Complete")
        mbox.setInformativeText(
            "\n".join(
                [
                    "Successful:       %s" % result.success,
                    result.message,
                    "After %d iterations" % result.nit,
                ]
            )
        )
        mbox.setStandardButtons(QMessageBox.Ok | QMessageBox.Cancel)
        yes_no = mbox.exec_()
        if yes_no != QMessageBox.Ok:
            xl.Range("Inputs").Value = in_values
        else:
            xl.Range("Inputs").Value = [(float(x),) for x in result.x]

    finally:
        # restore the original calculation
        # and screen updating mode
        xl.Calculation = orig_calc_mode

def obj_func(xl, arg):
    """Wraps a spreadsheet computation as a Python function."""
    # Copy argument values to input range
    xl.Range("Inputs").Value = [(float(x),) for x in arg]

    # Calculate after changing the inputs
    xl.Calculate()

    # Return the value of the output cell
    result = xl.Range("Output").Value
    return result


}

    .top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
        text-decoration: underline;
    }

    .top-row ::deep a:first-child {
        overflow: hidden;
        text-overflow: ellipsis;
    }

@media (max-width: 640.98px) {
    .top-row {
        justify-content: space-between;
    }

    .top-row ::deep a, .top-row ::deep .btn-link {
        margin-left: 0;
    }
}

@media (min-width: 641px) {
    .page {
        flex-direction: row;
    }

    .sidebar {
        width: 250px;
        height: 100vh;
        position: sticky;
        top: 0;
    }

    .top-row {
        position: sticky;
        top: 0;
        z-index: 1;
    }

    .top-row.auth ::deep a:first-child {
        flex: 1;
        text-align: right;
        width: 0;
    }

    .top-row, article {
        padding-left: 2rem !important;
        padding-right: 1.5rem !important;
    }
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }
h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e51410;
}

.validation-message {
    color: #e51410;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRy


--[[
Copyright (C) 2020, 2021 penguin0616

This file is part of Insight.

The source code of this program is shared under the RECEX
SHARED SOURCE LICENSE (version 1.0).
The source code is shared for referrence and academic purposes
with the hope that people can read and learn from it. This is not
Free and Open Source software, and code is not redistributable
without permission of the author. Read the RECEX SHARED
SOURCE LICENSE for details
The source codes does not come with any warranty including
the implied warranty of merchandise.
You should have received a copy of the RECEX SHARED SOURCE
LICENSE in the form of a LICENSE file in the root of the source
directory. If not, please refer to
<https://raw.githubusercontent.com/Recex/Licenses/master/SharedSourceLicense/LICENSE.txt>
]]

-- carnivaldecor_figure_kit.lua [Prefab]

local rarity_colors = {
	rare = Insight.COLORS.DECORATION,
	uncommon = "#bb88ff",
	common = "#ffcccc",
	unknown = "#ffffff",
}

-- Obtained from prefabs/carnivaldecor_figure.lua on June 11, 2021, game version 467172
local rarity_decor_vale_map = {
	rare     = 20,
	uncommon = 16,
	common   = 12,
	unknown  = "?",
}

local shape_rarity_season1 = setmetatable({
	s1 = "rare",
	s2 = "uncommon",
	s3 = "uncommon",
	s4 = "common",
	s5 = "common",
	s6 = "common",
	s7 = "uncommon",
	s8 = "common",
	s9 = "common",
	s10 = "common",
	s11 = "common",
	s12 = "common",
}, {
	__index = function(self, index)
		rawset(self, index, "unknown")
		return "unknown"
	end
})

local shape_rarity_season2 = setmetatable({
	s1 = "common",
	s2 = "common",
	s3 = "uncommon",
	s4 = "uncommon",
	s5 = "common",
	s6 = "common",
	s7 = "common",
	s8 = "uncommon",
	s9 = "common",
	s10


790.8 576H612.4c0 19.4 6.7 38 16.8 48 10.2 9.9 24.8 14.9 43.9 14.9 13.8 0 25.5-3.5 35.5-10.4 9.9-6.9 15.9-14.2 18.1-21.8h59.8c-9.6 29.7-24.2 50.9-44 63.7-19.6 12.8-43.6 19.2-71.5 19.2-19.5 0-37-3.2-52.7-9.3-15.1-5.9-28.7-14.9-39.9-26.5a121.2 121.2 0 0 1-25.1-41.2c-6.1-16.9-9.1-34.7-8.9-52.6 0-18.5 3.1-35.7 9.1-51.7 11.5-31.1 35.4-56 65.9-68.9 16.3-6.8 33.8-10.2 51.5-10 21 0 39.2 4 55 12.2a111.6 111.6 0 0 1 38.6 32.8c10.1 13.7 17.2 29.3 21.7 46.9 4.3 17.3 5.8 35.5 4.6 54.7zm-122-95.6c-10.8 0-19.9 1.9-26.9 5.6-7 3.7-12.8 8.3-17.2 13.6a48.4 48.4 0 0 0-9.1 17.4c-1.6 5.3-2.7 10.7-3.1 16.2H723c-1.6-17.3-7.6-30.1-15.6-39.1-8.4-8.9-21.9-13.7-38.6-13.7zm-248.5-10.1c8.7-6.3 12.9-16.7 12.9-31 .3-6.8-1.1-13.5-4.1-19.6-2.7-4.9-6.7-9-11.6-11.9a44.8 44.8 0 0 0-16.6-6c-6.4-1.2-12.9-1.8-19.3-1.7h-70.3v79.7h76.1c13.1.1 24.2-3.1 32.9-9.5zm11.8 72c-9.8-7.5-22.9-11.2-39.2-11.2h-81.8v94h80.2c7.5 0 14.4-.7 21.1-2.1s12.7-3.8 17.8-7.2c5.1-3.3 9.2-7.8 12.3-13.6 3-5.8 4.5-13.2 4.5-22.1 0-17.7-5-30.2-14.9-37.8z")),t.BookOutline=l("book",i,s(o,"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-260 72h96v209.9L621.5 312 572 347.4V136zm220 752H232V136h280v296.9c0 3.3 1 6.6 3 9.3a15.9 15.9 0 0 0 22.3 3.7l83.8-59.9 81.4 59.4c2.7 2 6 3.1 9.4 3.1 8.8 0 16-7.2 16-16V136h64v752z")),t.BoxPlotOutline=l("box-plot",i,s(o,"M952 224h-52c-4.4 0-8 3.6-8 8v248h-92V304c0-4.4-3.6-8-8-8H232c-4.4 0-8 3.6-8 8v176h-92V232c0-4.4-3.6-8-8-8H72c-4.4 0-8 3.6-8 8v560c0 4.4 3.6 8 8 8h52


f + 0.5f).toInt()
}

/**
 * Convert HSL (hue-saturation-lightness) components to a RGB color.
 *
 *  * hsl[0] is Hue [0 .. 360)
 *  * hsl[1] is Saturation [0...1]
 *  * hsl[2] is Lightness [0...1]
 *
 * If hsv values are out of range, they are pinned.
 *
 * @param hsl 3-element array which holds the input HSL components
 * @return the resulting RGB color
 */
@ColorInt
fun hslToColor(hsl: FloatArray): Int {
    val h = hsl[0]
    val s = hsl[1]
    val l = hsl[2]

    val c = (1f - abs(2 * l - 1f)) * s
    val m = l - 0.5f * c
    val x = c * (1f - abs(h / 60f % 2f - 1f))

    val hueSegment = h.toInt() / 60

    var r = 0f
    var g = 0f
    var b = 0f

    when (hueSegment) {
        0 -> {
            r = (c + m)
            g = (x + m)
            b = m
        }
        1 -> {
            r = (x + m)
            g = (c + m)
            b = m
        }
        2 -> {
            r = m
            g = (c + m)
            b = (x + m)
        }
        3 -> {
            r = m
            g = (x + m)
            b = (c + m)
        }
        4 -> {
            r = (x + m)
            g = m
            b = (c + m)
        }
        5, 6 -> {
            r = (c + m)
            g = m
            b = (x + m)
        }
    }

    r = constrain(r, 0f, 1f)
    g = constrain(g, 0f, 1f)
    b = constrain(b, 0f, 1f)

    return rgbColorInt(r, g, b)
}

/**
 * Convert RGB components to HSL (hue-saturation-lightness).
 *
 *  * outHsl[0] is Hue [0 .. 360)
 *  * outHsl[1] is Saturation [0...1]
 *  * outHsl[2] is Lightness [0...1]
 *
 *
 * @param r red component value [0..255]
 * @param g green component value [0..255]
 * @param b blue component value [0..255]
 * @param outHsl 3-element array which holds the resulting HSL components
 */
fun rgbToHsl(
    @IntRange(from = 0x0, to = 0xFF) r: Int,
    @IntRange(from = 0x0, to = 0xFF) g: Int,
    @IntRange(from = 0x0, to = 0xFF) b: Int,
    outHsl: FloatArray
) {
    val rf = r / 255f
    val gf = g / 255f
    val bf = b / 255f

    val max = Math.max(rf, Math.max(gf, bf))
    val min = Math.min(rf, Math.min(gf, bf))
    val deltaMaxMin = max - min

    var h: Float
    val s: Float
    val l = (max + min) / 2f

    if (max == min) {
        // Monochromatic
        s = 0f
        h = s
    } else {
        if (max == rf) {
            h = (gf - bf) / deltaMaxMin % 6f
        } else if (max == gf) {
            h = (bf - rf) / deltaMaxMin + 2f
        } else {
            h = (rf - gf) / deltaMaxMin + 4f
        }

        s = deltaMaxMin / (1f - Math.abs(2f * l - 1f))
    }

    h = h * 60f % 360f
    if (h < 0) {
        h += 360f
    }

    outHsl[0] = constrain(h, 0f, 360f)


   /**
     * ```
     * Optional default parameters for the request / response.
     * NOTE: This is an extension to the standard
     * ```
     *
     * `map<string, .inference.InferParameter> parameters = 6;`
     */
    @kotlin.jvm.JvmSynthetic
    @JvmName("clearParameters")
    public fun com.google.protobuf.kotlin.DslMap<kotlin.String, io.seldon.mlops.inference.v2.V2Dataplane.InferParameter, ParametersProxy>
      .clear() {
         _builder.clearParameters()
       }
  }
  @kotlin.jvm.JvmName("-initializetensorMetadata")
  public inline fun tensorMetadata(block: io.seldon.mlops.inference.v2.ModelMetadataResponseKt.TensorMetadataKt.Dsl.() -> kotlin.Unit): io.seldon.mlops.inference.v2.V2Dataplane.ModelMetadataResponse.TensorMetadata =
    io.seldon.mlops.inference.v2.ModelMetadataResponseKt.TensorMetadataKt.Dsl._create(io.seldon.mlops.inference.v2.V2Dataplane.ModelMetadataResponse.TensorMetadata.newBuilder()).apply { block() }._build()
  /**
   * ```
   * Metadata for a tensor.
   * ```
   *
   * Protobuf type `inference.ModelMetadataResponse.TensorMetadata`
   */
  public object TensorMetadataKt {
    @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)
    @com.google.protobuf.kotlin.ProtoDslMarker
    public class Dsl private constructor(
      private val _builder: io.seldon.mlops.inference.v2.V2Dataplane.ModelMetadataResponse.TensorMetadata.Builder
    ) {
      public companion object {
        @kotlin.jvm.JvmSynthetic
        @kotlin.PublishedApi
        internal fun _create(builder: io.seldon.mlops.inference.v2.V2Dataplane.ModelMetadataResponse.TensorMetadata.Builder): Dsl = Dsl(builder)
      }

      @kotlin.jvm.JvmSynthetic
      @kotlin.PublishedApi
      internal fun _build(): io.seldon.mlops.inference.v2.V2Dataplane.ModelMetadataResponse.TensorMetadata = _builder.build()

      /**
       * ```
       * The tensor name.
       * ```
       *
       * `string name = 1;`
       */
      public var name: kotlin.String
        @JvmName("getName")
        get() = _builder.getName()
        @JvmName("setName")
        set(value) {
          _builder.setName(value)
        }
      /**
       * ```
       * The tensor name.
       * ```
       *
       * `string name = 1;`
       */
      public fun clearName() {
        _builder.clearName()
      }

      /**
       * ```
       * The tensor data type.
       * ```
       *
       * `string datatype = 2;`
       */
      public var datatype: kotlin.String
        @JvmName("getDatatype")
        get() = _builder.getDatatype()
        @JvmName("setDatatype")
        set(value) {
          _builder.setDatatype(value)
        }
      /**
       * ```
       * The tensor data type.
       * ```
       *
       * `string datatype = 2;`
       */
      public fun clearDatatype() {
        _builder.clearDatatype()
      }

      /**
       * An uninstantiable, behaviorless type to represent the field in
       * generics.
       */
      @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)
      public class ShapeProxy private constructor() : com.google.protobuf.kotlin.DslProxy()


# © Tg @yeah_new | YEAR-NEW | @NT_BOT_CHANNEL

import traceback, datetime, asyncio, string, random, time, os, aiofiles, aiofiles.os
from pyrogram import filters
from pyrogram import Client
from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
from pyrogram.errors import FloodWait, InputUserDeactivated, UserIsBlocked, PeerIdInvalid
from plugins.database.database import db
from plugins.config import Config
broadcast_ids = {}

async def send_msg(user_id, message):
    try:
        await message.copy(chat_id=user_id)
        return 200, None
    except FloodWait as e:
        await asyncio.sleep(e.x)
        return send_msg(user_id, message)
    except InputUserDeactivated:
        return 400, f"{user_id} : deactivated\n"
    except UserIsBlocked:
        return 400, f"{user_id} : blocked the bot\n"
    except PeerIdInvalid:
        return 400, f"{user_id} : user id invalid\n"
    except Exception as e:
        return 500, f"{user_id} : {traceback.format_exc()}\n"

@Client.on_message(filters.private & filters.command('broadcast') & filters.reply)
async def broadcast_(c, m):
    if m.from_user.id != Config.OWNER_ID:
        return
    all_users = await db.get_all_users()

    broadcast_msg = m.reply_to_message

    while True:
        broadcast_id = ''.join([random.choice(string.ascii_letters) for i in range(3)])
        if not broadcast_ids.get(broadcast_id):
            break

    out = await m.reply_text(
        text = f"You will be notified with log file when all the users are notified."
    )
    start_time = time.time()
    total_users = await db.total_users_count()
    done = 0
    failed = 0
    success = 0

    broadcast_ids[broadcast_id] = dict(
        total = total_users,
        current = done,
        failed = failed,
        success = success
    )

    async with aiofiles.open('broadcast.txt', 'w') as broadcast_log_file:
        async for user in all_users:

            sts, msg = await send_msg(
                user_id = int(user['id']),
                message = broadcast_msg
            )
            if msg is not None:
                await broadcast_log_file.write(msg)

            if sts == 200:
                success += 1
            else:
                failed += 1

            if sts == 400:
                await db.delete_user(user['id'])

            done += 1
            if broadcast_ids.get(broadcast_id) is None:
                break
            else:
                broadcast_ids[broadcast_id].update(
                    dict(
                        current = done,
                        failed = failed,
                        success = success
                    )
                )
    if broadcast_ids.get(broadcast_id):
        broadcast_ids.pop(broadcast_id)
    completed_in = datetime.timedelta(seconds=int(time.time()-start_time))

    await asyncio.sleep(5)

    await out.delete()

    if failed == 0:
        await m.reply_text(
            text=f"broadcast completed in `{completed_in}`\n\nTotal users {total_users}.\nTotal done {done}, {success} success and {failed} failed.",
            quote=True
        )
    else:
        await m.reply_document(
            document='broadcast.txt',
            caption=f"broadcast completed in `{completed_in}`\n\nTotal users {total_users}.\nTotal done {done}, {success} success and {failed} failed.",
            quote=True
        )

    await aiofiles.os.remove('broadcast.txt')


2[..4].copy_from_slice(&cid);
        packet2[4..15].copy_from_slice(&[
            0x86, 0x00, 0x08, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0,
        ]);
        let mut result = Vec::new();
        let mut assembler_reply = MessageAssembler::new();
        for pkt_request in &[packet1, packet2] {
            for pkt_reply in
                ctap_hid.process_hid_packet(&pkt_request, DUMMY_CLOCK_VALUE, &mut ctap_state)
            {
                if let Some(message) = assembler_reply
                    .parse_packet(&pkt_reply, DUMMY_TIMESTAMP)
                    .unwrap()
                {
                    result.push(message);
                }
            }
        }
        assert_eq!(
            result,
            vec![Message {
                cid,
                cmd: CtapHid::COMMAND_INIT,
                payload: vec![
                    0x12, // Nonce
                    0x34,
                    0x56,
                    0x78,
                    0x9A,
                    0xBC,
                    0xDE,
                    0xF0,
                    cid[0], // Allocated CID
                    cid[1],
                    cid[2],
                    cid[3],
                    0x02, // Protocol version
                    0x01, // Device version
                    0x00,
                    0x00,
                    CtapHid::CAPABILITIES
                ]
            }]
        );
    }

    #[test]
    fn test_command_ping() {
        let mut rng = ThreadRng256 {};
        let user_immediately_present = |_| Ok(());
        let mut ctap_state = CtapState::new(&mut rng, user_immediately_present, DUMMY_CLOCK_VALUE);
        let mut ctap_hid = CtapHid::new();
        let cid = cid_from_init(&mut ctap_hid, &mut ctap_state);

        let reply = process_messages(
            &mut ctap_hid,
            &mut ctap_state,
            vec![Message {
                cid,
                cmd: CtapHid::COMMAND_PING,
                payload: vec![0x99, 0x99],
            }],
        );

        assert_eq!(
            reply,
            Some(vec![Message {
                cid,
                cmd: CtapHid::COMMAND_PING,
                payload: vec![0x99, 0x99]
            }])
        );
    }
}
// use std::thread;
// use std::time::Duration;
#[tokio::test]
async fn my_test() {
    tokio::join!(async move {
        //super::server::run().await;
    });
}
<reponame>nephele-rs/cynthia<filename>cynthia/src/platform/dup/dup.rs
#![forbid(unsafe_code)]

use futures_io::{AsyncRead, AsyncSeek, AsyncWrite};
use std::fmt;
use std::hash::{Hash, Hasher};
use std::io::{self, IoSlice, IoSliceMut, SeekFrom};
use std::ops::{Deref, DerefMut};
use std::pin::Pin;
use std::task::{Context, Poll};

use crate::platform::mutex;

pub struct Mutex<T>(mutex::Mutex<T>);

impl<T> Mutex<T> {
    pub fn new(data: T) -> Mutex<T> {
        Mutex(data.into())
    }


block;position:absolute;top:0;left:0;z-index:-1;filter:alpha(opacity = 0);width:100%;height:100%}.cke_dialog_contents_body .cke_accessibility_legend{margin:2px 7px 2px 2px}.cke_dialog_contents_body .cke_accessibility_legend:focus,.cke_dialog_contents_body .cke_accessibility_legend:active{outline:0;border:2px solid #139ff7;margin:0 5px 0 0}.cke_dialog_contents_body input[type=file]:focus,.cke_dialog_contents_body input[type=file]:active{border:2px solid #139ff7}.cke_dialog_find_fieldset{margin-top:10px!important}.cke_dialog_image_ratiolock{margin-top:52px!important}.cke_dialog_forms_select_order label.cke_dialog_ui_labeled_label{margin-left:0}.cke_dialog_forms_select_order div.cke_dialog_ui_input_select{width:100%}.cke_dialog_forms_select_order_txtsize .cke_dialog_ui_hbox_last{padding-top:4px}.cke_dialog_image_url .cke_dialog_ui_hbox_last{vertical-align:bottom}a.cke_dialog_ui_button.cke_dialog_image_browse{margin-top:10px}.cke_dialog_contents_body .cke_tpl_list{border:#bcbcbc 1px solid;margin:1px}.cke_dialog_contents_body .cke_tpl_list:focus,.cke_dialog_contents_body .cke_tpl_list:active{outline:0;margin:0;border:2px solid #139ff7}.cke_dialog_contents_body .cke_tpl_list a:focus,.cke_dialog_contents_body .cke_tpl_list a:active{outline:0}.cke_dialog_contents_body .cke_tpl_list a:focus .cke_tpl_item,.cke_dialog_contents_body .cke_tpl_list a:active .cke_tpl_item{border:2px solid #139ff7;padding:6px}.cke_rtl input.cke_dialog_ui_input_text,.cke_rtl input.cke_dialog_ui_input_password,.cke_rtl input.cke_dialog_ui_input_tel{padding-right:2px}.cke_rtl div.cke_dialog_ui_input_text,.cke_rtl div.cke_dialog_ui_input_password,.cke_rtl div.cke_dialog_ui_input_tel{padding-left:2px}.cke_rtl div.cke_dialog_ui_input_text{padding-right:1px}.cke_rtl .cke_dialog_ui_vbox_child,.cke_rtl .cke_dialog_ui_hbox_child,.cke_rtl .cke_dialog_ui_hbox_first,.cke_rtl .cke_dialog_ui_hbox_last{padding-right:2px!important}.cke_hc .cke_dialog_title,.cke_hc .cke_dialog_footer,.cke_hc a.cke_dialog_tab,.cke_hc a.cke_dialog_ui_button,.cke_hc a.cke_dialog_ui_button:hover,.cke_hc a.cke_dialog_ui_button_ok,.cke_hc a.cke_dialog_ui_button_ok:hover{filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.cke_hc div.cke_dialog_ui_input_text,.cke_hc div.cke_dialog_ui_input_password,.cke_hc div.cke_dialog_ui_input_tel,.cke_hc div.cke_dialog_ui_input_textarea,.cke_hc div.cke_dialog_ui_input_select,.cke_hc div.cke_dialog_ui_input_file{border:0}.cke_dialog_footer{filter:""}/*
Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
.cke_reset{margin:0;padding:0;border:0;background:transparent;text-decoration:none;width:auto;height:auto;vertical-


my_tuple = (3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5)
k = 3
max_k_elements = tuple(sorted(my_tuple)[-k:])
min_k_elements = tuple(sorted(my_tuple)[:k])
print("Original Tuple:", my_tuple)
print(f"Maximum {k} elements:", max_k_elements)
print(f"Minimum {k} elements:", min_k_elements)


().CreateEmbeddings(suite.ctx, oai.EmbeddingRequest{
		Model: "thenlper/gte-small",
		Input: "test-content",
	}).Return(oai.EmbeddingResponse{
		Data: []oai.Embedding{
			{
				Embedding: []float32{0.1, 0.2, 0.3},
			},
		},
	}, nil)

	vector := pgvector.NewVector([]float32{0.1, 0.2, 0.3})

	suite.mockEmbeddingsStore.EXPECT().CreateKnowledgeEmbedding(suite.ctx, gomock.Any()).DoAndReturn(func(_ context.Context, embeddings ...*types.KnowledgeEmbeddingItem) error {
		suite.Equal(embeddings[0].Embedding384, &vector)
		suite.Nil(embeddings[0].Embedding512)
		suite.Nil(embeddings[0].Embedding1024)
		suite.Nil(embeddings[0].Embedding1536)
		suite.Nil(embeddings[0].Embedding3584)

		suite.Equal("test-data-entity-id", embeddings[0].DataEntityID)
		suite.Equal("test-document-id", embeddings[0].DocumentID)
		suite.Equal("test-document-group-id", embeddings[0].DocumentGroupID)
		suite.Equal("test-content", embeddings[0].Content)
		suite.Equal("test-source", embeddings[0].Source)

		return nil
	})

	err := suite.pg.Index(suite.ctx, &types.SessionRAGIndexChunk{
		DataEntityID:    "test-data-entity-id",
		DocumentID:      "test-document-id",
		DocumentGroupID: "test-document-group-id",
		Source:          "test-source",
		Content:         "test-content",
	})
	suite.Require().NoError(err)
}

func (suite *PGVectorTestSuite) TestIndex_1536_text_embedding_3_small() {
	suite.mockProvider.EXPECT().GetClient(suite.ctx, &manager.GetClientRequest{
		Provider: "vllm",
	}).Return(suite.mockClient, nil)

	suite.pg.cfg.RAG.PGVector.EmbeddingsModel = "text-embedding-3-small"

	suite.mockClient.EXPECT().CreateEmbeddings(suite.ctx, oai.EmbeddingRequest{
		Model: "text-embedding-3-small",
		Input: "test-content",
	}).Return(oai.EmbeddingResponse{
		Data: []oai.Embedding{
			{
				Embedding: []float32{0.1, 0.2, 0.3},
			},
		},
	}, nil)

	vector := pgvector.NewVector([]float32{0.1, 0.2, 0.3})

	suite.mockEmbeddingsStore.EXPECT().CreateKnowledgeEmbedding(suite.ctx, gomock.Any()).DoAndReturn(func(_ context.Context, embeddings ...*types.KnowledgeEmbeddingItem) error {
		suite.Equal(embeddings[0].Embedding1536, &vector)

		suite.Nil(embeddings[0].Embedding384)
		suite.Nil(embeddings[0].Embedding512)
		suite.Nil(embeddings[0].Embedding1024)
		suite.Nil(embeddings[0].Embedding3584)

		suite.Equal("test-data-entity-id", embeddings[0].DataEntityID)
		suite.Equal("test-document-id", embeddings[0].DocumentID)
		suite.Equal("test-document-group-id", embeddings[0].DocumentGroupID)
		suite.Equal("test-content", embeddings[0].Content)
		suite.Equal("test-source", embeddings[0].Source)

		return nil
	})

	err := suite.pg.Index(suite.ctx, &types.SessionRAGIndexChunk{
		DataEntityID:    "test-data-entity-id",
		DocumentID:      "test-document-id",
		DocumentGroupID: "test-document-group-id",
		Source:          "test-source",
		Content:         "test-content",
	})
	suite.Require().NoError(err)
}
// package agent - errors.go
// Defines session-specific errors and demonstrates customized retryable
// and ignora


qVLDVCBiDaAYuT4o5uRNMMuBFhB9":  {"Saber mSOL-JSOL LP", "mSOL-JSOL", 9, ":B/icon.png"},
	"SoLaUA1vvCaidtQLYwt4yszBv1LtbYJDjEbwC4bzxca":  {"Saber scnSOL-JSOL LP", "scnSOL-JSOL", 9, ":B/icon.png"},
	"USTKgR66nvdkCc4bUKsirzEnyFoPtRyZzT2xsqB5t7c":  {"Saber solUST-UST LP", "solUST-UST", 6, ":B/icon.png"},
	"USTRHDiTkhjE1oDydHqNkPJNDeBKTTbz9crTmiYc2w9":  {"Saber solUST-USDH LP", "solUST-USDH", 6, ":B/icon.png"},
	"UXDgmqLd1roNYkC4TmJzok61qcM9oKs5foDADiFoCiJ":  {"Saber UXD-USDC LP", "UXD-USDC", 6, ":B/icon.png"},
	"UXDjCH2xGyyLWa92stSUDftWPKGFFPEvqvk28gQA8bW":  {"Saber UXD-CASH LP", "UXD-CASH", 6, ":B/icon.png"},
	"WLPmZgnajNcCzYv68gQDsix4NNjTxGTPmKRMtiXMuFg":  {"Saber soFTT-FTT LP", "soFTT-FTT", 8, ":B/icon.png"},
	"5azmHy2UZfpYhtxPgzPfGEh9E3i9vmQe945wQKiR1WMz": {"SolReapers Souls", "RSOULS", 6, ":D/beamseree/SolReapers/main/assets/Soul.png"},
	"DeM5g1xR3Hj3djs1v8BMuDAGfAxzkb2KdAG1M26kNMQ5": {"Presidential", "POTUS", 9, ":D/asapBern/Cryypto/main/Presidential%20Logo%20-%20Copy.png"},
	"2sbn1jfZUzj8VJutfmsPxtwevZpBDiBWsXJj2owjX3vn": {"Vote", "VOTE", 9, ":D/FullMoonMiningCo/logos/main/vote-logo.png"},
	"2U7AMRZBMFqNeCpDRnSzVeyvDTTKunssxHUj1twD4oSE": {"Birthday", "BDAY", 9, ":D/FullMoonMiningCo/logos/main/bday-logo.png"},
	"2urksvP5mopRd1kxmbR93tUWadqq3eSoZjjoFzZYU1Pp": {"Donation", "DONATE", 9, ":D/FullMoonMiningCo/logos/main/donate-logo.png"},
	"3qYpt9J7XYDDbH882W9uT9wTZiT3i4kKFfR3u87xot47": {"Prestige", "TIGE", 9, ":D/FullMoonMiningCo/logos/main/tige-logo.png"},
	"4tu2y9ymeNFyQSFJbRmgZ411yiXv1oye9Kkvt29RstLY": {"Character", "CHTR", 9, ":D/FullMoonMiningCo/logos/main/chtr-logo.png"},
	"55WUsHhhCPNrUDCzakT1m1h8XhdT2pNNbHwd2EVG3qRX": {"Control", "CTRL", 9, ":D/FullMoonMiningCo/logos/main/ctrl-logo.


as a {@link DataFrame}.
     * @example
     *   sparkSession.readStream.parquet("/path/to/directory/of/parquet/files")
     *   sparkSession.readStream.schema(schema).json("/path/to/directory/of/json/files")
     *
     *
     * @since EclairJS 0.6 Spark  2.0.0
     * @function
     * @name module:eclairjs/sql.SparkSession#readStream
     * @returns {module:eclairjs/sql/streaming.DataStreamReader}
     */
/*    SparkSession.prototype.readStream = function() {
       var javaObject =  this.getJavaObject().readStream();
       return Utils.javaToJs(javaObject);
    };
    */

    /**
     * Stop the underlying {@link module:eclairjs.SparkContext}.
     *
     * @function
     * @name module:eclairjs/sql.SparkSession#stop
     * @since EclairJS 0.6 Spark  2.0.0
     */

    //
    // static methods
    //

    /**
     * Creates a [[module:eclairjs/sql.SparkSessionBuilder]] for constructing a {@link module:eclairjs/sql.SparkSession}.
     *
     * @since EclairJS 0.6 Spark  2.0.0
     * @function
     * @static
     * @name module:eclairjs/sql.SparkSession#builder
     * @returns {module:eclairjs/sql.SparkSessionBuilder}
     */

    /**
     * Changes the SparkSession that will be returned in this thread and its children when
     * SparkSession.getOrCreate() is called. This can be used to ensure that a given thread receives
     * a SparkSession with an isolated session, instead of the global (first created) context.
     *
     * @since EclairJS 0.6 Spark  2.0.0
     * @function
     * @static
     * @name module:eclairjs/sql.SparkSession#setActiveSession
     * @param {module:eclairjs/sql.SparkSession} session
     */

    /**
     * Clears the active SparkSession for current thread. Subsequent calls to getOrCreate will
     * return the first created context instead of a thread-local override.
     *
     * @since EclairJS 0.6 Spark  2.0.0
     * @function
     * @static
     * @name module:eclairjs/sql.SparkSession#clearActiveSession
     */

    /**
     * Sets the default SparkSession that is returned by the builder.
     *
     * @since EclairJS 0.6 Spark  2.0.0
     * @function
     * @static
     * @name module:eclairjs/sql.SparkSession#setDefaultSession
     * @param {module:eclairjs/sql.SparkSession} session
     */

    /**
     * Clears the default SparkSession that is returned by the builder.
     *
     * @function
     * @static
     * @name module:eclairjs/sql.SparkSession#clearDefaultSession
     * @since EclairJS 0.6 Spark  2.0.0
     */

    module.exports = SparkSession;
})();/*
 * Copyright 2016 IBM Corp.
 *
 * 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.
 */

(function () {


_tmp+3]
    s_mul_i32 s[s_ho_diff_acc_y], -1, s[s_dtile_dy]
    s_mul_i32 s[s_wo_diff_acc_x], -1, s[s_dtile_dx]
    s_mul_i32 s[s_out_os_diff_acc_wo], s[s_wo_diff_acc_x], s[s_out_stride_wo]
    s_mul_i32 s[s_tmp+1], s[s_wo], s[s_out_stride_wo] ; s_out_stride_ho
    s_mul_i32 s[s_tmp], s[s_ho_diff_acc_y], s[s_tmp+1]
    s_add_i32 s[s_out_os_diff_acc_ho_rst_wo], s[s_out_os_diff_acc_ho_rst_wo], s[s_tmp]

    s_mov_b32 s[s_p_in+2], 0xffffffff
    s_mov_b32 s[s_p_in+3], 0x27000
    ; start MFMA loop, 64x32 wave tile with 1x2 repeat, 1x1 step, k_pack:4
    s_waitcnt vmcnt(4)
    v_pack_b32_f16 v[v_pack_k_tmp], v[v_gld_b], v[v_gld_b+1]
    ds_write_b32 v[v_sst_b_os], v[v_pack_k_tmp]
    v_pack_b32_f16 v[v_pack_k_tmp], v[v_gld_b], v[v_gld_b+1] op_sel:[1, 1]
    ds_write_b32 v[v_sst_b_os], v[v_pack_k_tmp] offset:8

    s_waitcnt vmcnt(0)
    ds_write_b64 v[v_sst_a_os], v[v_gld_a+0:v_gld_a+0+1]
    ds_write_b64 v[v_sst_a_os], v[v_gld_a+2:v_gld_a+2+1] offset:512
    ds_write_b64 v[v_sst_a_os], v[v_gld_a+4:v_gld_a+4+1] offset:1024
    ds_write_b64 v[v_sst_a_os], v[v_gld_a+6:v_gld_a+6+1] offset:1536

    .v_clear_acc_c a_c, 64
    ; make sure acc WAR harzard, at least 1 nop for src_c
    s_sub_i32 s[s_kitr], s[s_knum], 16
    s_cmp_gt_i32 s[s_kitr], 0
    s_cbranch_scc0 L_igemm_bwd_gtcx_nhwc_fp16_bx0_ex1_bt256x64x16_wt64x32x4_ws1x1_wr1x2_ta1x4x4x1_1x4x1x64_tb1x2x1x2_1x8x1x32_mh_vs1_gkgs_mfma_end

    s_add_u32 s[s_out_offset],  s[s_move_slice_out_stride_k], s[s_out_offset]
    v_add_u32 v[v_wei_os], s[s_move_slice_wei_stride_k], v[v_wei_os]
    s_cmp_le_u32 s[s_gemm_k_num_k], s[s_out_offset]
    s_cselect_b32 s[s_flag_need_acc_yx], 1, 0

    s_cmp_eq_u32 1, s[


--------------------------------------------------------------
  17.0 - Plugins
------------------------------------------------------------------------------*/

.plugins tbody th.check-column,
.plugins tbody {
	padding: 8px 0 0 2px;
}

.plugins tbody th.check-column input[type=checkbox] {
	margin-top: 4px;
}

.updates-table .plugin-title p {
	margin-top: 0;
}

.plugins thead td.check-column,
.plugins tfoot td.check-column,
.plugins .inactive th.check-column {
	padding-left: 6px;
}

.plugins,
.plugins th,
.plugins td {
	color: #000;
}

.plugins tr {
	background: #fff;
}

.plugins p {
	margin: 0 4px;
	padding: 0;
}

.plugins .desc p {
	margin: 0 0 8px;
}

.plugins td.desc {
	line-height: 1.5;
}

.plugins .desc ul,
.plugins .desc ol {
	margin: 0 0 0 2em;
}

.plugins .desc ul {
	list-style-type: disc;
}

.plugins .row-actions {
	font-size: 13px;
	padding: 0;
}

.plugins .inactive td,
.plugins .inactive th,
.plugins .active td,
.plugins .active th {
	padding: 10px 9px;
}

.plugins .active td,
.plugins .active th {
	background-color: #f7fcfe;
}

.plugins .update th,
.plugins .update td {
	border-bottom: 0;
}

.plugins .inactive td,
.plugins .inactive th,
.plugins .active td,
.plugins .active th,
.plugin-install #the-list td,
.upgrade .plugins td,
.upgrade .plugins th {
	box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

.plugins tr.active.plugin-update-tr + tr.inactive th,
.plugins tr.active.plugin-update-tr + tr.inactive td,
.plugins tr.active + tr.inactive th,
.plugins tr.active + tr.inactive td {
	border-top: 1px solid rgba(0, 0, 0, 0.03);
	box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.02), inset 0 -1px 0 #e1e1e1;
}

.plugins .update td,
.plugins .update th,
.upgrade .plugins tr:last-of-type td,
.upgrade .plugins tr:last-of-type th,
.plugins tr.active + tr.inactive.update th,
.plugins tr.active + tr.inactive.update td,
.plugins .updated td,
.plugins .updated th,
.plugins tr.active + tr.inactive.updated th,
.plugins tr.active + tr.inactive.updated td {
	box-shadow: none;
}

.plugins .active th.check-column,
.plugin-update-tr.active td {
	border-left: 4px solid #00a0d2;
}

.wp-list-table.plugins .plugin-title,
.wp-list-table.plugins .theme-title {
	padding-right: 12px;
	white-space: nowrap;
}

.plugins .plugin-title img,
.plugins .plugin-title .dashicons {
	float: left;
	padding: 0 10px 0 0;
	width: 64px;
	height: 64px;
}

.plugins .plugin-title .dashicons:before {
	padding: 2px;
	background-color: #eee;
	box-shadow: inset 0 0 10px rgba(160, 165, 170, 0.15);
	font-size: 60px;
	color: #B4B9BE;
}

#update-themes-table .plugin


 once now before a thread continues to check. */

#if SDL_ALSA_HOTPLUG_THREAD
    SDL_AtomicSet(&ALSA_hotplug_shutdown, 0);
    ALSA_hotplug_thread = SDL_CreateThread(ALSA_HotplugThread, "SDLHotplugALSA", NULL);
    /* if the thread doesn't spin, oh well, you just don't get further hotplug events. */
#endif
}

static void
ALSA_Deinitialize(void)
{
    ALSA_Device *dev;
    ALSA_Device *next;

#if SDL_ALSA_HOTPLUG_THREAD
    if(ALSA_hotplug_thread != NULL) {
        SDL_AtomicSet(&ALSA_hotplug_shutdown, 1);
        SDL_WaitThread(ALSA_hotplug_thread, NULL);
        ALSA_hotplug_thread = NULL;
    }
#endif

    /* Shutting down! Clean up any data we've gathered. */
    for(dev = hotplug_devices; dev; dev = next) {
        /*printf("ALSA: at shutdown, removing %s device '%s'\n", dev->iscapture ? "capture" : "output", dev->name);*/
        next = dev->next;
        SDL_free(dev->name);
        SDL_free(dev);
    }
    hotplug_devices = NULL;

    UnloadALSALibrary();
}

static int
ALSA_Init(SDL_AudioDriverImpl *impl)
{
    if(LoadALSALibrary() < 0) {
        return 0;
    }

    /* Set the function pointers */
    impl->DetectDevices = ALSA_DetectDevices;
    impl->OpenDevice = ALSA_OpenDevice;
    impl->WaitDevice = ALSA_WaitDevice;
    impl->GetDeviceBuf = ALSA_GetDeviceBuf;
    impl->PlayDevice = ALSA_PlayDevice;
    impl->CloseDevice = ALSA_CloseDevice;
    impl->Deinitialize = ALSA_Deinitialize;
    impl->CaptureFromDevice = ALSA_CaptureFromDevice;
    impl->FlushCapture = ALSA_FlushCapture;

    impl->HasCaptureSupport = SDL_TRUE;

    return 1;   /* this audio target is available. */
}

AudioBootStrap ALSA_bootstrap = {
    "alsa", "ALSA PCM audio", ALSA_Init, 0
};

#endif /* SDL_AUDIO_DRIVER_ALSA */

/* vi: set ts=4 sw=4 expandtab: */


point_to_chunk_point(point);
        self.spawn_chunk(point)
    }

    /// De-spawns a spawned chunk at a given index or coordinate.
    ///
    /// If the chunk is not spawned this will result in nothing.
    ///
    /// # Errors
    ///
    /// If the coordinate or index is out of bounds, an error will be returned.
    ///
    /// # Examples
    /// ```
    /// use bevy_asset::{prelude::*, HandleId};
    /// use bevy_sprite::prelude::*;
    /// use bevy_tilemap::prelude::*;
    ///
    /// // In production use a strong handle from an actual source.
    /// let texture_atlas_handle = Handle::weak(HandleId::random::<TextureAtlas>());
    ///
    /// let mut tilemap = TilemapBuilder::new()
    ///     .texture_atlas(texture_atlas_handle)
    ///     .dimensions(1, 1)
    ///     .texture_dimensions(32, 32)
    ///     .finish()
    ///     .unwrap();
    ///
    /// assert!(tilemap.insert_chunk((0, 0)).is_ok());
    ///
    /// // Ideally you should want to set some tiles here else nothing will
    /// // display in the render...
    ///
    /// assert!(tilemap.spawn_chunk((0, 0)).is_ok());
    ///
    /// // Later a frame or more on...
    ///
    /// assert!(tilemap.despawn_chunk((0, 0)).is_ok());
    /// assert!(tilemap.despawn_chunk((-1, -1)).is_err());
    /// ```
    pub fn despawn_chunk<P: Into<Point2>>(&mut self, point: P) -> TilemapResult<()> {
        let point: Point2 = point.into();
        if let Some(dimensions) = &self.dimensions {
            dimensions.check_point(point)?;
        }

        self.spawned.remove(&(point.x, point.y));

        if self.chunks.get_mut(&point).is_some() {
            self.chunk_events
                .send(TilemapChunkEvent::Despawned { point });
            Ok(())
        } else {
            Err(ErrorKind::MissingChunk.into())
        }
    }

    /// Destructively removes a chunk at a coordinate position and despawns them
    /// if needed.
    ///
    /// Internally, this sends an event to the tilemap's system flagging which
    /// chunks must be removed by index and entity. A chunk is not recoverable
    /// if this action is done.
    ///
    /// Does nothing if the chunk does not exist.
    ///
    /// # Errors
    ///
    /// If the coordinate or index is out of bounds, an error will be returned.
    ///
    /// # Examples
    /// ```
    /// use bevy_asset::{prelude::*, HandleId};
    /// use bevy_sprite::prelude::*;
    /// use bevy_tilemap::prelude::*;
    ///
    /// // In production use a strong handle from an actual source.
    /// let texture_atlas_handle = Handle::weak(HandleId::random::<TextureAtlas>());
    ///
    /// let mut tilemap = TilemapBuilder::new()
    ///     .texture_atlas(texture_atlas_handle)
    ///     .dimensions(3, 3)
    ///     .texture_dimensions(32, 32)
    ///     .finish()
    ///     .unwrap();
    ///
    /// // Add some chunks.
    /// assert!(tilemap.insert_chunk((0, 0)).is_ok());
    /// assert!(tilemap.insert_chunk((1, 1)).is_ok());
    ///
    /// assert!(tilemap.remove_chunk((0, 0)).is_ok());
    /// assert!(tilemap.remove_chunk((1, 1)).i


_joint_->speed = speed;
    req_move_joint_->acc = acc;
    req_move_joint_->mvtime = mvtime;
    req_move_joint_->wait = wait;
    req_move_joint_->timeout = timeout;
    req_move_joint_->radius = radius;
    return _call_request(client_set_servo_angle_, req_move_joint_);
}

int XArmROSClient::set_servo_angle(const std::vector<fp32>& angles, bool wait, fp32 timeout, fp32 radius)
{
    return set_servo_angle(angles, 0, 0, 0, wait, timeout, radius);
}

int XArmROSClient::set_servo_angle_j(const std::vector<fp32>& angles, fp32 speed, fp32 acc, fp32 mvtime)
{
    req_move_joint_->angles = angles;
    req_move_joint_->speed = speed;
    req_move_joint_->acc = acc;
    req_move_joint_->mvtime = mvtime;
    return _call_request(client_set_servo_angle_j_, req_move_joint_);
}

// MoveCircle
int XArmROSClient::move_circle(const std::vector<fp32>& pose1, const std::vector<fp32>& pose2, fp32 percent, fp32 speed, fp32 acc, fp32 mvtime, bool wait, fp32 timeout)
{
    req_move_circle_->pose1 = pose1;
    req_move_circle_->pose2 = pose2;
    req_move_circle_->percent = percent;
    req_move_circle_->speed = speed;
    req_move_circle_->acc = acc;
    req_move_circle_->mvtime = mvtime;
    req_move_circle_->wait = wait;
    req_move_circle_->timeout = timeout;
    return _call_request(client_move_circle_, req_move_circle_);
}

// MoveHome
int XArmROSClient::move_gohome(fp32 speed, fp32 acc, fp32 mvtime, bool wait, fp32 timeout)
{
    req_move_home_->speed = speed;
    req_move_home_->acc = acc;
    req_move_home_->mvtime = mvtime;
    req_move_home_->wait = wait;
    req_move_home_->timeout = timeout;
    return _call_request(client_move_gohome_, req_move_home_);
}
int XArmROSClient::move_gohome(bool wait, fp32 timeout)
{
    return move_gohome(0, 0, 0, wait, timeout);
}

// MoveVelocity
int XArmROSClient::vc_set_joint_velocity(const std::vector<fp32>& speeds, bool is_sync, float duration)
{
    req_move_velocity_->speeds = speeds;
    req_move_velocity_->is_sync = is_sync;
    req_move_velocity_->duration = duration;
    return _call_request(client_vc_set_joint_velocity_, req_move_velocity_);
}

int XArmROSClient::vc_set_cartesian_velocity(const std::vector<fp32>& speeds, bool is_tool_coord, float duration)
{
    req_move_velocity_->speeds = speeds;
    req_move_velocity_->is_tool_coord = is_tool_coord;
    req_move_velocity_->duration = duration;
    return _call_request(client_vc_set_cartesian_velocity_, req_move_velocity_);
}

// GetDigitalIO
int XArmROSClient::get_tgpio_digital(std::vector<int>& digitals)
{
    int ret = _call_request(client_get_tgpio_digital_, req_get_digital_io_, res_get_digital_io_);
    digitals.resize(2);
    // digitals.swap(res_get_digital_io_->digitals);
    digit


COMPLETED = 92103,

    [Text("|Lv. 76+| Red Libra's Request - Huge Orc")]
    LV_76_RED_LIBRA_S_REQUEST_HUGE_ORC_2 = 92104,

    [Text("Defeat Huge Orc")]
    DEFEAT_HUGE_ORC_6 = 92105,

    [Text("76")]
    SEVENTY_SIX_2 = 92111,

    [Text("Plains of Glory, War-Torn Plains, Silent Valley, Dragon Valley, Tower of Insolence")]
    PLAINS_OF_GLORY_WAR_TORN_PLAINS_SILENT_VALLEY_DRAGON_VALLEY_TOWER_OF_INSOLENCE_6 = 92112,

    [Text("|Lv. 60-69| Aden's Defenders Challenge - A")]
    LV_60_69_ADEN_S_DEFENDERS_CHALLENGE_A = 92501,

    [Text("|Lv. 60-69| Aden's Defenders Challenge - A (In progress)")]
    LV_60_69_ADEN_S_DEFENDERS_CHALLENGE_A_IN_PROGRESS = 92502,

    [Text("|Lv. 60-69| Aden's Defenders Challenge - A (Completed)")]
    LV_60_69_ADEN_S_DEFENDERS_CHALLENGE_A_COMPLETED = 92503,

    [Text("|Lv. 60-69| Aden's Defenders Challenge - A")]
    LV_60_69_ADEN_S_DEFENDERS_CHALLENGE_A_2 = 92504,

    [Text("Kill monsters in the Plains of Glory and War-Torn Plains")]
    KILL_MONSTERS_IN_THE_PLAINS_OF_GLORY_AND_WAR_TORN_PLAINS = 92505,

    [Text("Talk to Harvest Expert")]
    TALK_TO_HARVEST_EXPERT = 92510,

    [Text("Lv. 60 - Lv. 70")]
    LV_60_LV_70 = 92511,

    [Text("Plains of Glory, War-Torn Plains")]
    PLAINS_OF_GLORY_WAR_TORN_PLAINS = 92512,

    [Text("500")]
    FIVE_HUNDRED_4 = 92513,

    [Text("Lv. 60-70, meeting requirements of the Aden's Defenders Challenge - A. Plains of Glory and War-Torn Plains")]
    FONT_COLOR_LEVEL_LV_60_70_FONT_MEETING_REQUIREMENTS_OF_THE_FONT_COLOR_LEVEL_ADEN_S_DEFENDERS_CHALLENGE_A_FONT_FONT_COLOR_LEVEL_PLAINS_OF_GLORY_AND_WAR_TORN_PLAINS_FONT = 92514,

    [Text("|Lv. 70-79| Aden's Defenders Challenge - B")]
    LV_70_79_ADEN_S_DEFENDERS_CHALLENGE_B = 92601,

    [Text("|Lv. 70-79| Aden's Defenders Challenge - B (In progress)")]
    LV_70_79_ADEN_S_DEFENDERS_CHALLENGE_B_IN_PROGRESS = 92602,

    [Text("|Lv. 70-79| Aden's Defenders Challenge - B (Completed)")]
    LV_70_79_ADEN_S_DEFENDERS_CHALLENGE_B_COMPLETED = 92603,

    [Text("|Lv. 70-79| Aden's Defenders Challenge - B")]
    LV_70_79_ADEN_S_DEFENDERS_CHALLENGE_B_2 = 92604,

    [Text("Kill monsters in the Silent Valley and the Plains of


"

	private val json = message["media"]["document"].obj

	init {
		extension = processExtension()
	}

	private fun processExtension(): String {
		//if (doc == null) return "empty"
		var ext: String? = null
		var original_filename: String? = null
		if (json.contains("attributes"))
			for (attr in json["attributes"].array) {
				if (attr.obj["_constructor"].string.startsWith("documentAttributeFilename")) {
					original_filename = attr.obj["fileName"].string
				}
			}
		if (original_filename != null) {
			val i = original_filename.lastIndexOf('.')
			if (i > 0) ext = original_filename.substring(i + 1)

		}
		if (ext == null) {
			ext = extensionFromMimetype(json["mimeType"].string)
		}

		// Sometimes, extensions contain a trailing double quote. Remove this. Fixes #12.
		ext = ext.replace("\"", "")

		return ext
	}

	@Throws(RpcErrorException::class, IOException::class, TimeoutException::class)
	override fun download(prog: DownloadProgressInterface?): Boolean {
		DownloadManager.downloadFile(targetPathAndFilename, size, json["dcId"].int, json["id"].long, json["accessHash"].long, prog)
		return true
	}
}
package it.codingjam.github.testdata

import assertk.Assert
import assertk.assertions.isEqualTo
import it.codingjam.github.util.ActionsFlow
import it.codingjam.github.util.StateAction
import it.codingjam.github.vo.Lce
import kotlinx.coroutines.flow.fold
import kotlinx.coroutines.runBlocking
import org.mockito.Mockito
import org.mockito.stubbing.OngoingStubbing

fun Assert<List<Any>>.containsLce(expected: String) = given { actual ->
    val actualString = actual.map {
        when (it) {
            is Lce.Success<*> -> "S"
            is Lce.Loading -> "L"
            is Lce.Error -> "E"
            else -> "N"
        }
    }.joinToString("")
    assertThat(actualString).isEqualTo(expected)
}

fun <T, P> Assert<List<T>>.map(extract: (T) -> P): Assert<List<P>> =
        transform { it.map(extract) }

fun <T> on(methodCall: suspend () -> T): OngoingStubbing<T> {
    return Mockito.`when`(runBlocking { methodCall() })!!
}

fun <T : Any> ActionsFlow<T>.states(initialState: T): List<Any> = runBlocking {
    fold(initialState to emptyList<Any>()) { (prevState, states), action ->
        if (action is StateAction) {
            val curState = action(prevState)
            curState to states + curState
        } else
            prevState to states + action
    }.second
}package it.cosenonjaviste.daggermock

import org.mockito.Mockito
import org.mockito.stubbing.Answer

fun DaggerMock.Companion.overrideComponent(c: Class<*>, componentFactory: () -> Any, testObj: Any): Any {
    val overriddenObjectsMap = OverriddenObjectsMap()
    overriddenObjectsMap.init(testObj)

    val component = try {
        componentFactory()
    } catch (e: Exception) {
        null
    }

    val defaultAnswer = Answer<Any> { invocation ->
        val method = invocation.method
        val provider = overriddenObjectsMap.getProvider(method)
        if (provider != null) {
            provider.get()
        } else {
            if (component != null) {
                method.isAccessible = true
                method.invoke(component, *invocation.arguments)
            } else {
                Mockito.mock(method.returnType)
            }
        }
    }
    return Mockito.mock(c, defaultAnswer)
}

fun DaggerMock.Companion.interceptor(testObj: Any): (Class<*>, () -> Any) -> Any {
    return { c, componentFactory ->
        Dag


nt) {
            this.isAttached = true
            this.position = position
            parent.addView(itemView)
        }

        internal fun detach(parent: ViewGroup) {
            parent.removeView(itemView)
            isAttached = false
        }

        internal fun onRestoreInstanceState(state: Parcelable?) {
            getStateFromParcelable(state)?.let { itemView.restoreHierarchyState(it) }
        }

        internal fun onSaveInstanceState(): Parcelable {
            val state = SparseArray<Parcelable>()
            itemView.saveHierarchyState(state)
            return Bundle().apply { putSparseParcelableArray(STATE, state) }
        }

        private fun getStateFromParcelable(state: Parcelable?): SparseArray<Parcelable>? {
            if (state != null && state is Bundle && state.containsKey(STATE)) {
                return state.getSparseParcelableArray<Parcelable>(STATE)
            }
            return null
        }
    }
}/*
 * Copyright (c) 2022(-0001) STMicroelectronics.
 * All rights reserved.
 * This software is licensed under terms that can be found in the LICENSE file in
 * the root directory of this software component.
 * If no LICENSE file comes with this software, it is provided AS-IS.
 */
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask

buildscript {
    repositories {
        google()
        mavenCentral()
    }
}

plugins {
    alias(libs.plugins.androidApplication) apply false
    alias(libs.plugins.androidLibrary) apply false
    alias(libs.plugins.benManes) apply true
    alias(libs.plugins.composeCompiler) apply false
    alias(libs.plugins.hilt) apply false
    alias(libs.plugins.kotlinAndroid) apply false
    alias(libs.plugins.kotlinSerialization) apply false
    alias(libs.plugins.ksp) apply false
    alias(libs.plugins.littlerobots) apply true
}

fun isNonStable(version: String): Boolean {
    return version.contains("alpha", true) ||
            version.contains("beta", true) ||
            version.contains("dev", true)
}

// https://github.com/ben-manes/gradle-versions-plugin
tasks.withType<DependencyUpdatesTask> {
    rejectVersionIf {
        isNonStable(candidate.version)
    }
}
/*
 * Copyright (c) 2022(-0001) STMicroelectronics.
 * All rights reserved.
 * This software is licensed under terms that can be found in the LICENSE file in
 * the root directory of this software component.
 * If no LICENSE file comes with this software, it is provided AS-IS.
 */

plugins {
    alias(libs.plugins.androidApplication)
    alias(libs.plugins.composeCompiler)
    alias(libs.plugins.kotlinAndroid)
    alias(libs.plugins.kotlinSerialization)
    alias(libs.plugins.hilt)
    alias(libs.plugins.ksp)
    alias(libs.plugins.jaredsburrowsLicense)
}

android {
    namespace = "com.st.demo"
    compileSdk = 36

    defaultConfig {
        applicationId = "com.st.demo"
        minSdk = 26
        targetSdk = 36
        versionCode = 12
        versionName = "5.2.12"

        vectorDrawables { useSupportLibrary = true }

        manifestPlaceholders["appAuthRedirectScheme"] = "com.st.demo"
    }

    hilt {
        enableAggregatingTask = true
    }

    buildTypes {
        release {
            isMinifyEnabled = false

            proguardFiles(
                getDefaultProguardFile("proguard-android-optimize.txt"),
                "proguard-rules.pro"
            )
        }
    }

    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_21
        targetCompatibility = JavaVersion.VERSION_21
    }

    buildFeatures {
        buildConfig = true
        compose = true
    }

    ksp {
        arg("room.schemaLocation", "$projectDir/schemas")
        arg("room.generateKotlin", "true")
    }

    buildFeatures


e.time() - t_start):.1f}s] "
              f"combining {video_file_muted} together with audios "
              f"{final_cut_audio_path} and {final_cut_audio_merged} "
              f"into video {p_output_video}..."
              )

        from .cut import merge_video_audio
        total_duration = merge_video_audio(
            video_file_muted,
            final_cut_audio_path,
            final_cut_audio_merged,
            p_output_video
            )
    else:
        #
        # If we shall deliver a clean audio track, we only need to render
        # two things together:
        # - the synthesized audio track final_cut_audio_path
        # - the muted video video_file_muted
        #
        print(f"[{(time.time() - t_start):.1f}s] "
              f"combining audio {final_cut_audio_path} with "
              f"video {video_file_muted} into {p_output_video}..."
              )

        from .cut import overlay_audio_on_video
        total_duration = overlay_audio_on_video(
            final_cut_audio_path,
            video_file_muted,
            p_output_video)

    #
    # Some cleanup and stat presenting and we're done
    #
    synthesis.close()

    print(f"[{(time.time() - t_start):.1f}s] "
          f"video processing complete: [[[ {p_output_video} ]]]"
          )
    if total_duration and total_duration > 0:
        calculation_duration = time.time() - t_start
        realtime_factor = calculation_duration / total_duration

        print(f"[{(time.time() - t_start):.1f}s] "
              f"calculation realtime factor for {total_duration:.1f}s "
              f"video: {realtime_factor:.2f}x"
              )


onPath, "VersionUpgrader", "SQL", "12004_to_12005.sql"), conn);
                RunFile(Path.Combine(this.applicationPath, "VersionUpgrader", "SQL", "12004_to_12005_data.sql"), conn);
                RunFile(Path.Combine(this.applicationPath, "VersionUpgrader", "SQL", "12004_to_12005_data2.sql"), conn);
                RunFile(Path.Combine(this.applicationPath, "VersionUpgrader", "SQL", "12004_to_12005_data3.sql"), conn);

                this.UpgradeToVersionLocalDB(conn, myVersion);
            }
            catch (Exception e)
            {
                throw new DatabaseUpgradeException("Error in upgrading database version 12.0.0.4 to 12.0.0.5: " + e.Message);
            }
        }
    }
}


 result := <-respCh:
			// w.log.Info("got 1 result", "id", w.id, "count", count)
			for _, a := range aggregators {
				a.Add(result)
			}
			count += 1
		case err := <-errCh:
			// error encountered
			w.log.Info("error running sim", "id", w.id, "err", err)
			w.handleErr(err)
			return
		case <-w.cancel:
			w.log.Info("cancel signal received", "id", w.id)
			// expectation is w.cancel is closed causing all go routines to wrap it up
			break iters
		}
		// flush and update results
		if count-lastFlush > flushInterval {
			w.log.Debug("flushing results", "id", w.id, "count", count, "flush", lastFlush)
			lastFlush = count
			stats := flush(aggregators)
			w.result.Statistics = stats
		}
	}
	w.log.Info("sim done", "id", w.id, "count", count, "flush", lastFlush)
	stats := flush(aggregators)
	w.result.Statistics = stats
}

func (w *worker) iter(work chan job, res chan stats.Result, errChan chan error) {
	for {
		select {
		case <-w.cancel:
			return
		case job, ok := <-work:
			if !ok {
				w.log.Info("work channel closed, iter worker ending", "id", w.id)
				return
			}

			c, err := simulation.NewCore(job.seed, false, job.cfg)
			if err != nil {
				errChan <- err
				return
			}
			eval, err := eval.NewEvaluator(job.node, c)
			if err != nil {
				errChan <- err
				break
			}
			s, err := simulation.New(job.cfg, eval, c)
			if err != nil {
				errChan <- err
				break
			}
			r, err := s.Run()
			if err != nil {
				errChan <- err
				break
			}
			res <- r
		}
	}
}
package enemy

import (
	"github.com/genshinsim/gcsim/pkg/core/attributes"
	"github.com/genshinsim/gcsim/pkg/core/glog"
	"github.com/genshinsim/gcsim/pkg/core/info"
)

func (e *Enemy) calc(atk *info.AttackEvent, evt glog.Event) (float64, bool) {
	var isCrit bool

	st := attributes.EleToDmgP(atk.Info.Element)
	// if st < 0 {
	// 	log.Println(atk)
	// }
	elePer := 0.0
	if st > -1 {
		elePer = atk.Snapshot.Stats[st]
		// Generally not needed except for sim issues
		// e.Core.Log.NewEvent("ele lookup ok",
		// 	glog.LogCalc, atk.Info.ActorIndex,
		// 	"attack_tag", atk.Info.AttackTag,
		// 	"ele", atk.Info.Element,
		// 	"st", st,
		// 	"percent", atk.Snapshot.Stats[st],
		// 	"abil", atk.Info.Abil,
		// 	"stats", atk.Snapshot.Stats,
		// 	"target", e.TargetIndex,
		// )
	}
	dmgBonus := elePer + atk.Snapshot.Stats[attributes.DmgP]

	// calculate using attack or def
	var a float64
	switch {
	case atk.Info.UseHP:
		a = atk.Snapshot.Stats.MaxHP()
	case atk.Info.UseDef:
		a = atk.Snapshot.Stats.TotalDEF()
	default:
		a = at