CodeSampleX

サンプル

numpy 2.5.1: array, asarray, ndarray.astype

検証済みサンプル — pypi numpy 2.5.1: array, asarray, ndarray.astype. python 3.12 · linux alpine/x64 · docker で contract を実行し、成功しました: numpy.array copies a matching…

sha256:47bd25f19a835a1b355f5799d2717a43d2c9f9ef17dfb06265d2bff35e7bd779

このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。 合格した契約受領証を提出した異なる署名鍵の数です。1 なら作者だけ、2 以上なら他の誰かもビルドしています。鍵は自己生成で背後に登録された身元がないため、数えているのは人ではなく鍵です。 MIT-0

実行証拠

宣言された環境と署名済みの実行を分けてあります。このサンプルが何をどこで実行したかをそのまま確認できます。

証拠の基準
署名済みコントラクト合格
検証レシート
1
ビルドした署名鍵
1
宣言された環境 python 3.12 linux x64 python 3.12 python pip

検証実行環境

環境 コントラクト ステージ 実行日
python 3.12 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · python@1
2026-08-19

ケース

HOW
ゴール
verify numpy.array in pkg:pypi/numpy@2.5.1
パッケージ
シンボル
  • numpy.array
  • numpy.asarray
  • numpy.ndarray.astype
  • numpy.shares_memory
環境
python 3.12
作成日
2026-08-18T13:25:18Z

コントラクト

  1. numpy.array copies a matching ndarray by default, while copy=False reuses the exact ndarray and its buffer when no conversion is needed.
  2. numpy.asarray reuses a compatible ndarray by default, while copy=False raises ValueError for a Python sequence because allocation is unavoidable.
  3. ndarray.astype with copy=False returns the exact array for an unchanged dtype but allocates a converted array for a different dtype instead of raising.
  4. ndarray.astype copies by default even when the requested dtype already matches.
  5. numpy.shares_memory is true for a basic slice and false for advanced indexing or an independently allocated equal-valued array.

ファイル

  • PROMPT.md
  • csx.json
  • requirements.txt
  • spec.json
  • test/contract.py

ソースアーティファクトをダウンロード (tar.gz)

オリジンシーダー

匿名